created audio mixer board GUI control

This commit is contained in:
Volker Fischer 2006-12-09 15:00:24 +00:00
parent d3644c447d
commit d0bb262193
13 changed files with 353 additions and 240 deletions

View File

@ -15,7 +15,8 @@ llcon_SOURCES = ../src/buffer.cpp \
../src/server.cpp \ ../src/server.cpp \
../src/settings.cpp \ ../src/settings.cpp \
../src/protocol.cpp \ ../src/protocol.cpp \
../src/multicolorled.cpp \ ../src/multicolorled.cpp \
../src/audiomixerboard.cpp \
sound.cpp \ sound.cpp \
../src/buffer.h \ ../src/buffer.h \
../src/global.h \ ../src/global.h \
@ -29,7 +30,8 @@ llcon_SOURCES = ../src/buffer.cpp \
../src/server.h \ ../src/server.h \
../src/settings.h \ ../src/settings.h \
../src/protocol.h \ ../src/protocol.h \
../src/multicolorled.h \ ../src/multicolorled.h \
../src/audiomixerboard.h \
../src/llconserverdlg.h \ ../src/llconserverdlg.h \
../src/llconclientdlg.h \ ../src/llconclientdlg.h \
../src/clientsettingsdlg.h \ ../src/clientsettingsdlg.h \
@ -45,7 +47,8 @@ BUILT_SOURCES=moc/moc_server.cpp \
moc/moc_protocol.cpp \ moc/moc_protocol.cpp \
moc/moc_channel.cpp \ moc/moc_channel.cpp \
moc/moc_socket.cpp \ moc/moc_socket.cpp \
moc/moc_multicolorled.cpp \ moc/moc_multicolorled.cpp \
moc/moc_audiomixerboard.cpp \
moc/moc_util.cpp \ moc/moc_util.cpp \
moc/moc_llconclientdlg.cpp moc/moc_llconclientdlgbase.cpp moc/llconclientdlgbase.h moc/llconclientdlgbase.cpp \ moc/moc_llconclientdlg.cpp moc/moc_llconclientdlgbase.cpp moc/llconclientdlgbase.h moc/llconclientdlgbase.cpp \
moc/moc_clientsettingsdlg.cpp moc/moc_clientsettingsdlgbase.cpp moc/clientsettingsdlgbase.h moc/clientsettingsdlgbase.cpp \ moc/moc_clientsettingsdlg.cpp moc/moc_clientsettingsdlgbase.cpp moc/clientsettingsdlgbase.h moc/clientsettingsdlgbase.cpp \
@ -71,6 +74,9 @@ moc/moc_socket.cpp: ../src/socket.h
moc/moc_multicolorled.cpp: ../src/multicolorled.h moc/moc_multicolorled.cpp: ../src/multicolorled.h
$(MOC) ../src/multicolorled.h -o moc/moc_multicolorled.cpp $(MOC) ../src/multicolorled.h -o moc/moc_multicolorled.cpp
moc/moc_audiomixerboard.cpp: ../src/audiomixerboard.h
$(MOC) ../src/audiomixerboard.h -o moc/moc_audiomixerboard.cpp
moc/moc_util.cpp: ../src/util.h moc/moc_util.cpp: ../src/util.h
$(MOC) ../src/util.h -o moc/moc_util.cpp $(MOC) ../src/util.h -o moc/moc_util.cpp

157
src/audiomixerboard.cpp Executable file
View File

