Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions include/InstrumentTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class EXPORT InstrumentTrack : public Track, public MidiEventProcessor
{
return &m_baseNoteModel;
}

int baseNote() const;

Piano *pianoModel()
Expand Down Expand Up @@ -207,6 +207,8 @@ class EXPORT InstrumentTrack : public Track, public MidiEventProcessor
return &m_effectChannelModel;
}

void setPreviewMode( const bool );


signals:
void instrumentChanged();
Expand Down Expand Up @@ -242,15 +244,17 @@ protected slots:

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;
Expand Down
1 change: 1 addition & 0 deletions src/core/PresetPreviewPlayHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class PreviewTrackContainer : public TrackContainer
setJournalling( false );
m_previewInstrumentTrack = dynamic_cast<InstrumentTrack *>( Track::create( Track::InstrumentTrack, this ) );
m_previewInstrumentTrack->setJournalling( false );
m_previewInstrumentTrack->setPreviewMode( true );
}

virtual ~PreviewTrackContainer()
Expand Down
18 changes: 15 additions & 3 deletions src/tracks/InstrumentTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) ),
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down