add Evoral::SMF::end_track()

This changes the assumption that an SMF object only refers to
a single track when being written.

::end_track() is used within begin::write()/end_write() pairs to mark the start
of a new SMF track.
This commit is contained in:
Paul Davis 2025-08-18 16:23:01 -06:00 committed by Edgar Aichinger
parent 0126509937
commit a9dc45a620
2 changed files with 11 additions and 1 deletions

View file

@ -548,7 +548,15 @@ SMF::begin_write()
assert(_smf_track);
smf_add_track(_smf, _smf_track);
assert(_smf->number_of_tracks == 1);
}
void
SMF::end_track ()
{
/* nothing to do in libsmf API to "close" the track, it seems */
_smf_track = smf_track_new();
assert (_smf_track);
smf_add_track(_smf, _smf_track);
}
void

View file

@ -168,6 +168,8 @@ public:
bool _has_pgm_change;
int _num_channels;
UsedChannels _used_channels;
void end_track ();
};
}; /* namespace Evoral */