@ -0,0 +1,157 @@
/******************************************************************************\
* Copyright (c) 2004-2006
*
* Author(s):
* Volker Fischer
*
* Description:
*
*
******************************************************************************
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
\******************************************************************************/
#include "audiomixerboard.h"
/* Implementation *************************************************************/
CChannelFader::CChannelFader ( QWidget* pNW,
QHBoxLayout* pNPtLy,
QString sName ) :
pParentLayout ( pNPtLy )
{
// create new GUI control objects and store pointers to them
pMainGrid = new QGridLayout ( pNW, 2, 1 );
pFader = new QSlider ( Qt::Vertical, pNW );
pLabel = new QLabel ( "", pNW );
// setup slider
pFader->setPageStep ( 1 );
pFader->setTickmarks ( QSlider::Both );
pFader->setRange ( 0, AUD_MIX_FADER_MAX );
pFader->setTickInterval ( AUD_MIX_FADER_MAX / 9 );
// TEST set value and make read only
pFader->setValue ( 0 );
pFader->setEnabled ( FALSE );
// set label text
pLabel->setText ( sName );
// add slider to grid as position 0 / 0
pMainGrid->addWidget( pFader, 0, 0, Qt::AlignHCenter );
// add label to grid as position 1 / 0
pMainGrid->addWidget( pLabel, 1, 0, Qt::AlignHCenter );
pParentLayout->insertLayout ( 0, pMainGrid );
}
void CChannelFader::SetText ( const std::string sText )
{
const int iBreakPos = 6;
// break text at predefined position
QString sModText = sText.c_str();
if ( sModText.length() > iBreakPos )
{
sModText.insert ( iBreakPos, QString ( "<br>" ) );
}
// use bold text
sModText.prepend ( "<b>" );
sModText.append ( "</b>" );
pLabel->setText ( sModText );
}
CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent,
const char* name,
WFlags f ) :
QFrame ( parent, name, f )
{
// set modified style
setFrameShape ( QFrame::StyledPanel );
setFrameShadow ( QFrame::Sunken );
// add hboxlayout with horizontal spacer
pMainLayout = new QHBoxLayout ( this, 11, 6 );
pMainLayout->addItem ( new QSpacerItem ( 0, 0, QSizePolicy::Expanding ) );
// create all mixer controls and make them invisible
vecpChanFader.Init ( MAX_NUM_CHANNELS );
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
vecpChanFader[i] = new CChannelFader ( this,
pMainLayout, "test" );
vecpChanFader[i]->Hide();
}
// TEST
//vecpChanFader.Init(0);
//vecpChanFader.Add(new CLlconClientDlg::CChannelFader(FrameAudioFaders, FrameAudioFadersLayout, "test"));
//FrameAudioFadersLayout->addWidget(new QLabel ( "test", FrameAudioFaders ));
/*
for ( int z = 0; z < 100; z++)
{
CLlconClientDlg::CChannelFader* pTest = new CLlconClientDlg::CChannelFader(FrameAudioFaders, FrameAudioFadersLayout);
delete pTest;
}
*/
}
void CAudioMixerBoard::Clear()
{
// make old controls invisible
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
vecpChanFader[i]->Hide();
}
}
void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo )
{
int i;
// TODO
// make old controls invisible
Clear();
// TEST add current faders
for ( i = 0; i < vecChanInfo.Size(); i++ )
{
QHostAddress addrTest ( vecChanInfo[i].veciIpAddr );
vecpChanFader[i]->SetText ( addrTest.toString().latin1() );
vecpChanFader[i]->Show();
// vecpChanFader[i] = new CLlconClientDlg::CChannelFader ( FrameAudioFaders,
// FrameAudioFadersLayout, addrTest.toString() );
}
}

91
src/audiomixerboard.h Executable file
View File

@ -0,0 +1,91 @@
/******************************************************************************\
* Copyright (c) 2004-2006
*
* Author(s):
* Volker Fischer
*
* Description:
*
*
******************************************************************************
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
\******************************************************************************/
#if !defined(MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_)
#define MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_
#include <qframe.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qstring.h>
#include <qslider.h>
#include <qsizepolicy.h>
#include "global.h"
#include "util.h"
/* Definitions ****************************************************************/
// audio mixer fader range
#define AUD_MIX_FADER_MAX 100
/* Classes ********************************************************************/
class CChannelFader
{
public:
CChannelFader ( QWidget* pNW, QHBoxLayout* pNPtLy, QString sName );
~CChannelFader()
{
pLabel->close();
pFader->close();
// TODO get rid of pMainGrid
}
void SetText ( const std::string sText );
void Show() { pLabel->show(); pFader->show(); }
void Hide() { pLabel->hide(); pFader->hide(); }
protected:
QGridLayout* pMainGrid;
QSlider* pFader;
QLabel* pLabel;
QHBoxLayout* pParentLayout;
};
class CAudioMixerBoard : public QFrame
{
Q_OBJECT
public:
CAudioMixerBoard ( QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
void Clear();
void ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo );
protected:
CVector<CChannelFader*> vecpChanFader;
QHBoxLayout* pMainLayout;
signals:
void ChangeChanGain ( int iId, double dGain );
};
#endif // MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_

