diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
commit | efbc9d9043ff8ff92716ddd00a5f61412d535593 (patch) | |
tree | 8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /src/apps/mplayerc/TunerScanDlg.cpp | |
parent | df6b139a6d9027156f614b68687e039e3a5854db (diff) |
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/TunerScanDlg.cpp')
-rw-r--r-- | src/apps/mplayerc/TunerScanDlg.cpp | 216 |
1 files changed, 108 insertions, 108 deletions
diff --git a/src/apps/mplayerc/TunerScanDlg.cpp b/src/apps/mplayerc/TunerScanDlg.cpp index dab09bba2..bae4cb0c9 100644 --- a/src/apps/mplayerc/TunerScanDlg.cpp +++ b/src/apps/mplayerc/TunerScanDlg.cpp @@ -31,10 +31,10 @@ enum TSC_COLUMN
{
- TSCC_NUMBER,
- TSCC_NAME,
- TSCC_FREQUENCY,
- TSCC_CHANNEL
+ TSCC_NUMBER,
+ TSCC_NAME,
+ TSCC_FREQUENCY,
+ TSCC_CHANNEL
};
// CTunerScanDlg dialog
@@ -42,11 +42,11 @@ enum TSC_COLUMN IMPLEMENT_DYNAMIC(CTunerScanDlg, CDialog)
CTunerScanDlg::CTunerScanDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CTunerScanDlg::IDD, pParent)
- , m_ulFrequencyStart(474000)
- , m_ulFrequencyEnd(858000)
- , m_ulBandwidth(8000)
- , m_bInProgress(false)
+ : CDialog(CTunerScanDlg::IDD, pParent)
+ , m_ulFrequencyStart(474000)
+ , m_ulFrequencyEnd(858000)
+ , m_ulBandwidth(8000)
+ , m_bInProgress(false)
{
}
@@ -56,46 +56,46 @@ CTunerScanDlg::~CTunerScanDlg() BOOL CTunerScanDlg::OnInitDialog()
{
- CDialog::OnInitDialog();
+ CDialog::OnInitDialog();
+
+ m_ChannelList.InsertColumn(TSCC_NUMBER, _T("N°"), LVCFMT_LEFT, 50);
+ m_ChannelList.InsertColumn(TSCC_NAME, _T("Name"), LVCFMT_LEFT, 250);
+ m_ChannelList.InsertColumn(TSCC_FREQUENCY, _T("Frequency"), LVCFMT_LEFT, 100);
+ m_ChannelList.InsertColumn(TSCC_CHANNEL, _T("Channel"), LVCFMT_LEFT, 0);
- m_ChannelList.InsertColumn(TSCC_NUMBER, _T("N°"), LVCFMT_LEFT, 50);
- m_ChannelList.InsertColumn(TSCC_NAME, _T("Name"), LVCFMT_LEFT, 250);
- m_ChannelList.InsertColumn(TSCC_FREQUENCY, _T("Frequency"), LVCFMT_LEFT, 100);
- m_ChannelList.InsertColumn(TSCC_CHANNEL, _T("Channel"), LVCFMT_LEFT, 0);
+ m_Progress.SetRange(0, 100);
+ m_Strength.SetRange(0, 100);
+ m_Quality.SetRange(0, 100);
+ m_btnSave.EnableWindow(FALSE);
- m_Progress.SetRange(0, 100);
- m_Strength.SetRange(0, 100);
- m_Quality.SetRange(0, 100);
- m_btnSave.EnableWindow(FALSE);
-
- return TRUE;
+ return TRUE;
}
void CTunerScanDlg::DoDataExchange(CDataExchange* pDX)
{
- CDialog::DoDataExchange(pDX);
- DDX_Text(pDX, IDC_FREQ_START, m_ulFrequencyStart);
- DDX_Text(pDX, IDC_FREQ_END, m_ulFrequencyEnd);
- DDX_Text(pDX, IDC_BANDWIDTH, m_ulBandwidth);
- DDX_Control(pDX, IDC_PROGRESS, m_Progress);
- DDX_Control(pDX, IDC_STRENGTH, m_Strength);
- DDX_Control(pDX, IDC_QUALITY, m_Quality);
- DDX_Control(pDX, IDC_CHANNEL_LIST, m_ChannelList);
- DDX_Control(pDX, ID_START, m_btnStart);
- DDX_Control(pDX, ID_SAVE, m_btnSave);
- DDX_Control(pDX, IDCANCEL, m_btnCancel);
+ CDialog::DoDataExchange(pDX);
+ DDX_Text(pDX, IDC_FREQ_START, m_ulFrequencyStart);
+ DDX_Text(pDX, IDC_FREQ_END, m_ulFrequencyEnd);
+ DDX_Text(pDX, IDC_BANDWIDTH, m_ulBandwidth);
+ DDX_Control(pDX, IDC_PROGRESS, m_Progress);
+ DDX_Control(pDX, IDC_STRENGTH, m_Strength);
+ DDX_Control(pDX, IDC_QUALITY, m_Quality);
+ DDX_Control(pDX, IDC_CHANNEL_LIST, m_ChannelList);
+ DDX_Control(pDX, ID_START, m_btnStart);
+ DDX_Control(pDX, ID_SAVE, m_btnSave);
+ DDX_Control(pDX, IDCANCEL, m_btnCancel);
}
BEGIN_MESSAGE_MAP(CTunerScanDlg, CDialog)
- ON_MESSAGE(WM_TUNER_SCAN_PROGRESS, OnScanProgress)
- ON_MESSAGE(WM_TUNER_SCAN_END, OnScanEnd)
- ON_MESSAGE(WM_TUNER_STATS, OnStats)
- ON_MESSAGE(WM_TUNER_NEW_CHANNEL, OnNewChannel)
- ON_BN_CLICKED(ID_SAVE, &CTunerScanDlg::OnBnClickedSave)
- ON_BN_CLICKED(ID_START, &CTunerScanDlg::OnBnClickedStart)
- ON_BN_CLICKED(IDCANCEL, &CTunerScanDlg::OnBnClickedCancel)
+ ON_MESSAGE(WM_TUNER_SCAN_PROGRESS, OnScanProgress)
+ ON_MESSAGE(WM_TUNER_SCAN_END, OnScanEnd)
+ ON_MESSAGE(WM_TUNER_STATS, OnStats)
+ ON_MESSAGE(WM_TUNER_NEW_CHANNEL, OnNewChannel)
+ ON_BN_CLICKED(ID_SAVE, &CTunerScanDlg::OnBnClickedSave)
+ ON_BN_CLICKED(ID_START, &CTunerScanDlg::OnBnClickedStart)
+ ON_BN_CLICKED(IDCANCEL, &CTunerScanDlg::OnBnClickedCancel)
END_MESSAGE_MAP()
@@ -103,106 +103,106 @@ END_MESSAGE_MAP() void CTunerScanDlg::OnBnClickedSave()
{
- AppSettings& s = AfxGetAppSettings();
+ AppSettings& s = AfxGetAppSettings();
- s.DVBChannels.RemoveAll();
+ s.DVBChannels.RemoveAll();
- for(int i = 0; i < m_ChannelList.GetItemCount(); i++)
- {
- CDVBChannel Channel;
- Channel.FromString(m_ChannelList.GetItemText(i, TSCC_CHANNEL));
- Channel.SetPrefNumber(i);
- s.DVBChannels.AddTail(Channel);
- }
+ for (int i=0;i <m_ChannelList.GetItemCount(); i++)
+ {
+ CDVBChannel Channel;
+ Channel.FromString (m_ChannelList.GetItemText (i, TSCC_CHANNEL));
+ Channel.SetPrefNumber(i);
+ s.DVBChannels.AddTail (Channel);
+ }
- OnOK();
+ OnOK();
}
void CTunerScanDlg::OnBnClickedStart()
{
- if(!m_bInProgress)
- {
- CAutoPtr<TunerScanData> pTSD(DNew TunerScanData);
- pTSD->Hwnd = m_hWnd;
- pTSD->FrequencyStart = m_ulFrequencyStart;
- pTSD->FrequencyStop = m_ulFrequencyEnd;
- pTSD->Bandwidth = m_ulBandwidth;
-
- m_ChannelList.DeleteAllItems();
- ((CMainFrame*)AfxGetMainWnd())->StartTunerScan(pTSD);
-
- SetProgress(true);
- }
- else
- ((CMainFrame*)AfxGetMainWnd())->StopTunerScan();
+ if (!m_bInProgress)
+ {
+ CAutoPtr<TunerScanData> pTSD (DNew TunerScanData);
+ pTSD->Hwnd = m_hWnd;
+ pTSD->FrequencyStart = m_ulFrequencyStart;
+ pTSD->FrequencyStop = m_ulFrequencyEnd;
+ pTSD->Bandwidth = m_ulBandwidth;
+
+ m_ChannelList.DeleteAllItems();
+ ((CMainFrame*)AfxGetMainWnd())->StartTunerScan (pTSD);
+
+ SetProgress (true);
+ }
+ else
+ ((CMainFrame*)AfxGetMainWnd())->StopTunerScan();
}
void CTunerScanDlg::OnBnClickedCancel()
{
- if(m_bInProgress)
- ((CMainFrame*)AfxGetMainWnd())->StopTunerScan();
+ if (m_bInProgress)
+ ((CMainFrame*)AfxGetMainWnd())->StopTunerScan();
- OnCancel();
+ OnCancel();
}
LRESULT CTunerScanDlg::OnScanProgress(WPARAM wParam, LPARAM lParam)
{
- m_Progress.SetPos(wParam);
- return TRUE;
+ m_Progress.SetPos(wParam);
+ return TRUE;
}
LRESULT CTunerScanDlg::OnScanEnd(WPARAM wParam, LPARAM lParam)
-{
- SetProgress(false);
- return TRUE;
+{
+ SetProgress (false);
+ return TRUE;
}
LRESULT CTunerScanDlg::OnStats(WPARAM wParam, LPARAM lParam)
{
- m_Strength.SetPos((int)wParam);
- m_Quality.SetPos((int)lParam);
- return TRUE;
+ m_Strength.SetPos ((int)wParam);
+ m_Quality.SetPos ((int)lParam);
+ return TRUE;
}
LRESULT CTunerScanDlg::OnNewChannel(WPARAM wParam, LPARAM lParam)
{
- CDVBChannel Channel;
- CString strTemp;
- int nItem;
- Channel.FromString((LPCTSTR) lParam);
-
- strTemp.Format(_T("%03d"), Channel.GetOriginNumber());
- nItem = m_ChannelList.InsertItem(m_ChannelList.GetItemCount(), strTemp);
-
- strTemp.Format(_T("%d"), m_ChannelList.GetItemCount());
- m_ChannelList.SetItemText(nItem, TSCC_NUMBER, strTemp);
-
- m_ChannelList.SetItemText(nItem, TSCC_NAME, Channel.GetName());
-
- strTemp.Format(_T("%d"), Channel.GetFrequency());
- m_ChannelList.SetItemText(nItem, TSCC_FREQUENCY, strTemp);
-
- m_ChannelList.SetItemText(nItem, TSCC_CHANNEL, (LPCTSTR) lParam);
-
-
- return TRUE;
+ CDVBChannel Channel;
+ CString strTemp;
+ int nItem;
+ Channel.FromString ((LPCTSTR) lParam);
+
+ strTemp.Format(_T("%03d"), Channel.GetOriginNumber());
+ nItem = m_ChannelList.InsertItem (m_ChannelList.GetItemCount(), strTemp);
+
+ strTemp.Format(_T("%d"), m_ChannelList.GetItemCount());
+ m_ChannelList.SetItemText (nItem, TSCC_NUMBER, strTemp);
+
+ m_ChannelList.SetItemText (nItem, TSCC_NAME, Channel.GetName());
+
+ strTemp.Format(_T("%d"), Channel.GetFrequency());
+ m_ChannelList.SetItemText (nItem, TSCC_FREQUENCY, strTemp);
+
+ m_ChannelList.SetItemText (nItem, TSCC_CHANNEL, (LPCTSTR) lParam);
+
+
+ return TRUE;
}
-void CTunerScanDlg::SetProgress(bool bState)
+void CTunerScanDlg::SetProgress (bool bState)
{
- if(bState)
- {
- m_btnStart.SetWindowTextW(_T("Stop"));
- m_btnSave.EnableWindow(FALSE);
- }
- else
- {
- m_btnStart.SetWindowTextW(_T("Start"));
- m_Progress.SetPos(0);
- m_btnSave.EnableWindow(TRUE);
- }
-
- m_bInProgress = bState;
+ if (bState)
+ {
+ m_btnStart.SetWindowTextW(_T("Stop"));
+ m_btnSave.EnableWindow(FALSE);
+ }
+ else
+ {
+ m_btnStart.SetWindowTextW(_T("Start"));
+ m_Progress.SetPos (0);
+ m_btnSave.EnableWindow(TRUE);
+ }
+
+ m_bInProgress = bState;
}
\ No newline at end of file |