more changes to wscript files to catch up with waf 1.6 and fix OS X issues
[ardour.git] / gtk2_ardour / tempo_dialog.cc
index 93cb5fcf01432dc5112ae8e3ade954e283c0abfb..cca9e6f7c5a3fc6e2602697a272e45bd6f651f94 100644 (file)
@@ -33,16 +33,16 @@ using namespace Gtkmm2ext;
 using namespace ARDOUR;
 using namespace PBD;
 
-TempoDialog::TempoDialog (TempoMap& map, nframes_t frame, const string & action)
-       : ArdourDialog (_("edit tempo")),
-         bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0, 1.0),
+TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string & action)
+       : ArdourDialog (_("New Tempo")),
+         bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0),
          bpm_spinner (bpm_adjustment),
          ok_button (action),
          cancel_button (_("Cancel")),
          when_bar_label (_("bar:"), ALIGN_LEFT, ALIGN_CENTER),
          when_beat_label (_("beat:"), ALIGN_LEFT, ALIGN_CENTER)
 {
-       BBT_Time when;
+       Timecode::BBT_Time when;
        Tempo tempo (map.tempo_at (frame));
        map.bbt_time (frame, when);
 
@@ -50,8 +50,8 @@ TempoDialog::TempoDialog (TempoMap& map, nframes_t frame, const string & action)
 }
 
 TempoDialog::TempoDialog (TempoSection& section, const string & action)
-       : ArdourDialog ("tempo dialog"),
-         bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0, 1.0),
+       : ArdourDialog ("Edit Tempo"),
+         bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0),
          bpm_spinner (bpm_adjustment),
          ok_button (action),
          cancel_button (_("Cancel")),
@@ -62,7 +62,7 @@ TempoDialog::TempoDialog (TempoSection& section, const string & action)
 }
 
 void
-TempoDialog::init (const BBT_Time& when, double bpm, double note_type, bool movable)
+TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, bool movable)
 {
        bpm_spinner.set_numeric (true);
        bpm_spinner.set_digits (2);
@@ -142,6 +142,7 @@ TempoDialog::init (const BBT_Time& when, double bpm, double note_type, bool mova
        bpm_spinner.signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &TempoDialog::response), RESPONSE_ACCEPT));
        bpm_spinner.signal_button_press_event().connect (sigc::mem_fun (*this, &TempoDialog::bpm_button_press), false);
        bpm_spinner.signal_button_release_event().connect (sigc::mem_fun (*this, &TempoDialog::bpm_button_release), false);
+       bpm_spinner.signal_changed().connect (sigc::mem_fun (*this, &TempoDialog::bpm_changed));
        when_bar_entry.signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &TempoDialog::response), RESPONSE_ACCEPT));
        when_bar_entry.signal_key_release_event().connect (sigc::mem_fun (*this, &TempoDialog::entry_key_release), false);
        when_beat_entry.signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &TempoDialog::response), RESPONSE_ACCEPT));
@@ -149,6 +150,12 @@ TempoDialog::init (const BBT_Time& when, double bpm, double note_type, bool mova
        note_types.signal_changed().connect (sigc::mem_fun (*this, &TempoDialog::note_types_change));
 }
 
+void
+TempoDialog::bpm_changed ()
+{
+       set_response_sensitive (RESPONSE_ACCEPT, true);
+}
+
 bool
 TempoDialog::bpm_button_press (GdkEventButton*)
 {
@@ -182,7 +189,7 @@ TempoDialog::get_bpm ()
 }
 
 bool
-TempoDialog::get_bbt_time (BBT_Time& requested)
+TempoDialog::get_bbt_time (Timecode::BBT_Time& requested)
 {
        if (sscanf (when_bar_entry.get_text().c_str(), "%" PRIu32, &requested.bars) != 1) {
                return false;
@@ -232,12 +239,12 @@ TempoDialog::note_types_change ()
 }
 
 
-MeterDialog::MeterDialog (TempoMap& map, nframes_t frame, const string & action)
-       : ArdourDialog ("meter dialog"),
+MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string & action)
+       : ArdourDialog ("New Meter"),
          ok_button (action),
          cancel_button (_("Cancel"))
 {
-       BBT_Time when;
+       Timecode::BBT_Time when;
        frame = map.round_to_bar(frame,0);
        Meter meter (map.meter_at(frame));
 
@@ -246,7 +253,7 @@ MeterDialog::MeterDialog (TempoMap& map, nframes_t frame, const string & action)
 }
 
 MeterDialog::MeterDialog (MeterSection& section, const string & action)
-       : ArdourDialog ("meter dialog"),
+       : ArdourDialog ("Edit Meter"),
          ok_button (action),
          cancel_button (_("Cancel"))
 {
@@ -254,7 +261,7 @@ MeterDialog::MeterDialog (MeterSection& section, const string & action)
 }
 
 void
-MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool movable)
+MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double note_type, bool movable)
 {
        snprintf (buf, sizeof (buf), "%.2f", bpb);
        bpb_entry.set_text (buf);
@@ -440,9 +447,8 @@ MeterDialog::get_note_type ()
 }
 
 bool
-MeterDialog::get_bbt_time (BBT_Time& requested)
+MeterDialog::get_bbt_time (Timecode::BBT_Time& requested)
 {
-
        if (sscanf (when_bar_entry.get_text().c_str(), "%" PRIu32, &requested.bars) != 1) {
                return false;
        }