View File

@ -428,6 +428,9 @@ CChannel::CChannel() : sName ( "" ),
QObject::connect ( &Protocol, QObject::connect ( &Protocol,
SIGNAL ( ChangeNetwBlSiFact ( int ) ), SIGNAL ( ChangeNetwBlSiFact ( int ) ),
this, SLOT ( OnNetwBlSiFactChange ( int ) ) ); this, SLOT ( OnNetwBlSiFactChange ( int ) ) );
QObject::connect( &Protocol, SIGNAL ( ChangeChanGain ( int, double ) ),
this, SLOT ( OnChangeChanGain ( int, double ) ) );
} }
void CChannel::SetEnable ( const bool bNEnStat ) void CChannel::SetEnable ( const bool bNEnStat )

View File

@ -41,10 +41,6 @@
// correction is implemented) // correction is implemented)
#define CON_TIME_OUT_SEC_MAX 5 // seconds #define CON_TIME_OUT_SEC_MAX 5 // seconds
// maximum number of internet connections (channels)
// if you want to change this paramter, change the connections in this class, too!
#define MAX_NUM_CHANNELS 10 /* max number channels for server */
// no valid channel number // no valid channel number
#define INVALID_CHANNEL_ID (MAX_NUM_CHANNELS + 1) #define INVALID_CHANNEL_ID (MAX_NUM_CHANNELS + 1)
@ -96,6 +92,9 @@ public:
void SetGain ( const int iNID, const double dNG ) { vecdGains[iNID] = dNG; } void SetGain ( const int iNID, const double dNG ) { vecdGains[iNID] = dNG; }
double GetGain( const int iNID ) { return vecdGains[iNID]; } double GetGain( const int iNID ) { return vecdGains[iNID]; }
void SetRemoteChanGain ( const int iId, const double dGain )
{ Protocol.CreateChanGainMes ( iId, dGain ); }
void SetSockBufSize ( const int iNumBlocks ); void SetSockBufSize ( const int iNumBlocks );
int GetSockBufSize() { return iCurSockBufSize; } int GetSockBufSize() { return iCurSockBufSize; }

View File

@ -46,9 +46,6 @@
// audio in fader range // audio in fader range
#define AUD_FADER_IN_MAX 100 #define AUD_FADER_IN_MAX 100
// audio mixer fader range
#define AUD_MIX_FADER_MAX 100
// audio reverberation range // audio reverberation range
#define AUD_REVERB_MAX 100 #define AUD_REVERB_MAX 100
@ -62,13 +59,13 @@ public:
CClient(); CClient();
virtual ~CClient() {} virtual ~CClient() {}
void Init(); void Init();
bool Stop(); bool Stop();
bool IsRunning() { return bRun; } bool IsRunning() { return bRun; }
bool SetServerAddr ( QString strNAddr ); bool SetServerAddr ( QString strNAddr );
double MicLevelL() { return SignalLevelMeterL.MicLevel(); } double MicLevelL() { return SignalLevelMeterL.MicLevel(); }
double MicLevelR() { return SignalLevelMeterR.MicLevel(); } double MicLevelR() { return SignalLevelMeterR.MicLevel(); }
bool IsConnected() { return Channel.IsConnected(); } bool IsConnected() { return Channel.IsConnected(); }
/* we want to return the standard deviation. For that we need to calculate /* we want to return the standard deviation. For that we need to calculate
the sqaure root */ the sqaure root */
@ -113,9 +110,12 @@ public:
} }
int GetNetwBufSizeFactOut() { return Channel.GetNetwBufSizeFactOut(); } int GetNetwBufSizeFactOut() { return Channel.GetNetwBufSizeFactOut(); }
void SetRemoteChanGain ( const int iId, const double dGain )
{ Channel.SetRemoteChanGain ( iId, dGain ); }
CSound* GetSndInterface() { return &Sound; } CSound* GetSndInterface() { return &Sound; }
CChannel* GetChannel() { return &Channel; } CChannel* GetChannel() { return &Channel; }
// settings // settings

View File

