- //---------------------------------------------------------------------------
- #ifndef _FORM_TDMB_H_
- #define _FORM_TDMB_H_
- //---------------------------------------------------------------------------
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <ExtCtrls.hpp>
- #include <ComCtrls.hpp>
- #include <Dialogs.hpp>
- #ifndef _TDMB_RF_H_
- #include "tdmb_rf.h"
- #endif
- //---------------------------------------------------------------------------
- typedef enum
- {
- TDMB_DRAW_MASK_CHANNEL = 0x01,
- TDMB_DRAW_MASK_FREQ_SERVICES = 0x02,
- TDMB_DRAW_MASK_SCAN_SERVICES = 0x04,
- TDMB_DRAW_MASK_SIGNAL = 0x08
- }E_TDMB_DRAW_MASK;
- //---------------------------------------------------------------------------
- class TfrmTDMB : public TForm
- {
- __published: // IDE-managed Components
- TPanel *Panel1;
- TLabel *Label1;
- TComboBox *m_cbBand;
- TLabel *Label2;
- TComboBox *m_cbChannel;
- TTreeView *m_tvServices;
- TStaticText *StaticText1;
- TButton *m_btnSetChannel;
- TButton *m_btnAutoScan;
- TStatusBar *m_sbTDMB;
- TPanel *Panel2;
- TLabel *Label3;
- TLabel *Label5;
- TLabel *Label6;
- TStaticText *m_stSNR;
- TStaticText *m_stPreBER;
- TStaticText *m_stRSSI;
- TTimer *m_tmSingal;
- TLabel *Label7;
- TLabel *Label8;
- TSaveDialog *m_dlgService;
- TButton *m_btnStop;
- TProgressBar *m_pbService;
- TTimer *m_tmService;
- TTimer *m_tmGetFile;
- TLabel *Label4;
- TButton *m_btnStartRS;
- TButton *m_btnSelectService;
- void __fastcall m_cbBandChange(TObject *Sender);
- void __fastcall FormShow(TObject *Sender);
- void __fastcall m_btnSetChannelClick(TObject *Sender);
- void __fastcall m_btnAutoScanClick(TObject *Sender);
- void __fastcall FormActivate(TObject *Sender);
- void __fastcall m_tmSingalTimer(TObject *Sender);
- void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
- void __fastcall FormHide(TObject *Sender);
- void __fastcall m_btnStopClick(TObject *Sender);
- void __fastcall m_tmGetFileTimer(TObject *Sender);
- void __fastcall m_tmServiceTimer(TObject *Sender);
- void __fastcall m_btnSelectServiceClick(TObject *Sender);
- void __fastcall m_btnStartRSClick(TObject *Sender);
- private: // User declarations
- // common
- CTDMBRF m_TDMB_RF_Obj;
- bool m_bInit;
- //HANDLE m_hSemaphore;
- bool m_bAction;
- // service
- bool m_bService;
- bool m_bRecordStream;
- TDMB_SET_FREQ_CNF_T m_sFreqEnsemble;
- TDMB_GET_ENSM_INFO_BY_AUTO_SCAN_CNF_T m_sScanEnsemble;
- // signal quality
- TDMB_GET_SIGNAL_CNF_T m_sSignal;
- // bool m_bSignalQEnable;
- public: // User declarations
- __fastcall TfrmTDMB(TComponent* Owner);
- void Init(void);
- // UI
- void Disable_AllTimer(void);
- void CurrentPageReset(void);
- void CurrentPageLock(void);
- void ReDrawFields(E_TDMB_DRAW_MASK mask);
- void Display_Channel(E_TDMB_BAND_T band);
- void Display_FreqEnsembleDB(void);
- void Display_ScanEnsembleDB(void);
- unsigned int Get_TDMBFreqKHz(void);
- bool Get_ServiceID(unsigned int &ch_kHz, unsigned int &ui_ServiceId, unsigned int &ui_SubChnId);
- // callback
- void CNF_TDMB_PowerOn(void);
- void CNF_TDMB_SetFreq(void);
- void CNF_TDMB_AutoScan(void);
- void CNF_TDMB_GetSignal(void);
- void CNF_TDMB_SelServiceOnly(void);
- void CNF_TDMB_RecordStream(void);
- void CNF_TDMB_StopService(void);
- };
- //---------------------------------------------------------------------------
- extern PACKAGE TfrmTDMB *frmTDMB;
- //---------------------------------------------------------------------------
- #endif