Skip to content

Commit

Permalink
Remove more global automation from MidiImport (#6605)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong authored Jan 17, 2023
1 parent 679d632 commit e8e54a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
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

0 comments on commit e8e54a7

Please sign in to comment.