📄 mainwindowsub.h
字号:
//// The contents of this file are subject to the Mozilla Public License// Version 1.0 (the "License"); you may not use this file except in// compliance with the License. You may obtain a copy of the License at// http://www.mozilla.org/MPL/// // Software distributed under the License is distributed on an "AS IS"// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See// the License for the specific language governing rights and limitations// under the License.// // The Original Code is CPhone, a cross platform voip gui.//// The Initial Developer of the Original Code is Derek Smithies.//// Copyright (C) 2002 Indranet Technologies Ltd, // http://www.indranet-technologies.com// All Rights Reserved.//// Contributor(s): _______________/* * * $Log: mainwindowSub.h,v $ * Revision 1.4 2003/05/20 03:32:28 dereksmithies * Better handling of ixj handset states, and call progress states. * * Revision 1.3 2003/05/09 03:08:24 dereksmithies * Fix Microtelco handling, and message display * * Revision 1.2 2003/04/04 04:37:49 dereksmithies * Major upgrade. * Ixj & microtelco support added. Fix threading issues. * * Revision 1.1.1.1 2002/05/12 22:55:05 dereksmithies * Initial release. * * * * */#ifndef MAINUI_H#define MAINUI_H#define MAIN_UI_UP 0x2000#define CALL_ANSWER_RESPONSE_YES 0x4000#define CALL_ANSWER_RESPONSE_NO 0x4001#define CALL_ANSWER_RESPONSE_TMO 0x4002#define CALL_ANSWER_INITIATE 0x4003#define CUSTOM_EVENT_DIE 0x5000#include "mainwindow.h"#include "cpendpoint.h"#include <ptlib.h>#include <h323.h>#include <qevent.h> class MainUi : public FormMainWindow, H323EndPoint{ PCLASSINFO(MainUi, H323EndPoint);public: MainUi(); ~MainUi(); /** Determines the default settings of everything, and sets it appropriately. Does this by opening each of the descendant forms, which reads each parameter (with a default setting available*/ void InitialiseConfiguration(); PVideoOutputDevice *GetDisplayModule (BOOL isEncoding, BOOL isFlipped); void AudioClicked_slot(); void ConnectClicked_slot(); void ExitClicked_slot(); void SettingsClicked_slot(); void VideoClicked_slot(); void HangupClicked_slot(); void QueryCallAnswer(PString remoteNode); void SetDisplayString(QString message); void DisplayCriticalError(char * message); void DisplayCriticalError(PString message); void DisplayCriticalError(QString message); void closeEvent(QCloseEvent *e); void customEvent(QCustomEvent *e); void timerEvent(QTimerEvent *); void OnConnectionEstablished(PString message); void OnConnectionCleared(PString message); void OnConnectionEstablished(BOOL isEstablished); void SendDieMessageToWindow(enum WindowName name); void StopCallAnswer(); BOOL SetEchoCancellation(PString newLevel); const PString & GetLocalUserName() const { return H323EndPoint::GetLocalUserName(); } void TranslateTCPAddress(PIPSocket::Address &localAddr, const PIPSocket::Address &remoteAddr); // overrides from H323EndPoint virtual H323Connection * CreateConnection(unsigned callReference); virtual BOOL OnIncomingCall(H323Connection &, const H323SignalPDU &, H323SignalPDU &); virtual void OnConnectionEstablished(H323Connection &, const PString &); virtual void OnConnectionCleared(H323Connection &, const PString &); virtual BOOL OpenAudioChannel(H323Connection &, BOOL, unsigned, H323AudioCodec &); virtual BOOL OpenVideoChannel(H323Connection &, BOOL, H323VideoCodec &); // Functions that are added to the base H323EndPoint class. BOOL InitialiseVoipSettings(void); BOOL SearchForAGatekeeper(PString gkName=""); BOOL SetDisableSilenceDetection(BOOL disableSilence); BOOL WaitingForACall(); PString GetCurrentCallToken() const { return currentCallToken; } CpVideoChannel *GetReceiveVideoChannel() { return receiveVideoChannel; } CpVideoChannel *GetTransmitVideoChannel() { return transmitVideoChannel; } void AddAllCapabilities(); void RebuildCapabilityTable(); void StartTerminationProcess(); void ExitCurrentCall(); void GetVideoFrameSizeSetting(unsigned &newFrameWidth, unsigned &newFrameHeight); void MakeOutgoingCall(const PString &, const PString &); void OnNoAnswerTimeout(); void StartCall(const PString & str); void ReorderCapabilities(); void UpdateUdpPorts(); PStringToString GetInterfaceAddressList(); void UpdateUserName(); void DisplayMessage(QString message); void UpdateNatTraversalAddress(); void DisplayMessage(PString message); void DisplayMessage(char * message); BOOL CreateLocalVideoDisplayThread(); BOOL DeleteLocalVideoDisplayThread(); BOOL InitialiseVideoDisplay(); void DeleteVideoDisplay(); BOOL DisplayLocalIsNow(BOOL doDisplayLocal); BOOL AttachPlayerReaderToVideoChannel(BOOL isEncoding); AudioOptions audioOpts; ConnectOptions connectOpts; VideoOptions videoOpts; void AnswerCall(H323Connection::AnswerCallResponse response); PStringArray GetAvailableDeviceNames(); PStringArray GetAvailableIxjDeviceNames() { return ixjCardNames; } PStringArray GetAvailableEchoCancNames(); void SetSoundChannelBufferDepth(unsigned int newDepth); void SetAudioJitterDelay(unsigned int low, unsigned int high); virtual BOOL SetSoundChannelRecordDevice(const PString &newDevice); virtual BOOL SetSoundChannelPlayDevice(const PString &newDevice); H323Connection::AnswerCallResponse AnswerCallConditional(const PString & caller, PString newCallToken);#ifdef HAS_IXJ LidHandlerThread lidThread;#endif enum States { epNoTone, /*0*/ epDialTone, /*1*/ epAnsweringCall, /*2*/ epConnectingCall, /*3*/ epWaitingForAnswer,/*4*/ epCallInProgress, /*5*/ epCallHungup, /*6*/ epStateIllegal, };protected: States epState; public: BOOL IsWaitingForAnswer() { return epState == epWaitingForAnswer; } BOOL IsInCall() { return epState == epCallInProgress; } States GetEpState() { return epState; } BOOL MicroTelcoActivate(BOOL doActivate); BOOL InitialiseGatekeeper(); PString GetGatekeeperName(); PString GetGatekeeperRegistrationMessage(); void HandleHandsetDown(BOOL isDown); protected: // only used internally QString remoteComputer; LocalVideoDisplayThread * localVideoThread; PIPSocket::Address masqAddress; BOOL SetSoundDevice(const char *, PSoundChannel::Directions); CpVideoChannel *receiveVideoChannel; CpVideoChannel *transmitVideoChannel; PString currentCallToken; PString setupInformation; BOOL firstErrorOpenAudioChannel; BOOL applicationIsExiting; PStringArray soundCardNames; PStringArray ixjCardNames; friend class CpConnection; };#endif // MAINUI_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -