library infrastructure for changing both aspects of audio file format at once

This commit is contained in:
Paul Davis 2024-03-26 10:43:38 -06:00
parent 67b53f27c1
commit 58dba50f3a
3 changed files with 30 additions and 0 deletions

View File

@ -1405,6 +1405,9 @@ public:
void start_domain_bounce (Temporal::DomainBounceInfo&);
void finish_domain_bounce (Temporal::DomainBounceInfo&);
void enable_file_format_reset ();
void disable_file_format_reset ();
protected:
friend class AudioEngine;
void set_block_size (pframes_t nframes);
@ -2415,6 +2418,7 @@ private:
void handle_slots_empty_status (std::weak_ptr<Route> const &);
void time_domain_changed ();
uint32_t _no_file_format_reset;
};

View File

@ -608,6 +608,13 @@ enum HeaderFormat {
FLAC,
};
struct LiveTraxFileFormat {
LiveTraxFileFormat (SampleFormat sff, HeaderFormat hff) : sf (sff), hf (hff) {}
SampleFormat sf;
HeaderFormat hf;
};
struct PeakData {
typedef Sample PeakDatum;

View File

@ -346,6 +346,7 @@ Session::Session (AudioEngine &eng,
, _pending_cue (-1)
, _active_cue (-1)
, tb_with_filled_slots (0)
, _no_file_format_reset (0)
{
_suspend_save.store (0);
_playback_load.store (0);
@ -6092,9 +6093,27 @@ Session::unmark_insert_id (uint32_t id)
}
}
void
Session::enable_file_format_reset ()
{
if (_no_file_format_reset) {
_no_file_format_reset--;
}
}
void
Session::disable_file_format_reset ()
{
_no_file_format_reset++;
}
void
Session::reset_native_file_format ()
{
if (_no_file_format_reset) {
return;
}
std::shared_ptr<RouteList const> rl = routes.reader ();
for (auto const& i : *rl) {