jamulus/src/audiomixerboard.h

116 lines
3.8 KiB
C
Raw Normal View History

/******************************************************************************\
* Copyright (c) 2004-2009
*
* Author(s):
* Volker Fischer
*
******************************************************************************
*
* 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
*
\******************************************************************************/
2007-09-08 12:45:14 +02:00
#if !defined ( MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_ )
#define MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_
2008-01-20 19:07:13 +01:00
#include <qframe.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qstring.h>
#include <qslider.h>
#include <qsizepolicy.h>
2008-01-22 22:15:04 +01:00
#include <qhostaddress.h>
2006-12-09 16:00:24 +01:00
#include "global.h"
#include "util.h"
2006-12-09 16:00:24 +01:00
/* Definitions ****************************************************************/
// audio mixer fader range
#define AUD_MIX_FADER_MAX 100
2006-12-09 16:00:24 +01:00
/* Classes ********************************************************************/
2006-12-09 19:37:40 +01:00
class CChannelFader : public QObject
2006-12-09 16:00:24 +01:00
{
2006-12-09 19:37:40 +01:00
Q_OBJECT
2006-12-09 16:00:24 +01:00
public:
CChannelFader ( QWidget* pNW, QHBoxLayout* pParentLayout, QString sName );
2006-12-09 16:00:24 +01:00
~CChannelFader()
{
pLabel->close();
pFader->close();
// TODO get rid of pMainGrid
}
2008-01-22 22:15:04 +01:00
void SetText ( const QString sText );
2006-12-09 16:00:24 +01:00
void Show() { pLabel->show(); pFader->show(); }
void Hide() { pLabel->hide(); pFader->hide(); }
2006-12-09 19:37:40 +01:00
bool IsVisible() { return pLabel->isVisible(); }
// init gain value -> maximum value as definition according to server
2008-02-02 10:35:58 +01:00
void ResetGain() { pFader->setValue ( AUD_MIX_FADER_MAX ); }
2006-12-09 16:00:24 +01:00
protected:
QGridLayout* pMainGrid;
QSlider* pFader;
QLabel* pLabel;
2006-12-09 19:37:40 +01:00
public slots:
void OnValueChanged ( int value );
signals:
void valueChanged ( double value );
2006-12-09 16:00:24 +01:00
};
class CAudioMixerBoard : public QFrame
{
Q_OBJECT
2006-12-09 16:00:24 +01:00
public:
CAudioMixerBoard ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
2006-12-09 16:00:24 +01:00
2006-12-09 19:37:40 +01:00
void HideAll();
2006-12-09 16:00:24 +01:00
void ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo );
protected:
2008-01-22 22:15:04 +01:00
QString GenFaderText ( CChannelShortInfo& ChanInfo );
2006-12-09 19:37:40 +01:00
2006-12-09 16:00:24 +01:00
CVector<CChannelFader*> vecpChanFader;
QHBoxLayout* pMainLayout;
2006-12-09 19:37:40 +01:00
public slots:
// CODE TAG: MAX_NUM_CHANNELS_TAG
// make sure we have MAX_NUM_CHANNELS connections!!!
void OnValueChangedCh0 ( double dValue ) { emit ChangeChanGain ( 0, dValue ); }
void OnValueChangedCh1 ( double dValue ) { emit ChangeChanGain ( 1, dValue ); }
void OnValueChangedCh2 ( double dValue ) { emit ChangeChanGain ( 2, dValue ); }
void OnValueChangedCh3 ( double dValue ) { emit ChangeChanGain ( 3, dValue ); }
void OnValueChangedCh4 ( double dValue ) { emit ChangeChanGain ( 4, dValue ); }
void OnValueChangedCh5 ( double dValue ) { emit ChangeChanGain ( 5, dValue ); }
void OnValueChangedCh6 ( double dValue ) { emit ChangeChanGain ( 6, dValue ); }
void OnValueChangedCh7 ( double dValue ) { emit ChangeChanGain ( 7, dValue ); }
void OnValueChangedCh8 ( double dValue ) { emit ChangeChanGain ( 8, dValue ); }
void OnValueChangedCh9 ( double dValue ) { emit ChangeChanGain ( 9, dValue ); }
2006-12-09 19:37:40 +01:00
2006-12-09 16:00:24 +01:00
signals:
void ChangeChanGain ( int iId, double dGain );
};
#endif // MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_