summaryrefslogtreecommitdiff
path: root/libs/ardour/tempo.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-10-25 20:11:42 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-10-25 20:11:42 +0000
commitbcd511aa3fec59e1527c8b7ab80dabda4db1a6f9 (patch)
tree0e704409baaaa22a43b918adc126c76990208f5f /libs/ardour/tempo.cc
parent1b39adc4ce8566fd731cf433094b1faf4fe63205 (diff)
fixes for endemic (compiler?) issues with virtual inheritance of sigc::trackable. NOTE: automation list undo/redo no longer operational, fix to follow
git-svn-id: svn://localhost/ardour2/trunk@1007 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/tempo.cc')
-rw-r--r--libs/ardour/tempo.cc43
1 files changed, 34 insertions, 9 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 913218c91c..e9d46f83e3 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -206,7 +206,9 @@ TempoMap::TempoMap (nframes_t fr)
_frame_rate = fr;
last_bbt_valid = false;
BBT_Time start;
+#ifdef STATE_MANAGER
in_set_state = false;
+#endif
start.bars = 1;
start.beats = 1;
@@ -223,7 +225,9 @@ TempoMap::TempoMap (nframes_t fr)
metrics->push_back (t);
metrics->push_back (m);
+#ifdef STATE_MANAGER
save_state (_("initial"));
+#endif
}
TempoMap::~TempoMap ()
@@ -256,7 +260,9 @@ TempoMap::move_metric_section (MetricSection& section, const BBT_Time& when)
section.set_start (corrected);
metrics->sort (cmp);
timestamp_metrics ();
+#ifdef STATE_MANAGER
save_state (_("move metric"));
+#endif
return 0;
}
@@ -265,7 +271,7 @@ void
TempoMap::move_tempo (TempoSection& tempo, const BBT_Time& when)
{
if (move_metric_section (tempo, when) == 0) {
- send_state_changed (Change (0));
+ StateChanged (Change (0));
}
}
@@ -273,7 +279,7 @@ void
TempoMap::move_meter (MeterSection& meter, const BBT_Time& when)
{
if (move_metric_section (meter, when) == 0) {
- send_state_changed (Change (0));
+ StateChanged (Change (0));
}
}
@@ -301,7 +307,7 @@ TempoMap::remove_tempo (const TempoSection& tempo)
}
if (removed) {
- send_state_changed (Change (0));
+ StateChanged (Change (0));
}
}
@@ -327,12 +333,14 @@ TempoMap::remove_meter (const MeterSection& tempo)
}
if (removed) {
+#ifdef STATE_MANAGER
save_state (_("metric removed"));
+#endif
}
}
if (removed) {
- send_state_changed (Change (0));
+ StateChanged (Change (0));
}
}
@@ -370,10 +378,12 @@ TempoMap::add_tempo (const Tempo& tempo, BBT_Time where)
do_insert (new TempoSection (where, tempo.beats_per_minute()));
+#ifdef STATE_MANAGER
save_state (_("add tempo"));
+#endif
}
- send_state_changed (Change (0));
+ StateChanged (Change (0));
}
void
@@ -399,12 +409,14 @@ TempoMap::replace_tempo (TempoSection& existing, const Tempo& replacement)
}
if (replaced) {
+#ifdef STATE_MANAGER
save_state (_("replace tempo"));
+#endif
}
}
if (replaced) {
- send_state_changed (Change (0));
+ StateChanged (Change (0));
}
}
@@ -432,10 +444,12 @@ TempoMap::add_meter (const Meter& meter, BBT_Time where)
do_insert (new MeterSection (where, meter.beats_per_bar(), meter.note_divisor()));
+#ifdef STATE_MANAGER
save_state (_("add meter"));
+#endif
}
- send_state_changed (Change (0));
+ StateChanged (Change (0));
}
void
@@ -460,12 +474,14 @@ TempoMap::replace_meter (MeterSection& existing, const Meter& replacement)
}
if (replaced) {
+#ifdef STATE_MANAGER
save_state (_("replaced meter"));
+#endif
}
}
if (replaced) {
- send_state_changed (Change (0));
+ StateChanged (Change (0));
}
}
@@ -1266,7 +1282,9 @@ TempoMap::set_state (const XMLNode& node)
XMLNodeConstIterator niter;
Metrics old_metrics (*metrics);
+#ifdef STATE_MANAGER
in_set_state = true;
+#endif
metrics->clear();
@@ -1308,7 +1326,9 @@ TempoMap::set_state (const XMLNode& node)
timestamp_metrics ();
}
+#ifdef STATE_MANAGER
in_set_state = false;
+#endif
}
/* This state needs to be saved. This string will never be a part of the
@@ -1318,9 +1338,12 @@ TempoMap::set_state (const XMLNode& node)
If this state is not saved, there is no way to reach it through undo actions.
*/
+
+#ifdef STATE_MANAGER
save_state(_("load XML data"));
+#endif
- send_state_changed (Change (0));
+ StateChanged (Change (0));
return 0;
}
@@ -1343,6 +1366,7 @@ TempoMap::dump (std::ostream& o) const
}
}
+#ifdef STATE_MANAGER
UndoAction
TempoMap::get_memento () const
{
@@ -1405,3 +1429,4 @@ TempoMap::save_state (std::string why)
StateManager::save_state (why);
}
}
+#endif