From 8bfff2a273f8e5664476aa477d0af27ca172dd55 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 11 Jul 2008 22:41:39 +0000 Subject: [PATCH] use combobox instead of button-group for selecting arpeggio-direction git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1300 0778d3d1-df1d-0410-868b-ea421aaaa00d --- data/themes/default/arp_down.png | Bin 0 -> 604 bytes data/themes/default/arp_random.png | Bin 0 -> 492 bytes data/themes/default/arp_up.png | Bin 0 -> 581 bytes data/themes/default/arp_up_and_down.png | Bin 0 -> 569 bytes include/instrument_function_views.h | 4 +- include/instrument_functions.h | 2 +- src/core/instrument_functions.cpp | 11 +++- src/gui/widgets/instrument_function_views.cpp | 51 ++---------------- 8 files changed, 16 insertions(+), 52 deletions(-) create mode 100644 data/themes/default/arp_down.png create mode 100644 data/themes/default/arp_random.png create mode 100644 data/themes/default/arp_up.png create mode 100644 data/themes/default/arp_up_and_down.png diff --git a/data/themes/default/arp_down.png b/data/themes/default/arp_down.png new file mode 100644 index 0000000000000000000000000000000000000000..b0ce4a5cc110e4dfc2cf1c6e352e8bf76c056d95 GIT binary patch literal 604 zcmXAlZAeoA6o%imP3Om`ZJFMMI9$`IYoI15VltU7mkyccLUd{N!4k)aVNgTF_G8Kh zVM?Lfe`Q&_zr9VzkyvaA4RfexDoD%$Utn&#~9vh9DgpJ z@8=7i3y8M_@tz<)5Q)=?NjH;3PEqnuvUp4^osp)!OOwBmXU}KnOyuNE=N0r96pj@t zyb8su{1SJGdQ`3UskM{Z>fvhLW1Vh7S3}m+j_B(i*6BTZgV$grjV996Lbg~YEv-|n zj(JBH*%c0lZL%{Bl%XkRt%h>+KMaa}Ocwj#5y>%AoBipFU}$G|kKzxFTw>0r_84bR zs+5NDCLiS}dP|jxs)U}#dKEL)%JyZg-krM6v^dRNyJKgwhzLsJ7Apl}%cnBgu&jJ@ zu&w6YTA(X=ua;Zxf8E{OcERMn=1Q6UVdizOxGp|F# z`LVQMK6JkEqV;r!Jbr!9n8COb$@F@L9}MvGv&H@f=f)wllz{5#W) literal 0 HcmV?d00001 diff --git a/data/themes/default/arp_random.png b/data/themes/default/arp_random.png new file mode 100644 index 0000000000000000000000000000000000000000..d2ecee9782c4c1f53ec4d0e9d7460785469e94ea GIT binary patch literal 492 zcmVMzCV_|S* zE^l&Yo9;Xs0004NNklnq~{KoQW z;c@7*`E~ka)hB55lUN$~E3i$TA(Bi|VC8+Wx&*u>lR5^t;Ft~?nP83uX5MG4062Fs zDiukQrj=Q4*kqJRa&Kc%4eW1|2!Lk4#kTjEx2e^(2Ed)5ihhv|Wl@ zbf_Xq1tFC(N#NsA{Vd+CL!7(Q?E46DvaHid=C|XaX$aOd%}*0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L00l7s00l7tx9uoW00007bV*G`2iOG- z6DT%>v_(|_00G5GL_t(I%gxixOH@%92Jq*6jB~w?AJv$Fi%YiXKp?h?$O+md5x59f zk`Y6zkZ2JS6e&b8yTpZv3tRaI*q@NJ3_;>qbfZNw16nPdY39y3_nsD-t1QV)&-y(- z9^S(%j4?P)B#xOw0nQVbo{x%uZ}0))_4@Lu%P+3@+DvT-PnF_B9u43$g;_LSTol{y zHrBJ<-e!!sG=+xvE5I^g=8fkAejC^0sU5H~ttOt8k1bO%o-+g=e?FKOzxxH2`DW_e z)b*;bs<;s&_A!DWKr3jyHIGc`&kgQydSYneMy5060tfT}=mA<`3&pTF%9ng{D8Nac zEe(`jMO_inT#BSKf$g?HAAmk!C)`2t^qDz6;|P~yc>wSp1pq|7(WkNVW8T5RX@{gU zfh+8{_=OZ|I1%-~@7lDI6-v$f6lTGAmg$zREoEC@x1@uERTeg9;X6E#2M_?z05afv zxb5|Dw>5VMg)|GsbCR2@H&;>rQJ1Mt;p86B)@`6;|8W7p$-R9bgvj@2o{RAp&D)$^ zxw>*;ZDS2iI@EO?jeG-5)r8tr5LQ5Y4V`Hy8$fxDTvJ1~rMMN242u8vn2wsCDRI9r THwpji00000NkvXXu0mjfR{Q#= literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..f72c0c9405d0a2453e45f4cbca74c57b1f3683a5 GIT binary patch literal 569 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GXl47!?A1LR>X8G#L6A7-lgr>|tP- zz|7sx2jWg(U}$0BpUThB0AeugU|`tAz|a9kKn4)?F=$;-)4Qa$^6JVpH`ai(JYisX z!NBl}f#D4U!yg8Qe+-QO8JYhxOW&53y)A2V$|h+~Qq6&yDQBk4yE1RVwFOKMn3$e0 zbsq0zSjNDx3T!6O0SADHmEi~j!#M_qOAHKG7#MCbFx+Ecc*MZ)3~cy228Is|9D8_p zRtfOV=H;8i$G3t{@~WidbxEmHQc`E6zyJ90^A`&E{pa7me^(#u z1$u{pG0EHACBFD#pe~Rz!PCVtMB;LCLIcCK0y8#|2XEgs9NNzR?aDUCN8GOLRWDvi z9{BkuO7Pz~H??C;XA<;;r$^rzLb_yn3*j8XlZhD(x(2^ jx~oEUCce3G7Z}tVdW9Kzyw-dIx{blp)z4*}Q$iB}$~W1* literal 0 HcmV?d00001 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 ); }