Move FX assignment/creation logic to InsTrackView
This commit is contained in:
@@ -322,6 +322,9 @@ private slots:
|
||||
void midiConfigChanged();
|
||||
void muteChanged();
|
||||
|
||||
void assignFxLine( int channelIndex );
|
||||
void createFxLine();
|
||||
|
||||
|
||||
private:
|
||||
InstrumentTrackWindow * m_window;
|
||||
@@ -375,6 +378,11 @@ public:
|
||||
|
||||
void setInstrumentTrackView( InstrumentTrackView * _tv );
|
||||
|
||||
InstrumentTrackView * instrumentTrackView()
|
||||
{
|
||||
return m_itv;
|
||||
}
|
||||
|
||||
PianoView * pianoView()
|
||||
{
|
||||
return m_pianoView;
|
||||
|
||||
@@ -391,8 +391,6 @@ private slots:
|
||||
void recordingOn();
|
||||
void recordingOff();
|
||||
void clearTrack();
|
||||
void assignFxLine( int channelIndex );
|
||||
void createFxLine();
|
||||
|
||||
private:
|
||||
static QPixmap * s_grip;
|
||||
|
||||
@@ -1711,29 +1711,6 @@ void TrackOperationsWidget::clearTrack()
|
||||
|
||||
|
||||
|
||||
/*! \brief Create and assign a new FX Channel for this track */
|
||||
void TrackOperationsWidget::createFxLine()
|
||||
{
|
||||
int channelIndex = gui->fxMixerView()->addNewChannel();
|
||||
|
||||
Engine::fxMixer()->effectChannel( channelIndex )->m_name = m_trackView->getTrack()->name();
|
||||
|
||||
assignFxLine(channelIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*! \brief Assign a specific FX Channel for this track */
|
||||
void TrackOperationsWidget::assignFxLine(int channelIndex)
|
||||
{
|
||||
Track * track = m_trackView->getTrack();
|
||||
dynamic_cast<InstrumentTrack *>( track )->effectChannelModel()->setValue( channelIndex );
|
||||
|
||||
gui->fxMixerView()->setCurrentFxLine( channelIndex );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*! \brief Remove this track from the track list
|
||||
*
|
||||
*/
|
||||
@@ -1777,7 +1754,7 @@ void TrackOperationsWidget::updateMenu()
|
||||
QMenu * fxMenu = new QMenu( tr( "FX %1: %2" ).arg( channelIndex ).arg( fxChannel->m_name ), to_menu );
|
||||
QSignalMapper * fxMenuSignalMapper = new QSignalMapper(this);
|
||||
|
||||
fxMenu->addAction("Assign to new FX Channel" , this, SLOT( createFxLine() ) );
|
||||
fxMenu->addAction( tr( "Assign to new FX Channel" ), trackView, SLOT( createFxLine() ) );
|
||||
fxMenu->addSeparator();
|
||||
|
||||
|
||||
@@ -1794,7 +1771,7 @@ void TrackOperationsWidget::updateMenu()
|
||||
}
|
||||
|
||||
to_menu->addMenu(fxMenu);
|
||||
connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int)));
|
||||
connect(fxMenuSignalMapper, SIGNAL(mapped(int)), trackView, SLOT(assignFxLine(int)));
|
||||
|
||||
to_menu->addSeparator();
|
||||
to_menu->addMenu( trackView->midiMenu() );
|
||||
|
||||
@@ -963,6 +963,30 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow()
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Create and assign a new FX Channel for this track */
|
||||
void InstrumentTrackView::createFxLine()
|
||||
{
|
||||
int channelIndex = gui->fxMixerView()->addNewChannel();
|
||||
|
||||
Engine::fxMixer()->effectChannel( channelIndex )->m_name = getTrack()->name();
|
||||
|
||||
assignFxLine(channelIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Assign a specific FX Channel for this track */
|
||||
void InstrumentTrackView::assignFxLine(int channelIndex)
|
||||
{
|
||||
model()->effectChannelModel()->setValue( channelIndex );
|
||||
|
||||
gui->fxMixerView()->setCurrentFxLine( channelIndex );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// TODO: Add windows to free list on freeInstrumentTrackWindow.
|
||||
// But, don't NULL m_window or disconnect signals. This will allow windows
|
||||
// that are being show/hidden frequently to stay connected.
|
||||
|
||||
Reference in New Issue
Block a user