@ -80,7 +80,11 @@
# define AUD_SLIDER_LENGTH 30 # define AUD_SLIDER_LENGTH 30
#else #else
# define AUD_SLIDER_LENGTH 6 # define AUD_SLIDER_LENGTH 6
#endif #endif
// maximum number of internet connections (channels)
// if you want to change this paramter, change the connections in channel class, too!
#define MAX_NUM_CHANNELS 10 /* max number channels for server */
/* sample rate offset estimation algorithm */ /* sample rate offset estimation algorithm */
/* time interval for sample rate offset estimation */ /* time interval for sample rate offset estimation */

View File

@ -29,8 +29,7 @@
CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent, CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
const char* name, bool modal, WFlags f) : pClient ( pNCliP ), const char* name, bool modal, WFlags f) : pClient ( pNCliP ),
CLlconClientDlgBase ( parent, name, modal, f ), CLlconClientDlgBase ( parent, name, modal, f ),
ClientSettingsDlg ( pNCliP, 0, 0, FALSE, Qt::WStyle_MinMax ), ClientSettingsDlg ( pNCliP, 0, 0, FALSE, Qt::WStyle_MinMax )
vecpChanFader ( 0 )
{ {
/* 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 "
@ -76,7 +75,7 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
QWhatsThis::add ( RadioButtonRevSelL, strRevChanSel ); QWhatsThis::add ( RadioButtonRevSelL, strRevChanSel );
QWhatsThis::add ( RadioButtonRevSelR, strRevChanSel ); QWhatsThis::add ( RadioButtonRevSelR, strRevChanSel );
QWhatsThis::add ( CLEDOverallStatus, tr ( "<b>Overall Status:</b> " QWhatsThis::add ( LEDOverallStatus, 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." ) );
@ -113,13 +112,13 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
/* set radio buttons --- */ /* set radio buttons --- */
// reverb channel // reverb channel
if (pClient->IsReverbOnLeftChan()) if ( pClient->IsReverbOnLeftChan() )
{ {
RadioButtonRevSelL->setChecked(true); RadioButtonRevSelL->setChecked ( true );
} }
else else
{ {
RadioButtonRevSelR->setChecked(true); RadioButtonRevSelR->setChecked ( true );
} }
@ -141,21 +140,9 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
/* Now tell the layout about the menu */ /* Now tell the layout about the menu */
CLlconClientDlgBaseLayout->setMenuBar ( pMenu ); CLlconClientDlgBaseLayout->setMenuBar ( pMenu );
// mixer board -------------------------------------------------------------
// create all mixer controls and make them invisible
vecpChanFader.Init ( MAX_NUM_CHANNELS );
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
vecpChanFader[i] = new CLlconClientDlg::CChannelFader ( FrameAudioFaders,
FrameAudioFadersLayout, "test" );
vecpChanFader[i]->Hide();
}
/* connections ---------------------------------------------------------- */ // connections -------------------------------------------------------------
// push-buttons // push-buttons
QObject::connect(PushButtonConnect, SIGNAL(clicked()), QObject::connect(PushButtonConnect, SIGNAL(clicked()),
this, SLOT(OnConnectDisconBut())); this, SLOT(OnConnectDisconBut()));
@ -179,30 +166,16 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QWidget* parent,
this, SLOT(OnRevSelR())); this, SLOT(OnRevSelR()));
// other // other
QObject::connect(pClient, SIGNAL ( ConClientListMesReceived ( CVector<CChannelShortInfo> ) ), QObject::connect ( pClient,
SIGNAL ( ConClientListMesReceived ( CVector<CChannelShortInfo> ) ),
this, SLOT ( OnConClientListMesReceived ( CVector<CChannelShortInfo> ) ) ); this, SLOT ( OnConClientListMesReceived ( CVector<CChannelShortInfo> ) ) );
QObject::connect ( MainMixerBoard, SIGNAL ( ChangeChanGain ( int, double ) ),
this, SLOT ( OnChangeChanGain ( int, double ) ) );
/* timers --------------------------------------------------------------- */ // timers ------------------------------------------------------------------
// start timer for status bar // start timer for status bar
TimerStatus.start(STATUSBAR_UPDATE_TIME); TimerStatus.start(STATUSBAR_UPDATE_TIME);
// TEST
//vecpChanFader.Init(0);
//vecpChanFader.Add(new CLlconClientDlg::CChannelFader(FrameAudioFaders, FrameAudioFadersLayout, "test"));
//FrameAudioFadersLayout->addWidget(new QLabel ( "test", FrameAudioFaders ));
/*
for ( int z = 0; z < 100; z++)
{
CLlconClientDlg::CChannelFader* pTest = new CLlconClientDlg::CChannelFader(FrameAudioFaders, FrameAudioFadersLayout);
delete pTest;
}
*/
} }
CLlconClientDlg::~CLlconClientDlg() CLlconClientDlg::~CLlconClientDlg()
@ -223,56 +196,47 @@ void CLlconClientDlg::closeEvent ( QCloseEvent * Event )
Event->accept(); Event->accept();
} }
void CLlconClientDlg::OnConnectDisconBut () void CLlconClientDlg::OnConnectDisconBut()
{ {
/* start/stop client, set button text */ // start/stop client, set button text
if ( pClient->IsRunning () ) if ( pClient->IsRunning() )
{ {
pClient->Stop (); pClient->Stop();
PushButtonConnect->setText ( CON_BUT_CONNECTTEXT ); PushButtonConnect->setText ( CON_BUT_CONNECTTEXT );
/* stop timer for level meter bars and reset them */ // stop timer for level meter bars and reset them
TimerSigMet.stop (); TimerSigMet.stop();
ProgressBarInputLevelL->setProgress ( 0 ); ProgressBarInputLevelL->setProgress ( 0 );
ProgressBarInputLevelR->setProgress ( 0 ); ProgressBarInputLevelR->setProgress ( 0 );
/* immediately update status bar */ // immediately update status bar
OnTimerStatus (); OnTimerStatus();
// clear mixer board (remove all faders)
MainMixerBoard->Clear();
// TEST
// make old controls invisible
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
vecpChanFader[i]->Hide();
}
} }
else else
{ {
/* 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 ) #if ( QT_VERSION > 300 )
pClient->start ( QThread::TimeCriticalPriority ); pClient->start ( QThread::TimeCriticalPriority );
#else #else
pClient->start (); pClient->start();
#endif #endif
PushButtonConnect->setText ( CON_BUT_DISCONNECTTEXT ); PushButtonConnect->setText ( CON_BUT_DISCONNECTTEXT );
/* start timer for level meter bar */ // start timer for level meter bar
TimerSigMet.start ( LEVELMETER_UPDATE_TIME ); TimerSigMet.start ( LEVELMETER_UPDATE_TIME );
} }
else else
{ {
/* Restart timer to ensure that the text is visible at // Restart timer to ensure that the text is visible at
least the time for one complete interval */ // least the time for one complete interval
TimerStatus.changeInterval ( STATUSBAR_UPDATE_TIME ); TimerStatus.changeInterval ( STATUSBAR_UPDATE_TIME );
/* show the error in the status bar */ // show the error in the status bar
TextLabelStatus->setText ( tr ( "invalid address" ) ); TextLabelStatus->setText ( tr ( "invalid address" ) );
} }
} }
@ -284,11 +248,11 @@ void CLlconClientDlg::OnOpenGeneralSettings()
ClientSettingsDlg.show(); ClientSettingsDlg.show();
} }
void CLlconClientDlg::OnTimerSigMet () void CLlconClientDlg::OnTimerSigMet()
{ {
/* get current input levels */ /* get current input levels */
double dCurSigLevelL = pClient->MicLevelL (); double dCurSigLevelL = pClient->MicLevelL();
double dCurSigLevelR = pClient->MicLevelR (); double dCurSigLevelR = pClient->MicLevelR();
/* linear transformation of the input level range to the progress-bar /* linear transformation of the input level range to the progress-bar
range */ range */
@ -317,37 +281,6 @@ void CLlconClientDlg::OnTimerSigMet ()
ProgressBarInputLevelR->setProgress ( (int) ceil ( dCurSigLevelR ) ); ProgressBarInputLevelR->setProgress ( (int) ceil ( dCurSigLevelR ) );
} }
void CLlconClientDlg::OnConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo )
{
int i;
// TODO
// make old controls invisible
for ( i = 0; i < MAX_NUM_CHANNELS; i++ )
{
vecpChanFader[i]->Hide();
}
// TEST add current faders
for ( i = 0; i < vecChanInfo.Size(); i++ )
{
QHostAddress addrTest ( vecChanInfo[i].veciIpAddr );
vecpChanFader[i]->SetText ( addrTest.toString().latin1() );
vecpChanFader[i]->Show();
// vecpChanFader[i] = new CLlconClientDlg::CChannelFader ( FrameAudioFaders,
// FrameAudioFadersLayout, addrTest.toString() );
}
}
void CLlconClientDlg::UpdateDisplay() void CLlconClientDlg::UpdateDisplay()
{ {
/* show connection status in status bar */ /* show connection status in status bar */
@ -376,11 +309,11 @@ void CLlconClientDlg::customEvent ( QCustomEvent* Event )
case MS_JIT_BUF_GET: case MS_JIT_BUF_GET:
// show overall status -> if any LED goes red, this LED will go red // show overall status -> if any LED goes red, this LED will go red
CLEDOverallStatus->SetLight ( iStatus ); LEDOverallStatus->SetLight ( iStatus );
break; break;
case MS_RESET_ALL: case MS_RESET_ALL:
CLEDOverallStatus->Reset(); LEDOverallStatus->Reset();
break; break;
} }
@ -388,56 +321,3 @@ void CLlconClientDlg::customEvent ( QCustomEvent* Event )
ClientSettingsDlg.SetStatus ( iMessType, iStatus ); ClientSettingsDlg.SetStatus ( iMessType, iStatus );
} }
} }
// Help classes ---------------------------------------------------------------
CLlconClientDlg::CChannelFader::CChannelFader ( QWidget* pNW,
QHBoxLayout* pNPtLy,
QString sName ) :
pParentLayout ( pNPtLy )
{
// create new GUI control objects and store pointers to them
pMainGrid = new QGridLayout ( pNW, 2, 1 );
pFader = new QSlider ( Qt::Vertical, pNW );
pLabel = new QLabel ( "", pNW );
// setup slider
pFader->setPageStep ( 1 );
pFader->setTickmarks ( QSlider::Both );
pFader->setRange ( 0, AUD_MIX_FADER_MAX );
pFader->setTickInterval ( AUD_MIX_FADER_MAX / 9 );
// TEST set value and make read only
pFader->setValue ( 0 );
pFader->setEnabled ( FALSE );
// set label text
pLabel->setText ( sName );
// add slider to grid as position 0 / 0
pMainGrid->addWidget( pFader, 0, 0, Qt::AlignHCenter );
// add label to grid as position 1 / 0
pMainGrid->addWidget( pLabel, 1, 0, Qt::AlignHCenter );
pParentLayout->insertLayout ( 0, pMainGrid );
}
void CLlconClientDlg::CChannelFader::SetText ( const std::string sText )
{
const int iBreakPos = 6;
// break text at predefined position
QString sModText = sText.c_str();
if ( sModText.length() > iBreakPos )
{
sModText.insert ( iBreakPos, QString ( "<br>" ) );
}
// use bold text
sModText.prepend ( "<b>" );
sModText.append ( "</b>" );
pLabel->setText ( sModText );
}

