diff --git a/ChangeLog b/ChangeLog index 8989de0ba..513d7cb5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,12 @@ Made wet/dry knob do something. Acts as a nice panning knob when the matrix has the channels swapped. + * src/tracks/instrument_track.cpp: + * src/gui/fx_mixer_view.cpp: + * include/fx_mixer_view.h: + - Made bank-buttons easier to hit + - Double click on fx-channel LCD in ITW to warp to the proper FX-line + 2008-04-20 Tobias Doerffel * src/gui/widgets/group_box.cpp: diff --git a/include/fx_mixer_view.h b/include/fx_mixer_view.h index dfd2b2367..24796fd0a 100644 --- a/include/fx_mixer_view.h +++ b/include/fx_mixer_view.h @@ -32,6 +32,7 @@ class QStackedLayout; +class QButtonGroup; class fader; class fxLine; class effectRackView; @@ -51,6 +52,7 @@ public: return( m_currentFxLine ); } void setCurrentFxLine( fxLine * _line ); + void setCurrentFxLine( int _line ); void clear( void ); @@ -73,6 +75,7 @@ private: QStackedLayout * m_fxRacksLayout; QStackedLayout * m_fxLineBanks; + QButtonGroup * m_bankButtons; fxLine * m_currentFxLine; } ; diff --git a/src/gui/fx_mixer_view.cpp b/src/gui/fx_mixer_view.cpp index f20422213..7af121cac 100644 --- a/src/gui/fx_mixer_view.cpp +++ b/src/gui/fx_mixer_view.cpp @@ -185,17 +185,18 @@ fxMixerView::fxMixerView() : QVBoxLayout * l = new QVBoxLayout; l->addSpacing( 10 ); QButtonGroup * g = new QButtonGroup( this ); + m_bankButtons = g; g->setExclusive( TRUE ); for( int j = 0; j < 4; ++j ) { QToolButton * btn = new QToolButton; btn->setText( QString( 'A'+j ) ); btn->setCheckable( TRUE ); + btn->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding ); l->addWidget( btn ); g->addButton( btn, j ); btn->setChecked( j == 0); } - l->addStretch( 1 ); ml->addLayout( l ); connect( g, SIGNAL( buttonClicked( int ) ), m_fxLineBanks, SLOT( setCurrentIndex( int ) ) ); @@ -248,6 +249,18 @@ void fxMixerView::setCurrentFxLine( fxLine * _line ) +void fxMixerView::setCurrentFxLine( int _line ) +{ + if ( _line >= 0 && _line < NumFxChannels+1 ) + { + setCurrentFxLine( m_fxChannelViews[_line].m_fxLine ); + + m_bankButtons->button( _line / 16 )->click(); + } +} + + + void fxMixerView::clear( void ) { diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index eef9e00e7..5e8a275c6 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -1206,7 +1206,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) { int tmp = abs( pos_ticks - (int)( (*it)->pos() ) ); - if( tmp < shortDistance && (*it)->length().getTicks() > 0 ) + if( tmp <= shortDistance && (*it)->length().getTicks() > 0 ) { shortDistance = tmp; shortNote = *it ; diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 4df01da10..c65b094e5 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -52,6 +52,7 @@ #include "effect_rack_view.h" #include "embed.h" #include "engine.h" +#include "fx_mixer_view.h" #include "instrument_sound_shaping.h" #include "instrument_sound_shaping_view.h" #include "fade_button.h" @@ -1014,7 +1015,20 @@ void instrumentTrackView::updateName( void ) +class fxLineLcdSpinBox : public lcdSpinBox +{ + public: + fxLineLcdSpinBox( int _num_digits, QWidget * _parent, + const QString & _name ) : + lcdSpinBox( _num_digits, _parent, _name ) {} + protected: + virtual void mouseDoubleClickEvent ( QMouseEvent * _me ) + { + engine::getFxMixerView()->setCurrentFxLine( value() ); + //engine::getFxMixerView()->raise(); + } +}; @@ -1069,13 +1083,12 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) : // setup spinbox for selecting FX-channel - m_effectChannelNumber = new lcdSpinBox( 2, m_generalSettingsWidget, + m_effectChannelNumber = new fxLineLcdSpinBox( 2, m_generalSettingsWidget, tr( "FX channel" ) ); m_effectChannelNumber->setLabel( tr( "FX CHNL" ) ); m_effectChannelNumber->move( m_panningKnob->x() + m_panningKnob->width() + 16, 44 ); - m_saveSettingsBtn = new QPushButton( embed::getIconPixmap( "project_save" ), "", m_generalSettingsWidget );