diff --git a/data/themes/classic/led_purple.png b/data/themes/classic/led_purple.png new file mode 100644 index 000000000..7e6643527 Binary files /dev/null and b/data/themes/classic/led_purple.png differ diff --git a/data/themes/default/led_purple.png b/data/themes/default/led_purple.png new file mode 100644 index 000000000..7e6643527 Binary files /dev/null and b/data/themes/default/led_purple.png differ diff --git a/include/Track.h b/include/Track.h index 89c95059c..beda718fe 100644 --- a/include/Track.h +++ b/include/Track.h @@ -57,7 +57,7 @@ class TrackView; const int DEFAULT_SETTINGS_WIDGET_WIDTH = 224; -const int TRACK_OP_WIDTH = 78; +const int TRACK_OP_WIDTH = 94; // This shaves 150-ish pixels off track buttons, // ruled from config: ui.compacttrackbuttons const int DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT = 96; @@ -466,6 +466,7 @@ private: QPushButton * m_trackOps; PixmapButton * m_muteBtn; PixmapButton * m_soloBtn; + PixmapButton * m_soloAutomationsBtn; // Purple LED that enables solo with automations friend class TrackView; @@ -629,6 +630,8 @@ private: BoolModel m_soloModel; bool m_mutedBeforeSolo; + BoolModel m_soloAutomationsModel; // That option prevents solo from muting automation tracks + bool m_simpleSerializingMode; tcoVector m_trackContentObjects; diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 502741588..953ccd05e 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -1871,16 +1871,23 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : m_soloBtn->setInactiveGraphic( embed::getIconPixmap( "led_off" ) ); m_soloBtn->setCheckable( true ); + m_soloAutomationsBtn = new PixmapButton( this, tr( "Solo with Automations" ) ); + m_soloAutomationsBtn->setActiveGraphic( embed::getIconPixmap( "led_purple" ) ); + m_soloAutomationsBtn->setInactiveGraphic( embed::getIconPixmap( "led_off" ) ); + m_soloAutomationsBtn->setCheckable( true ); + if( ConfigManager::inst()->value( "ui", "compacttrackbuttons" ).toInt() ) { m_muteBtn->move( 46, 0 ); - m_soloBtn->move( 46, 16 ); + m_soloBtn->move( 46, 9 ); + m_soloAutomationsBtn->move( 46, 18 ); } else { m_muteBtn->move( 46, 8 ); m_soloBtn->move( 62, 8 ); + m_soloAutomationsBtn->move( 78, 8 ); } m_muteBtn->show(); @@ -1889,6 +1896,14 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : m_soloBtn->show(); ToolTip::add( m_soloBtn, tr( "Solo" ) ); + m_soloAutomationsBtn->show(); + ToolTip::add( m_soloAutomationsBtn, tr( "Solo with Automations" ) ); + // The purple LED will simply enable the regular solo (red LED). But since it will also + // change m_soloAutomationsModel to true, the behavior of the solo will be different + // keeping the automation tracks on their current state (either muted or unmuted). + connect( m_soloAutomationsBtn, SIGNAL( clicked() ), + m_soloBtn, SLOT( toggle() ) ); + connect( this, SIGNAL( trackRemovalScheduled( TrackView * ) ), m_trackView->trackContainerView(), SLOT( deleteTrackView( TrackView * ) ), @@ -2643,6 +2658,13 @@ void Track::toggleSolo() } const bool solo = m_soloModel.value(); + + // Turn off the soloAutomationsBtn LED if we are disabling the solo + if( !solo ) + { + m_soloAutomationsModel.setValue( false ); + } + for( TrackContainer::TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it ) { @@ -2653,20 +2675,29 @@ void Track::toggleSolo() { ( *it )->m_mutedBeforeSolo = ( *it )->isMuted(); } - // Don't mute AutomationTracks (keep their original state) if( *it == this ){ ( *it )->setMuted( false ); - } else if( ( *it )->type() != AutomationTrack ){ - ( *it )->setMuted( true ); + } else { + // Only mutes the automation tracks if the soloAutomationsBtn LED is not + // toggled + if( ( *it )->type() == AutomationTrack ){ + if( !m_soloAutomationsModel.value() ) + { + ( *it )->setMuted( true ); + } + } else { + ( *it )->setMuted( true ); + } } if( *it != this ) { ( *it )->m_soloModel.setValue( false ); + // If the soloAutomationsBtn LED is activated on another track we disable it as well + ( *it )->m_soloAutomationsModel.setValue( false ); } } - else if( !soloBefore && (* it )->type() != AutomationTrack ) + else if( !soloBefore ) { - // Only restores the mute state if the track isn't an Automation Track ( *it )->setMuted( ( *it )->m_mutedBeforeSolo ); } } @@ -2675,6 +2706,7 @@ void Track::toggleSolo() + BoolModel *Track::getMutedModel() { return &m_mutedModel; @@ -2841,6 +2873,7 @@ void TrackView::modelChanged() connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) ); m_trackOperationsWidget.m_muteBtn->setModel( &m_track->m_mutedModel ); m_trackOperationsWidget.m_soloBtn->setModel( &m_track->m_soloModel ); + m_trackOperationsWidget.m_soloAutomationsBtn->setModel( &m_track->m_soloAutomationsModel ); ModelView::modelChanged(); setFixedHeight( m_track->getHeight() ); }