fix for Mac issue with mixer fading layout problem

This commit is contained in:
Volker Fischer 2011-12-01 07:57:27 +00:00
parent d4a6ea617f
commit 354b6309bd
2 changed files with 19 additions and 24 deletions

View File

@ -31,12 +31,15 @@
CChannelFader::CChannelFader ( QWidget* pNW, CChannelFader::CChannelFader ( QWidget* pNW,
QHBoxLayout* pParentLayout ) QHBoxLayout* pParentLayout )
{ {
// create new GUI control objects and store pointers to them // create new GUI control objects and store pointers to them (note that
pMainGrid = new QVBoxLayout(); // QWidget takes the ownership of the pMainGrid so that this only has
pFader = new QSlider ( Qt::Vertical, pNW ); // to be created locally in this constructor)
pcbMute = new QCheckBox ( "Mute", pNW ); pFrame = new QFrame ( pNW );
pcbSolo = new QCheckBox ( "Solo", pNW ); QVBoxLayout* pMainGrid = new QVBoxLayout ( pFrame );
pLabel = new QLabel ( "", pNW ); pFader = new QSlider ( Qt::Vertical, pFrame );
pcbMute = new QCheckBox ( "Mute", pFrame );
pcbSolo = new QCheckBox ( "Solo", pFrame );
pLabel = new QLabel ( "", pFrame );
// setup slider // setup slider
pFader->setPageStep ( 1 ); pFader->setPageStep ( 1 );
@ -61,8 +64,8 @@ CChannelFader::CChannelFader ( QWidget* pNW,
pMainGrid->addWidget( pcbSolo, 0, Qt::AlignLeft ); pMainGrid->addWidget( pcbSolo, 0, Qt::AlignLeft );
pMainGrid->addWidget( pLabel, 0, Qt::AlignHCenter ); pMainGrid->addWidget( pLabel, 0, Qt::AlignHCenter );
// add fader layout to audio mixer board layout // add fader frame to audio mixer board layout
pParentLayout->addLayout ( pMainGrid ); pParentLayout->addWidget( pFrame );
// reset current fader // reset current fader
Reset(); Reset();

View File

@ -25,6 +25,7 @@
#if !defined ( MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_ ) #if !defined ( MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_ )
#define MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_ #define MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_
#include <qframe.h>
#include <qgroupbox.h> #include <qgroupbox.h>
#include <qlabel.h> #include <qlabel.h>
#include <qcheckbox.h> #include <qcheckbox.h>
@ -49,19 +50,10 @@ class CChannelFader : public QObject
public: public:
CChannelFader ( QWidget* pNW, QHBoxLayout* pParentLayout ); CChannelFader ( QWidget* pNW, QHBoxLayout* pParentLayout );
~CChannelFader()
{
pLabel->close();
pcbMute->close();
pcbSolo->close();
pFader->close();
// TODO get rid of pMainGrid
}
void SetText ( const QString sText ); void SetText ( const QString sText );
void Show() { pLabel->show(); pcbMute->show(); pcbSolo->show(); pFader->show(); } void Show() { pFrame->show(); }
void Hide() { pLabel->hide(); pcbMute->hide(); pcbSolo->hide(); pFader->hide(); } void Hide() { pFrame->hide(); }
bool IsVisible() { return pLabel->isVisible(); } bool IsVisible() { return pLabel->isVisible(); }
void SetGUIDesign ( const EGUIDesign eNewDesign ); void SetGUIDesign ( const EGUIDesign eNewDesign );
@ -74,11 +66,11 @@ protected:
double CalcFaderGain ( const int value ); double CalcFaderGain ( const int value );
void SetMute ( const bool bState ); void SetMute ( const bool bState );
QVBoxLayout* pMainGrid; QFrame* pFrame;
QSlider* pFader; QSlider* pFader;
QCheckBox* pcbMute; QCheckBox* pcbMute;
QCheckBox* pcbSolo; QCheckBox* pcbSolo;
QLabel* pLabel; QLabel* pLabel;
bool bOtherChannelIsSolo; bool bOtherChannelIsSolo;