Fixed #3182. Always using master channel for preset previews. (#3503)

* Fixed #3182. Always using master channel for preset previews.
This commit is contained in:
Karmo Rosental
2017-04-16 15:57:06 +03:00
committed by Tres Finocchiaro
parent 09c9ccb34d
commit 2df56829a3
3 changed files with 23 additions and 6 deletions

View File

@@ -166,7 +166,7 @@ public:
{
return &m_baseNoteModel;
}
int baseNote() const;
Piano *pianoModel()
@@ -207,6 +207,8 @@ public:
return &m_effectChannelModel;
}
void setPreviewMode( const bool );
signals:
void instrumentChanged();
@@ -242,15 +244,17 @@ private:
bool m_silentBuffersProcessed;
bool m_previewMode;
IntModel m_baseNoteModel;
NotePlayHandleList m_processHandles;
FloatModel m_volumeModel;
FloatModel m_panningModel;
AudioPort m_audioPort;
FloatModel m_pitchModel;
IntModel m_pitchRangeModel;
IntModel m_effectChannelModel;

View File

@@ -47,6 +47,7 @@ public:
setJournalling( false );
m_previewInstrumentTrack = dynamic_cast<InstrumentTrack *>( Track::create( Track::InstrumentTrack, this ) );
m_previewInstrumentTrack->setJournalling( false );
m_previewInstrumentTrack->setPreviewMode( true );
}
virtual ~PreviewTrackContainer()

View File

@@ -95,6 +95,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
m_notes(),
m_sustainPedalPressed( false ),
m_silentBuffersProcessed( false ),
m_previewMode( false ),
m_baseNoteModel( 0, 0, KeysPerOctave * NumOctaves - 1, this,
tr( "Base note" ) ),
m_volumeModel( DefaultVolume, MinVolume, MaxVolume, 0.1f, this, tr( "Volume" ) ),
@@ -724,7 +725,10 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement
m_pitchRangeModel.loadSettings( thisElement, "pitchrange" );
m_pitchModel.loadSettings( thisElement, "pitch" );
m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1 );
m_effectChannelModel.loadSettings( thisElement, "fxch" );
if ( !m_previewMode )
{
m_effectChannelModel.loadSettings( thisElement, "fxch" );
}
m_baseNoteModel.loadSettings( thisElement, "basenote" );
m_useMasterPitchModel.loadSettings( thisElement, "usemasterpitch");
@@ -791,6 +795,14 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement
void InstrumentTrack::setPreviewMode( const bool value )
{
m_previewMode = value;
}
Instrument * InstrumentTrack::loadInstrument( const QString & _plugin_name )
{
silenceAllNotes( true );
@@ -1774,7 +1786,7 @@ void InstrumentTrackWindow::viewInstrumentInDirection(int d)
idxOfNext = (idxOfNext + d + trackViews.size()) % trackViews.size();
newView = dynamic_cast<InstrumentTrackView*>(trackViews[idxOfNext]);
// the window that should be brought to focus is the FIRST InstrumentTrackView that comes after us
if (bringToFront == nullptr && newView != nullptr)
if (bringToFront == nullptr && newView != nullptr)
{
bringToFront = newView;
}
@@ -1791,7 +1803,7 @@ void InstrumentTrackWindow::viewInstrumentInDirection(int d)
// save current window pos and then hide the window by unchecking its button in the track list
QPoint curPos = parentWidget()->pos();
m_itv->m_tlb->setChecked(false);
// enable the new window by checking its track list button & moving it to where our window just was
newView->m_tlb->setChecked(true);
newView->getInstrumentTrackWindow()->parentWidget()->move(curPos);