00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _H_JACK_OUT_H
00020 #define _H_JACK_OUT_H
00021
00022 #include <jack/jack.h>
00023
00024 #ifndef __cplusplus
00025 #define bool long
00026 #endif
00027
00028 #ifndef TRUE
00029 #define TRUE 1
00030 #endif
00031
00032 #ifndef FALSE
00033 #define FALSE 0
00034 #endif
00035
00036 #define ERR_SUCCESS 0
00037 #define ERR_OPENING_JACK 1
00038 #define ERR_RATE_MISMATCH 2
00039 #define ERR_BYTES_PER_OUTPUT_FRAME_INVALID 3
00040 #define ERR_BYTES_PER_INPUT_FRAME_INVALID 4
00041 #define ERR_TOO_MANY_OUTPUT_CHANNELS 5
00042 #define ERR_PORT_NAME_OUTPUT_CHANNEL_MISMATCH 6
00043 #define ERR_PORT_NOT_FOUND 7
00044
00045 enum status_enum { PLAYING, PAUSED, STOPPED, CLOSED, RESET };
00046 enum pos_enum { BYTES, MILLISECONDS };
00047
00048 #define PLAYED 1
00049 #define WRITTEN_TO_JACK 2
00050 #define WRITTEN 3
00051
00052
00053
00054 void JACK_Init(void);
00055 int JACK_Open(int *deviceID, unsigned int bits_per_sample, unsigned long *rate, int channels);
00056 int JACK_OpenEx(int *deviceID, unsigned int bits_per_channel,
00057 unsigned long *rate,
00058 unsigned int input_channels, unsigned int output_channels,
00059 const char **jack_port_name, unsigned int jack_port_name_count,
00060 unsigned long jack_port_flags);
00061 int JACK_Close(int deviceID);
00062 void JACK_Reset(int deviceID);
00063 long JACK_Write(int deviceID, unsigned char *data, unsigned long bytes);
00064
00065
00066
00067 long JACK_GetPosition(int deviceID, enum pos_enum position, int type);
00068 void JACK_SetPosition(int deviceID, enum pos_enum position, long value);
00069
00070 long JACK_GetJackLatency(int deviceID);
00071
00072 int JACK_SetState(int deviceID, enum status_enum state);
00073 enum status_enum JACK_GetState(int deviceID);
00074
00075 long JACK_GetMaxBufferedBytes(int deviceID);
00076 void JACK_SetMaxBufferedBytes(int deviceID, long max_buffered_bytes);
00077
00078
00079 unsigned long JACK_GetJackBufferedBytes(int deviceID);
00080
00081
00082
00083
00084
00085
00086 enum JACK_VOLUME_TYPE { linear, dbAttenuation };
00087 enum JACK_VOLUME_TYPE JACK_SetVolumeEffectType(int deviceID,
00088 enum JACK_VOLUME_TYPE type);
00089
00090 int JACK_SetAllVolume(int deviceID, unsigned int volume);
00091 int JACK_SetVolumeForChannel(int deviceID, unsigned int channel, unsigned int volume);
00092 void JACK_GetVolumeForChannel(int deviceID, unsigned int channel, unsigned int *volume);
00093
00094
00095
00096 long JACK_GetOutputBytesPerSecond(int deviceID);
00097 long JACK_GetInputBytesPerSecond(int deviceID);
00098 long JACK_GetBytesStored(int deviceID);
00099
00100 long JACK_GetBytesFreeSpace(int deviceID);
00101 long JACK_GetBytesPerOutputFrame(int deviceID);
00102 int JACK_GetNumInputChannels(int deviceID);
00103 int JACK_SetNumInputChannels(int deviceID, int channels);
00104 int JACK_GetNumOutputChannels(int deviceID);
00105 int JACK_SetNumOutputChannels(int deviceID, int channels);
00106 long JACK_GetSampleRate(int deviceID);
00107
00108 #endif
00109