View File

@ -36,6 +36,7 @@
#include "global.h" #include "global.h"
#include "client.h" #include "client.h"
#include "multicolorled.h" #include "multicolorled.h"
#include "audiomixerboard.h"
#include "clientsettingsdlg.h" #include "clientsettingsdlg.h"
#ifdef _WIN32 #ifdef _WIN32
# include "../windows/moc/llconclientdlgbase.h" # include "../windows/moc/llconclientdlgbase.h"
@ -73,30 +74,6 @@ public:
virtual ~CLlconClientDlg (); virtual ~CLlconClientDlg ();
protected: protected:
class CChannelFader
{
public:
CChannelFader ( QWidget* pNW, QHBoxLayout* pNPtLy, QString sName );
~CChannelFader()
{
pLabel->close();
pFader->close();
// TODO get rid of pMainGrid
}
void SetText ( const std::string sText );
void Show() { pLabel->show(); pFader->show(); }
void Hide() { pLabel->hide(); pFader->hide(); }
protected:
QGridLayout* pMainGrid;
QSlider* pFader;
QLabel* pLabel;
QHBoxLayout* pParentLayout;
};
CClient* pClient; CClient* pClient;
bool bConnected; bool bConnected;
QTimer TimerSigMet; QTimer TimerSigMet;
@ -110,8 +87,6 @@ protected:
QMenuBar* pMenu; QMenuBar* pMenu;
CClientSettingsDlg ClientSettingsDlg; CClientSettingsDlg ClientSettingsDlg;
CVector<CChannelFader*> vecpChanFader;
public slots: public slots:
void OnConnectDisconBut(); void OnConnectDisconBut();
@ -123,5 +98,8 @@ public slots:
{ pClient->SetReverbLevel ( AUD_REVERB_MAX - 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 ); }
void OnChangeChanGain ( int iId, double dGain )
{ pClient->SetRemoteChanGain ( iId, dGain ); }
}; };

