libardour: infrastructure for notifying routes of tempo map change

The call to the Session is made before we call ::process(), from the
AudioEngine. Currently, only MIDI triggers care about this.
This commit is contained in:
Paul Davis 2022-09-30 17:21:43 -06:00
parent 173de9f0ef
commit 4f7c1aba24
4 changed files with 22 additions and 0 deletions

View File

@ -208,6 +208,7 @@ public:
DiskIOPoint disk_io_point() const { return _disk_io_point; }
void stop_triggers (bool now);
void tempo_map_changed();
/* Processors */

View File

@ -368,6 +368,7 @@ public:
template<class A> void foreach_track (void (Track::*method)(A), A arg);
template<class A1, class A2> void foreach_track (void (Track::*method)(A1, A2), A1 arg1, A2 arg2);
void foreach_route (void (Route::*method)());
template<class A> void foreach_route (void (Route::*method)(A), A arg);
template<class A1, class A2> void foreach_route (void (Route::*method)(A1, A2), A1 arg1, A2 arg2);

View File

@ -6506,3 +6506,11 @@ Route::monitoring_state () const
abort(); /* NOTREACHED */
return MonitoringSilence;
}
void
Route::tempo_map_changed ()
{
if (_triggerbox) {
_triggerbox->tempo_map_changed ();
}
}

View File

@ -106,6 +106,7 @@
#include "ardour/revision.h"
#include "ardour/route_group.h"
#include "ardour/rt_tasklist.h"
#include "ardour/rt_safe_delete.h"
#include "ardour/silentfilesource.h"
#include "ardour/send.h"
@ -5536,6 +5537,8 @@ Session::tempo_map_changed ()
clear_clicks ();
sync_cues ();
foreach_route (&Route::tempo_map_changed);
_playlists->update_after_tempo_map_change ();
set_dirty ();
@ -7591,3 +7594,12 @@ Session::ProcessorChangeBlocker::~ProcessorChangeBlocker ()
}
}
}
void
Session::foreach_route (void (Route::*method)())
{
for (auto & r : *(routes.reader())) {
((r.get())->*method) ();
}
}