forked from baycom/poc32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
decoder.cpp
executable file
·125 lines (106 loc) · 2.89 KB
/
decoder.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Decoder.cpp : implementation file
//
#include "stdafx.h"
#include "pex32.h"
#include "Decoder.h"
#include "Encoder.h"
#include "Hardware.h"
#include "Statistic.h"
#include "Set.h"
#include "Filter.h"
#include "ListManager.h"
#include "Options.h"
#include "SetGeneral.h"
#include "MyStatusBar.h"
#include "MainFrm.h"
#include "Listen.h"
#include "aliases.h"
#include "MyMessageBox.h"
#include "Pex32Doc.h"
//#include "Pex32View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDecoder property page
extern CPex32Doc *pPex32Doc;
IMPLEMENT_DYNCREATE (CDecoder, CPropertyPage) CDecoder::CDecoder ():CPropertyPage (CDecoder::
IDD)
{
//{{AFX_DATA_INIT(CDecoder)
m_bitrate = -1;
m_skyper = FALSE;
//}}AFX_DATA_INIT
}
CDecoder::~CDecoder ()
{
}
void
CDecoder::DoDataExchange (CDataExchange * pDX)
{
CPropertyPage::DoDataExchange (pDX);
DDX_CBIndex (pDX, IDC_FCT0, m_fct[0]);
DDX_CBIndex (pDX, IDC_FCT1, m_fct[1]);
DDX_CBIndex (pDX, IDC_FCT2, m_fct[2]);
DDX_CBIndex (pDX, IDC_FCT3, m_fct[3]);
//{{AFX_DATA_MAP(CDecoder)
DDX_Control (pDX, IDC_CHARSET, m_chartbl);
DDX_CBIndex (pDX, IDC_COMBO_BITRATE, m_bitrate);
DDX_Check (pDX, IDC_SKYPER, m_skyper);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP (CDecoder, CPropertyPage)
//{{AFX_MSG_MAP(CDecoder)
ON_BN_CLICKED (IDC_CHARSET, OnCharset)
//}}AFX_MSG_MAP
END_MESSAGE_MAP ()
/////////////////////////////////////////////////////////////////////////////
// CDecoder message handlers
BOOL CDecoder::OnApply ()
{
::SendMessage (AfxGetApp ()->m_pMainWnd->m_hWnd, WM_COMMAND, WM_SETPREFS,
0);
return CPropertyPage::OnApply ();
}
BOOL CDecoder::OnCommand (WPARAM wParam, LPARAM lParam)
{
SetModified (TRUE);
return CPropertyPage::OnCommand (wParam, lParam);
}
void
CDecoder::OnCharset ()
{
char fname[FILENAME_MAX], *t;
strcpy (fname, pPex32Doc->m_tblname);
if ((t = strchr (fname, '.')) != NULL)
t[0] = 0;
CString s;
s.LoadString (IDS_TBLFILE);
//CFileDialog fd( TRUE, "tbl",fname,OFN_HIDEREADONLY,s);
CFileDialog fd (TRUE, "tbl", "*.tbl", OFN_HIDEREADONLY, s);
if (fd.DoModal () == IDOK)
if (!pPex32Doc->LoadTransTbl (fd.GetPathName ())) {
CString s, t;
s.LoadString (IDS_NOFILE);
t.Format (s, pPex32Doc->m_tblname);
AfxMessageBox (t);
}
else {
char fname[FILENAME_MAX];
pPex32Doc->m_tblname = fd.GetPathName ();
_splitpath (pPex32Doc->m_tblname, NULL, NULL, fname, NULL);
m_chartbl.SetWindowText (fname);
}
}
BOOL CDecoder::OnInitDialog ()
{
CPropertyPage::OnInitDialog ();
char
fname[FILENAME_MAX];
_splitpath (pPex32Doc->m_tblname, NULL, NULL, fname, NULL);
m_chartbl.SetWindowText (fname);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}