fixed warnings shown in QtCreator
This commit is contained in:
parent
6f12d8395a
commit
fa0f122638
19 changed files with 60 additions and 63 deletions
|
@ -47,8 +47,8 @@ class CAnalyzerConsole : public QDialog
|
|||
|
||||
public:
|
||||
CAnalyzerConsole ( CClient* pNCliP,
|
||||
QWidget* parent = 0,
|
||||
Qt::WindowFlags f = 0 );
|
||||
QWidget* parent = nullptr,
|
||||
Qt::WindowFlags f = nullptr );
|
||||
|
||||
|
||||
protected:
|
||||
|
|
|
@ -95,7 +95,7 @@ class CAudioMixerBoard : public QGroupBox
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CAudioMixerBoard ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||
CAudioMixerBoard ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
||||
|
||||
void HideAll();
|
||||
void ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInfo );
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
// CChannel implementation *****************************************************
|
||||
CChannel::CChannel ( const bool bNIsServer ) :
|
||||
vecdGains ( MAX_NUM_CHANNELS, (double) 1.0 ),
|
||||
vecdGains ( MAX_NUM_CHANNELS, 1.0 ),
|
||||
bDoAutoSockBufSize ( true ),
|
||||
bIsEnabled ( false ),
|
||||
bIsServer ( bNIsServer )
|
||||
|
@ -355,9 +355,9 @@ void CChannel::OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTranspor
|
|||
{
|
||||
// store received parameters
|
||||
eAudioCompressionType = NetworkTransportProps.eAudioCodingType;
|
||||
iNumAudioChannels = NetworkTransportProps.iNumAudioChannels;
|
||||
iNumAudioChannels = static_cast<int> ( NetworkTransportProps.iNumAudioChannels );
|
||||
iNetwFrameSizeFact = NetworkTransportProps.iBlockSizeFact;
|
||||
iNetwFrameSize = NetworkTransportProps.iBaseNetworkPacketSize;
|
||||
iNetwFrameSize = static_cast<int> ( NetworkTransportProps.iBaseNetworkPacketSize );
|
||||
|
||||
MutexSocketBuf.lock();
|
||||
{
|
||||
|
@ -388,14 +388,13 @@ CNetworkTransportProps CChannel::GetNetworkTransportPropsFromCurrentSettings()
|
|||
{
|
||||
// use current stored settings of the channel to fill the network transport
|
||||
// properties structure
|
||||
return CNetworkTransportProps (
|
||||
iNetwFrameSize,
|
||||
iNetwFrameSizeFact,
|
||||
iNumAudioChannels,
|
||||
SYSTEM_SAMPLE_RATE_HZ,
|
||||
eAudioCompressionType,
|
||||
0, // version of the codec
|
||||
0 );
|
||||
return CNetworkTransportProps ( static_cast<uint32_t> ( iNetwFrameSize ),
|
||||
static_cast<uint16_t> ( iNetwFrameSizeFact ),
|
||||
static_cast<uint32_t> ( iNumAudioChannels ),
|
||||
SYSTEM_SAMPLE_RATE_HZ,
|
||||
eAudioCompressionType,
|
||||
0, // version of the codec
|
||||
0 );
|
||||
}
|
||||
|
||||
void CChannel::Disconnect()
|
||||
|
|
|
@ -39,7 +39,7 @@ class CChatDlg : public QDialog, private Ui_CChatDlgBase
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CChatDlg ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||
CChatDlg ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
||||
|
||||
void AddChatText ( QString strChatText );
|
||||
|
||||
|
|
|
@ -1090,7 +1090,7 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
|
|||
if ( eAudioCompressionType == CT_OPUS )
|
||||
{
|
||||
opus_custom_decode ( OpusDecoderMono,
|
||||
NULL,
|
||||
nullptr,
|
||||
iCeltNumCodedBytes,
|
||||
&vecsAudioSndCrdMono[i * SYSTEM_FRAME_SIZE_SAMPLES],
|
||||
SYSTEM_FRAME_SIZE_SAMPLES );
|
||||
|
@ -1101,7 +1101,7 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
|
|||
if ( eAudioCompressionType == CT_OPUS )
|
||||
{
|
||||
opus_custom_decode ( OpusDecoderStereo,
|
||||
NULL,
|
||||
nullptr,
|
||||
iCeltNumCodedBytes,
|
||||
&vecsStereoSndCrd[i * 2 * SYSTEM_FRAME_SIZE_SAMPLES],
|
||||
SYSTEM_FRAME_SIZE_SAMPLES );
|
||||
|
@ -1158,7 +1158,7 @@ int CClient::EstimatedOverallDelay ( const int iPingTimeMs )
|
|||
// Consider the jitter buffer on the client and on the server side, too.
|
||||
const double dTotalJitterBufferDelayMs = SYSTEM_BLOCK_DURATION_MS_FLOAT *
|
||||
static_cast<double> ( GetSockBufNumFrames() +
|
||||
GetServerSockBufNumFrames() ) * 0.7f;
|
||||
GetServerSockBufNumFrames() ) * 0.7;
|
||||
|
||||
// consider delay introduced by the sound card conversion buffer by using
|
||||
// "GetSndCrdConvBufAdditionalDelayMonoBlSize()"
|
||||
|
|
|
@ -920,8 +920,8 @@ void CClientDlg::OnTimerSigMet()
|
|||
}
|
||||
|
||||
// show current level
|
||||
lbrInputLevelL->setValue ( (int) ceil ( dCurSigLevelL ) );
|
||||
lbrInputLevelR->setValue ( (int) ceil ( dCurSigLevelR ) );
|
||||
lbrInputLevelL->setValue ( static_cast<int> ( ceil ( dCurSigLevelL ) ) );
|
||||
lbrInputLevelR->setValue ( static_cast<int> ( ceil ( dCurSigLevelR ) ) );
|
||||
}
|
||||
|
||||
void CClientDlg::OnTimerBuffersLED()
|
||||
|
@ -1036,9 +1036,7 @@ void CClientDlg::Connect ( const QString& strSelectedAddress,
|
|||
catch ( CGenErr generr )
|
||||
{
|
||||
// show error message and return the function
|
||||
QMessageBox::critical (
|
||||
this, APP_NAME, generr.GetErrorText(), "Close", 0 );
|
||||
|
||||
QMessageBox::critical ( this, APP_NAME, generr.GetErrorText(), "Close", nullptr );
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -455,7 +455,7 @@ QString CClientSettingsDlg::GenSndCrdBufferDelayString ( const int iFrameSiz
|
|||
{
|
||||
// use two times the buffer delay for the entire delay since
|
||||
// we have input and output
|
||||
return QString().setNum ( (double) iFrameSize * 2 *
|
||||
return QString().setNum ( static_cast<double> ( iFrameSize ) * 2 *
|
||||
1000 / SYSTEM_SAMPLE_RATE_HZ, 'f', 2 ) + " ms (" +
|
||||
QString().setNum ( iFrameSize ) + strAddText + ")";
|
||||
}
|
||||
|
@ -629,7 +629,7 @@ void CClientSettingsDlg::OnSoundcardActivated ( int iSndDevIdx )
|
|||
QString ( tr ( "The selected audio device could not be used "
|
||||
"because of the following error: " ) ) + strError +
|
||||
QString ( tr ( " The previous driver will be selected." ) ),
|
||||
"Ok", 0 );
|
||||
"Ok", nullptr );
|
||||
|
||||
// recover old selection
|
||||
cbxSoundcard->setCurrentIndex ( pClient->GetSndCrdDev() );
|
||||
|
|
|
@ -52,8 +52,8 @@ class CClientSettingsDlg : public QDialog, private Ui_CClientSettingsDlgBase
|
|||
|
||||
public:
|
||||
CClientSettingsDlg ( CClient* pNCliP,
|
||||
QWidget* parent = 0,
|
||||
Qt::WindowFlags f = 0 );
|
||||
QWidget* parent = nullptr,
|
||||
Qt::WindowFlags f = nullptr );
|
||||
|
||||
void SetStatus ( const CMultiColorLED::ELightColor eStatus ) { ledNetw->SetLight ( eStatus ); }
|
||||
|
||||
|
|
|
@ -440,7 +440,7 @@ void CConnectDlg::OnServerListItemDoubleClicked ( QTreeWidgetItem* Item,
|
|||
{
|
||||
// if a server list item was double clicked, it is the same as if the
|
||||
// connect button was clicked
|
||||
if ( Item != 0 )
|
||||
if ( Item != nullptr )
|
||||
{
|
||||
OnConnectClicked();
|
||||
}
|
||||
|
@ -632,7 +632,7 @@ QTreeWidgetItem* CConnectDlg::FindListViewItem ( const CHostAddress& InetAddr )
|
|||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QTreeWidgetItem* CConnectDlg::GetParentListViewItem ( QTreeWidgetItem* pItem )
|
||||
|
|
|
@ -48,8 +48,8 @@ class CConnectDlg : public QDialog, private Ui_CConnectDlgBase
|
|||
|
||||
public:
|
||||
CConnectDlg ( const bool bNewShowCompleteRegList,
|
||||
QWidget* parent = 0,
|
||||
Qt::WindowFlags f = 0 );
|
||||
QWidget* parent = nullptr,
|
||||
Qt::WindowFlags f = nullptr );
|
||||
|
||||
void Init ( const QString strNewCentralServerAddr,
|
||||
const CVector<QString>& vstrIPAddresses );
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
RL_RED
|
||||
};
|
||||
|
||||
CMultiColorLED ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||
CMultiColorLED ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
||||
|
||||
void Reset();
|
||||
void SetLight ( const ELightColor eNewStatus );
|
||||
|
|
|
@ -39,7 +39,7 @@ class CMultiColorLEDBar : public QFrame
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CMultiColorLEDBar ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
|
||||
CMultiColorLEDBar ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
||||
virtual ~CMultiColorLEDBar();
|
||||
|
||||
void setValue ( const int value );
|
||||
|
|
|
@ -797,7 +797,7 @@ JitterMeas.Measure();
|
|||
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
|
||||
{
|
||||
opus_custom_decode ( OpusDecoderMono[iCurChanID],
|
||||
NULL,
|
||||
nullptr,
|
||||
iCeltNumCodedBytes,
|
||||
&vecvecsData[i][0],
|
||||
SYSTEM_FRAME_SIZE_SAMPLES );
|
||||
|
@ -809,7 +809,7 @@ JitterMeas.Measure();
|
|||
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
|
||||
{
|
||||
opus_custom_decode ( OpusDecoderStereo[iCurChanID],
|
||||
NULL,
|
||||
nullptr,
|
||||
iCeltNumCodedBytes,
|
||||
&vecvecsData[i][0],
|
||||
SYSTEM_FRAME_SIZE_SAMPLES );
|
||||
|
@ -1252,11 +1252,11 @@ bool CServer::PutAudioData ( const CVector<uint8_t>& vecbyRecBuf,
|
|||
// time reset gains of this channel ID for all other channels
|
||||
for ( int i = 0; i < iMaxNumChannels; i++ )
|
||||
{
|
||||
vecChannels[iCurChanID].SetGain ( i, (double) 1.0 );
|
||||
vecChannels[iCurChanID].SetGain ( i, 1.0 );
|
||||
|
||||
// other channels (we do not distinguish the case if
|
||||
// i == iCurChanID for simplicity)
|
||||
vecChannels[i].SetGain ( iCurChanID, (double) 1.0 );
|
||||
vecChannels[i].SetGain ( iCurChanID, 1.0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -450,7 +450,7 @@ void CServerDlg::OnTimer()
|
|||
// fill list with connected clients
|
||||
for ( int i = 0; i < iNumChannels; i++ )
|
||||
{
|
||||
if ( !( vecHostAddresses[i].InetAddr == QHostAddress ( (quint32) 0 ) ) )
|
||||
if ( !( vecHostAddresses[i].InetAddr == QHostAddress ( static_cast<quint32> ( 0 ) ) ) )
|
||||
{
|
||||
// IP, port number
|
||||
vecpListViewItems[i]->setText ( 0,
|
||||
|
|
|
@ -53,8 +53,8 @@ public:
|
|||
CServerDlg ( CServer* pNServP,
|
||||
CSettings* pNSetP,
|
||||
const bool bStartMinimized,
|
||||
QWidget* parent = 0,
|
||||
Qt::WindowFlags f = 0 );
|
||||
QWidget* parent = nullptr,
|
||||
Qt::WindowFlags f = nullptr );
|
||||
|
||||
protected:
|
||||
virtual void changeEvent ( QEvent* pEvent );
|
||||
|
|
|
@ -170,7 +170,7 @@ protected:
|
|||
class CSocketThread : public QThread
|
||||
{
|
||||
public:
|
||||
CSocketThread ( CSocket* pNewSocket = NULL, QObject* parent = 0 ) :
|
||||
CSocketThread ( CSocket* pNewSocket = nullptr, QObject* parent = nullptr ) :
|
||||
QThread ( parent ), pSocket ( pNewSocket ), bRun ( true ) {}
|
||||
|
||||
void Stop()
|
||||
|
@ -191,7 +191,7 @@ protected:
|
|||
void run() {
|
||||
// make sure the socket pointer is initialized (should be always the
|
||||
// case)
|
||||
if ( pSocket != NULL )
|
||||
if ( pSocket != nullptr )
|
||||
{
|
||||
while ( bRun )
|
||||
{
|
||||
|
|
|
@ -186,13 +186,13 @@ QString CSoundBase::SetDev ( const int iNewDev )
|
|||
// have changed so that they are not compatible to our
|
||||
// software anymore
|
||||
QMessageBox::critical (
|
||||
0, APP_NAME, QString ( tr ( "The audio driver properties "
|
||||
nullptr, APP_NAME, QString ( tr ( "The audio driver properties "
|
||||
"have changed to a state which is incompatible to this "
|
||||
"software. The selected audio device could not be used "
|
||||
"because of the following error: <b>" ) ) +
|
||||
strErrorMessage +
|
||||
QString ( tr ( "</b><br><br>Please restart the software." ) ),
|
||||
"Close", 0 );
|
||||
"Close", nullptr );
|
||||
|
||||
_exit ( 0 );
|
||||
}
|
||||
|
|
10
src/util.cpp
10
src/util.cpp
|
@ -170,13 +170,13 @@ void CAudioReverb::Init ( const int iSampleRate,
|
|||
|
||||
// delay lengths for 44100 Hz sample rate
|
||||
int lengths[9] = { 1116, 1356, 1422, 1617, 225, 341, 441, 211, 179 };
|
||||
const double scaler = (double) iSampleRate / 44100.0;
|
||||
const double scaler = static_cast<double> ( iSampleRate ) / 44100.0;
|
||||
|
||||
if ( scaler != 1.0 )
|
||||
{
|
||||
for ( i = 0; i < 9; i++ )
|
||||
{
|
||||
delay = (int) floor ( scaler * lengths[i] );
|
||||
delay = static_cast<int> ( floor ( scaler * lengths[i] ) );
|
||||
|
||||
if ( ( delay & 1 ) == 0 )
|
||||
{
|
||||
|
@ -206,7 +206,7 @@ void CAudioReverb::Init ( const int iSampleRate,
|
|||
setT60 ( rT60, iSampleRate );
|
||||
outLeftDelay.Init ( lengths[7] );
|
||||
outRightDelay.Init ( lengths[8] );
|
||||
allpassCoefficient = (double) 0.7;
|
||||
allpassCoefficient = 0.7;
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ bool CAudioReverb::isPrime ( const int number )
|
|||
|
||||
if ( number & 1 )
|
||||
{
|
||||
for ( int i = 3; i < (int) sqrt ( (double) number ) + 1; i += 2 )
|
||||
for ( int i = 3; i < static_cast<int> ( sqrt ( static_cast<double> ( number ) ) ) + 1; i += 2 )
|
||||
{
|
||||
if ( ( number % i ) == 0 )
|
||||
{
|
||||
|
@ -263,7 +263,7 @@ void CAudioReverb::setT60 ( const double rT60,
|
|||
// set the reverberation T60 decay time
|
||||
for ( int i = 0; i < 4; i++ )
|
||||
{
|
||||
combCoefficient[i] = pow ( (double) 10.0, (double) ( -3.0 *
|
||||
combCoefficient[i] = pow ( 10.0, static_cast<double> ( -3.0 *
|
||||
combDelays[i].Size() / ( rT60 * iSampleRate ) ) );
|
||||
}
|
||||
}
|
||||
|
|
28
src/util.h
28
src/util.h
|
@ -83,7 +83,7 @@ inline short Double2Short ( const double dInput )
|
|||
return _MAXSHORT;
|
||||
}
|
||||
|
||||
return (short) dInput;
|
||||
return static_cast<short> ( dInput );
|
||||
}
|
||||
|
||||
// debug error handling
|
||||
|
@ -412,7 +412,7 @@ class CAboutDlg : public QDialog, private Ui_CAboutDlgBase
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CAboutDlg ( QWidget* parent = 0 );
|
||||
CAboutDlg ( QWidget* parent = nullptr );
|
||||
|
||||
static QString GetVersionAndNameStr ( const bool bWithHtml = true );
|
||||
};
|
||||
|
@ -424,7 +424,7 @@ class CLicenceDlg : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CLicenceDlg ( QWidget* parent = 0 );
|
||||
CLicenceDlg ( QWidget* parent = nullptr );
|
||||
|
||||
protected:
|
||||
QPushButton* butAccept;
|
||||
|
@ -441,7 +441,7 @@ class CMusProfDlg : public QDialog
|
|||
|
||||
public:
|
||||
CMusProfDlg ( CClient* pNCliP,
|
||||
QWidget* parent = 0 );
|
||||
QWidget* parent = nullptr );
|
||||
|
||||
protected:
|
||||
virtual void showEvent ( QShowEvent* );
|
||||
|
@ -469,7 +469,7 @@ class CHelpMenu : public QMenu
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CHelpMenu ( QWidget* parent = 0 );
|
||||
CHelpMenu ( QWidget* parent = nullptr );
|
||||
|
||||
protected:
|
||||
CAboutDlg AboutDlg;
|
||||
|
@ -993,13 +993,13 @@ public:
|
|||
{
|
||||
switch ( eOSType )
|
||||
{
|
||||
case OT_WINDOWS: return "Windows"; break;
|
||||
case OT_MAC_OS: return "MacOS"; break;
|
||||
case OT_LINUX: return "Linux"; break;
|
||||
case OT_ANDROID: return "Android"; break;
|
||||
case OT_I_OS: return "iOS"; break;
|
||||
case OT_UNIX: return "Unix"; break;
|
||||
default: return "Unknown"; break;
|
||||
case OT_WINDOWS: return "Windows";
|
||||
case OT_MAC_OS: return "MacOS";
|
||||
case OT_LINUX: return "Linux";
|
||||
case OT_ANDROID: return "Android";
|
||||
case OT_I_OS: return "iOS";
|
||||
case OT_UNIX: return "Unix";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1024,7 +1024,7 @@ class CAudioReverb
|
|||
public:
|
||||
CAudioReverb() {}
|
||||
|
||||
void Init ( const int iSampleRate, const double rT60 = (double) 1.1 );
|
||||
void Init ( const int iSampleRate, const double rT60 = 1.1 );
|
||||
void Clear();
|
||||
void ProcessSample ( int16_t& iInputOutputLeft,
|
||||
int16_t& iInputOutputRight,
|
||||
|
@ -1083,7 +1083,7 @@ class MathUtils
|
|||
public:
|
||||
static int round ( double x )
|
||||
{
|
||||
return (int) ( ( x - floor ( x ) ) >= 0.5 ) ? ceil(x) : floor(x);
|
||||
return static_cast<int> ( ( x - floor ( x ) ) >= 0.5 ) ? static_cast<int> ( ceil ( x ) ) : static_cast<int> ( floor ( x ) );
|
||||
}
|
||||
|
||||
static void UpDownIIR1 ( double& dOldValue,
|
||||
|
|
Loading…
Reference in a new issue