View File

@ -11,7 +11,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>597</width> <width>586</width>
<height>289</height> <height>289</height>
</rect> </rect>
</property> </property>
@ -401,7 +401,7 @@
<class>CMultiColorLED</class> <class>CMultiColorLED</class>
<property stdset="1"> <property stdset="1">
<name>name</name> <name>name</name>
<cstring>CLEDOverallStatus</cstring> <cstring>LEDOverallStatus</cstring>
</property> </property>
<property stdset="1"> <property stdset="1">
<name>minimumSize</name> <name>minimumSize</name>
@ -612,50 +612,18 @@ Fader</string>
</vbox> </vbox>
</widget> </widget>
<widget> <widget>
<class>QFrame</class> <class>CAudioMixerBoard</class>
<property stdset="1"> <property stdset="1">
<name>name</name> <name>name</name>
<cstring>FrameAudioFaders</cstring> <cstring>MainMixerBoard</cstring>
</property> </property>
<property stdset="1"> <property stdset="1">
<name>frameShape</name> <name>sizePolicy</name>
<enum>StyledPanel</enum> <sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>5</vsizetype>
</sizepolicy>
</property> </property>
<property stdset="1">
<name>frameShadow</name>
<enum>Sunken</enum>
</property>
<hbox>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
<spacer>
<property>
<name>name</name>
<cstring>Spacer2</cstring>
</property>
<property>
<name>orientation</name>
<enum>Horizontal</enum>
</property>
<property>
<name>sizeType</name>
<enum>Expanding</enum>
</property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
@ -676,6 +644,20 @@ Fader</string>
</sizepolicy> </sizepolicy>
<pixmap>image2</pixmap> <pixmap>image2</pixmap>
</customwidget> </customwidget>
<customwidget>
<class>CAudioMixerBoard</class>
<header location="local">audiomixerboard.h</header>
<sizehint>
<width>-1</width>
<height>-1</height>
</sizehint>
<container>0</container>
<sizepolicy>
<hordata>5</hordata>
<verdata>5</verdata>
</sizepolicy>
<pixmap>image2</pixmap>
</customwidget>
</customwidgets> </customwidgets>
<images> <images>
<image> <image>

