Compare commits
2 Commits
master
...
tempo-map-
Author | SHA1 | Date |
---|---|---|
Robin Gareus | 991ab1f8f8 | |
Robin Gareus | c437d6f886 |
|
@ -1662,9 +1662,9 @@ Editor::toggle_tempo_type ()
|
||||||
|
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("change tempo type"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("change tempo type"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1696,9 +1696,9 @@ Editor::toggle_tempo_continues ()
|
||||||
|
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("change tempo clamp"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("change tempo clamp"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1729,9 +1729,9 @@ Editor::ramp_to_next_tempo ()
|
||||||
|
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("changed tempo ramp"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("changed tempo ramp"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -7462,9 +7462,9 @@ Editor::define_one_bar (timepos_t const & start, timepos_t const & end)
|
||||||
XMLNode& after (tmap->get_state());
|
XMLNode& after (tmap->get_state());
|
||||||
|
|
||||||
_session->add_command (new Temporal::TempoCommand (_("set tempo from range"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("set tempo from range"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -490,9 +490,8 @@ Editor::mouse_add_new_tempo_event (timepos_t pos)
|
||||||
map->set_tempo (map->tempo_at (pos), pos);
|
map->set_tempo (map->tempo_at (pos), pos);
|
||||||
XMLNode &after = map->get_state();
|
XMLNode &after = map->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("add tempo"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("add tempo"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (map);
|
TempoMap::update (map);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
//map.dump (cerr);
|
//map.dump (cerr);
|
||||||
|
@ -533,9 +532,9 @@ Editor::mouse_add_new_meter_event (timepos_t pos)
|
||||||
map->set_meter (Meter (bpb, note_type), pos);
|
map->set_meter (Meter (bpb, note_type), pos);
|
||||||
|
|
||||||
_session->add_command (new Temporal::TempoCommand (_("add time signature"), &before, &map->get_state()));
|
_session->add_command (new Temporal::TempoCommand (_("add time signature"), &before, &map->get_state()));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (map);
|
TempoMap::update (map);
|
||||||
|
commit_reversible_command ();
|
||||||
|
|
||||||
//map.dump (cerr);
|
//map.dump (cerr);
|
||||||
}
|
}
|
||||||
|
@ -579,9 +578,9 @@ Editor::mouse_add_bbt_marker_event (timepos_t pos)
|
||||||
map->set_bartime (bbt, marker_dialog.position(), name);
|
map->set_bartime (bbt, marker_dialog.position(), name);
|
||||||
|
|
||||||
_session->add_command (new Temporal::TempoCommand (_("add BBT marker"), &before, &map->get_state()));
|
_session->add_command (new Temporal::TempoCommand (_("add BBT marker"), &before, &map->get_state()));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (map);
|
TempoMap::update (map);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -657,9 +656,9 @@ Editor::edit_meter_section (Temporal::MeterPoint& section)
|
||||||
|
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("edit time signature"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("edit time signature"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -693,9 +692,9 @@ Editor::edit_bbt (MusicTimePoint& point)
|
||||||
|
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("edit tempo"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("edit tempo"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -730,9 +729,9 @@ Editor::edit_tempo_section (TempoPoint& section)
|
||||||
|
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("edit tempo"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("edit tempo"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -762,9 +761,9 @@ Editor::real_remove_bbt_marker (MusicTimePoint const * point)
|
||||||
tmap->remove_bartime (*point);
|
tmap->remove_bartime (*point);
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("remove BBT marker"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("remove BBT marker"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -778,10 +777,8 @@ Editor::real_remove_tempo_marker (TempoPoint const * section)
|
||||||
tmap->remove_tempo (*section);
|
tmap->remove_tempo (*section);
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("remove tempo change"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("remove tempo change"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -815,9 +812,8 @@ Editor::real_remove_meter_marker (Temporal::MeterPoint const * section)
|
||||||
tmap->remove_meter (*section);
|
tmap->remove_meter (*section);
|
||||||
XMLNode &after = tmap->get_state();
|
XMLNode &after = tmap->get_state();
|
||||||
_session->add_command (new Temporal::TempoCommand (_("remove time signature change"), &before, &after));
|
_session->add_command (new Temporal::TempoCommand (_("remove time signature change"), &before, &after));
|
||||||
commit_reversible_command ();
|
|
||||||
|
|
||||||
TempoMap::update (tmap);
|
TempoMap::update (tmap);
|
||||||
|
commit_reversible_command ();
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -292,9 +292,6 @@ AudioEngine::process_callback (pframes_t nframes)
|
||||||
Temporal::TempoMap::WritableSharedPtr current_map = Temporal::TempoMap::read ();
|
Temporal::TempoMap::WritableSharedPtr current_map = Temporal::TempoMap::read ();
|
||||||
if (current_map != Temporal::TempoMap::use()) {
|
if (current_map != Temporal::TempoMap::use()) {
|
||||||
Temporal::TempoMap::set (current_map);
|
Temporal::TempoMap::set (current_map);
|
||||||
if (_session) {
|
|
||||||
_session->tempo_map_changed ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is for JACK, where the latency callback arrives in sync with
|
/* This is for JACK, where the latency callback arrives in sync with
|
||||||
|
|
|
@ -502,6 +502,8 @@ Session::Session (AudioEngine &eng,
|
||||||
|
|
||||||
IOPluginsChanged.connect_same_thread (*this, boost::bind (&Session::resort_io_plugs, this));
|
IOPluginsChanged.connect_same_thread (*this, boost::bind (&Session::resort_io_plugs, this));
|
||||||
|
|
||||||
|
TempoMap::MapChanged.connect_same_thread (*this, boost::bind (&Session::tempo_map_changed, this));
|
||||||
|
|
||||||
emit_thread_start ();
|
emit_thread_start ();
|
||||||
auto_connect_thread_start ();
|
auto_connect_thread_start ();
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,11 @@ function factory () return function ()
|
||||||
tm:set_tempo (Temporal.Tempo (140, 120, 4), Temporal.timepos_t (0))
|
tm:set_tempo (Temporal.Tempo (140, 120, 4), Temporal.timepos_t (0))
|
||||||
tm:set_tempo (Temporal.Tempo (120, 80, 4), Temporal.timepos_t.from_ticks (Temporal.ticks_per_beat * 4))
|
tm:set_tempo (Temporal.Tempo (120, 80, 4), Temporal.timepos_t.from_ticks (Temporal.ticks_per_beat * 4))
|
||||||
tm:set_tempo (Temporal.Tempo (80, 80, 4), Temporal.timepos_t.from_ticks (Temporal.ticks_per_beat * 4))
|
tm:set_tempo (Temporal.Tempo (80, 80, 4), Temporal.timepos_t.from_ticks (Temporal.ticks_per_beat * 4))
|
||||||
|
Session:begin_reversible_command ("Change Tempo Map")
|
||||||
Temporal.TempoMap.update (tm)
|
Temporal.TempoMap.update (tm)
|
||||||
|
if not Session:abort_empty_reversible_command () then
|
||||||
|
Session:commit_reversible_command (nil)
|
||||||
|
end
|
||||||
tm = nil
|
tm = nil
|
||||||
|
|
||||||
-- Abort Edit example
|
-- Abort Edit example
|
||||||
|
|
Loading…
Reference in New Issue