void ColorPicker::CreateColorControl( Gwen::String name, int y ) { int colorSize = 12; GroupBox* colorGroup = new GroupBox( this ); colorGroup->SetPos( 10, y ); colorGroup->SetText( name ); colorGroup->SetSize( 160, 35 ); colorGroup->SetName( name + "groupbox" ); ColorDisplay* disp = new ColorDisplay( colorGroup ); disp->SetName(name); disp->SetBounds( 0 , 10, colorSize, colorSize ); TextBoxNumeric* numeric = new TextBoxNumeric( colorGroup ); numeric->SetName( name + "Box" ); numeric->SetPos( 105, 7 ); numeric->SetSize( 26, 16 ); numeric->SetSelectAllOnFocus( true ); numeric->onTextChanged.Add( this, &ColorPicker::NumericTyped ); HorizontalSlider* slider = new HorizontalSlider( colorGroup ); slider->SetPos( colorSize + 5 , 10 ); slider->SetRange( 0, 255 ); slider->SetSize( 80, colorSize ); slider->SetName( name + "Slider"); slider->onValueChanged.Add( this, &ColorPicker::SlidersMoved ); }
// Constructor FusionDialog::FusionDialog(QWidget* parent) : Dialog(parent) { setWindowTitle("Fusion"); // Create the interface QVBoxLayout* vLayout = new QVBoxLayout(); m_addMergedSeriesButton = new PushButton("Ajouter une fusion"); vLayout->addWidget(m_addMergedSeriesButton); m_mergedSeriesComboBox = new ComboBox(); vLayout->addWidget(m_mergedSeriesComboBox); GroupBox* seriesBox = new GroupBox("Séries"); m_seriesLayout = new QVBoxLayout(); seriesBox->setLayout(m_seriesLayout); vLayout->addWidget(seriesBox); m_checkBoxesGroup.setExclusive(false); PushButton* okButton = new PushButton("Ok"); vLayout->addWidget(okButton); setLayout(vLayout); // Event connections connect(m_mergedSeriesComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCheckboxes())); connect(&m_checkBoxesGroup, SIGNAL(buttonClicked(int)), this, SLOT(moveSeriesInterfaceIntoFusion(int))); connect(m_addMergedSeriesButton, SIGNAL(clicked()), this, SLOT(askNewFusion())); connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); }
void ColorPicker::Layout( Skin::Base* skin ) { BaseClass::Layout( skin ); SizeToChildren( false, true ); SetSize( Width(), Height() + 5 ); GroupBox* groupBox = gwen_cast<GroupBox> ( FindChildByName( "ResultGroupBox", true ) ); if ( groupBox ) { groupBox->SetPos( groupBox->X(), Height() * 0.5f - groupBox->Height() * 0.5f ); } UpdateControls(); }
void ColorPicker::CreateControls() { int startY = 5; int height = 35; CreateColorControl( "Red", startY ); CreateColorControl( "Green", startY + height ); CreateColorControl( "Blue", startY + height * 2 ); CreateColorControl( "Alpha", startY + height * 3 ); GroupBox* finalGroup = new GroupBox( this ); finalGroup->SetPos( 180, 40 ); finalGroup->SetSize( 60, 60 ); finalGroup->SetText( "Result" ); finalGroup->SetName( "ResultGroupBox" ); ColorDisplay* disp = new ColorDisplay( finalGroup ); disp->SetName( "Result" ); disp->SetBounds( 7 , 5, 32, 32 ); disp->SetDrawCheckers( true ); //UpdateControls(); }
void ColorPicker::SetAlphaVisible( bool visible ) { GroupBox* groupBox = gwen_cast<GroupBox>(FindChildByName( "Alphagroupbox", true ) ); groupBox->SetHidden( !visible ); Invalidate(); }
InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : QWidget( parent ), ModelView( NULL, this ), m_rpBtn( NULL ), m_wpBtn( NULL ) { QVBoxLayout* layout = new QVBoxLayout( this ); layout->setMargin( 5 ); m_midiInputGroupBox = new GroupBox( tr( "ENABLE MIDI INPUT" ) ); layout->addWidget( m_midiInputGroupBox ); QHBoxLayout* midiInputLayout = new QHBoxLayout( m_midiInputGroupBox ); midiInputLayout->setContentsMargins( 8, 18, 8, 8 ); midiInputLayout->setSpacing( 6 ); m_inputChannelSpinBox = new LcdSpinBox( 2, m_midiInputGroupBox ); m_inputChannelSpinBox->addTextForValue( 0, "--" ); m_inputChannelSpinBox->setLabel( tr( "CHANNEL" ) ); m_inputChannelSpinBox->setEnabled( false ); midiInputLayout->addWidget( m_inputChannelSpinBox ); m_fixedInputVelocitySpinBox = new LcdSpinBox( 3, m_midiInputGroupBox ); m_fixedInputVelocitySpinBox->setDisplayOffset( 1 ); m_fixedInputVelocitySpinBox->addTextForValue( 0, "---" ); m_fixedInputVelocitySpinBox->setLabel( tr( "VELOCITY" ) ); m_fixedInputVelocitySpinBox->setEnabled( false ); midiInputLayout->addWidget( m_fixedInputVelocitySpinBox ); midiInputLayout->addStretch(); connect( m_midiInputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_inputChannelSpinBox, SLOT( setEnabled( bool ) ) ); connect( m_midiInputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_fixedInputVelocitySpinBox, SLOT( setEnabled( bool ) ) ); m_midiOutputGroupBox = new GroupBox( tr( "ENABLE MIDI OUTPUT" ) ); layout->addWidget( m_midiOutputGroupBox ); QHBoxLayout* midiOutputLayout = new QHBoxLayout( m_midiOutputGroupBox ); midiOutputLayout->setContentsMargins( 8, 18, 8, 8 ); midiOutputLayout->setSpacing( 6 ); m_outputChannelSpinBox = new LcdSpinBox( 2, m_midiOutputGroupBox ); m_outputChannelSpinBox->setLabel( tr( "CHANNEL" ) ); m_outputChannelSpinBox->setEnabled( false ); midiOutputLayout->addWidget( m_outputChannelSpinBox ); m_fixedOutputVelocitySpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox ); m_fixedOutputVelocitySpinBox->setDisplayOffset( 1 ); m_fixedOutputVelocitySpinBox->addTextForValue( 0, "---" ); m_fixedOutputVelocitySpinBox->setLabel( tr( "VELOCITY" ) ); m_fixedOutputVelocitySpinBox->setEnabled( false ); midiOutputLayout->addWidget( m_fixedOutputVelocitySpinBox ); m_outputProgramSpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox ); m_outputProgramSpinBox->setLabel( tr( "PROGRAM" ) ); m_outputProgramSpinBox->setEnabled( false ); midiOutputLayout->addWidget( m_outputProgramSpinBox ); m_fixedOutputNoteSpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox ); m_fixedOutputNoteSpinBox->setDisplayOffset( 1 ); m_fixedOutputNoteSpinBox->addTextForValue( 0, "---" ); m_fixedOutputNoteSpinBox->setLabel( tr( "NOTE" ) ); m_fixedOutputNoteSpinBox->setEnabled( false ); midiOutputLayout->addWidget( m_fixedOutputNoteSpinBox ); midiOutputLayout->addStretch(); connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_outputChannelSpinBox, SLOT( setEnabled( bool ) ) ); connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_fixedOutputVelocitySpinBox, SLOT( setEnabled( bool ) ) ); connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_outputProgramSpinBox, SLOT( setEnabled( bool ) ) ); connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_fixedOutputNoteSpinBox, SLOT( setEnabled( bool ) ) ); if( !Engine::mixer()->midiClient()->isRaw() ) { m_rpBtn = new QToolButton; m_rpBtn->setMinimumSize( 32, 32 ); m_rpBtn->setText( tr( "MIDI devices to receive MIDI events from" ) ); m_rpBtn->setIcon( embed::getIconPixmap( "piano" ) ); m_rpBtn->setPopupMode( QToolButton::InstantPopup ); midiInputLayout->insertSpacing( 0, 4 ); midiInputLayout->insertWidget( 0, m_rpBtn ); m_wpBtn = new QToolButton; m_wpBtn->setMinimumSize( 32, 32 ); m_wpBtn->setText( tr( "MIDI devices to send MIDI events to" ) ); m_wpBtn->setIcon( embed::getIconPixmap( "piano" ) ); m_wpBtn->setPopupMode( QToolButton::InstantPopup ); midiOutputLayout->insertSpacing( 0, 4 ); midiOutputLayout->insertWidget( 0, m_wpBtn ); } #define PROVIDE_CUSTOM_BASE_VELOCITY_UI #ifdef PROVIDE_CUSTOM_BASE_VELOCITY_UI GroupBox* baseVelocityGroupBox = new GroupBox( tr( "CUSTOM BASE VELOCITY" ) ); layout->addWidget( baseVelocityGroupBox ); QVBoxLayout* baseVelocityLayout = new QVBoxLayout( baseVelocityGroupBox ); baseVelocityLayout->setContentsMargins( 8, 18, 8, 8 ); baseVelocityLayout->setSpacing( 6 ); QLabel* baseVelocityHelp = new QLabel( tr( "Specify the velocity normalization base for MIDI-based instruments at 100% note velocity" ) ); baseVelocityHelp->setWordWrap( true ); baseVelocityHelp->setFont( pointSize<8>( baseVelocityHelp->font() ) ); baseVelocityLayout->addWidget( baseVelocityHelp ); m_baseVelocitySpinBox = new LcdSpinBox( 3, baseVelocityGroupBox ); m_baseVelocitySpinBox->setLabel( tr( "BASE VELOCITY" ) ); m_baseVelocitySpinBox->setEnabled( false ); baseVelocityLayout->addWidget( m_baseVelocitySpinBox ); connect( baseVelocityGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_baseVelocitySpinBox, SLOT( setEnabled( bool ) ) ); #endif layout->addStretch(); }
void ColorPicker::SetAlphaVisible( bool visible ) { GroupBox* groupBox = FindChildByName( "Alphagroupbox", true )->DynamicCastGroupBox(); groupBox->SetHidden( !visible ); Invalidate(); }
ILXSoundMixer::ILXSoundMixer(int argc, char* argv[]) : Application(&argc, &argv, AppOptions(OptDaleAuto | OptSound)), _soundComponent(NULL), _music(NULL), _bandSliderFont(NULL) { setMargin(20); setLayout(new VBoxLayout()); _bandSliderFont = new Font("Sans", 8); HBoxLayout* volStuff = new HBoxLayout(); addWidget(volStuff); TabPanel* panel = new TabPanel(); volStuff->addWidget(panel); //********** HBoxLayout* volHBox = new HBoxLayout(); panel->addTab(volHBox, "Volume Control"); GridLayout* volGrid = new GridLayout(8, 3); volHBox->addWidget(volGrid); volGrid->addWidget(new Label("Master Volume:"), 0, 0, 0, 3); _masterVolume = new Slider(); _masterVolume->setRange(0, 1); _masterVolume->setValue(SoundDFB::getMasterVolume()); _masterVolume->setStep(0.1); _masterVolume->setPageStep(0.2); _masterVolume->setUpdateMode(Slider::UponRelease); _masterVolume->sigValueChanged.connect(sigc::mem_fun(this, &ILXSoundMixer::changeMasterVolume)); volGrid->addWidget(_masterVolume, 1, 0, 0, 2); _mute = new PushButton("Mute"); _mute->setXConstraint(FixedConstraint); volGrid->addWidget(_mute, 1, 2); _mute->sigClicked.connect(sigc::mem_fun(this, &ILXSoundMixer::mute)); volGrid->addWidget(new Label("Sound Effects:"), 2, 0, 0, 3); _effectsVolume = new Slider(); _effectsVolume->setRange(0, 1); _effectsVolume->setValue(1); _effectsVolume->setStep(0.1); _effectsVolume->setPageStep(0.2); _effectsVolume->setUpdateMode(Slider::UponRelease); _effectsVolume->sigValueChanged.connect(sigc::mem_fun(this, &ILXSoundMixer::changeEffectsVolume)); volGrid->addWidget(_effectsVolume, 3, 0, 0, 2); volGrid->addWidget(new Label("Balance:"), 4, 0, 0, 3); volGrid->addWidget(new Label("Front"), 5, 0); Slider* frSlider = new Slider(); frSlider->setValue(50); volGrid->addWidget(frSlider, 5, 1); volGrid->addWidget(new Label("Rear"), 5, 2); volGrid->addWidget(new Label("Left"), 6, 0); Slider* lrSlider = new Slider(); lrSlider->setValue(50); volGrid->addWidget(lrSlider, 6, 1); volGrid->addWidget(new Label("Right"), 6, 2); volGrid->addWidget(new Spacer(Vertical), 7, 0); GroupBox* volMeter = new GroupBox("Meter"); VBoxLayout* volMeterLayout = new VBoxLayout(); volMeterLayout->setHorizontalAlignment(Alignment::Center); volMeter->setLayout(volMeterLayout); volMeter->setXConstraint(FixedConstraint); volStuff->addWidget(volMeter); VolumeMeter* meter = new VolumeMeter(); volMeter->addWidget(meter); volHBox->addWidget(volMeter); //********* VBoxLayout* eqBox = new VBoxLayout(); panel->addTab(eqBox, "Equalizer"); HBoxLayout* buttons = new HBoxLayout(); buttons->addWidget(new CheckBox("EQ Enabled")); buttons->addWidget(new Spacer(Horizontal)); buttons->addWidget(new PushButton("Load Preset")); buttons->addWidget(new PushButton("Save Preset")); PushButton* testSound = new PushButton("Test"); testSound->sigClicked.connect(sigc::mem_fun(this, &ILXSoundMixer::playTestSound)); buttons->addWidget(testSound); eqBox->addWidget(buttons); HBoxLayout* rowLevels = new HBoxLayout(); rowLevels->setYConstraint(ExpandingConstraint); rowLevels->addWidget(new BandSlider("50Hz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("100Hz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("156Hz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("220Hz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("311Hz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("440Hz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("622Hz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("880Hz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("1.25KHz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("1.75KHz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("2.5KHz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("3.5KHz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("5KHz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("10KHz", _bandSliderFont)); rowLevels->addWidget(new BandSlider("20KHz", _bandSliderFont)); eqBox->addWidget(rowLevels); #if ILIXI_HAVE_COMPOSITOR DaleDFB::comaGetComponent("SoundMixer", &_soundComponent); if (_soundComponent) _soundComponent->Listen(_soundComponent, SoundMixer::VolumeChanged, volumeListener, this); #endif _music = new Music(ILIXI_DATADIR"soundmixer/test.wav"); _music->setRepeat(true); }