View File

@ -175,7 +175,7 @@ void CMultiColorLEDbase::SetUpdateTime(int iNUTi)
CMultiColorLED::CMultiColorLED(QWidget* parent, const char* name, WFlags f) : CMultiColorLED::CMultiColorLED(QWidget* parent, const char* name, WFlags f) :
QLabel(parent, name, f) QLabel(parent, name, f)
{ {
/* Set modified style */ // set modified style
setFrameShape(QFrame::Panel); setFrameShape(QFrame::Panel);
setFrameShadow(QFrame::Sunken); setFrameShadow(QFrame::Sunken);
setIndent(0); setIndent(0);

View File

@ -28,6 +28,7 @@ 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\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

View File

@ -117,6 +117,10 @@ SOURCE=.\moc\moc_aboutdlgbase.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\moc\moc_audiomixerboard.cpp
# End Source File
# Begin Source File
SOURCE=.\moc\moc_channel.cpp SOURCE=.\moc\moc_channel.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -174,6 +178,10 @@ SOURCE=..\src\audiocompr.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\audiomixerboard.cpp
# End Source File
# Begin Source File
SOURCE=..\src\buffer.cpp SOURCE=..\src\buffer.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -242,6 +250,10 @@ SOURCE=..\src\audiocompr.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\audiomixerboard.h
# End Source File
# Begin Source File
SOURCE=..\src\buffer.h SOURCE=..\src\buffer.h
# End Source File # End Source File
# Begin Source File # Begin Source File