first attempt to port to QT4, not working, still a lot to do...

This commit is contained in:
Volker Fischer 2008-01-14 22:14:17 +00:00
parent 3ea7dc0424
commit 6608de0bdc
22 changed files with 115 additions and 135 deletions

View File

@ -149,7 +149,7 @@ CVector<unsigned char> CImaAdpcm::Encode ( const CVector<short>& vecsAudio )
// init diff and step // init diff and step
int diff = vecsAudio[i] - iPrevAudio; int diff = vecsAudio[i] - iPrevAudio;
ASSERT ( iStepindEnc < IMA_STEP_SIZE_TAB_LEN ); Q_ASSERT ( iStepindEnc < IMA_STEP_SIZE_TAB_LEN );
int step = ima_step_size[iStepindEnc]; int step = ima_step_size[iStepindEnc];
short bytecode = 0; short bytecode = 0;
@ -183,7 +183,7 @@ CVector<unsigned char> CImaAdpcm::Encode ( const CVector<short>& vecsAudio )
} }
// adjust step size // adjust step size
ASSERT ( bytecode < IMA_INDX_ADJUST_TAB_LEN ); Q_ASSERT ( bytecode < IMA_INDX_ADJUST_TAB_LEN );
iStepindEnc += ima_indx_adjust[bytecode]; iStepindEnc += ima_indx_adjust[bytecode];
// check that values do not exceed the bounds // check that values do not exceed the bounds
@ -249,7 +249,7 @@ CVector<short> CImaAdpcm::Decode ( const CVector<unsigned char>& vecbyAdpcm )
{ {
const short bytecode = vecsAudio[i] & 0xF ; const short bytecode = vecsAudio[i] & 0xF ;
ASSERT ( iStepindDec < IMA_STEP_SIZE_TAB_LEN ); Q_ASSERT ( iStepindDec < IMA_STEP_SIZE_TAB_LEN );
short step = ima_step_size[iStepindDec]; short step = ima_step_size[iStepindDec];
int current = vecsAudio[i - 1]; int current = vecsAudio[i - 1];
@ -274,7 +274,7 @@ CVector<short> CImaAdpcm::Decode ( const CVector<unsigned char>& vecbyAdpcm )
current += diff; current += diff;
ASSERT ( bytecode < IMA_INDX_ADJUST_TAB_LEN ); Q_ASSERT ( bytecode < IMA_INDX_ADJUST_TAB_LEN );
iStepindDec += ima_indx_adjust[bytecode]; iStepindDec += ima_indx_adjust[bytecode];
// check that values do not exceed the bounds // check that values do not exceed the bounds

View File

@ -34,13 +34,13 @@ CChannelFader::CChannelFader ( QWidget* pNW,
QString sName ) QString sName )
{ {
// create new GUI control objects and store pointers to them // create new GUI control objects and store pointers to them
pMainGrid = new QGridLayout ( 2, 1 ); pMainGrid = new QGridLayout();
pFader = new QSlider ( Qt::Vertical, pNW ); pFader = new QSlider ( Qt::Vertical, pNW );
pLabel = new QLabel ( "", pNW ); pLabel = new QLabel ( "", pNW );
// setup slider // setup slider
pFader->setPageStep ( 1 ); pFader->setPageStep ( 1 );
pFader->setTickmarks ( QSlider::Both ); pFader->setTickPosition ( QSlider::TicksBothSides );
pFader->setRange ( 0, AUD_MIX_FADER_MAX ); pFader->setRange ( 0, AUD_MIX_FADER_MAX );
pFader->setTickInterval ( AUD_MIX_FADER_MAX / 9 ); pFader->setTickInterval ( AUD_MIX_FADER_MAX / 9 );
pFader->setValue ( 0 ); // set init value pFader->setValue ( 0 ); // set init value
@ -57,11 +57,11 @@ CChannelFader::CChannelFader ( QWidget* pNW,
pParentLayout->insertLayout ( 0, pMainGrid ); pParentLayout->insertLayout ( 0, pMainGrid );
// add help text to controls // add help text to controls
QWhatsThis::add ( pFader, "<b>Mixer Fader:</b> Adjusts the audio level of this " pFader->setWhatsThis ( "<b>Mixer Fader:</b> Adjusts the audio level of this "
"channel. All connected clients at the server will be assigned an audio " "channel. All connected clients at the server will be assigned an audio "
"fader at each client" ); "fader at each client" );
QWhatsThis::add ( pLabel, "<b>Mixer Fader Label:</b> Label (fader tag) identifying " pLabel->setWhatsThis ( "<b>Mixer Fader Label:</b> Label (fader tag) identifying "
"the connected client. The tag name can be set in the clients main window." ); "the connected client. The tag name can be set in the clients main window." );
@ -104,17 +104,17 @@ void CChannelFader::SetText ( const std::string sText )
pLabel->setText ( sModText ); pLabel->setText ( sModText );
} }
CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags f ) : QFrame ( parent, f )
const char* name,
WFlags f ) :
QFrame ( parent, name, f )
{ {
// set modified style // set modified style
setFrameShape ( QFrame::StyledPanel ); setFrameShape ( QFrame::StyledPanel );
setFrameShadow ( QFrame::Sunken ); setFrameShadow ( QFrame::Sunken );
// add hboxlayout with horizontal spacer // add hboxlayout with horizontal spacer
pMainLayout = new QHBoxLayout ( this, 11, 0 );
// TODO is this ok this way? Don't we need the border 11 and space 0?
pMainLayout = new QHBoxLayout ( this );//, 11, 0 );
pMainLayout->addItem ( new QSpacerItem ( 0, 0, QSizePolicy::Expanding ) ); pMainLayout->addItem ( new QSpacerItem ( 0, 0, QSizePolicy::Expanding ) );
// create all mixer controls and make them invisible // create all mixer controls and make them invisible
@ -194,7 +194,7 @@ std::string CAudioMixerBoard::GenFaderText ( CChannelShortInfo& ChanInfo )
{ {
// convert IP address to text and show it // convert IP address to text and show it
const QHostAddress addrTest ( ChanInfo.iIpAddr ); const QHostAddress addrTest ( ChanInfo.iIpAddr );
return addrTest.toString().latin1(); return std::string ( addrTest.toString().toLatin1() );
} }
else else
{ {

View File

@ -84,7 +84,7 @@ class CAudioMixerBoard : public QFrame
Q_OBJECT Q_OBJECT
public: public:
CAudioMixerBoard ( QWidget* parent = 0, const char* name = 0, WFlags f = 0 ); CAudioMixerBoard ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
void HideAll(); void HideAll();
void ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo ); void ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo );

View File

@ -99,7 +99,7 @@ CVector<CChannelShortInfo> CChannelSet::CreateChannelList()
// append channel ID, IP address and channel name to storing vectors // append channel ID, IP address and channel name to storing vectors
vecChanInfo.Add ( CChannelShortInfo ( vecChanInfo.Add ( CChannelShortInfo (
i, // ID i, // ID
vecChannels[i].GetAddress().InetAddr.ip4Addr(), // IP address vecChannels[i].GetAddress().InetAddr.toIPv4Address(), // IP address
vecChannels[i].GetName() /* name */ ) ); vecChannels[i].GetName() /* name */ ) );
} }
} }
@ -549,7 +549,7 @@ void CChannel::OnJittBufSizeChange ( int iNewJitBufSize )
void CChannel::OnChangeChanGain ( int iChanID, double dNewGain ) void CChannel::OnChangeChanGain ( int iChanID, double dNewGain )
{ {
ASSERT ( ( iChanID >= 0 ) && ( iChanID < MAX_NUM_CHANNELS ) ); Q_ASSERT ( ( iChanID >= 0 ) && ( iChanID < MAX_NUM_CHANNELS ) );
// set value // set value
vecdGains[iChanID] = dNewGain; vecdGains[iChanID] = dNewGain;
@ -685,8 +685,8 @@ for ( int i = 0; i < iCurNetwInBlSiFact * MIN_BLOCK_SIZE_SAMPLES; i++ ) {
{ {
// log new connection // log new connection
CHostAddress address ( GetAddress() ); CHostAddress address ( GetAddress() );
qDebug ( CLogTimeDate::toString() + "Connected with IP %s", qDebug() << CLogTimeDate::toString() << "Connected with IP " <<
address.InetAddr.toString().latin1() ); address.InetAddr.toString().toLatin1();
emit NewConnection(); emit NewConnection();
} }

View File

@ -97,7 +97,7 @@ bool CClient::SetServerAddr ( QString strNAddr )
// it was no vaild IP address, try to get host by name, assuming // it was no vaild IP address, try to get host by name, assuming
// that the string contains a valid host name string // that the string contains a valid host name string
const hostent* HostInf = gethostbyname ( strNAddr.latin1() ); const hostent* HostInf = gethostbyname ( strNAddr.toLatin1() );
if ( HostInf ) if ( HostInf )
{ {

View File

@ -53,7 +53,7 @@
/* Classes ********************************************************************/ /* Classes ********************************************************************/
class CClient : public QObject, public QThread class CClient : public QThread
{ {
Q_OBJECT Q_OBJECT

View File

@ -27,8 +27,7 @@
/* Implementation *************************************************************/ /* Implementation *************************************************************/
CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent, CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
const char* name, bool modal, WFlags f) : pClient ( pNCliP ), Qt::WindowFlags f ) : pClient ( pNCliP ), QDialog ( parent, f )
CClientSettingsDlgBase ( parent, name, modal, f )
{ {
/* Init timing jitter text label */ /* Init timing jitter text label */
TextLabelStdDevTimer->setText ( "" ); TextLabelStdDevTimer->setText ( "" );

View File

@ -49,20 +49,20 @@
/* Classes ********************************************************************/ /* Classes ********************************************************************/
class CClientSettingsDlg : public CClientSettingsDlgBase class CClientSettingsDlg : public QDialog, private Ui_CClientSettingsDlgBase
{ {
Q_OBJECT Q_OBJECT
public: public:
CClientSettingsDlg ( CClient* pNCliP, QWidget* parent = 0, CClientSettingsDlg ( CClient* pNCliP, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, WFlags f = 0 ); Qt::WindowFlags f = 0 );
void SetStatus ( const int iMessType, const int iStatus ); void SetStatus ( const int iMessType, const int iStatus );
protected: protected:
CClient* pClient; CClient* pClient;
QTimer TimerStatus; QTimer TimerStatus;
void UpdateDisplay(); void UpdateDisplay();
public slots: public slots:
void OnTimerStatus() { UpdateDisplay(); } void OnTimerStatus() { UpdateDisplay(); }

View File

@ -30,6 +30,7 @@
#include <string> #include <string>
#include <qstring.h> #include <qstring.h>
#include <qevent.h> #include <qevent.h>
#include <qdebug.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
@ -147,11 +148,11 @@ public:
QString strError; QString strError;
}; };
class CLlconEvent : public QCustomEvent class CLlconEvent : public QEvent
{ {
public: public:
CLlconEvent ( int iNewMeTy, int iNewSt, int iNewChN = 0 ) : CLlconEvent ( int iNewMeTy, int iNewSt, int iNewChN = 0 ) :
QCustomEvent ( QEvent::User + 11 ), iMessType ( iNewMeTy ), iStatus ( iNewSt ), QEvent ( QEvent::Type ( QEvent::User + 11 ) ), iMessType ( iNewMeTy ), iStatus ( iNewSt ),
iChanNum ( iNewChN ) {} iChanNum ( iNewChN ) {}
int iMessType; int iMessType;
@ -162,9 +163,9 @@ public:
/* Prototypes for global functions ********************************************/ /* Prototypes for global functions ********************************************/
// command line parsing, TODO do not declare functions globally but in a class // command line parsing, TODO do not declare functions globally but in a class
std::string UsageArguments ( char **argv ); std::string UsageArguments ( char **argv );
bool GetFlagArgument ( int, char **argv, int &i, std::string strShortOpt, std::string strLongOpt ); bool GetFlagArgument ( int, char **argv, int &i, std::string strShortOpt, std::string strLongOpt );
bool GetStringArgument ( int argc, char **argv, int &i, std::string strShortOpt, std::string strLongOpt, std::string & strArg ); bool GetStringArgument ( int argc, char **argv, int &i, std::string strShortOpt, std::string strLongOpt, std::string & strArg );
bool GetNumericArgument ( int argc, char **argv, int &i, std::string strShortOpt, std::string strLongOpt, double rRangeStart, double rRangeStop, double & rValue); bool GetNumericArgument ( int argc, char **argv, int &i, std::string strShortOpt, std::string strLongOpt, double rRangeStart, double rRangeStop, double & rValue);
// posting a window message // posting a window message

View File

@ -26,62 +26,61 @@
/* Implementation *************************************************************/ /* Implementation *************************************************************/
CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent, CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent )
const char* name, bool modal, WFlags f ) : pClient ( pNCliP ), : pClient ( pNCliP ), QDialog ( parent ),
CLlconClientDlgBase ( parent, name, modal, f ), ClientSettingsDlg ( pNCliP, 0, Qt::WindowMinMaxButtonsHint )
ClientSettingsDlg ( pNCliP, 0, 0, FALSE, Qt::WStyle_MinMax )
{ {
/* add help text to controls */ /* add help text to controls */
QString strInpLevH = tr ( "<b>Input level meter:</b> Shows the level of the " QString strInpLevH = tr ( "<b>Input level meter:</b> Shows the level of the "
"input audio signal of the sound card. The level is in dB. Overload " "input audio signal of the sound card. The level is in dB. Overload "
"should be avoided." ); "should be avoided." );
QWhatsThis::add ( TextLabelInputLevel, strInpLevH ); TextLabelInputLevel->setWhatsThis ( strInpLevH );
QWhatsThis::add ( ProgressBarInputLevelL, strInpLevH ); ProgressBarInputLevelL->setWhatsThis ( strInpLevH );
QWhatsThis::add ( ProgressBarInputLevelR, strInpLevH ); ProgressBarInputLevelR->setWhatsThis ( strInpLevH );
QWhatsThis::add(PushButtonConnect, tr ( "<b>Connect / Disconnect Button:" PushButtonConnect->setWhatsThis ( tr ( "<b>Connect / Disconnect Button:"
"</b> Push this button to connect the server. A valid IP address has " "</b> Push this button to connect the server. A valid IP address has "
"to be specified before. If the client is connected, pressing this " "to be specified before. If the client is connected, pressing this "
"button will disconnect the connection." ) ); "button will disconnect the connection." ) );
QWhatsThis::add(TextLabelStatus, tr ( "<b>Status Bar:</b> In the status bar " TextLabelStatus->setWhatsThis ( tr ( "<b>Status Bar:</b> In the status bar "
"different messages are displayed. E.g., if an error occurred or the " "different messages are displayed. E.g., if an error occurred or the "
"status of the connection is shown." ) ); "status of the connection is shown." ) );
QString strServAddrH = tr ( "<b>Server Address:</b> In this edit control, " QString strServAddrH = tr ( "<b>Server Address:</b> In this edit control, "
"the IP address of the server can be set. If an invalid address was " "the IP address of the server can be set. If an invalid address was "
"chosen, an error message is shown in the status bar." ); "chosen, an error message is shown in the status bar." );
QWhatsThis::add ( TextLabelServerAddr, strServAddrH ); TextLabelServerAddr->setWhatsThis ( strServAddrH );
QWhatsThis::add ( LineEditServerAddr, strServAddrH ); LineEditServerAddr->setWhatsThis ( strServAddrH );
QString strFaderTag = tr ( "<b>Fader Tag:</b> In this edit control, " QString strFaderTag = tr ( "<b>Fader Tag:</b> In this edit control, "
"the tag string of your fader can be set. This tag will appear " "the tag string of your fader can be set. This tag will appear "
"at your fader on the mixer board when connected to the server."); "at your fader on the mixer board when connected to the server.");
QWhatsThis::add ( TextLabelServerTag, strFaderTag ); TextLabelServerTag->setWhatsThis ( strFaderTag );
QWhatsThis::add ( LineEditFaderTag, strFaderTag ); LineEditFaderTag->setWhatsThis ( strFaderTag );
QString strAudFader = tr ( "<b>Audio Fader:</b> With the audio fader " QString strAudFader = tr ( "<b>Audio Fader:</b> With the audio fader "
"control the level of left and right audio input channels can " "control the level of left and right audio input channels can "
"be controlled." ); "be controlled." );
QWhatsThis::add ( TextAudInFader, strAudFader ); TextAudInFader->setWhatsThis ( strAudFader );
QWhatsThis::add ( SliderAudInFader, strAudFader ); SliderAudInFader->setWhatsThis ( strAudFader );
QString strAudReverb = tr ( "<b>Reverberation Level:</b> The level of " QString strAudReverb = tr ( "<b>Reverberation Level:</b> The level of "
"reverberation effect can be set with this control. The channel to " "reverberation effect can be set with this control. The channel to "
"which that reverberation effect shall be applied can be chosen " "which that reverberation effect shall be applied can be chosen "
"with the Reverberation Channel Selection radio buttons." ); "with the Reverberation Channel Selection radio buttons." );
QWhatsThis::add ( TextLabelAudReverb, strAudReverb ); TextLabelAudReverb->setWhatsThis ( strAudReverb );
QWhatsThis::add ( SliderAudReverb, strAudReverb ); SliderAudReverb->setWhatsThis ( strAudReverb );
QString strRevChanSel = tr ( "<b>Reverberation Channel Selection:</b> " QString strRevChanSel = tr ( "<b>Reverberation Channel Selection:</b> "
"With these radio buttons the audio input channel on which the " "With these radio buttons the audio input channel on which the "
"reverberation effect is applied can be chosen. Either the left " "reverberation effect is applied can be chosen. Either the left "
"or right input channel can be selected." ); "or right input channel can be selected." );
QWhatsThis::add ( TextLabelReverbSelection, strRevChanSel ); TextLabelReverbSelection->setWhatsThis ( strRevChanSel );
QWhatsThis::add ( RadioButtonRevSelL, strRevChanSel ); RadioButtonRevSelL->setWhatsThis ( strRevChanSel );
QWhatsThis::add ( RadioButtonRevSelR, strRevChanSel ); RadioButtonRevSelR->setWhatsThis ( strRevChanSel );
QWhatsThis::add ( LEDOverallStatus, tr ( "<b>Overall Status:</b> " LEDOverallStatus->setWhatsThis ( tr ( "<b>Overall Status:</b> "
"The overall status of the software is shown. If either the " "The overall status of the software is shown. If either the "
"network or sound interface has bad status, this LED will show " "network or sound interface has bad status, this LED will show "
"red color." ) ); "red color." ) );
@ -210,10 +209,10 @@ CLlconClientDlg::~CLlconClientDlg()
void CLlconClientDlg::closeEvent ( QCloseEvent * Event ) void CLlconClientDlg::closeEvent ( QCloseEvent * Event )
{ {
// store IP address // store IP address
pClient->strIPAddress = LineEditServerAddr->text().latin1(); pClient->strIPAddress = LineEditServerAddr->text().toLatin1();
// store fader tag // store fader tag
pClient->strName = LineEditFaderTag->text().latin1(); pClient->strName = LineEditFaderTag->text().toLatin1();
// default implementation of this event handler routine // default implementation of this event handler routine
Event->accept(); Event->accept();
@ -279,7 +278,7 @@ void CLlconClientDlg::OnOpenGeneralSettings()
void CLlconClientDlg::OnFaderTagTextChanged ( const QString& strNewName ) void CLlconClientDlg::OnFaderTagTextChanged ( const QString& strNewName )
{ {
// refresh internal name parameter // refresh internal name parameter
pClient->strName = strNewName.latin1(); pClient->strName = strNewName.toLatin1();
// update name at server // update name at server
pClient->SetRemoteName(); pClient->SetRemoteName();

View File

@ -63,14 +63,12 @@
/* Classes ********************************************************************/ /* Classes ********************************************************************/
class CLlconClientDlg : public CLlconClientDlgBase class CLlconClientDlg : public QDialog, private Ui_CLlconClientDlgBase
{ {
Q_OBJECT Q_OBJECT
public: public:
CLlconClientDlg ( CClient* pNCliP, QWidget* parent = 0, CLlconClientDlg ( CClient* pNCliP, QWidget* parent = 0 );
const char* name = 0, bool modal = FALSE, WFlags f = 0 );
virtual ~CLlconClientDlg(); virtual ~CLlconClientDlg();
protected: protected:

View File

@ -26,9 +26,8 @@
/* Implementation *************************************************************/ /* Implementation *************************************************************/
CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent, CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent )
const char* name, bool modal, WFlags f ) : pServer ( pNServP ), : pServer ( pNServP ), QDialog ( parent )
CLlconServerDlgBase ( parent, name, modal, f )
{ {
/* set text for version and application name */ /* set text for version and application name */
TextLabelNameVersion->setText ( QString ( APP_NAME ) + TextLabelNameVersion->setText ( QString ( APP_NAME ) +
@ -116,11 +115,11 @@ void CLlconServerDlg::OnTimer()
/* fill list with connected clients */ /* fill list with connected clients */
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ ) for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{ {
if ( ! ( vecHostAddresses[i].InetAddr == QHostAddress ( (Q_UINT32) 0 ) ) ) if ( !( vecHostAddresses[i].InetAddr == QHostAddress ( (quint32) 0 ) ) )
{ {
// IP, port number // IP, port number
vecpListViewItems[i]->setText ( 0, QString().sprintf ( "%s : %d", vecpListViewItems[i]->setText ( 0, QString().sprintf ( "%s : %d",
vecHostAddresses[i].InetAddr.toString().latin1(), vecHostAddresses[i].InetAddr.toString().toLatin1(),
vecHostAddresses[i].iPort ) /* IP, port */); vecHostAddresses[i].iPort ) /* IP, port */);
// name // name

View File

@ -46,14 +46,12 @@
/* Classes ********************************************************************/ /* Classes ********************************************************************/
class CLlconServerDlg : public CLlconServerDlgBase class CLlconServerDlg : public QDialog, private Ui_CLlconServerDlgBase
{ {
Q_OBJECT Q_OBJECT
public: public:
CLlconServerDlg ( CServer* pNServP, QWidget* parent = 0, CLlconServerDlg ( CServer* pNServP, QWidget* parent = 0 );
const char* name = 0, bool modal = FALSE, WFlags f = 0 );
virtual ~CLlconServerDlg() {} virtual ~CLlconServerDlg() {}
protected: protected:

View File

@ -176,8 +176,7 @@ void CMultiColorLEDbase::SetUpdateTime ( int iNUTi )
} }
CMultiColorLED::CMultiColorLED ( QWidget* parent, const char* name, WFlags f ) : CMultiColorLED::CMultiColorLED ( QWidget* parent, Qt::WindowFlags f ) : QLabel ( parent, f )
QLabel ( parent, name, f )
{ {
// set modified style // set modified style
setFrameShape ( QFrame::Panel ); setFrameShape ( QFrame::Panel );

View File

@ -36,7 +36,8 @@
#include <qlabel.h> #include <qlabel.h>
#include <qpixmap.h> #include <qpixmap.h>
#include <qtimer.h> #include <qtimer.h>
#include <qlistview.h> #include <qtreewidget.h>
#include <qicon.h>
#include "global.h" #include "global.h"
@ -48,7 +49,7 @@
/* Classes ********************************************************************/ /* Classes ********************************************************************/
class CMultiColorLEDbase : public QObject class CMultiColorLEDbase : public QLabel
{ {
Q_OBJECT Q_OBJECT
@ -88,10 +89,10 @@ protected slots:
}; };
class CMultiColorLED : public QLabel, public CMultiColorLEDbase class CMultiColorLED : public CMultiColorLEDbase
{ {
public: public:
CMultiColorLED ( QWidget* parent, const char* name = 0, WFlags f = 0 ); CMultiColorLED ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
protected: protected:
virtual void SetPixmap ( QPixmap& NewBitmap ) { setPixmap ( NewBitmap ); } virtual void SetPixmap ( QPixmap& NewBitmap ) { setPixmap ( NewBitmap ); }
@ -104,7 +105,7 @@ public:
CMultColLEDListViewItem ( const int iNewCol ) : iColumn ( iNewCol ), CMultColLEDListViewItem ( const int iNewCol ) : iColumn ( iNewCol ),
pListViewItem ( NULL ) {} pListViewItem ( NULL ) {}
void SetListViewItemPointer ( QListViewItem* pNewListViewItem ) void SetListViewItemPointer ( QTreeWidgetItem* pNewListViewItem )
{ {
pListViewItem = pNewListViewItem; pListViewItem = pNewListViewItem;
} }
@ -114,20 +115,20 @@ protected:
{ {
if ( pListViewItem != NULL ) if ( pListViewItem != NULL )
{ {
pListViewItem->setPixmap ( iColumn, NewBitmap ); pListViewItem->setIcon ( iColumn, QIcon ( NewBitmap ) );
} }
} }
QListViewItem* pListViewItem; QTreeWidgetItem* pListViewItem;
int iColumn; int iColumn;
}; };
class CServerListViewItem : public QListViewItem class CServerListViewItem : public QTreeWidgetItem
{ {
public: public:
CServerListViewItem ( QListView* parent ) : LED0 ( 2 ), LED1 ( 3 ), CServerListViewItem ( QTreeWidget* parent ) : LED0 ( 2 ), LED1 ( 3 ),
QListViewItem ( parent ) QTreeWidgetItem ( parent )
{ {
LED0.SetListViewItemPointer ( this ); LED0.SetListViewItemPointer ( this );
LED1.SetListViewItemPointer ( this ); LED1.SetListViewItemPointer ( this );

View File

@ -702,8 +702,8 @@ uint32_t CProtocol::GetValFromStream ( const CVector<uint8_t>& vecIn,
note: iPos is automatically incremented in this function note: iPos is automatically incremented in this function
*/ */
// 4 bytes maximum since we return uint32 // 4 bytes maximum since we return uint32
ASSERT ( ( iNumOfBytes > 0 ) && ( iNumOfBytes <= 4 ) ); Q_ASSERT ( ( iNumOfBytes > 0 ) && ( iNumOfBytes <= 4 ) );
ASSERT ( vecIn.Size() >= iPos + iNumOfBytes ); Q_ASSERT ( vecIn.Size() >= iPos + iNumOfBytes );
uint32_t iRet = 0; uint32_t iRet = 0;
for ( int i = 0; i < iNumOfBytes; i++ ) for ( int i = 0; i < iNumOfBytes; i++ )
@ -781,8 +781,8 @@ void CProtocol::PutValOnStream ( CVector<uint8_t>& vecIn,
note: iPos is automatically incremented in this function note: iPos is automatically incremented in this function
*/ */
// 4 bytes maximum since we use uint32 // 4 bytes maximum since we use uint32
ASSERT ( ( iNumOfBytes > 0 ) && ( iNumOfBytes <= 4 ) ); Q_ASSERT ( ( iNumOfBytes > 0 ) && ( iNumOfBytes <= 4 ) );
ASSERT ( vecIn.Size() >= iPos + iNumOfBytes ); Q_ASSERT ( vecIn.Size() >= iPos + iNumOfBytes );
for ( int i = 0; i < iNumOfBytes; i++ ) for ( int i = 0; i < iNumOfBytes; i++ )
{ {

View File

@ -26,7 +26,7 @@
#define PROTOCOL_H__3B123453_4344_BB2392354455IUHF1912__INCLUDED_ #define PROTOCOL_H__3B123453_4344_BB2392354455IUHF1912__INCLUDED_
#include <qglobal.h> #include <qglobal.h>
#include <qthread.h> #include <qmutex.h>
#include <qtimer.h> #include <qtimer.h>
#include <list> #include <list>
#include "global.h" #include "global.h"

View File

@ -33,7 +33,7 @@ void CSocket::Init()
// initialize the listening socket // initialize the listening socket
bool bSuccess = SocketDevice.bind ( bool bSuccess = SocketDevice.bind (
QHostAddress ( (Q_UINT32) 0 ), // INADDR_ANY QHostAddress ( (quint32) 0 ), // INADDR_ANY
LLCON_PORT_NUMBER ); LLCON_PORT_NUMBER );
if ( bIsClient ) if ( bIsClient )
@ -44,7 +44,7 @@ void CSocket::Init()
// if server and client is on same machine, decrease port number by // if server and client is on same machine, decrease port number by
// one by definition // one by definition
bSuccess = SocketDevice.bind ( bSuccess = SocketDevice.bind (
QHostAddress( (Q_UINT32) 0 ), // INADDR_ANY QHostAddress( (quint32) 0 ), // INADDR_ANY
LLCON_PORT_NUMBER - 1 ); LLCON_PORT_NUMBER - 1 );
} }
} }

View File

@ -28,8 +28,7 @@
#include <vector> #include <vector>
#include <qobject.h> #include <qobject.h>
#include <qmessagebox.h> #include <qmessagebox.h>
#include <qsocket.h> #include <qudpsocket.h>
#include <qsocketdevice.h>
#include <qsocketnotifier.h> #include <qsocketnotifier.h>
#include "global.h" #include "global.h"
#include "channel.h" #include "channel.h"
@ -47,13 +46,11 @@ class CSocket : public QObject
Q_OBJECT Q_OBJECT
public: public:
CSocket(CChannel* pNewChannel) : pChannel(pNewChannel), CSocket(CChannel* pNewChannel) : pChannel(pNewChannel), bIsClient(true)
SocketDevice(QSocketDevice::Datagram /* UDP */), bIsClient(true) { Init(); }
{Init();}
CSocket(CChannelSet* pNewChannelSet, QObject* pNServP) : CSocket(CChannelSet* pNewChannelSet, QObject* pNServP) :
pChannelSet(pNewChannelSet), pServer ( pNServP ), pChannelSet(pNewChannelSet), pServer ( pNServP ), bIsClient(false)
SocketDevice(QSocketDevice::Datagram /* UDP */), bIsClient(false) { Init(); }
{Init();}
virtual ~CSocket() {} virtual ~CSocket() {}
void SendPacket ( const CVector<unsigned char>& vecbySendBuf, void SendPacket ( const CVector<unsigned char>& vecbySendBuf,
@ -62,7 +59,7 @@ public:
protected: protected:
void Init(); void Init();
QSocketDevice SocketDevice; QUdpSocket SocketDevice;
CVector<unsigned char> vecbyRecBuf; CVector<unsigned char> vecbyRecBuf;
CHostAddress RecHostAddr; CHostAddress RecHostAddr;

View File

@ -269,9 +269,10 @@ double CAudioReverb::ProcessSample ( const double input )
* GUI utilities * * GUI utilities *
\******************************************************************************/ \******************************************************************************/
/* About dialog ------------------------------------------------------------- */ /* About dialog ------------------------------------------------------------- */
CAboutDlg::CAboutDlg ( QWidget* parent, const char* name, bool modal, WFlags f ) CAboutDlg::CAboutDlg ( QWidget* parent ) : QDialog ( parent )
: CAboutDlgBase ( parent, name, modal, f )
{ {
setupUi ( this );
// set the text for the about dialog html text control // set the text for the about dialog html text control
TextViewCredits->setText ( TextViewCredits->setText (
"<p>" // general description of llcon software "<p>" // general description of llcon software

View File

@ -26,9 +26,9 @@
#define UTIL_HOIH934256GEKJH98_3_43445KJIUHF1912__INCLUDED_ #define UTIL_HOIH934256GEKJH98_3_43445KJIUHF1912__INCLUDED_
#include <qhostaddress.h> #include <qhostaddress.h>
#include <qpopupmenu.h> #include <qmenu.h>
#include <qwhatsthis.h> #include <qwhatsthis.h>
#include <qtextview.h> #include <qtextbrowser.h>
#include <qlabel.h> #include <qlabel.h>
#include <qdatetime.h> #include <qdatetime.h>
#include <vector> #include <vector>
@ -314,20 +314,19 @@ template<class TData> void CMovingAv<TData>::Add ( const TData tNewD )
* GUI utilities * * GUI utilities *
\******************************************************************************/ \******************************************************************************/
/* About dialog ------------------------------------------------------------- */ /* About dialog ------------------------------------------------------------- */
class CAboutDlg : public CAboutDlgBase class CAboutDlg : public QDialog, private Ui_CAboutDlgBase
{ {
Q_OBJECT Q_OBJECT
public: public:
CAboutDlg ( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, CAboutDlg ( QWidget* parent = 0 );
WFlags f = 0 );
static QString GetVersionAndNameStr ( const bool bWithHtml = true ); static QString GetVersionAndNameStr ( const bool bWithHtml = true );
}; };
/* Help menu ---------------------------------------------------------------- */ /* Help menu ---------------------------------------------------------------- */
class CLlconHelpMenu : public QPopupMenu class CLlconHelpMenu : public QMenu
{ {
Q_OBJECT Q_OBJECT
@ -362,8 +361,8 @@ protected:
class CHostAddress class CHostAddress
{ {
public: public:
CHostAddress() : InetAddr ( (Q_UINT32) 0 ), iPort ( 0 ) {} CHostAddress() : InetAddr ( (quint32) 0 ), iPort ( 0 ) {}
CHostAddress ( const QHostAddress NInetAddr, const Q_UINT16 iNPort ) : CHostAddress ( const QHostAddress NInetAddr, const quint16 iNPort ) :
InetAddr ( NInetAddr ), iPort ( iNPort ) {} InetAddr ( NInetAddr ), iPort ( iNPort ) {}
CHostAddress ( const CHostAddress& NHAddr ) : CHostAddress ( const CHostAddress& NHAddr ) :
InetAddr ( NHAddr.InetAddr ), iPort ( NHAddr.iPort ) {} InetAddr ( NHAddr.InetAddr ), iPort ( NHAddr.iPort ) {}
@ -375,7 +374,7 @@ public:
{ return ( ( CompAddr.InetAddr == InetAddr ) && ( CompAddr.iPort == iPort ) ); } { return ( ( CompAddr.InetAddr == InetAddr ) && ( CompAddr.iPort == iPort ) ); }
QHostAddress InetAddr; QHostAddress InetAddr;
Q_UINT16 iPort; quint16 iPort;
}; };
class CChannelShortInfo class CChannelShortInfo
@ -513,7 +512,7 @@ public:
{ {
if ( bDoLogging ) if ( bDoLogging )
{ {
fprintf ( pFile, "%s\n", sNewStr.latin1() ); fprintf ( pFile, "%s\n", sNewStr.toLatin1() );
fflush ( pFile ); fflush ( pFile );
} }
} }

View File

@ -25,33 +25,22 @@ rem *
rem\******************************************************************************/ rem\******************************************************************************/
rem .h -------------- rem .h --------------
%qtdir%\bin\moc.exe ..\src\util.h -o moc\moc_util.cpp %qtdir%\bin\moc.exe ..\src\util.h -o moc\moc_util.cpp
%qtdir%\bin\moc.exe ..\src\multicolorled.h -o moc\moc_multicolorled.cpp %qtdir%\bin\moc.exe ..\src\multicolorled.h -o moc\moc_multicolorled.cpp
%qtdir%\bin\moc.exe ..\src\audiomixerboard.h -o moc\moc_audiomixerboard.cpp %qtdir%\bin\moc.exe ..\src\audiomixerboard.h -o moc\moc_audiomixerboard.cpp
%qtdir%\bin\moc.exe ..\src\llconclientdlg.h -o moc\moc_llconclientdlg.cpp %qtdir%\bin\moc.exe ..\src\llconclientdlg.h -o moc\moc_llconclientdlg.cpp
%qtdir%\bin\moc.exe ..\src\clientsettingsdlg.h -o moc\moc_clientsettingsdlg.cpp %qtdir%\bin\moc.exe ..\src\clientsettingsdlg.h -o moc\moc_clientsettingsdlg.cpp
%qtdir%\bin\moc.exe ..\src\llconserverdlg.h -o moc\moc_llconserverdlg.cpp %qtdir%\bin\moc.exe ..\src\llconserverdlg.h -o moc\moc_llconserverdlg.cpp
%qtdir%\bin\moc.exe ..\src\server.h -o moc\moc_server.cpp %qtdir%\bin\moc.exe ..\src\server.h -o moc\moc_server.cpp
%qtdir%\bin\moc.exe ..\src\client.h -o moc\moc_client.cpp %qtdir%\bin\moc.exe ..\src\client.h -o moc\moc_client.cpp
%qtdir%\bin\moc.exe ..\src\socket.h -o moc\moc_socket.cpp %qtdir%\bin\moc.exe ..\src\socket.h -o moc\moc_socket.cpp
%qtdir%\bin\moc.exe ..\src\protocol.h -o moc\moc_protocol.cpp %qtdir%\bin\moc.exe ..\src\protocol.h -o moc\moc_protocol.cpp
%qtdir%\bin\moc.exe ..\src\channel.h -o moc\moc_channel.cpp %qtdir%\bin\moc.exe ..\src\channel.h -o moc\moc_channel.cpp
rem .ui ------------- rem .ui -------------
%qtdir%\bin\uic.exe ..\src\aboutdlgbase.ui -o moc\aboutdlgbase.h %qtdir%\bin\uic.exe ..\src\aboutdlgbase_qt4.ui -o moc\aboutdlgbase.h
%qtdir%\bin\uic.exe ..\src\aboutdlgbase.ui -i aboutdlgbase.h -o moc\aboutdlgbase.cpp %qtdir%\bin\uic.exe ..\src\llconclientdlgbase_qt4.ui -o moc\llconclientdlgbase.h
%qtdir%\bin\moc.exe moc\aboutdlgbase.h -o moc\moc_aboutdlgbase.cpp %qtdir%\bin\uic.exe ..\src\clientsettingsdlgbase_qt4.ui -o moc\clientsettingsdlgbase.h
%qtdir%\bin\uic.exe ..\src\llconserverdlgbase_qt4.ui -o moc\llconserverdlgbase.h
%qtdir%\bin\uic.exe ..\src\llconclientdlgbase.ui -o moc\llconclientdlgbase.h
%qtdir%\bin\uic.exe ..\src\llconclientdlgbase.ui -i llconclientdlgbase.h -o moc\llconclientdlgbase.cpp
%qtdir%\bin\moc.exe moc\llconclientdlgbase.h -o moc\moc_llconclientdlgbase.cpp
%qtdir%\bin\uic.exe ..\src\clientsettingsdlgbase.ui -o moc\clientsettingsdlgbase.h
%qtdir%\bin\uic.exe ..\src\clientsettingsdlgbase.ui -i clientsettingsdlgbase.h -o moc\clientsettingsdlgbase.cpp
%qtdir%\bin\moc.exe moc\clientsettingsdlgbase.h -o moc\moc_clientsettingsdlgbase.cpp
%qtdir%\bin\uic.exe ..\src\llconserverdlgbase.ui -o moc\llconserverdlgbase.h
%qtdir%\bin\uic.exe ..\src\llconserverdlgbase.ui -i llconserverdlgbase.h -o moc\llconserverdlgbase.cpp
%qtdir%\bin\moc.exe moc\llconserverdlgbase.h -o moc\moc_llconserverdlgbase.cpp