summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-12-28 21:02:31 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-12-28 21:02:31 +0000
commita85e0b0a2edc2df28a9ece5742a97c9790bf45d1 (patch)
treecbf4b0e5f11c95cf2ee52517540cdb49e04f0fe2 /gtk2_ardour
parentc3a52084f8ca0dc93daaf81efb726d051ed47bf6 (diff)
a huge set of changes to tempo+meter handling. testing feedback requested. the_CLA, you know who i mean :)
git-svn-id: svn://localhost/ardour2/branches/3.0@11103 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc6
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc16
-rw-r--r--gtk2_ardour/insert_time_dialog.cc8
-rw-r--r--gtk2_ardour/insert_time_dialog.h1
-rw-r--r--gtk2_ardour/tempo_dialog.cc1
5 files changed, 17 insertions, 15 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 2d6c98b373..5482b265cf 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -1972,7 +1972,7 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
if (!_copy) {
TempoMap& map (_editor->session()->tempo_map());
/* remove the section while we drag it */
- map.remove_meter (section);
+ map.remove_meter (section, true);
}
}
@@ -2090,7 +2090,7 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
if (!_copy) {
TempoMap& map (_editor->session()->tempo_map());
/* remove the section while we drag it */
- map.remove_tempo (section);
+ map.remove_tempo (section, true);
}
}
@@ -2143,7 +2143,7 @@ TempoMarkerDrag::aborted (bool moved)
if (moved) {
TempoMap& map (_editor->session()->tempo_map());
/* we removed it before, so add it back now */
- map.add_tempo (_marker->tempo(), _marker->tempo().frame());
+ map.add_tempo (_marker->tempo(), _marker->tempo().start());
// delete the dummy marker we used for visual representation while moving.
// a new visual marker will show up automatically.
delete _marker;
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 5f9293d4e2..89832c5d13 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -330,9 +330,12 @@ Editor::edit_meter_section (MeterSection* section)
double note_type = meter_dialog.get_note_type ();
+ Timecode::BBT_Time when;
+ meter_dialog.get_bbt_time(when);
+
begin_reversible_command (_("replace tempo mark"));
XMLNode &before = _session->tempo_map().get_state();
- _session->tempo_map().replace_meter (*section, Meter (bpb, note_type));
+ _session->tempo_map().replace_meter (*section, Meter (bpb, note_type), when);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
commit_reversible_command ();
@@ -360,14 +363,9 @@ Editor::edit_tempo_section (TempoSection* section)
tempo_dialog.get_bbt_time(when);
bpm = max (0.01, bpm);
- cerr << "Editing tempo section to be at " << when << endl;
- _session->tempo_map().dump (cerr);
begin_reversible_command (_("replace tempo mark"));
XMLNode &before = _session->tempo_map().get_state();
- _session->tempo_map().replace_tempo (*section, Tempo (bpm,nt));
- _session->tempo_map().dump (cerr);
- _session->tempo_map().move_tempo (*section, when);
- _session->tempo_map().dump (cerr);
+ _session->tempo_map().replace_tempo (*section, Tempo (bpm, nt), when);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command (new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
commit_reversible_command ();
@@ -416,7 +414,7 @@ Editor::real_remove_tempo_marker (TempoSection *section)
{
begin_reversible_command (_("remove tempo mark"));
XMLNode &before = _session->tempo_map().get_state();
- _session->tempo_map().remove_tempo (*section);
+ _session->tempo_map().remove_tempo (*section, true);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
commit_reversible_command ();
@@ -450,7 +448,7 @@ Editor::real_remove_meter_marker (MeterSection *section)
{
begin_reversible_command (_("remove tempo mark"));
XMLNode &before = _session->tempo_map().get_state();
- _session->tempo_map().remove_meter (*section);
+ _session->tempo_map().remove_meter (*section, true);
XMLNode &after = _session->tempo_map().get_state();
_session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
commit_reversible_command ();
diff --git a/gtk2_ardour/insert_time_dialog.cc b/gtk2_ardour/insert_time_dialog.cc
index ae0e9a1f8f..a63d885fdc 100644
--- a/gtk2_ardour/insert_time_dialog.cc
+++ b/gtk2_ardour/insert_time_dialog.cc
@@ -80,8 +80,12 @@ InsertTimeDialog::InsertTimeDialog (PublicEditor& e)
indent->set_padding (0, 0, 12, 0);
indent->add (_move_locked_markers);
get_vbox()->pack_start (*indent);
- _move_tempos.set_label (_("Move tempo and meter changes"));
- get_vbox()->pack_start (_move_tempos);
+ tempo_label.set_markup (_("Move tempo and meter changes\n<i>(may cause oddities in the tempo map)</i>"));
+ HBox* tempo_box = manage (new HBox);
+ tempo_box->set_spacing (6);
+ tempo_box->pack_start (_move_tempos, false, false);
+ tempo_box->pack_start (tempo_label, false, false);
+ get_vbox()->pack_start (*tempo_box);
add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
add_button (_("Insert time"), Gtk::RESPONSE_OK);
diff --git a/gtk2_ardour/insert_time_dialog.h b/gtk2_ardour/insert_time_dialog.h
index 06fbc32b7e..3c365c1f6b 100644
--- a/gtk2_ardour/insert_time_dialog.h
+++ b/gtk2_ardour/insert_time_dialog.h
@@ -47,5 +47,6 @@ private:
Gtk::CheckButton _move_glued_markers;
Gtk::CheckButton _move_locked_markers;
Gtk::CheckButton _move_tempos;
+ Gtk::Label tempo_label;
AudioClock _clock;
};
diff --git a/gtk2_ardour/tempo_dialog.cc b/gtk2_ardour/tempo_dialog.cc
index 0edc098c86..edac3bfbef 100644
--- a/gtk2_ardour/tempo_dialog.cc
+++ b/gtk2_ardour/tempo_dialog.cc
@@ -455,7 +455,6 @@ MeterDialog::get_bbt_time (Timecode::BBT_Time& requested)
}
requested.beats = 1;
-
requested.ticks = 0;
return true;