Merge pull request #683 from diizy/autorec

Automation recording: add option to trackops to switch on/off recording ...
This commit is contained in:
Tobias Doerffel
2014-05-04 23:49:56 +02:00
2 changed files with 39 additions and 1 deletions

View File

@@ -373,7 +373,8 @@ private slots:
void cloneTrack();
void removeTrack();
void updateMenu();
void recordingOn();
void recordingOff();
private:
static QPixmap * s_grip;

View File

@@ -1479,6 +1479,9 @@ void trackOperationsWidget::removeTrack()
*
* For all track types, we have the Clone and Remove options.
* For instrument-tracks we also offer the MIDI-control-menu
* For automation tracks, extra options: turn on/off recording
* on all TCOs (same should be added for sample tracks when
* sampletrack recording is implemented)
*/
void trackOperationsWidget::updateMenu()
{
@@ -1497,11 +1500,45 @@ void trackOperationsWidget::updateMenu()
to_menu->addMenu( dynamic_cast<InstrumentTrackView *>(
m_trackView )->midiMenu() );
}
if( dynamic_cast<AutomationTrackView *>( m_trackView ) )
{
to_menu->addAction( tr( "Turn all recording on" ), this, SLOT( recordingOn() ) );
to_menu->addAction( tr( "Turn all recording off" ), this, SLOT( recordingOff() ) );
}
}
void trackOperationsWidget::recordingOn()
{
AutomationTrackView * atv = dynamic_cast<AutomationTrackView *>( m_trackView );
if( atv )
{
const track::tcoVector & tcov = atv->getTrack()->getTCOs();
for( track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); it++ )
{
AutomationPattern * ap = dynamic_cast<AutomationPattern *>( *it );
if( ap ) { ap->setRecording( true ); }
}
atv->update();
}
}
void trackOperationsWidget::recordingOff()
{
AutomationTrackView * atv = dynamic_cast<AutomationTrackView *>( m_trackView );
if( atv )
{
const track::tcoVector & tcov = atv->getTrack()->getTCOs();
for( track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); it++ )
{
AutomationPattern * ap = dynamic_cast<AutomationPattern *>( *it );
if( ap ) { ap->setRecording( false ); }
}
atv->update();
}
}
// ===========================================================================
// track