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

Remove more global automation from MidiImport #6605

Merged
merged 1 commit into from
Jan 17, 2023
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
6 changes: 5 additions & 1 deletion include/Song.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ class LMMS_EXPORT Song : public TrackContainer


bpm_t getTempo();
AutomationClip * tempoAutomationClip() override;

AutomationTrack * globalAutomationTrack()
{
Expand Down Expand Up @@ -352,6 +351,11 @@ class LMMS_EXPORT Song : public TrackContainer
return m_timeSigModel;
}

IntModel& tempoModel()
{
return m_tempoModel;
}

void exportProjectMidi(QString const & exportFileName) const;

inline void setLoadOnLaunch(bool value) { m_loadOnLaunch = value; }
Expand Down
6 changes: 0 additions & 6 deletions include/TrackContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ class LMMS_EXPORT TrackContainer : public Model, public JournallingObject

void loadSettings( const QDomElement & _this ) override;


virtual AutomationClip * tempoAutomationClip()
{
return nullptr;
}

int countTracks( Track::TrackTypes _tt = Track::NumTrackTypes ) const;


Expand Down
6 changes: 5 additions & 1 deletion plugins/MidiImport/MidiImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ bool MidiImport::readSMF( TrackContainer* tc )
pd.setValue( 2 );

// Tempo stuff
AutomationClip * tap = tc->tempoAutomationClip();
auto tt = dynamic_cast<AutomationTrack*>(Track::create(Track::AutomationTrack, Engine::getSong()));
tt->setName(tr("Tempo"));
auto tap = new AutomationClip(tt);
tap->setDisplayName(tr("Tempo"));
tap->addObject(&Engine::getSong()->tempoModel());
if( tap )
{
tap->clear();
Expand Down
8 changes: 0 additions & 8 deletions src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,14 +837,6 @@ bpm_t Song::getTempo()
}




AutomationClip * Song::tempoAutomationClip()
{
return AutomationClip::globalAutomationClip( &m_tempoModel );
}


AutomatedValueMap Song::automatedValuesAt(TimePos time, int clipNum) const
{
return TrackContainer::automatedValuesFromTracks(TrackList{m_globalAutomationTrack} << tracks(), time, clipNum);
Expand Down