ixjDefs.h

Go to the documentation of this file.
00001 /*
00002         ixjDefs.h
00003 
00004         Copyright (c) 1996-1998, Quicknet Technologies, Inc.
00005         All Rights Reserved.
00006 
00007         Internet PhoneJACK, Internet LineJACK, etc. definitions.
00008 
00009     -----------------------------------------------------------------
00010 
00011         $Header: /cvsroot/openh323/opal/include/lids/ixjDefs.h,v 2.1 2002/03/22 06:57:48 robertj Exp $
00012 
00013   $Log: ixjDefs.h,v $
00014   Revision 2.1  2002/03/22 06:57:48  robertj
00015   Updated to OpenH323 version 1.8.2
00016 
00017   Revision 1.4  2002/03/21 21:21:10  craigs
00018   Move idb stuff to separate file
00019 */
00020 
00021 #ifndef _IXJDEFS_H
00022 #define _IXJDEFS_H
00023 
00024 #include "ixjIdb.h"
00025 
00026 //==========================================================================
00027 //==========================================================================
00028 //
00029 //      Constants and structures for Quicknet's Internet PhoneJACK and
00030 //      Internet LineJACK cards.
00031 //
00032 //==========================================================================
00033 
00034 //------------------------------------------------
00035 //      Plug and Play IDs
00036 //------------------------------------------------
00037 #define MODEL_INTERNET_PHONEJACK                0x0100
00038 #define MODEL_INTERNET_BLACKJACK                0x0200
00039 #define MODEL_INTERNET_LINEJACK                 0x0300
00040 #define MODEL_INTERNET_PHONEJACK_LITE   0x0400
00041 #define MODEL_INTERNET_PHONEJACK_PCI    0x0500
00042 #define MODEL_INTERNET_PHONEJACK_TJPCI  0x0501
00043 #define MODEL_INTERNET_PHONECARD                0x0600
00044 
00045 //--------------------------------------------------------------------------
00046 //      Codec support
00047 //--------------------------------------------------------------------------
00048 //
00049 #define CODEC_RATE_4000Hz  4000
00050 #define CODEC_RATE_5500Hz  5500
00051 #define CODEC_RATE_6000Hz  6000
00052 #define CODEC_RATE_7333Hz  7333
00053 #define CODEC_RATE_8000Hz  8000
00054 #define CODEC_RATE_11025Hz 11025
00055 #define CODEC_RATE_16000Hz 16000
00056 #define CODEC_RATE_22050Hz 22050
00057 #define CODEC_RATE_32000Hz 32000
00058 #define CODEC_RATE_33075Hz 33075
00059 #define CODEC_RATE_44100Hz 44100
00060 #define CODEC_RATE_48000Hz 48000
00061 
00062 #define OLD_CODEC_RATE_4000Hz  1000
00063 #define OLD_CODEC_RATE_5500Hz  1010
00064 #define OLD_CODEC_RATE_6000Hz  1020
00065 #define OLD_CODEC_RATE_7333Hz  1030
00066 #define OLD_CODEC_RATE_8000Hz  1040
00067 #define OLD_CODEC_RATE_11025Hz 1050
00068 #define OLD_CODEC_RATE_16000Hz 1060
00069 #define OLD_CODEC_RATE_22050Hz 1070
00070 #define OLD_CODEC_RATE_32000Hz 1080
00071 #define OLD_CODEC_RATE_33075Hz 1090
00072 #define OLD_CODEC_RATE_44100Hz 1100
00073 #define OLD_CODEC_RATE_48000Hz 1110
00074 
00075 //      XTAL = 3.8912 MHz
00076 //      Clock = 10*XTAL = 38.912 MHz
00077 //
00078 //      Rules:
00079 //              SCLK = Clock/(N+1)
00080 //              FSYNC = SCLK/(M+1)
00081 //
00082 //              4 <= (N+1) <= 32
00083 //              For 8-bit Codec:  SCLK >= 16*FSYNC
00084 //              For 16-bit Codec: SCLK >= 32*FSYNC
00085 //
00086 //      8Khz Playback/Record:
00087 //              SCLK = Clock/( 18+1) = 2.048 MHz
00088 //              FSYNC = SCLK/(255+1) =  8000 Hz ( 8,000.0 Hz =   8,000 Hz standard + 0%)
00089 //      11Khz Playback/Record:
00090 //              SCLK = Clock/( 13+1) = 2.779 MHz
00091 //              FSYNC = SCLK/(251+1) =  11025 Hz (11,029.5 Hz = 11,025 Hz standard + -0.04%)
00092 //      22Khz Playback/Record:
00093 //              SCLK = Clock/( 9+1)  = 3.8912 MHz
00094 //              FSYNC = SCLK/(175+1) =  22050 Hz (22,109.1 Hz = 22,050 Hz standard + ?.?%) +59.1
00095 //
00096 //              SCLK = Clock/( 13+1) = 2.779 MHz
00097 //              FSYNC = SCLK/(125+1) =  22050 Hz (22,059.0 Hz = 22,050 Hz standard + ?.?%) 
00098 //
00099 
00100 //      XTAL = 3.8912 MHz
00101 //      Clock = 10*XTAL = 38.912 MHz
00102 //
00103 //      SCLK = Clock/( 18+1) = 2.048 MHz
00104 //      FSYNC = SCLK/(371+1) =  5505 Hz ( 5,505.4 Hz =  5,500 Hz standard + x%)
00105 //      FSYNC = SCLK/(340+1) =  6006 Hz ( 6,005.9 Hz =  6,000 Hz standard + x%)
00106 //      FSYNC = SCLK/(278+1) =  7341 Hz ( 7,340.5 Hz =  7,333 Hz standard + x%)
00107 //      FSYNC = SCLK/(255+1) =  8000 Hz ( 8,000.0 Hz =  8,000 Hz standard + 0%)
00108 //      FSYNC = SCLK/(127+1) = 16000 Hz (16,000.0 Hz = 16,000 Hz standard + 0%)
00109 //      FSYNC = SCLK/( 63+1) = 32000 Hz (32,000.0 Hz = 32,000 Hz standard + 0%)
00110 //      FSYNC = SCLK/( 61+1) = 33032 Hz (33,032.3 Hz = 33,075 Hz standard + x%)
00111 //      FSYNC = SCLK/( 45+1) = 44522 Hz (44,521.7 Hz = 44,100 Hz standard + x%)
00112 //      FSYNC = SCLK/( 42+1) = 47628 Hz (47,627.9 Hz = 48,000 Hz standard - x%)
00113 
00114 //      Selects: Sets the division factor used to divide the SCLK clock to generate FSYNC.
00115 #define CODEC_FSYNC_RATE_371 371
00116 #define CODEC_FSYNC_RATE_340 340
00117 #define CODEC_FSYNC_RATE_278 278
00118 #define CODEC_FSYNC_RATE_255 255
00119 #define CODEC_FSYNC_RATE_251 251
00120 #define CODEC_FSYNC_RATE_185 185
00121 #define CODEC_FSYNC_RATE_175 175
00122 #define CODEC_FSYNC_RATE_127 127
00123 #define CODEC_FSYNC_RATE_125 125
00124 #define CODEC_FSYNC_RATE_92   92
00125 #define CODEC_FSYNC_RATE_63   63
00126 #define CODEC_FSYNC_RATE_61   61
00127 #define CODEC_FSYNC_RATE_45   45
00128 #define CODEC_FSYNC_RATE_42   42
00129 
00130 //      Selects: Sets the division factor used to divide the main CT8020 clock to generate SCLK.
00131 #define CODEC_CO_RATE_9 9
00132 #define CODEC_CO_RATE_13 13
00133 #define CODEC_CO_RATE_19 19
00134 #define CODEC_CO_RATE_18 18
00135 
00136 const WORD CODEC_WIDTH_8BIT  = 0;       //      Selects 8-bit Mu-law codec.
00137 const WORD CODEC_WIDTH_16BIT = 1;       //      Selects 16-bit linear codec.
00138 
00139 const WORD CODEC_LAW_MULAW = 0; //      Selects external Mu-law codec.
00140 
00141 const WORD CODEC_MASTER_SLAVE  = 0;     //      Selects save mode (FSYNC and SCLK are inputs - default after reset).
00142 const WORD CODEC_MASTER_MASTER = 1;     //      Selects master mode (FSYNC and SCLK are outputs).
00143 
00144 const WORD CODEC_LONG_SHORTFRAME = 0;   //      Selects short frame sync mode when WIDE=0.
00145 const WORD CODEC_LONG_LONGFRAME  = 1;   //      Selects long frame sync mode when WIDE=1.
00146 
00147 const WORD CODEC_OUTPUT_CODEC_DEFAULT = 0;      //      Selects: default output codec routing.
00148 const WORD CODEC_OUTPUT_CODEC_CODEC1  = 1;      //      Selects: output signal goes to codec 1 only.
00149 const WORD CODEC_OUTPUT_CODEC_CODEC0  = 2;      //      Selects: output signal goes to codec 0 only.
00150 const WORD CODEC_OUTPUT_CODEC_BOTH    = 3;      //      Selects: output signal goes to both codec 0 and codec 1.
00151 
00152 const WORD CODEC_INPUT_CODEC_NORMAL   = 0;      //      Selects: normal input codec routing.
00153 const WORD CODEC_INPUT_CODEC_EXCHANGE = 1;      //      Selects: input from codec 0 and codec 1 exchanged.
00154 
00155 const WORD CODEC_SET_RATE_NOACTION = 0; //      Selects: no action.
00156 const WORD CODEC_SET_RATE_NEXTCMD  = 1; //      Selects: next command word programs codec sample rate dividers.
00157 
00158 const WORD CODEC_WIDE_1SCLK      = 0;           //      Selects: FSYNC is 1 SCLK period wide.
00159 const WORD CODEC_WIDE_8OR16SCLKS = 1;           //      Selects: FSYNC is 8 SCLK periods wide if Width=0 or 16 SCLK periods wide if Width=1.
00160 
00161 const DWORD XTAL_38912 = 3891200;
00162 const DWORD XTAL_4000 = 4000000;
00163 const DWORD XTAL_4096 = 4096000;
00164 
00165 const DWORD SCLK_2048 = 2048000;
00166 const DWORD SCLK_512 = 512000;
00167 const DWORD SCLK_1024 = 1024000;
00168 const DWORD SCLK_2000 = 2000000;
00169 const DWORD SCLK_MAX = 1835008; // 300373; // 2097152; // 2095600;
00170 
00171 //==========================================================================
00172 //--------------------------------------------------------------------------
00173 //      Compression/Decompression support
00174 //--------------------------------------------------------------------------
00175 //
00176 #define COMPRESS_MODE_TRUESPEECH  0     //      Selects: TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps
00177 #define COMPRESS_MODE_ULAW        2     //      Selects: 64 Kbit/sec U-law PCM
00178 #define COMPRESS_MODE_16LINEAR    6     //      Selects: 128 Kbit/sec 16-bit linear
00179 #define COMPRESS_MODE_8LINEAR     4     //      Selects: 64 Kbit/sec 8-bit signed linear
00180 #define COMPRESS_MODE_8LINEAR_WSS 5     //      Selects: 64 Kbit/sec WSS 8-bit unsigned linear
00181 
00182 //      TrueSpeech compress modes: 8.5 - 4.1
00183 #define COMPRESS_RATE_TS85 0    //      Selects TrueSpeech 8.5 play mode.
00184 #define COMPRESS_RATE_TS63 1    //      Selects TrueSpeech 6.3 play mode.
00185 #define COMPRESS_RATE_TS53 2    //      Selects TrueSpeech 5.3 play mode.
00186 #define COMPRESS_RATE_TS48 3    //      Selects TrueSpeech 4.8 play mode.
00187 #define COMPRESS_RATE_TS41 4    //      Selects TrueSpeech 4.1 play mode.
00188 
00189 //      G.723.1 record/compress modes: 6.3 & 5.3
00190 //      NOTE: Same as TrueSpeech 6.3 & 5.3 modes.
00191 #define COMPRESS_RATE_G7231_TS63 1      //      Selects TrueSpeech 6.3 play mode.
00192 #define COMPRESS_RATE_G7231_TS53 2      //      Selects TrueSpeech 5.3 play mode.
00193 
00194 // ------------------------
00195 
00196 #define COMPRESS_FRAME_TRUESPEECH  0    //      TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps
00197 #define COMPRESS_FRAME_ULAW        120  //      64 Kbit/sec U-law PCM
00198 #define COMPRESS_FRAME_16LINEAR    240  //      128 Kbit/sec 16-bit linear
00199 #define COMPRESS_FRAME_8LINEAR     120  //      64 Kbit/sec 8-bit signed linear
00200 #define COMPRESS_FRAME_8LINEAR_WSS 120  //      64 Kbit/sec WSS 8-bit unsigned linear
00201 
00202 //      TrueSpeech recording modes: 8.5 - 4.1
00203 #define COMPRESS_FRAME_TS85 16  //      TrueSpeech 8.5 record frame.
00204 #define COMPRESS_FRAME_TS63 12  //      TrueSpeech 6.3 record frame.
00205 #define COMPRESS_FRAME_TS53 10  //      TrueSpeech 5.3 record frame.
00206 #define COMPRESS_FRAME_TS48 9           //      TrueSpeech 4.8 record frame.
00207 #define COMPRESS_FRAME_TS41 8           //      TrueSpeech 4.1 record frame.
00208 
00209 //      G.723.1 recording modes: 6.3 & 5.3
00210 //      NOTE: Same as TrueSpeech 6.3 & 5.3 modes.
00211 #define COMPRESS_FRAME_G7231_TS63 COMPRESS_FRAME_TS63   //      TrueSpeech 6.3 record frame.
00212 #define COMPRESS_FRAME_G7231_TS53 COMPRESS_FRAME_TS53   //      TrueSpeech 5.3 record frame.
00213 
00214 #define COMPRESS_MAX_BUFFER_SIZE COMPRESS_FRAME_16LINEAR        //      Max buffer size: Tx or Rx.
00215 
00216 //      Additional bit patterns to 'Or' into Command Base 'words'
00217 const WORD COMPRESS_TFRMODE_80X5 = 0;   //      Selects Data transfer via Software Control and Status Registers (CT8015/CT8005 protocol mode).
00218 const WORD COMPRESS_TFRMODE_8020 = 3;   //      Selects Data transfer via Host Transmit Data Buffer Access Port.
00219 
00220 const WORD COMPRESS_SYNC_MODE_CODEC = 0;
00221 const WORD COMPRESS_SYNC_MODE_DATA  = 1;
00222 const WORD COMPRESS_SYNC_MODE_POLL  = 2;
00223 const WORD COMPRESS_SYNC_MODE_HOST  = 3;
00224 
00225 //==========================================================================
00226 //--------------------------------------------------------------------------
00227 //      Device support
00228 //--------------------------------------------------------------------------
00229 //
00230 //      Additional bit patterns to 'Or' into Command Base 'words'
00231 //const WORD DEVCTRL_TONE_MODE_SYNC  = 0;       //      Selects Synchronous Tone mode
00232 //const WORD DEVCTRL_TONE_MODE_ASYNC = 1;       //      Selects Asynchronous Tone mode
00233 
00234 // Analog source for the Codec #1.
00235 //      Analog source is determined by the GPIO bits: 6 & 7.
00236 //                                      | GPIO6 | GPIO7 |
00237 //------------------|-------|-------|-------
00238 //      POTS Phone              |   0   |   0   |
00239 //      Speakerphone    |   0   |   1   |
00240 //      Handset Phone   |   1   |   0   |
00241 //        ??????                |   1   |   1   |
00242 //-------------------------------------------
00243 //
00244 #define ANALOG_SOURCE_POTSPHONE         (0x0)
00245 #define ANALOG_SOURCE_SPEAKERPHONE      (0x1)
00246 #define ANALOG_SOURCE_HANDSETPHONE      (0x2)
00247 #define ANALOG_SOURCE_PSTNLINE          (0x2)
00248 
00249 #define LINEJACK_MODE_PHONEJACK         (0x0)
00250 #define LINEJACK_MODE_LINEJACK          (0x1)
00251 #define LINEJACK_MODE_STANDALONE        (0x2)
00252 
00253 #define DEVICE_SPEAKERPHONE 0x01
00254 #define DEVICE_POTS 0x02
00255 #define DEVICE_HANDSET 0x04
00256 #define DEVICE_PSTN 0x08
00257 
00258 #define COEFF_US            0
00259 #define COEFF_UK            1
00260 #define COEFF_FRANCE        2
00261 #define COEFF_GERMANY       3
00262 #define COEFF_AUSTRALIA     4
00263 #define COEFF_JAPAN         5
00264 #define COEFF_CTR21         6
00265 #define COEFF_CZECH         7
00266 #define COEFF_GERMANY2      8
00267 #define COEFF_ITALY         9
00268 #define COEFF_SOUTH_KOREA  10
00269 #define COEFF_NEW_ZEALAND  11
00270 #define COEFF_NORWAY       12
00271 #define COEFF_PHILIPPINES  13
00272 #define COEFF_POLAND       14
00273 #define COEFF_SOUTH_AFRICA 15
00274 #define COEFF_SWEDEN       16
00275 
00276 // SLIC States
00277 //      SLIC State is determined by the GPIO bits: 1,2,3
00278 //                                      | GPIO3 | GPIO2 | GPIO1 | !GPIO1 |
00279 //                                      |   C3  |   C2  |   C1  |  B2EN  |
00280 //------------------|-------|-------|-------|--------|
00281 //      Open Circuit    |   0   |   0   |   0   |   1    |
00282 //      Ringing                 |   0   |   0   |   1   |   0    |
00283 //      Active          |   0   |   1   |   0   |   1    |
00284 //----------------------------------------------------
00285 //
00286 #define SLIC_STATE_OPENCIRCUIT  0
00287 #define SLIC_STATE_RINGING              1
00288 #define SLIC_STATE_ACTIVE               2
00289 #define SLIC_STATE_OHT                  3
00290 #define SLIC_STATE_TIPOPEN              4
00291 #define SLIC_STATE_STANDBY              5
00292 #define SLIC_STATE_APR                  6
00293 #define SLIC_STATE_OHTPR                7
00294 
00295 // Switch Hook States
00296 //      Switch Hook State is determined by GPIO 5
00297 //                                      | GPIO5  |
00298 //------------------|--------|
00299 //      Off Hook                |   0    |
00300 //      On Hook                 |   1    |
00301 //----------------------------
00302 //
00303 #define SLIC_OFF_HOOK   (0x0)
00304 #define SLIC_ON_HOOK    (0x1)
00305 
00306 // LineJack Test error codes
00307 #define LINE_TEST_OK 0
00308 #define LINE_TEST_TESTING 1
00309 #define LINE_TEST_POTS_OFF_HOOK 2
00310 #define LINE_TEST_LINE_CONNECTED_TO_POTS 3
00311 #define LINE_TEST_NO_LINE_PRESENT 4
00312 
00313 // The ring pattern is a 12-bit sequence.
00314 // Each bit represents 1/2 second of ring
00315 // on or off for a total of 6 seconds.
00316 #define RING_PATTERN_MASK (0x0FFF)
00317 
00318 #define DEVCTRL_HOOKSTATE_INIT                  0
00319 #define DEVCTRL_HOOKSTATE_ON_HOOK_1             1
00320 #define DEVCTRL_HOOKSTATE_ON_HOOK_2             2
00321 #define DEVCTRL_HOOKSTATE_ON_HOOK_3             3
00322 #define DEVCTRL_HOOKSTATE_OFF_HOOK_1    4
00323 #define DEVCTRL_HOOKSTATE_OFF_HOOK_2    5
00324 #define DEVCTRL_HOOKSTATE_OFF_HOOK_3    6
00325 
00326 #define DEVCTRL_RINGSTATE_INIT          0
00327 #define DEVCTRL_RINGSTATE_RING_0        1
00328 #define DEVCTRL_RINGSTATE_RING_1        2
00329 #define DEVCTRL_RINGSTATE_RING_2        3
00330 #define DEVCTRL_RINGSTATE_RING_3        4
00331 #define DEVCTRL_RINGSTATE_RING_4        5
00332 #define DEVCTRL_RINGSTATE_RING_5        6
00333 #define DEVCTRL_RINGSTATE_RING_6        7
00334 #define DEVCTRL_RINGSTATE_RING_7        8
00335 #define DEVCTRL_RINGSTATE_RING_8        9
00336 #define DEVCTRL_RINGSTATE_RING_9        10
00337 #define DEVCTRL_RINGSTATE_RING_10       11
00338 #define DEVCTRL_RINGSTATE_RING_11       12
00339 
00340 //==========================================================================
00341 //--------------------------------------------------------------------------
00342 //      Filter support
00343 //--------------------------------------------------------------------------
00344 //
00345 //      Additional bit patterns to 'Or' into Command Base 'words'
00346 #define FILTER_MODE_SYNC  0
00347 #define FILTER_MODE_ASYNC 1
00348 
00349 #define FILTER_LINE_VOLUME_POS_0DB 2    //      +0 dB
00350 #define FILTER_LINE_VOLUME_MUTE    3    //      Mute Microphone (also resets AEC)
00351 
00352 #define FILTER_SPEAKER_VOLUME_POS_14DB 0        //      +14 dB
00353 #define FILTER_SPEAKER_VOLUME_POS_12DB 1        //      +12 dB
00354 #define FILTER_SPEAKER_VOLUME_POS_10DB 2        //      +10 dB
00355 #define FILTER_SPEAKER_VOLUME_POS_8DB  3        //      +8 dB
00356 #define FILTER_SPEAKER_VOLUME_POS_6DB  4        //      +6 dB
00357 #define FILTER_SPEAKER_VOLUME_POS_4DB  5        //      +4 dB
00358 #define FILTER_SPEAKER_VOLUME_POS_2DB  6        //      +2 dB
00359 #define FILTER_SPEAKER_VOLUME_POS_0DB  7        //      0 dB
00360 #define FILTER_SPEAKER_VOLUME_NEG_2DB  8        //      -2 dB
00361 #define FILTER_SPEAKER_VOLUME_NEG_4DB  9        //      -4 dB
00362 #define FILTER_SPEAKER_VOLUME_NEG_6DB  10       //      -6 dB
00363 #define FILTER_SPEAKER_VOLUME_NEG_8DB  11       //      -8 dB
00364 #define FILTER_SPEAKER_VOLUME_NEG_10DB 12       //      -10 dB
00365 #define FILTER_SPEAKER_VOLUME_NEG_12DB 13       //      -12 dB
00366 #define FILTER_SPEAKER_VOLUME_NEG_14DB 14       //      -14 dB
00367 #define FILTER_SPEAKER_VOLUME_MUTE     15       //      Mute Filter
00368 
00369 #define FILTER_DTMFSTATE_INIT                   0
00370 #define FILTER_DTMFSTATE_NOT_VALID_1    1
00371 #define FILTER_DTMFSTATE_NOT_VALID_2    2
00372 #define FILTER_DTMFSTATE_NOT_VALID_3    3
00373 #define FILTER_DTMFSTATE_VALID_1                4
00374 #define FILTER_DTMFSTATE_VALID_2                5
00375 #define FILTER_DTMFSTATE_VALID_3                6
00376 
00377 #define FrameCount( LineMonitor ) ((LineMonitor>>12)&0x0f)
00378 #define FilterBits( LineMonitor ) ((LineMonitor>>8)&0x0f)
00379 #define Peak( LineMonitor ) ((LineMonitor>>6)&1)
00380 #define DTMFValid( LineMonitor ) ((LineMonitor>>5)&1)
00381 #define CPFValid( LineMonitor ) ((LineMonitor>>4)&1)
00382 #define DTMFDigit( LineMonitor ) (LineMonitor&0x0f)
00383 
00384 
00385 //==========================================================================
00386 //--------------------------------------------------------------------------
00387 //      Idle support
00388 //--------------------------------------------------------------------------
00389 //
00390 #define IDLE_TONE_MODE_SYNC  0  //      Selects Synchronous Tone mode
00391 #define IDLE_TONE_MODE_ASYNC 1  //      Selects Asynchronous Tone mode
00392 
00393 #define IDLE_TONE_NOTONE        0
00394 #define IDLE_TONE_1             1
00395 #define IDLE_TONE_2             2
00396 #define IDLE_TONE_3             3
00397 #define IDLE_TONE_4             4
00398 #define IDLE_TONE_5             5
00399 #define IDLE_TONE_6             6
00400 #define IDLE_TONE_7             7
00401 #define IDLE_TONE_8             8
00402 #define IDLE_TONE_9             9
00403 #define IDLE_TONE_STAR  10
00404 #define IDLE_TONE_0             11
00405 #define IDLE_TONE_POUND 12
00406 #define IDLE_TONE_DIAL  25
00407 #define IDLE_TONE_RING  26
00408 #define IDLE_TONE_BUSY  27
00409 #define IDLE_TONE_A             28
00410 #define IDLE_TONE_B             29
00411 #define IDLE_TONE_C             30
00412 #define IDLE_TONE_D             31
00413 
00414 //      Table from TelTone M-991 Spec sheet (table 4).
00415 //      Tone Name                               Frequency (Hz)                  Interruption Rate
00416 //                                                       1                       2
00417 //-------------------------------------------------------------------------------------------
00418 //      Dial                            |       350             |       440             |       Steady
00419 //      Reorder                         |       480             |       620             |       Repeat, tones on and off 250 ms +- 25ms
00420 //      Busy                            |       480             |       620             |       Repeat, tones on and off 500 ms +- 50ms
00421 //      Audible Ring            |       480             |       480             |       Repeat, tones on 2 +- 0.2sec, tones off 4 +- 0.4sec
00422 //      Recall Dial                     |       350             |       440             |       Three bursts tones on and off 100 ms +- 20ms each followed by dial tone
00423 //      Special AR                      |       440             |       480             |       Tones on 1 +- 0.2sec, followed by single 440Hz on for 0.2sec on, and silence for 3 +- 0.3sec, repeat
00424 //      Intercept                       |       440             |       620             |       Repeat alternating tones, each on for 230ms +- 70ms with total cycle of 500 +- 50ms
00425 //      Call Waiting            |       440             |       Off             |       One burst 200 +- 100ms
00426 //      Busy Verification       |       440             |       Off             |       One burst of tone on 1.75 +- 0.25sec before attendant intrudes, followed by burst of tone 0.65 +- 0.15sec on, 8 to 20 sec apart for as long as the call lasts.
00427 //      Executive Override      |       440             |       Off             |       One burst of tone for 3 +- 1sec before overriding station intrudes.
00428 //      Confirmation            |       350             |       440             |       Three bursts on and off 100ms each or 100ms on, 100ms off, 300 ms on.
00429 
00430 #define TONE_DIAL                               0
00431 #define TONE_REORDER                    1
00432 #define TONE_BUSY                               2
00433 #define TONE_AUDIBLE_RING               3
00434 #define TONE_RECALL_DIAL                4
00435 #define TONE_SPECIAL_AR                 5
00436 #define TONE_INTERCEPT                  6
00437 #define TONE_CALL_WAITING               7
00438 #define TONE_BUSY_VERIFICATION  8
00439 #define TONE_EXECUTIVE_OVERRIDE 9
00440 #define TONE_CONFIRMATION               10
00441 
00442 typedef struct
00443 {
00444     DWORD dwToneIndex;
00445     DWORD dwDuration;
00446         DWORD dwToneOnPeriod;
00447         DWORD dwToneOffPeriod;
00448         DWORD dwMasterGain;
00449 } IDLE_TONE;
00450 
00451 typedef struct
00452 {
00453     DWORD dwToneIndex;   // 1-31, 0 reserved for silence
00454     DWORD dwFrequencyFactor0; // dwFrequencyFactor0 = 32767 * cos( 2*Pi*(frequency0/8000) )
00455         DWORD dwGain0;   // 0-15 See Tone Level Table
00456     DWORD dwFrequencyFactor1; // dwFrequencyFactor1 = 32767 * cos( 2*Pi*(frequency1/8000) )
00457         DWORD dwGain1;   // 0-15 See Tone Level Table
00458 } IDLE_NEW_TONE;
00459 
00460 //==========================================================================
00461 // 
00462 // Tone Level Table
00463 //____________________________________________________________
00464 // Index     Codec Output Level (dB relative to 0.707 Vrms)
00465 //____________________________________________________________
00466 //      0                   +6
00467 //      1                   +4
00468 //      2                   +2
00469 //      3                     0
00470 //      4                    -2
00471 //      5                    -4
00472 //      6                    -6
00473 //      7                    -8
00474 //      8                  -10
00475 //      9                  -12
00476 //     10                 -14
00477 //     11                 -16
00478 //     12                 -18
00479 //     13                 -20
00480 //     14                 -22
00481 //     15                 -24
00482 
00483 //==========================================================================
00484 //--------------------------------------------------------------------------
00485 //      Mixer support
00486 //--------------------------------------------------------------------------
00487 //
00488 // Playback mixer lines
00489 #define PlaybackMaster                  0
00490 #define PlaybackMicrophone              1
00491 #define PlaybackWave                    2
00492 #define PlaybackCD                              3
00493 #define PlaybackLineIn                  4
00494 #define PlaybackPhoneIn                 5
00495 #define PlaybackPhoneOut                6
00496 #define PlaybackPhoneLineOut    7
00497 #define PlaybackDeviceCount             8
00498 
00499 // Record mixer lines
00500 #define RecordMaster            0
00501 #define RecordMicrophone        1
00502 #define RecordWave                      2
00503 #define RecordCD                        3
00504 #define RecordLineIn            4
00505 #define RecordPhoneIn           5
00506 #define RecordPhoneLineIn       6
00507 #define RecordDeviceCount       7
00508 
00509 // Output mixer lines
00510 #define OutputMicrophone        PlaybackMicrophone
00511 #define OutputWave                      PlaybackWave
00512 #define OutputCD                        PlaybackCD
00513 #define OutputLineIn            PlaybackLineIn
00514 #define OutputPhoneIn           PlaybackPhoneIn
00515 
00516 // Input mixer lines
00517 #define InputMicrophone RecordMicrophone
00518 #define InputWave               RecordWave
00519 #define InputCD                 RecordCD
00520 #define InputLineIn             RecordLineIn
00521 #define InputPhoneIn    RecordPhoneIn
00522 
00523 // Mixer line structure
00524 typedef struct _MIXER_LINE
00525 {
00526     DWORD dwLineID;
00527     DWORD dwMute;
00528     DWORD dwLeftVolume;
00529     DWORD dwRightVolume;
00530 }
00531 MIXER_LINE;
00532 
00533 #define MIXER_ACCESS TEXT( "MixerAccess" )
00534 
00535 //==========================================================================
00536 //--------------------------------------------------------------------------
00537 //      Playback support
00538 //--------------------------------------------------------------------------
00539 //
00540 //      Additional bit patterns to 'Or' into Command Base 'words'
00541 #define PLAYBACK_TFRMODE_80X5 0 //      Selects Data transfer via Software Control and Status Registers (CT8015/CT8005 protocol mode).
00542 #define PLAYBACK_TFRMODE_8020 3 //      Selects Data transfer via Host Transmit Data Buffer Access Port.
00543 
00544 #define PLAYBACK_SYNC_MODE_CODEC        0
00545 #define PLAYBACK_SYNC_MODE_DATA         1
00546 #define PLAYBACK_SYNC_MODE_POLL         2
00547 #define PLAYBACK_SYNC_MODE_HOST         3
00548 
00549 //      Playback modes
00550 #define PLAYBACK_MODE_COMPRESSED                0       //      Selects: Compressed modes, TrueSpeech 8.5-4.1, G.723.1, G.722, G.728, G.729
00551 #define PLAYBACK_MODE_TRUESPEECH_V40    0       //      Selects: TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps
00552 #define PLAYBACK_MODE_TRUESPEECH                8       //      Selects: TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps Version 5.1
00553 #define PLAYBACK_MODE_ULAW                              2       //      Selects: 64 Kbit/sec MuA-law PCM
00554 #define PLAYBACK_MODE_ALAW                              10      //      Selects: 64 Kbit/sec A-law PCM
00555 #define PLAYBACK_MODE_16LINEAR                  6       //      Selects: 128 Kbit/sec 16-bit linear
00556 #define PLAYBACK_MODE_8LINEAR                   4       //      Selects: 64 Kbit/sec 8-bit signed linear
00557 #define PLAYBACK_MODE_8LINEAR_WSS               5       //      Selects: 64 Kbit/sec WSS 8-bit unsigned linear
00558 
00559 //      Playback rates
00560 #define PLAYBACK_RATE_TS85              0       //      Selects TrueSpeech 8.5 playback rate.
00561 #define PLAYBACK_RATE_TS63              1       //      Selects TrueSpeech 6.3 playback rate.
00562 #define PLAYBACK_RATE_TS53              2       //      Selects TrueSpeech 5.3 playback rate.
00563 #define PLAYBACK_RATE_TS48              3       //      Selects TrueSpeech 4.8 playback rate.
00564 #define PLAYBACK_RATE_TS41              4       //      Selects TrueSpeech 4.1 playback rate.
00565 #define PLAYBACK_RATE_G722              7       //      Selects G.722 playback rate.
00566 #define PLAYBACK_RATE_G723_63   PLAYBACK_RATE_TS63      //      Selects G.723.1 (6.3 kbps) playback rate.
00567 #define PLAYBACK_RATE_G723_53   PLAYBACK_RATE_TS53      //      Selects G.723.1 (5.3 kbps) playback rate.
00568 #define PLAYBACK_RATE_G728              5       //      Selects G.728 playback rate.
00569 #define PLAYBACK_RATE_G729              6       //      Selects G.729 playback rate.
00570 
00571 // Frame sizes in WORD units
00572 #define PLAYBACK_TS85_WORDS                             16              //      TrueSpeech 8.5, 30ms frame size
00573 #define PLAYBACK_TS63_WORDS                             12              //      TrueSpeech 6.3, 30ms frame size
00574 #define PLAYBACK_TS53_WORDS                             10              //      TrueSpeech 5.3, 30ms frame size
00575 #define PLAYBACK_TS48_WORDS                             9               //      TrueSpeech 4.8, 30ms frame size
00576 #define PLAYBACK_TS41_WORDS                             8               //      TrueSpeech 4.1, 30ms frame size
00577 #define PLAYBACK_ALAW_WORDS                             120             //      64 Kbit/sec A-law PCM, 30ms frame size
00578 #define PLAYBACK_ALAW_30MS_WORDS                120             //      64 Kbit/sec A-law PCM, 30ms frame size
00579 #define PLAYBACK_ALAW_20MS_WORDS                80              //      64 Kbit/sec A-law PCM, 20ms frame size
00580 #define PLAYBACK_ALAW_10MS_WORDS                40              //      64 Kbit/sec A-law PCM, 10ms frame size
00581 #define PLAYBACK_ULAW_WORDS                             120             //      64 Kbit/sec Mu-law PCM, 30ms frame size
00582 #define PLAYBACK_ULAW_30MS_WORDS                120             //      64 Kbit/sec Mu-law PCM, 30ms frame size
00583 #define PLAYBACK_ULAW_20MS_WORDS                80              //      64 Kbit/sec Mu-law PCM, 20ms frame size
00584 #define PLAYBACK_ULAW_10MS_WORDS                40              //      64 Kbit/sec Mu-law PCM, 10ms frame size
00585 #define PLAYBACK_16LINEAR_WORDS                 240             //      128 Kbit/sec 16-bit linear, 30ms frame size
00586 #define PLAYBACK_16LINEAR_30MS_WORDS    240             //      128 Kbit/sec 16-bit linear, 30ms frame size
00587 #define PLAYBACK_16LINEAR_20MS_WORDS    160             //      128 Kbit/sec 16-bit linear, 20ms frame size
00588 #define PLAYBACK_16LINEAR_10MS_WORDS    80              //      128 Kbit/sec 16-bit linear, 10ms frame size
00589 #define PLAYBACK_8LINEAR_WORDS                  120             //      64 Kbit/sec 8-bit signed linear, 30ms frame size
00590 #define PLAYBACK_8LINEAR_30MS_WORDS             120             //      64 Kbit/sec 8-bit signed linear, 30ms frame size
00591 #define PLAYBACK_8LINEAR_20MS_WORDS             80              //      64 Kbit/sec 8-bit signed linear, 20ms frame size
00592 #define PLAYBACK_8LINEAR_10MS_WORDS             40              //      64 Kbit/sec 8-bit signed linear, 10ms frame size
00593 #define PLAYBACK_8LINEAR_WSS_WORDS              120             //      64 Kbit/sec WSS 8-bit unsigned linear, 30ms frame size
00594 #define PLAYBACK_8LINEAR_WSS_30MS_WORDS 120             //      64 Kbit/sec WSS 8-bit unsigned linear, 30ms frame size
00595 #define PLAYBACK_8LINEAR_WSS_20MS_WORDS 80              //      64 Kbit/sec WSS 8-bit unsigned linear, 20ms frame size
00596 #define PLAYBACK_8LINEAR_WSS_10MS_WORDS 40              //      64 Kbit/sec WSS 8-bit unsigned linear, 10ms frame size
00597 #define PLAYBACK_G722_WORDS                             40              //      64 Kbit/sec G.722, 10ms frame size
00598 #define PLAYBACK_G723_63_WORDS                  PLAYBACK_TS63_WORDS     //      6.3 Kbit/sec G.723.1, 30ms frame size
00599 #define PLAYBACK_G723_53_WORDS                  PLAYBACK_TS53_WORDS     //      5.3 Kbit/sec G.723.1, 30ms frame size
00600 #define PLAYBACK_G728_10MS_WORDS                16              //      16 Kbit/sec G.728, 10ms frame size
00601 #define PLAYBACK_G728_20MS_WORDS                32              //      16 Kbit/sec G.728, 20ms frame size
00602 #define PLAYBACK_G728_30MS_WORDS                48              //      16 Kbit/sec G.728, 30ms frame size
00603 #define PLAYBACK_G729_10MS_WORDS                6               //      8 Kbit/sec G.729, 10ms frame size
00604 #define PLAYBACK_G729_20MS_WORDS                12              //      8 Kbit/sec G.729, 20ms frame size
00605 #define PLAYBACK_G729_30MS_WORDS                18              //      8 Kbit/sec G.729, 30ms frame size
00606 
00607 // Frame sizes in bytes
00608 #define PLAYBACK_FRAME_TS85                             (PLAYBACK_TS85_WORDS*2)
00609 #define PLAYBACK_FRAME_TS63                             (PLAYBACK_TS63_WORDS*2)
00610 #define PLAYBACK_FRAME_TS53                             (PLAYBACK_TS53_WORDS*2)
00611 #define PLAYBACK_FRAME_TS48                             (PLAYBACK_TS48_WORDS*2)
00612 #define PLAYBACK_FRAME_TS41                             (PLAYBACK_TS41_WORDS*2)
00613 #define PLAYBACK_FRAME_ALAW                             (PLAYBACK_ALAW_WORDS*2)
00614 #define PLAYBACK_FRAME_ALAW_30MS                (PLAYBACK_ALAW_30MS_WORDS*2)
00615 #define PLAYBACK_FRAME_ALAW_20MS                (PLAYBACK_ALAW_20MS_WORDS*2)
00616 #define PLAYBACK_FRAME_ALAW_10MS                (PLAYBACK_ALAW_10MS_WORDS*2)
00617 #define PLAYBACK_FRAME_ULAW                             (PLAYBACK_ULAW_WORDS*2)
00618 #define PLAYBACK_FRAME_ULAW_30MS                (PLAYBACK_ULAW_30MS_WORDS*2)
00619 #define PLAYBACK_FRAME_ULAW_20MS                (PLAYBACK_ULAW_20MS_WORDS*2)
00620 #define PLAYBACK_FRAME_ULAW_10MS                (PLAYBACK_ULAW_10MS_WORDS*2)
00621 #define PLAYBACK_FRAME_16LINEAR                 (PLAYBACK_16LINEAR_WORDS*2)
00622 #define PLAYBACK_FRAME_16LINEAR_30MS    (PLAYBACK_16LINEAR_30MS_WORDS*2)
00623 #define PLAYBACK_FRAME_16LINEAR_20MS    (PLAYBACK_16LINEAR_20MS_WORDS*2)
00624 #define PLAYBACK_FRAME_16LINEAR_10MS    (PLAYBACK_16LINEAR_10MS_WORDS*2)
00625 #define PLAYBACK_FRAME_8LINEAR                  (PLAYBACK_8LINEAR_WORDS*2)
00626 #define PLAYBACK_FRAME_8LINEAR_30MS             (PLAYBACK_8LINEAR_30MS_WORDS*2)
00627 #define PLAYBACK_FRAME_8LINEAR_20MS             (PLAYBACK_8LINEAR_20MS_WORDS*2)
00628 #define PLAYBACK_FRAME_8LINEAR_10MS             (PLAYBACK_8LINEAR_10MS_WORDS*2)
00629 #define PLAYBACK_FRAME_8LINEAR_WSS              (PLAYBACK_8LINEAR_WSS_WORDS*2)
00630 #define PLAYBACK_FRAME_8LINEAR_WSS_30MS (PLAYBACK_8LINEAR_WSS_30MS_WORDS*2)
00631 #define PLAYBACK_FRAME_8LINEAR_WSS_20MS (PLAYBACK_8LINEAR_WSS_20MS_WORDS*2)
00632 #define PLAYBACK_FRAME_8LINEAR_WSS_10MS (PLAYBACK_8LINEAR_WSS_10MS_WORDS*2)
00633 #define PLAYBACK_FRAME_G722                             (PLAYBACK_G722_WORDS*2)
00634 #define PLAYBACK_FRAME_G723_63                  (PLAYBACK_G723_63_WORDS*2)
00635 #define PLAYBACK_FRAME_G723_53                  (PLAYBACK_G723_53_WORDS*2)
00636 #define PLAYBACK_FRAME_G728_10MS                (PLAYBACK_G728_10MS_WORDS*2)
00637 #define PLAYBACK_FRAME_G728_20MS                (PLAYBACK_G728_20MS_WORDS*2)
00638 #define PLAYBACK_FRAME_G728_30MS                (PLAYBACK_G728_30MS_WORDS*2)
00639 #define PLAYBACK_FRAME_G729_10MS                (PLAYBACK_G729_10MS_WORDS*2)
00640 #define PLAYBACK_FRAME_G729_20MS                (PLAYBACK_G729_20MS_WORDS*2)
00641 #define PLAYBACK_FRAME_G729_30MS                (PLAYBACK_G729_30MS_WORDS*2)
00642 
00643 #define PLAYBACK_MAX_BUFFER_WORDS       PLAYBACK_16LINEAR_WORDS //      Max buffer size: Tx or Rx.
00644 #define PLAYBACK_MAX_BUFFER_SIZE        PLAYBACK_FRAME_16LINEAR //      Max buffer size: Tx or Rx.
00645 
00646 #define PLAYBACK_TS85_AVG_RATE  1067    //      TrueSpeech 8.5 Average bytes per second.
00647 #define PLAYBACK_TS63_AVG_RATE  800             //      TrueSpeech 6.3 Average bytes per second.
00648 #define PLAYBACK_TS53_AVG_RATE  667             //      TrueSpeech 5.3 Average bytes per second.
00649 #define PLAYBACK_TS48_AVG_RATE  600             //      TrueSpeech 4.8 Average bytes per second.
00650 #define PLAYBACK_TS41_AVG_RATE  533             //      TrueSpeech 4.1 Average bytes per second.
00651 
00652 //==========================================================================
00653 //--------------------------------------------------------------------------
00654 //      Record support
00655 //--------------------------------------------------------------------------
00656 //
00657 //      Additional bit patterns to 'Or' into Command Base 'words'
00658 #define RECORD_TFRMODE_80X5 0   //      Selects Data transfer via Software Control and Status Registers (CT8015/CT8005 protocol mode).
00659 #define RECORD_TFRMODE_8020 3   //      Selects Data transfer via Host Transmit Data Buffer Access Port.
00660 
00661 #define RECORD_SYNC_MODE_CODEC 0
00662 #define RECORD_SYNC_MODE_DATA  1
00663 #define RECORD_SYNC_MODE_POLL  2
00664 #define RECORD_SYNC_MODE_HOST  3
00665 
00666 //      Automatic Gain Control (AGC)
00667 #define RECORD_AGC_MIN_GAIN     0       //      Sets AGC Min Gain
00668 #define RECORD_AGC_MAX_GAIN     1       //      Sets AGC Max Gain
00669 #define RECORD_AGC_START_GAIN   2       //      Sets AGC Start Gain
00670 #define RECORD_AGC_HOLD_TIME    3       //      Sets AGC Hold Time
00671 #define RECORD_AGC_ATTACK_TIME  4       //      Sets AGC Attack Time Constant
00672 #define RECORD_AGC_DECAY_TIME   5       //      Sets AGC Decay Time Constant
00673 #define RECORD_AGC_ATTACK_THRES 6       //      Sets AGC Attack Threshold
00674 #define RECORD_AGC_ON_OFF       7       //      Sets AGC On/Off. Enable/Disable AGC.
00675 
00676 //      AGC Time Contants
00677 #define RECORD_AGC_250_us  0
00678 #define RECORD_AGC_512_us  1
00679 #define RECORD_AGC_1_ms    2
00680 #define RECORD_AGC_2_ms    3
00681 #define RECORD_AGC_4_ms    4
00682 #define RECORD_AGC_8_ms    5
00683 #define RECORD_AGC_16_ms   6
00684 #define RECORD_AGC_32_ms   7
00685 #define RECORD_AGC_64_ms   8
00686 #define RECORD_AGC_128_ms  9
00687 #define RECORD_AGC_256_ms  10
00688 #define RECORD_AGC_512_ms  11
00689 #define RECORD_AGC_1024_ms 12
00690 #define RECORD_AGC_2048_ms 13
00691 #define RECORD_AGC_4096_ms 14
00692 #define RECORD_AGC_8192_ms 15
00693 
00694 //      Record modes
00695 #define RECORD_MODE_COMPRESSED          0       //      Selects: Compressed modes, TrueSpeech 8.5-4.1, G.723.1, G.722, G.728, G.729
00696 #define RECORD_MODE_TRUESPEECH          0       //      Selects: TrueSpeech 8.5, 6.3, 5.3, 4.8 or 4.1 Kbps
00697 #define RECORD_MODE_ULAW                        4       //      Selects: 64 Kbit/sec Mu-law PCM
00698 #define RECORD_MODE_ALAW                        12      //      Selects: 64 Kbit/sec A-law PCM
00699 #define RECORD_MODE_16LINEAR            5       //      Selects: 128 Kbit/sec 16-bit linear
00700 #define RECORD_MODE_8LINEAR                     6       //      Selects: 64 Kbit/sec 8-bit signed linear
00701 #define RECORD_MODE_8LINEAR_WSS         7       //      Selects: 64 Kbit/sec WSS 8-bit unsigned linear
00702 
00703 //      Record rates
00704 #define RECORD_RATE_TS85        0       //      Selects TrueSpeech 8.5 record rate.
00705 #define RECORD_RATE_TS63        1       //      Selects TrueSpeech 6.3 record rate.
00706 #define RECORD_RATE_TS53        2       //      Selects TrueSpeech 5.3 record rate.
00707 #define RECORD_RATE_TS48        3       //      Selects TrueSpeech 4.8 record rate.
00708 #define RECORD_RATE_TS41        4       //      Selects TrueSpeech 4.1 record rate.
00709 #define RECORD_RATE_G722        7       //      Selects G.722 record rate.
00710 #define RECORD_RATE_G723_63     RECORD_RATE_TS63        //      Selects G.723.1 (6.3 kbps) record rate.
00711 #define RECORD_RATE_G723_53     RECORD_RATE_TS53        //      Selects G.723.1 (5.3 kbps) record rate.
00712 #define RECORD_RATE_G728        5       //      Selects G.728 record rate.
00713 #define RECORD_RATE_G729        6       //      Selects G.729 record rate.
00714 
00715 // Frame sizes in WORD units
00716 #define RECORD_TS85_WORDS                               16              //      TrueSpeech 8.5, 30ms frame size
00717 #define RECORD_TS63_WORDS                               12              //      TrueSpeech 6.3, 30ms frame size
00718 #define RECORD_TS53_WORDS                               10              //      TrueSpeech 5.3, 30ms frame size
00719 #define RECORD_TS48_WORDS                               9               //      TrueSpeech 4.8, 30ms frame size
00720 #define RECORD_TS41_WORDS                               8               //      TrueSpeech 4.1, 30ms frame size
00721 #define RECORD_ALAW_WORDS                               120             //      64 Kbit/sec A-law PCM, 30ms frame size
00722 #define RECORD_ALAW_30MS_WORDS                  120             //      64 Kbit/sec A-law PCM, 30ms frame size
00723 #define RECORD_ALAW_20MS_WORDS                  80              //      64 Kbit/sec A-law PCM, 20ms frame size
00724 #define RECORD_ALAW_10MS_WORDS                  40              //      64 Kbit/sec A-law PCM, 10ms frame size
00725 #define RECORD_ULAW_WORDS                               120             //      64 Kbit/sec Mu-law PCM, 30ms frame size
00726 #define RECORD_ULAW_30MS_WORDS                  120             //      64 Kbit/sec Mu-law PCM, 30ms frame size
00727 #define RECORD_ULAW_20MS_WORDS                  80              //      64 Kbit/sec Mu-law PCM, 20ms frame size
00728 #define RECORD_ULAW_10MS_WORDS                  40              //      64 Kbit/sec Mu-law PCM, 10ms frame size
00729 #define RECORD_16LINEAR_WORDS                   240             //      128 Kbit/sec 16-bit linear, 30ms frame size
00730 #define RECORD_16LINEAR_30MS_WORDS              240             //      128 Kbit/sec 16-bit linear, 30ms frame size
00731 #define RECORD_16LINEAR_20MS_WORDS              160             //      128 Kbit/sec 16-bit linear, 20ms frame size
00732 #define RECORD_16LINEAR_10MS_WORDS              80              //      128 Kbit/sec 16-bit linear, 10ms frame size
00733 #define RECORD_8LINEAR_WORDS                    120             //      64 Kbit/sec 8-bit signed linear, 30ms frame size
00734 #define RECORD_8LINEAR_30MS_WORDS               120             //      64 Kbit/sec 8-bit signed linear, 30ms frame size
00735 #define RECORD_8LINEAR_20MS_WORDS               80              //      64 Kbit/sec 8-bit signed linear, 20ms frame size
00736 #define RECORD_8LINEAR_10MS_WORDS               40              //      64 Kbit/sec 8-bit signed linear, 10ms frame size
00737 #define RECORD_8LINEAR_WSS_WORDS                120             //      64 Kbit/sec WSS 8-bit unsigned linear, 30ms frame size
00738 #define RECORD_8LINEAR_WSS_30MS_WORDS   120             //      64 Kbit/sec WSS 8-bit unsigned linear, 30ms frame size
00739 #define RECORD_8LINEAR_WSS_20MS_WORDS   80              //      64 Kbit/sec WSS 8-bit unsigned linear, 20ms frame size
00740 #define RECORD_8LINEAR_WSS_10MS_WORDS   40              //      64 Kbit/sec WSS 8-bit unsigned linear, 10ms frame size
00741 #define RECORD_G722_WORDS                               40              //      64 Kbit/sec G.722, 10ms frame size
00742 #define RECORD_G723_63_WORDS                    RECORD_TS63_WORDS       //      6.3 Kbit/sec G.723.1, 30ms frame size
00743 #define RECORD_G723_53_WORDS                    RECORD_TS53_WORDS       //      5.3 Kbit/sec G.723.1, 30ms frame size
00744 #define RECORD_G728_10MS_WORDS                  16              //      16 Kbit/sec G.728, 10ms frame size
00745 #define RECORD_G728_20MS_WORDS                  32              //      16 Kbit/sec G.728, 20ms frame size
00746 #define RECORD_G728_30MS_WORDS                  48              //      16 Kbit/sec G.728, 30ms frame size
00747 #define RECORD_G729_10MS_WORDS                  6               //      8 Kbit/sec G.729, 10ms frame size
00748 #define RECORD_G729_20MS_WORDS                  12              //      8 Kbit/sec G.729, 20ms frame size
00749 #define RECORD_G729_30MS_WORDS                  18              //      8 Kbit/sec G.729, 30ms frame size
00750 
00751 // Frame sizes in bytes
00752 #define RECORD_FRAME_TS85                               (RECORD_TS85_WORDS*2)
00753 #define RECORD_FRAME_TS63                               (RECORD_TS63_WORDS*2)
00754 #define RECORD_FRAME_TS53                               (RECORD_TS53_WORDS*2)
00755 #define RECORD_FRAME_TS48                               (RECORD_TS48_WORDS*2)
00756 #define RECORD_FRAME_TS41                               (RECORD_TS41_WORDS*2)
00757 #define RECORD_FRAME_ALAW                               (RECORD_ALAW_WORDS*2)
00758 #define RECORD_FRAME_ALAW_30MS                  (RECORD_ALAW_30MS_WORDS*2)
00759 #define RECORD_FRAME_ALAW_20MS                  (RECORD_ALAW_20MS_WORDS*2)
00760 #define RECORD_FRAME_ALAW_10MS                  (RECORD_ALAW_10MS_WORDS*2)
00761 #define RECORD_FRAME_ULAW                               (RECORD_ULAW_WORDS*2)
00762 #define RECORD_FRAME_ULAW_30MS                  (RECORD_ULAW_30MS_WORDS*2)
00763 #define RECORD_FRAME_ULAW_20MS                  (RECORD_ULAW_20MS_WORDS*2)
00764 #define RECORD_FRAME_ULAW_10MS                  (RECORD_ULAW_10MS_WORDS*2)
00765 #define RECORD_FRAME_16LINEAR                   (RECORD_16LINEAR_WORDS*2)
00766 #define RECORD_FRAME_16LINEAR_30MS              (RECORD_16LINEAR_30MS_WORDS*2)
00767 #define RECORD_FRAME_16LINEAR_20MS              (RECORD_16LINEAR_20MS_WORDS*2)
00768 #define RECORD_FRAME_16LINEAR_10MS              (RECORD_16LINEAR_10MS_WORDS*2)
00769 #define RECORD_FRAME_8LINEAR                    (RECORD_8LINEAR_WORDS*2)
00770 #define RECORD_FRAME_8LINEAR_30MS               (RECORD_8LINEAR_30MS_WORDS*2)
00771 #define RECORD_FRAME_8LINEAR_20MS               (RECORD_8LINEAR_20MS_WORDS*2)
00772 #define RECORD_FRAME_8LINEAR_10MS               (RECORD_8LINEAR_10MS_WORDS*2)
00773 #define RECORD_FRAME_8LINEAR_WSS                (RECORD_8LINEAR_WSS_WORDS*2)
00774 #define RECORD_FRAME_8LINEAR_WSS_30MS   (RECORD_8LINEAR_WSS_30MS_WORDS*2)
00775 #define RECORD_FRAME_8LINEAR_WSS_20MS   (RECORD_8LINEAR_WSS_20MS_WORDS*2)
00776 #define RECORD_FRAME_8LINEAR_WSS_10MS   (RECORD_8LINEAR_WSS_10MS_WORDS*2)
00777 #define RECORD_FRAME_G722                               (RECORD_G722_WORDS*2)
00778 #define RECORD_FRAME_G723_63                    (RECORD_G723_63_WORDS*2)
00779 #define RECORD_FRAME_G723_53                    (RECORD_G723_53_WORDS*2)
00780 #define RECORD_FRAME_G728_10MS                  (RECORD_G728_10MS_WORDS*2)
00781 #define RECORD_FRAME_G728_20MS                  (RECORD_G728_20MS_WORDS*2)
00782 #define RECORD_FRAME_G728_30MS                  (RECORD_G728_30MS_WORDS*2)
00783 #define RECORD_FRAME_G729_10MS                  (RECORD_G729_10MS_WORDS*2)
00784 #define RECORD_FRAME_G729_20MS                  (RECORD_G729_20MS_WORDS*2)
00785 #define RECORD_FRAME_G729_30MS                  (RECORD_G729_30MS_WORDS*2)
00786 
00787 #define RECORD_MAX_BUFFER_WORDS RECORD_16LINEAR_WORDS   //      Max buffer size: Tx or Rx.
00788 #define RECORD_MAX_BUFFER_SIZE  RECORD_FRAME_16LINEAR   //      Max buffer size: Tx or Rx.
00789 
00790 #define RECORD_TS85_AVG_RATE    1067    //      TrueSpeech 8.5 Average bytes per second.
00791 #define RECORD_TS63_AVG_RATE    800             //      TrueSpeech 6.3 Average bytes per second.
00792 #define RECORD_TS53_AVG_RATE    667             //      TrueSpeech 5.3 Average bytes per second.
00793 #define RECORD_TS48_AVG_RATE    600             //      TrueSpeech 4.8 Average bytes per second.
00794 #define RECORD_TS41_AVG_RATE    533             //      TrueSpeech 4.1 Average bytes per second.
00795 
00796 //==========================================================================
00797 //--------------------------------------------------------------------------
00798 //      Speakerphone support
00799 //--------------------------------------------------------------------------
00800 //
00801 //      Additional bit patterns to 'Or' into Command Base 'words'
00802 #define SPKRPHONE_LINE_VOLUME_POS_8DB   0       //      +8 dB
00803 #define SPKRPHONE_LINE_VOLUME_POS_4DB   1       //      +4 dB
00804 #define SPKRPHONE_LINE_VOLUME_POS_0DB   2       //      +0 dB
00805 #define SPKRPHONE_LINE_VOLUME_MUTE              3       //      Mute Microphone (also resets AEC)
00806 
00807 #define SPKRPHONE_SPEAKER_VOLUME_POS_14DB       0       //      +14 dB
00808 #define SPKRPHONE_SPEAKER_VOLUME_POS_12DB       1       //      +12 dB
00809 #define SPKRPHONE_SPEAKER_VOLUME_POS_10DB       2       //      +10 dB
00810 #define SPKRPHONE_SPEAKER_VOLUME_POS_8DB        3       //      +8 dB
00811 #define SPKRPHONE_SPEAKER_VOLUME_POS_6DB        4       //      +6 dB
00812 #define SPKRPHONE_SPEAKER_VOLUME_POS_4DB        5       //      +4 dB
00813 #define SPKRPHONE_SPEAKER_VOLUME_POS_2DB        6       //      +2 dB
00814 #define SPKRPHONE_SPEAKER_VOLUME_POS_0DB        7       //      0 dB
00815 #define SPKRPHONE_SPEAKER_VOLUME_NEG_2DB        8       //      -2 dB
00816 #define SPKRPHONE_SPEAKER_VOLUME_NEG_4DB        9       //      -4 dB
00817 #define SPKRPHONE_SPEAKER_VOLUME_NEG_6DB        10      //      -6 dB
00818 #define SPKRPHONE_SPEAKER_VOLUME_NEG_8DB        11      //      -8 dB
00819 #define SPKRPHONE_SPEAKER_VOLUME_NEG_10DB       12      //      -10 dB
00820 #define SPKRPHONE_SPEAKER_VOLUME_NEG_12DB       13      //      -12 dB
00821 #define SPKRPHONE_SPEAKER_VOLUME_NEG_14DB       14      //      -14 dB
00822 #define SPKRPHONE_SPEAKER_VOLUME_MUTE           15      //      Mute Speaker
00823 
00824 // AEC bit positions
00825 #define SPKRPHONE_AEC_ON        1
00826 #define SPKRPHONE_AEC_LO        2
00827 #define SPKRPHONE_AEC_HI        4
00828 
00829 //==========================================================================
00830 //--------------------------------------------------------------------------
00831 //      VxD support
00832 //
00833 //      NOTE: These names will be changed in the future to a generic 'driver'
00834 //        naming convention.
00835 //--------------------------------------------------------------------------
00836 //
00837 // Event bit fields.
00838 #define EVENT_TYPE_INT_DTMF                                             0x0002
00839 #define EVENT_TYPE_INT_TX_READY                                 0x0004
00840 #define EVENT_TYPE_INT_RX_READY                                 0x0008
00841 #define EVENT_TYPE_INT_HOOK                                             0x0010
00842 #define EVENT_TYPE_INT_RING                                             0x0020
00843 #define EVENT_TYPE_INT_WRITE_DONE                               0x0040
00844 #define EVENT_TYPE_INT_PLAYBACK_VOLUME_CHANGE   0x0080
00845 #define EVENT_TYPE_INT_RECORD_VOLUME_CHANGE             0x0100
00846 #define EVENT_TYPE_INT_ANALOG_SOURCE_CHANGE             0x0200
00847 #define EVENT_TYPE_INT_AEC_CHANGE                               0x0400
00848 #define EVENT_TYPE_INT_PLAYBACK_MUTE_CHANGE             0x0800
00849 #define EVENT_TYPE_INT_RECORD_MUTE_CHANGE               0x1000
00850 #define EVENT_TYPE_INT_MIXER_CHANGE                             0x2000
00851 
00852 //---------------------------------------
00853 //      This is included for legacy support.
00854 //      This name is used by Ring 3 Drivers that use a software interrupt to
00855 //      get the PM entry point to the VxD. If it changes here, all users of this
00856 //      define must recompile.
00857 #define IPJ_VXDNAME             "QTIPJ   "
00858 
00859 #define IXJ_DRV_NAME    TEXT("qtxjack.drv")
00860 #define IXJ_INST_NAME   TEXT("Internet PhoneJACK/Internet LineJACK")
00861 
00862 // Typedefs
00863 
00864 // For IOCTL_VxD_AddPerformanceStat & fnVxD_AddPerformanceStat
00865 typedef struct
00866 {
00867     DWORD ulFlags;
00868     LPSTR pszStatName;
00869     LPSTR pszStatDescription;
00870     LPVOID pStatFunc;
00871 } PERF_STAT, FAR *LPPERF_STAT;
00872 
00873 // Set lpBufPointer to lpPerfStat, dwBufSize to sizeof( PERF_STAT )
00874 
00875 /* pStatFunc points either directly to data (always a DWORD for now) */
00876 /* or, if PSTF_FUNCPTR_BIT is set, to a _cdecl function.  This function   */
00877 /* accepts a stat handle as it's argument and returns the stat in eax     */
00878 // The following #defines come from <perf.h>.
00879 
00880 #ifndef PSTF_FUNCPTR
00881 #define PSTF_FUNCPTR    0x00000001
00882 #define PSTF_COUNT              0x00000000
00883 #define PSTF_RATE               0x00000002
00884 #endif
00885 
00886 typedef struct ipj_vxd_devio
00887 {
00888     DWORD       dwSize;
00889         DEVNODE dnDevNode;
00890         DWORD   dwFunctionCode;
00891     DWORD       dwReturn;
00892         DWORD   dwSetData;
00893         DWORD   dwBufSize;
00894         LPVOID  lpBufPointer;
00895         DWORD   dwOutBufSize;
00896         LPVOID  lpOutBufPointer;
00897     DWORD       dwReserved;     // Must be zero
00898 } IPJ_VXD_DEVIO;
00899 
00900 #endif
00901 
00902 //      eof: ixjDefs.h

Generated on Mon Sep 25 16:20:07 2006 for OPAL by  doxygen 1.4.7