mmsstv/Loglink.h

124 lines
3.8 KiB
C
Raw Normal View History

2013-07-05 22:15:14 +02:00
//Copyright+LGPL
//-----------------------------------------------------------------------------------------------------------------------------------------------
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
//-----------------------------------------------------------------------------------------------------------------------------------------------
// This file is part of MMSSTV.
// MMSSTV is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
// MMSSTV is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see
// <http://www.gnu.org/licenses/>.
//-----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------
#ifndef LogLinkH
#define LogLinkH
#include <sys\stat.h>
#include <fcntl.h>
#include <io.h>
#include "ComLib.h"
#include "LogConv.h"
#include "MMLink.h"
#define LINKINTERVAL 200
//------------ Command of Hamlog -------------
#define THW_ENTER 0x10000
#define THW_FOCUS 0x20000
#define THW_SAVEBOX_ON 0x40000
#define THW_SAVEBOX_OFF 0x80000
#define THW_APPLIHWND 0x100000
//---------------------------------------------------------------------------
// CLogLink<6E>N<EFBFBD><4E><EFBFBD>X
class CLogLink
{
private:
int m_Enabled; // <20><><EFBFBD><EFBFBD><EFBFBD>N<EFBFBD>̋<EFBFBD><CC8B><EFBFBD>
int m_Polling; // <20><><EFBFBD>g<EFBFBD><67><EFBFBD>|<7C>[<5B><><EFBFBD><EFBFBD><EFBFBD>O
BOOL m_PTTEnabled; // PTT<54>R<EFBFBD><52><EFBFBD>g<EFBFBD><67><EFBFBD>[<5B><>
BOOL m_1stSession;
HWND m_hLog; // Hamlog<6F>v<EFBFBD><76><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>̃n<CC83><6E><EFBFBD>h<EFBFBD><68>
HWND m_hLogIn; // Hamlog<6F><67><EFBFBD>̓E<CD83>C<EFBFBD><43><EFBFBD>h<EFBFBD>E<EFBFBD>̃n<CC83><6E><EFBFBD>h<EFBFBD><68>
COPYDATASTRUCT m_cds; // <20>C<EFBFBD><43><EFBFBD>^<5E>[<5B>t<EFBFBD>F<EFBFBD>[<5B>X<EFBFBD>\<5C><><EFBFBD><EFBFBD>
int m_Count; // <20>Ď<EFBFBD><C48E>J<EFBFBD>E<EFBFBD><45><EFBFBD>^
int m_CStat; // <20><><EFBFBD>ԕύX<CF8D>Z<EFBFBD>}<7D>t<EFBFBD>H
int m_Count2; // <20>|<7C>[<5B><><EFBFBD><EFBFBD><EFBFBD>O<EFBFBD>J<EFBFBD>E<EFBFBD><45><EFBFBD>^
HWND m_hMain; // <20><><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD>ʂ̃E<CC83>C<EFBFBD><43><EFBFBD>h<EFBFBD>E<EFBFBD>n<EFBFBD><6E><EFBFBD>h<EFBFBD><68>
HWND m_hApp; // <20>A<EFBFBD>v<EFBFBD><76><EFBFBD>P<EFBFBD>[<5B>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD>̃E<CC83>C<EFBFBD><43><EFBFBD>h<EFBFBD>E<EFBFBD>n<EFBFBD><6E><EFBFBD>h<EFBFBD><68>
BOOL m_fHLV5; // Hamlog Ver 5.0
int m_Error;
AnsiString m_ItemName;
AnsiString m_QueryCall;
AnsiString m_AppName;
int m_AppVer;
int m_MMStat;
int m_AStat;
UINT m_uMsg;
char m_strMode[16];
public:
CMMLink *m_pLink;
private:
void __fastcall CloseMMLink(void);
public:
CLogLink();
~CLogLink();
void SetHandle(HWND hMain, UINT uMsg);
BOOL IsEnabled(void){return m_Enabled;};
void UpdateLink(int sw);
void Foreground(void);
BOOL IsError(void){return m_Error;};
void ClearError(void){m_Error = 0;};
BOOL __fastcall IsLink(void);
LPCSTR __fastcall GetSessionName(void);
BOOL CheckLink(void);
BOOL TimerLogLink(void);
void Clear(void);
void SetFocus(void);
void SetCall(LPSTR pCall, int sw);
void FindCall(LPSTR pCall);
void Write(SDMMLOG *sp, int sw);
int AnaData(SDMMLOG *sp, COPYDATASTRUCT *cp);
BOOL IsPolling(void){return m_Polling;};
void SetPolling(int sw){m_Polling = sw;};
void EventGetFreq(void);
void SetFreq(LPSTR pFreq);
void SetMode(LPCSTR pMode);
void __fastcall SetPTT(int ptt);
void __fastcall SetTime(SYSTEMTIME *tp, int sw);
public:
void __fastcall LoadMMLink(TMemIniFile *pIni);
void __fastcall SaveMMLink(TMemIniFile *pIni);
void __fastcall NotifySession(LPCSTR pSession);
int __fastcall QReturn(SDMMLOG *sp, const mmLOGDATA *pLog);
LPCSTR __fastcall GetItemName(void);
void __fastcall SetItemName(LPCSTR pName);
BOOL __fastcall IsCopyData(void);
inline BOOL __fastcall GetPTTEnabled(void){return m_PTTEnabled;};
inline void __fastcall SetPTTEnabled(BOOL e){m_PTTEnabled = e;};
};
extern CLogLink LogLink;
#endif