13
0

skeleton code for global temporal domain change during tempo mapping

This commit is contained in:
Paul Davis 2023-02-23 18:09:43 -07:00
parent 5c69aef56e
commit 1cd1430975
10 changed files with 68 additions and 0 deletions

View File

@ -38,6 +38,8 @@
#include "pbd/stateful.h"
#include "pbd/statefuldestructible.h"
#include "temporal/types.h"
#include "ardour/ardour.h"
#include "ardour/scene_change.h"
#include "ardour/session_handle.h"
@ -169,6 +171,8 @@ public:
Temporal::TimeDomain position_time_domain() const { return _start.time_domain(); }
void set_position_time_domain (Temporal::TimeDomain ps);
void globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to);
class ChangeSuspender {
public:
ChangeSuspender (Location* l) : _l (l) {
@ -292,6 +296,8 @@ public:
void find_all_between (timepos_t const & start, timepos_t const & end, LocationList&, Location::Flags);
void globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to);
PBD::Signal1<void,Location*> current_changed;
/* Objects that care about individual addition and removal of Locations should connect to added/removed.

View File

@ -302,6 +302,8 @@ public:
void set_capture_insertion_in_progress (bool yn);
void globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to);
protected:
friend class Session;

View File

@ -41,6 +41,8 @@
#include "pbd/controllable.h"
#include "pbd/destructible.h"
#include "temporal/types.h"
#include "ardour/ardour.h"
#include "ardour/gain_control.h"
#include "ardour/instrument_info.h"
@ -615,6 +617,8 @@ public:
virtual void use_captured_sources (SourceList& srcs, CaptureInfos const &) {}
void globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to);
protected:
friend class Session;

View File

@ -2374,6 +2374,8 @@ private:
int tb_with_filled_slots;
void handle_slots_empty_status (std::weak_ptr<Route> const &);
void globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to);
};

View File

@ -70,6 +70,8 @@ public:
std::vector<std::shared_ptr<Playlist> > get_unused () const;
uint32_t n_playlists() const;
void globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to);
private:
friend class Session;

View File

@ -763,6 +763,11 @@ Location::set_scene_change (std::shared_ptr<SceneChange> sc)
}
}
void
Location::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to)
{
}
/*---------------------------------------------------------------------- */
Locations::Locations (Session& s)
@ -1716,3 +1721,13 @@ Locations::clear_cue_markers (samplepos_t start, samplepos_t end)
return removed_at_least_one;
}
void
Locations::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to)
{
Glib::Threads::RWLock::WriterLock lm (_lock);
for (auto & l : locations) {
globally_change_time_domain (from, to);
}
}

View File

@ -3506,3 +3506,8 @@ Playlist::time_domain() const
return Temporal::BeatTime;
}
void
Playlist::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to)
{
}

View File

@ -6355,3 +6355,8 @@ Route::tempo_map_changed ()
_triggerbox->tempo_map_changed ();
}
}
void
Route::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to)
{
}

View File

@ -684,3 +684,13 @@ SessionPlaylists::foreach (boost::function<void(std::shared_ptr<const Playlist>)
}
}
}
void
SessionPlaylists::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to)
{
Glib::Threads::Mutex::Lock lm (lock);
for (auto & pl : playlists) {
pl->globally_change_time_domain (from, to);
}
}

View File

@ -32,7 +32,9 @@
#include "pbd/error.h"
#include "pbd/enumwriter.h"
#include "ardour/location.h"
#include "ardour/session.h"
#include "ardour/session_playlists.h"
#include "ardour/tempo.h"
#include "ardour/transport_fsm.h"
@ -296,3 +298,18 @@ Session::any_duration_to_samples (samplepos_t position, AnyTime const & duration
return duration.samples;
}
void
Session::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to)
{
{
std::shared_ptr<RouteList> rl (routes.reader());
for (auto & r : *rl) {
r->globally_change_time_domain (from, to);
}
}
_playlists->globally_change_time_domain (from, to);
_locations->globally_change_time_domain (from, to);
}