mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
API development for time domain flipping (GUI edition)
This commit is contained in:
parent
d513653912
commit
d25a615e20
4 changed files with 43 additions and 3 deletions
|
|
@ -1742,6 +1742,9 @@ private:
|
||||||
void mid_tempo_per_region_update (RegionView*);
|
void mid_tempo_per_region_update (RegionView*);
|
||||||
bool ignore_map_change;
|
bool ignore_map_change;
|
||||||
|
|
||||||
|
Temporal::TempoMap::WritableSharedPtr begin_tempo_mapping ();
|
||||||
|
void abort_tempo_mapping ();
|
||||||
|
|
||||||
enum MidTempoChanges {
|
enum MidTempoChanges {
|
||||||
TempoChanged = 0x1,
|
TempoChanged = 0x1,
|
||||||
MeterChanged = 0x2,
|
MeterChanged = 0x2,
|
||||||
|
|
@ -1752,6 +1755,7 @@ private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _commit_tempo_map_edit (Temporal::TempoMap::WritableSharedPtr&, bool with_update = false);
|
void _commit_tempo_map_edit (Temporal::TempoMap::WritableSharedPtr&, bool with_update = false);
|
||||||
|
void _commit_tempo_mapping (Temporal::TempoMap::WritableSharedPtr&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class DragManager;
|
friend class DragManager;
|
||||||
|
|
|
||||||
|
|
@ -3633,7 +3633,8 @@ TempoTwistDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||||
{
|
{
|
||||||
Drag::start_grab (event, cursor);
|
Drag::start_grab (event, cursor);
|
||||||
|
|
||||||
map = _editor->begin_tempo_map_edit ();
|
map = _editor->begin_tempo_mapping ();
|
||||||
|
|
||||||
/* Get the tempo point that starts this section */
|
/* Get the tempo point that starts this section */
|
||||||
|
|
||||||
_tempo = const_cast<TempoPoint*> (&map->tempo_at (raw_grab_time()));
|
_tempo = const_cast<TempoPoint*> (&map->tempo_at (raw_grab_time()));
|
||||||
|
|
@ -3714,13 +3715,13 @@ TempoTwistDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||||
_editor->session()->add_command (new Temporal::TempoCommand (_("twist tempo"), _before_state, &after));
|
_editor->session()->add_command (new Temporal::TempoCommand (_("twist tempo"), _before_state, &after));
|
||||||
_editor->commit_reversible_command ();
|
_editor->commit_reversible_command ();
|
||||||
|
|
||||||
_editor->commit_tempo_map_edit (map);
|
_editor->commit_tempo_mapping (map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TempoTwistDrag::aborted (bool moved)
|
TempoTwistDrag::aborted (bool moved)
|
||||||
{
|
{
|
||||||
_editor->abort_tempo_map_edit ();
|
_editor->abort_tempo_mapping ();
|
||||||
}
|
}
|
||||||
|
|
||||||
TempoEndDrag::TempoEndDrag (Editor* e, ArdourCanvas::Item* i)
|
TempoEndDrag::TempoEndDrag (Editor* e, ArdourCanvas::Item* i)
|
||||||
|
|
|
||||||
|
|
@ -754,6 +754,34 @@ Editor::real_remove_meter_marker (Temporal::MeterPoint const * section)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Temporal::TempoMap::WritableSharedPtr
|
||||||
|
Editor::begin_tempo_mapping ()
|
||||||
|
{
|
||||||
|
TempoMap::WritableSharedPtr wmap = TempoMap::fetch_writable ();
|
||||||
|
reassociate_metric_markers (wmap);
|
||||||
|
(void) Temporal::DomainSwapInformation::start (Temporal::BeatTime);
|
||||||
|
_session->globally_change_time_domain (Temporal::BeatTime, Temporal::AudioTime);
|
||||||
|
return wmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::abort_tempo_mapping ()
|
||||||
|
{
|
||||||
|
delete domain_swap; /* undo the domain swap */
|
||||||
|
domain_swap = 0;
|
||||||
|
|
||||||
|
TempoMap::SharedPtr tmap (TempoMap::fetch());
|
||||||
|
reassociate_metric_markers (tmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::_commit_tempo_mapping (TempoMap::WritableSharedPtr& new_map)
|
||||||
|
{
|
||||||
|
TempoMap::update (new_map);
|
||||||
|
abort_tempo_mapping ();
|
||||||
|
}
|
||||||
|
|
||||||
Temporal::TempoMap::WritableSharedPtr
|
Temporal::TempoMap::WritableSharedPtr
|
||||||
Editor::begin_tempo_map_edit ()
|
Editor::begin_tempo_map_edit ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -520,6 +520,12 @@ public:
|
||||||
_commit_tempo_map_edit (map, with_update);
|
_commit_tempo_map_edit (map, with_update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual Temporal::TempoMap::WritableSharedPtr begin_tempo_mapping () = 0;
|
||||||
|
virtual void abort_tempo_mapping () = 0;
|
||||||
|
void commit_tempo_mapping (Temporal::TempoMap::WritableSharedPtr& map) {
|
||||||
|
_commit_tempo_mapping (map);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void access_action (const std::string&, const std::string&) = 0;
|
virtual void access_action (const std::string&, const std::string&) = 0;
|
||||||
virtual void set_toggleaction (const std::string&, const std::string&, bool) = 0;
|
virtual void set_toggleaction (const std::string&, const std::string&, bool) = 0;
|
||||||
|
|
||||||
|
|
@ -584,6 +590,7 @@ protected:
|
||||||
virtual void suspend_route_redisplay () = 0;
|
virtual void suspend_route_redisplay () = 0;
|
||||||
virtual void resume_route_redisplay () = 0;
|
virtual void resume_route_redisplay () = 0;
|
||||||
virtual void _commit_tempo_map_edit (Temporal::TempoMap::WritableSharedPtr&, bool with_update) = 0;
|
virtual void _commit_tempo_map_edit (Temporal::TempoMap::WritableSharedPtr&, bool with_update) = 0;
|
||||||
|
virtual void _commit_tempo_mapping (Temporal::TempoMap::WritableSharedPtr&) = 0;
|
||||||
|
|
||||||
std::atomic<int> _suspend_route_redisplay_counter;
|
std::atomic<int> _suspend_route_redisplay_counter;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue