fixes for the QT4 slider controls

This commit is contained in:
Volker Fischer 2008-02-02 09:35:58 +00:00
parent cfa6891b5b
commit 2b47659346
5 changed files with 14 additions and 17 deletions

View file

@ -58,11 +58,11 @@ CChannelFader::CChannelFader ( QWidget* pNW,
// add help text to controls // add help text to controls
pFader->setWhatsThis ( "<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" );
pLabel->setWhatsThis ( "<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." );
// connections ------------------------------------------------------------- // connections -------------------------------------------------------------
@ -73,9 +73,8 @@ CChannelFader::CChannelFader ( QWidget* pNW,
void CChannelFader::OnValueChanged ( int value ) void CChannelFader::OnValueChanged ( int value )
{ {
// convert actual slider range in gain values // convert actual slider range in gain values
// reverse linear scale and normalize so that maximum gain is 1 // and normalize so that maximum gain is 1
const double dCurGain = const double dCurGain = static_cast<double> ( value ) / AUD_MIX_FADER_MAX;
static_cast<double> ( AUD_MIX_FADER_MAX - value ) / AUD_MIX_FADER_MAX;
emit valueChanged ( dCurGain ); emit valueChanged ( dCurGain );
} }

View file

@ -65,7 +65,7 @@ public:
bool IsVisible() { return pLabel->isVisible(); } bool IsVisible() { return pLabel->isVisible(); }
// init gain value -> maximum value as definition according to server // init gain value -> maximum value as definition according to server
void ResetGain() { pFader->setValue ( 0 ); } void ResetGain() { pFader->setValue ( AUD_MIX_FADER_MAX ); }
protected: protected:
QGridLayout* pMainGrid; QGridLayout* pMainGrid;

View file

@ -176,6 +176,7 @@ void CClient::run()
#ifdef _WIN32 #ifdef _WIN32
SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL ); SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL );
#else #else
/*
// set the process to realtime privs, taken from // set the process to realtime privs, taken from
// "http://www.gardena.net/benno/linux/audio" but does not seem to work, // "http://www.gardena.net/benno/linux/audio" but does not seem to work,
// maybe a problem with user rights // maybe a problem with user rights
@ -183,6 +184,7 @@ void CClient::run()
memset ( &schp, 0, sizeof ( schp ) ); memset ( &schp, 0, sizeof ( schp ) );
schp.sched_priority = sched_get_priority_max ( SCHED_FIFO ); schp.sched_priority = sched_get_priority_max ( SCHED_FIFO );
sched_setscheduler ( 0, SCHED_FIFO, &schp ); sched_setscheduler ( 0, SCHED_FIFO, &schp );
*/
#endif #endif
// init object // init object

View file

@ -121,7 +121,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent )
// audio reverberation // audio reverberation
SliderAudReverb->setRange ( 0, AUD_REVERB_MAX ); SliderAudReverb->setRange ( 0, AUD_REVERB_MAX );
const int iCurAudReverb = pClient->GetReverbLevel(); const int iCurAudReverb = pClient->GetReverbLevel();
SliderAudReverb->setValue ( AUD_REVERB_MAX - iCurAudReverb ); SliderAudReverb->setValue ( iCurAudReverb );
SliderAudReverb->setTickInterval ( AUD_REVERB_MAX / 9 ); SliderAudReverb->setTickInterval ( AUD_REVERB_MAX / 9 );
@ -244,11 +244,8 @@ void CLlconClientDlg::OnConnectDisconBut()
// set address and check if address is valid // set address and check if address is valid
if ( pClient->SetServerAddr ( LineEditServerAddr->text() ) ) if ( pClient->SetServerAddr ( LineEditServerAddr->text() ) )
{ {
#if ( QT_VERSION > 300 )
pClient->start ( QThread::TimeCriticalPriority ); pClient->start ( QThread::TimeCriticalPriority );
#else
pClient->start();
#endif
PushButtonConnect->setText ( CON_BUT_DISCONNECTTEXT ); PushButtonConnect->setText ( CON_BUT_DISCONNECTTEXT );
// start timer for level meter bar // start timer for level meter bar

View file

@ -91,11 +91,10 @@ public slots:
void OnTimerSigMet(); void OnTimerSigMet();
void OnTimerStatus() { UpdateDisplay(); } void OnTimerStatus() { UpdateDisplay(); }
void OnOpenGeneralSettings(); void OnOpenGeneralSettings();
void OnSliderAudInFader ( int value ) { pClient->SetAudioInFader(value); } void OnSliderAudInFader ( int value ) { pClient->SetAudioInFader ( value ); }
void OnSliderAudReverb ( int value ) void OnSliderAudReverb ( int value ) { pClient->SetReverbLevel ( value ); }
{ pClient->SetReverbLevel ( AUD_REVERB_MAX - value ); } void OnRevSelL() { pClient->SetReverbOnLeftChan ( true ); }
void OnRevSelL() { pClient->SetReverbOnLeftChan(true); } void OnRevSelR() { pClient->SetReverbOnLeftChan ( false ); }
void OnRevSelR() { pClient->SetReverbOnLeftChan(false); }
void OnConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo ) void OnConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo )
{ MainMixerBoard->ApplyNewConClientList ( vecChanInfo ); } { MainMixerBoard->ApplyNewConClientList ( vecChanInfo ); }
void OnChangeChanGain ( int iId, double dGain ) void OnChangeChanGain ( int iId, double dGain )