fix for old Qt version on Mac

This commit is contained in:
Volker Fischer 2012-01-30 19:08:40 +00:00
parent 97241d907f
commit 9976292bc5
3 changed files with 11 additions and 6 deletions

View file

@ -128,8 +128,8 @@ CClient::CClient ( const quint16 iPortNumber ) :
SIGNAL ( CLPingWithNumClientsReceived ( CHostAddress, int, int ) ),
this, SLOT ( OnCLPingWithNumClientsReceived ( CHostAddress, int, int ) ) );
QObject::connect ( &Sound, SIGNAL ( ReinitRequest ( ESndCrdResetType ) ),
this, SLOT ( OnSndCrdReinitRequest ( ESndCrdResetType ) ) );
QObject::connect ( &Sound, SIGNAL ( ReinitRequest ( int ) ),
this, SLOT ( OnSndCrdReinitRequest ( int ) ) );
}
void CClient::OnSendProtMessage ( CVector<uint8_t> vecMessage )
@ -443,8 +443,13 @@ void CClient::SetSndCrdRightOutputChannel ( const int iNewChan )
}
}
void CClient::OnSndCrdReinitRequest ( ESndCrdResetType eSndCrdResetType )
void CClient::OnSndCrdReinitRequest ( int iSndCrdResetType )
{
// in older QT versions, enums cannot easily be used in signals without
// registering them -> workaroud: we use the int type and cast to the enum
const ESndCrdResetType eSndCrdResetType =
static_cast<ESndCrdResetType> ( iSndCrdResetType );
// if client was running then first
// stop it and restart again after new initialization
const bool bWasRunning = Sound.IsRunning();

View file

@ -335,7 +335,7 @@ public slots:
int iMs,
int iNumClients );
void OnSndCrdReinitRequest ( ESndCrdResetType eSndCrdResetType );
void OnSndCrdReinitRequest ( int iSndCrdResetType );
signals:
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );

View file

@ -36,7 +36,7 @@
// problem: in signals it seems not to work to use CSoundBase::ESndCrdResetType
enum ESndCrdResetType
{
RS_ONLY_RESTART,
RS_ONLY_RESTART = 1,
RS_ONLY_RESTART_AND_INIT,
RS_RELOAD_RESTART_AND_INIT
};
@ -120,7 +120,7 @@ protected:
QString strDriverNames[MAX_NUMBER_SOUND_CARDS];
signals:
void ReinitRequest ( ESndCrdResetType eSndCrdResetType );
void ReinitRequest ( int iSndCrdResetType );
};
#endif /* !defined ( SOUNDBASE_HOIHGEH8_3_4344456456345634565KJIUHF1912__INCLUDED_ ) */