diff --git a/data/themes/default/arp_down.png b/data/themes/default/arp_down.png new file mode 100644 index 000000000..b0ce4a5cc Binary files /dev/null and b/data/themes/default/arp_down.png differ diff --git a/data/themes/default/arp_random.png b/data/themes/default/arp_random.png new file mode 100644 index 000000000..d2ecee978 Binary files /dev/null and b/data/themes/default/arp_random.png differ diff --git a/data/themes/default/arp_up.png b/data/themes/default/arp_up.png new file mode 100644 index 000000000..78e7ad37f Binary files /dev/null and b/data/themes/default/arp_up.png differ diff --git a/data/themes/default/arp_up_and_down.png b/data/themes/default/arp_up_and_down.png new file mode 100644 index 000000000..f72c0c940 Binary files /dev/null and b/data/themes/default/arp_up_and_down.png differ diff --git a/include/instrument_function_views.h b/include/instrument_function_views.h index aa1d01e9a..1de8686ca 100644 --- a/include/instrument_function_views.h +++ b/include/instrument_function_views.h @@ -31,7 +31,6 @@ #include class QLabel; -class automatableButtonGroup; class comboBox; class groupBox; class knob; @@ -85,8 +84,7 @@ private: QLabel * m_arpDirectionLbl; - automatableButtonGroup * m_arpDirectionBtnGrp; - + comboBox * m_arpDirectionComboBox; comboBox * m_arpModeComboBox; } ; diff --git a/include/instrument_functions.h b/include/instrument_functions.h index acb3f042f..c9dcce896 100644 --- a/include/instrument_functions.h +++ b/include/instrument_functions.h @@ -131,7 +131,7 @@ private: floatModel m_arpRangeModel; tempoSyncKnobModel m_arpTimeModel; floatModel m_arpGateModel; - intModel m_arpDirectionModel; + comboBoxModel m_arpDirectionModel; comboBoxModel m_arpModeModel; diff --git a/src/core/instrument_functions.cpp b/src/core/instrument_functions.cpp index fe66a4761..87506b2db 100644 --- a/src/core/instrument_functions.cpp +++ b/src/core/instrument_functions.cpp @@ -272,8 +272,7 @@ arpeggiator::arpeggiator( model * _parent ) : tr( "Arpeggio time" ) ), m_arpGateModel( 100.0f, 1.0f, 200.0f, 1.0f, this, tr( "Arpeggio gate" ) ), - m_arpDirectionModel( 0, 0, NumArpDirections, this, - tr( "Arpeggio direction" ) ), + m_arpDirectionModel( this, tr( "Arpeggio direction" ) ), m_arpModeModel( this, tr( "Arpeggio mode" ) ) { for( int i = 0; chordCreator::s_chordTable[i].interval[0] != -1; ++i ) @@ -283,6 +282,14 @@ arpeggiator::arpeggiator( model * _parent ) : name.toAscii().constData() ) ); } + m_arpDirectionModel.addItem( tr( "Up" ), + new pixmapLoader( "arp_up" ) ); + m_arpDirectionModel.addItem( tr( "Down" ), + new pixmapLoader( "arp_down" ) ); + m_arpDirectionModel.addItem( tr( "Up and down" ), + new pixmapLoader( "arp_up_and_down" ) ); + m_arpDirectionModel.addItem( tr( "Random" ), + new pixmapLoader( "arp_random" ) ); m_arpDirectionModel.setInitValue( ArpDirUp ); m_arpModeModel.addItem( tr( "Free" ), new pixmapLoader( "arp_free" ) ); diff --git a/src/gui/widgets/instrument_function_views.cpp b/src/gui/widgets/instrument_function_views.cpp index c7a746077..61acc1a0b 100644 --- a/src/gui/widgets/instrument_function_views.cpp +++ b/src/gui/widgets/instrument_function_views.cpp @@ -114,6 +114,7 @@ arpeggiatorView::arpeggiatorView( arpeggiator * _arp, QWidget * _parent ) : m_arpRangeKnob( new knob( knobBright_26, m_arpGroupBox ) ), m_arpTimeKnob( new tempoSyncKnob( knobBright_26, m_arpGroupBox ) ), m_arpGateKnob( new knob( knobBright_26, m_arpGroupBox ) ), + m_arpDirectionComboBox( new comboBox( m_arpGroupBox ) ), m_arpModeComboBox( new comboBox( m_arpGroupBox ) ) { move( ARP_GROUPBOX_X, ARP_GROUPBOX_Y ); @@ -168,55 +169,14 @@ arpeggiatorView::arpeggiatorView( arpeggiator * _arp, QWidget * _parent ) : m_arpDirectionLbl->setGeometry( 10, 60, 64, 10 ); m_arpDirectionLbl->setFont( pointSize<7>( m_arpDirectionLbl->font() ) ); - - - pixmapButton * arp_up_btn = new pixmapButton( m_arpGroupBox, NULL ); - arp_up_btn->move( 10, 74 ); - arp_up_btn->setActiveGraphic( embed::getIconPixmap( "arp_up_on" ) ); - arp_up_btn->setInactiveGraphic( embed::getIconPixmap( "arp_up_off" ) ); - toolTip::add( arp_up_btn, tr( "arpeggio direction = up" ) ); - - - pixmapButton * arp_down_btn = new pixmapButton( m_arpGroupBox, NULL ); - arp_down_btn->move( 30, 74 ); - arp_down_btn->setActiveGraphic( embed::getIconPixmap( "arp_down_on" ) ); - arp_down_btn->setInactiveGraphic( embed::getIconPixmap( - "arp_down_off" ) ); - toolTip::add( arp_down_btn, tr( "arpeggio direction = down" ) ); - - - pixmapButton * arp_up_and_down_btn = new pixmapButton( m_arpGroupBox, - NULL ); - arp_up_and_down_btn->move( 50, 74 ); - arp_up_and_down_btn->setActiveGraphic( embed::getIconPixmap( - "arp_up_and_down_on" ) ); - arp_up_and_down_btn->setInactiveGraphic( embed::getIconPixmap( - "arp_up_and_down_off" ) ); - toolTip::add( arp_up_and_down_btn, - tr( "arpeggio direction = up and down" ) ); - - - pixmapButton * arp_random_btn = new pixmapButton( m_arpGroupBox, NULL ); - arp_random_btn->move( 70, 74 ); - arp_random_btn->setActiveGraphic( embed::getIconPixmap( - "arp_random_on" ) ); - arp_random_btn->setInactiveGraphic( embed::getIconPixmap( - "arp_random_off" ) ); - toolTip::add( arp_random_btn, tr( "arpeggio direction = random" ) ); - - m_arpDirectionBtnGrp = new automatableButtonGroup( this ); - m_arpDirectionBtnGrp->addButton( arp_up_btn ); - m_arpDirectionBtnGrp->addButton( arp_down_btn ); - m_arpDirectionBtnGrp->addButton( arp_up_and_down_btn ); - m_arpDirectionBtnGrp->addButton( arp_random_btn ); - + m_arpDirectionComboBox->setGeometry( 10, 74, 140, 22 ); QLabel * mode_lbl = new QLabel( tr( "Mode:" ), m_arpGroupBox ); - mode_lbl->setGeometry( 10, 104, 64, 10 ); + mode_lbl->setGeometry( 10, 110, 64, 10 ); mode_lbl->setFont( pointSize<7>( mode_lbl->font() ) ); - m_arpModeComboBox->setGeometry( 10, 118, 128, 22 ); + m_arpModeComboBox->setGeometry( 10, 124, 128, 22 ); } @@ -224,7 +184,6 @@ arpeggiatorView::arpeggiatorView( arpeggiator * _arp, QWidget * _parent ) : arpeggiatorView::~arpeggiatorView() { - delete m_arpDirectionBtnGrp; delete m_arpGroupBox; } @@ -239,7 +198,7 @@ void arpeggiatorView::modelChanged( void ) m_arpRangeKnob->setModel( &m_a->m_arpRangeModel ); m_arpTimeKnob->setModel( &m_a->m_arpTimeModel ); m_arpGateKnob->setModel( &m_a->m_arpGateModel ); - m_arpDirectionBtnGrp->setModel( &m_a->m_arpDirectionModel ); + m_arpDirectionComboBox->setModel( &m_a->m_arpDirectionModel ); m_arpModeComboBox->setModel( &m_a->m_arpModeModel ); }