home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / tunerapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  6.7 KB  |  182 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * TunerAPI.h -  Tuner Application Programming Interface definitions           *
  4. *                                                                             *
  5. *               Version 1.00                                                  *
  6. *                                                                             *
  7. *               Copyright (c) 1998, Microsoft Corp.  All rights reserved      *
  8. *                                                                             *
  9. ******************************************************************************/
  10.  
  11. #include <windows.h>
  12.  
  13. #ifndef _TunerAPI_H_
  14. #define _TunerAPI_H_
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20.  
  21.  
  22. #define TC_MUTE         0x00000001        // Tuner Caps - supports MUTE function
  23. #define TC_LOCAL        0x00000002        // Tuner Caps - supports Distance/Local
  24.  
  25. #define BC_STEREO       0x00010000        // Band Caps - supports Stereo setting
  26. #define BC_RBDS         0x00020000        // Band Caps - supports RBDS setting
  27. #define BC_TWOWAY       0x00040000        // Band Caps - supports TWOWAY setting
  28.  
  29. //
  30. // this defines the bits for TUNERCONFIG structure
  31. //
  32. #define STEREO_ON       BC_STEREO       // Stereo on
  33. #define RBDS_ON            BC_RBDS            // RBDS mode on
  34. #define TWOWAY_ON        BC_TWOWAY        // Two way mode on
  35. #define LOCAL_ON        TC_LOCAL        // Local mode on (vs distance mode)
  36. #define MUTE_ON         TC_MUTE         // Tuner mute mode on
  37.             
  38. #define BAND_AM         0x00000001      // AM band
  39. #define BAND_FM         0x00000002      // FM band
  40. #define BAND_WEATHER    0x00000004        // Weather band
  41. #define BAND_TV         0x00000008      // TV band
  42. #define BAND_CB         0x00000010      // CB band
  43. #define BAND_USER       0x00010000      // start of user defined band
  44.  
  45. #define FREQ_IN_HZ      1
  46. #define FREQ_IN_KHZ     1000
  47. #define FREQ_IN_MHZ     1000000
  48. #define FREQ_IN_GHZ     1000000000
  49.  
  50. // Seek options
  51. #define TUNER_SEEK_TUNEDOWN                0x0001
  52. #define TUNER_SEEK_NO_WRAPAROUND        0x0002
  53. #define TUNER_SEEK_NO_MUTE                0x0004
  54.  
  55. //Seek sensitivity
  56. #define TUNER_SEEK_SENSITIVITY_NORMAL    (WORD)0
  57. #define TUNER_SEEK_SENSITIVITY_HIGH        (WORD)1
  58. #define TUNER_SEEK_SENSITIVITY_LOW        (WORD)2
  59.  
  60. typedef struct _TUNERDEVCAPS {    
  61.     DWORD           dwMakerID;          // Manufacture/Model ID
  62.     DWORD           dwDrvVer;           // Tuner Device driver version, HIWORD=Major, LOWWORD=Minor
  63.     DWORD           dwTunerCaps;        // supported tuner features
  64.     DWORD           dwBands;            // supported bands 
  65.     DWORD           dwReserved1;        // reserved
  66.     DWORD           dwReserved2;        // reserved
  67. } TUNERDEVCAPS, *PTUNERDEVCAPS;
  68.  
  69. typedef  struct _FREQUENCY {
  70.     DWORD           dwFreqValue;        // Frequency value
  71.     DWORD           dwFreqUnit;         // Frequency unit
  72. } FREQUENCY, *PFREQUENCY;
  73.  
  74. typedef struct _TUNERBANDINFO {
  75.     DWORD           dwBandID;           // Band identifer
  76.     FREQUENCY       RangeLow;           // Low end of the Tuner frequency range
  77.     FREQUENCY       RangeHigh;          // High end of the Tuner frequency range
  78.     FREQUENCY       MinTuningStep;      // Min tuning step
  79.     DWORD           dwBandCaps;         // Band capabilities
  80. } TUNERBANDINFO, *PTUNERBANDINFO;
  81.  
  82. typedef struct _TUNERCONFIG { 
  83.     DWORD           dwBand;             // Band selection
  84.     FREQUENCY       CurrentFreq;        // Current Frequency setting
  85.     FREQUENCY       SeekStep;           // station seek step size
  86.     FREQUENCY       RangeLow;           // Low end of the Band frequency range
  87.     FREQUENCY       RangeHigh;          // High end of the Band frequency range
  88.     DWORD           dwState;            // Settings
  89. } TUNERCONFIG, *PTUNERCONFIG;
  90.  
  91. typedef struct _FIELDSTRENGTH {
  92.     unsigned short  MaxStrength;
  93.     unsigned short  CurrentStrength;
  94. } FIELDSTRENGTH,*PFIELDSTRENGTH;
  95.  
  96. typedef struct _SIGNALINFO { 
  97.     BOOL            fIsStation;         // Suggest it is tuned to a valid station
  98.     FREQUENCY        CurrentFreq;        // Current tuned station
  99.     FIELDSTRENGTH   FieldStrength;      // FieldStrength Level Information
  100.     DWORD           dwMultiPath;        // MultiPath Level Information
  101.     BOOL            fStereoPresent;     // Stereo Pilot present
  102.     DWORD           dwReserved;         // reserved DWORD
  103. } SIGNALINFO, *PSIGNALINFO;
  104.  
  105. typedef BOOL (*SEEK_STATUS_NOTIFY)(PSIGNALINFO);
  106.  
  107. typedef struct _TUNERSEEKINFO
  108. {
  109.     WORD            wSeekOptions;
  110.     WORD            wSensitivity;
  111.     FREQUENCY       RangeLow;           // Low end of the freq range to search
  112.     FREQUENCY       RangeHigh;          // High end of the freq range to search
  113.     SEEK_STATUS_NOTIFY    fnCallBack;        // call back function
  114.     DWORD            Reserved;
  115. }TUNERSEEKINFO, *PTUNERSEEKINFO;
  116.  
  117. //
  118. // Tuner API functions
  119. //
  120.  
  121. BOOL TunerQuery(
  122.     OUT DWORD       *pdwTunerAPIVer,    // version of tuner api
  123.     OUT DWORD       *pdwNumDevs         // number of tuner devices available
  124. );    
  125.  
  126. BOOL TunerGetDevCaps (
  127.     IN DWORD            dwDeviceID,     // device to be queried
  128.     OUT PTUNERDEVCAPS   pTunerDevCaps   // pointer to TUNERDEVCAPS buffer
  129. );
  130.  
  131. //
  132. // return Value: the number of band information obtained
  133. //
  134. DWORD TunerGetBandInfo(
  135.     IN  DWORD       dwDeviceID,         // tuner device id
  136.     IN  DWORD       dwBands,            // a mask for interested bands
  137.     OUT PTUNERBANDINFO   pBandInfo,     // pointer to a buffer to receive band information
  138.     IN  DWORD       dwBufSize,          // size of the receiving buffer
  139.     OUT DWORD       *pdwActualOutSize   // pointer to actual size of buffer with info
  140. );
  141.  
  142. HANDLE TunerOpen(
  143.     DWORD           dwTunerId           // specify which tuner to open
  144. );    
  145.  
  146. BOOL TunerGetConfig(
  147.     IN HANDLE           hTuner,         // specify tuner
  148.     OUT PTUNERCONFIG    pTunerConfig    // address of tuner config structure
  149. );    
  150.  
  151. BOOL TunerSetConfig(
  152.     IN HANDLE       hTuner,             // specify which tuner to config
  153.     IN PTUNERCONFIG pTunerConfig        // address of tuner config structure
  154. );    
  155.  
  156. BOOL TunerGetSignalInfo(
  157.     IN HANDLE       hTuner,             // handle of the tuner device
  158.     OUT PSIGNALINFO pSignalInfo         // address of a tuner signal structure
  159. );
  160.  
  161. BOOL TunerReset(
  162.     IN HANDLE       hTuner              // handle of the tuner device
  163. );
  164.  
  165. BOOL TunerSeekStation(
  166.     IN HANDLE        hTuner,                // handle of the tuner device
  167.     PTUNERSEEKINFO pTunerSeekInfo
  168. );      
  169.  
  170. BOOL TunerCancelSeek(                    // cancels the last seek operation
  171.     IN HANDLE    hTuner
  172. );
  173.  
  174. BOOL TunerClose(
  175.     IN HANDLE       hTuner              // handle of the tuner device
  176. );    
  177.  
  178. #ifdef __cplusplus
  179. }
  180. #endif
  181. #endif // _TunerAPI_H_
  182.