projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add [hidden] option to list "Dummy" backend with optmized bundles
[ardour.git]
/
gtk2_ardour
/
tempo_dialog.cc
diff --git
a/gtk2_ardour/tempo_dialog.cc
b/gtk2_ardour/tempo_dialog.cc
index 5d06f5ca3c118c1ea4ee6d39bf8a5180d4dc8571..c28dfaf2194c4222300db562b525b114057fe194 100644
(file)
--- a/
gtk2_ardour/tempo_dialog.cc
+++ b/
gtk2_ardour/tempo_dialog.cc
@@
-26,7
+26,7
@@
#include "tempo_dialog.h"
#include "ui_config.h"
#include "tempo_dialog.h"
#include "ui_config.h"
-#include "i18n.h"
+#include "
pbd/
i18n.h"
using namespace std;
using namespace Gtk;
using namespace std;
using namespace Gtk;
@@
-36,6
+36,8
@@
using namespace PBD;
TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string&)
: ArdourDialog (_("New Tempo"))
TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string&)
: ArdourDialog (_("New Tempo"))
+ , _map (&map)
+ , _section (0)
, bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0)
, bpm_spinner (bpm_adjustment)
, when_bar_label (_("bar:"), ALIGN_LEFT, ALIGN_CENTER)
, bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0)
, bpm_spinner (bpm_adjustment)
, when_bar_label (_("bar:"), ALIGN_LEFT, ALIGN_CENTER)
@@
-43,15
+45,16
@@
TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string&)
, pulse_selector_label (_("Pulse note"), ALIGN_LEFT, ALIGN_CENTER)
, tap_tempo_button (_("Tap tempo"))
{
, pulse_selector_label (_("Pulse note"), ALIGN_LEFT, ALIGN_CENTER)
, tap_tempo_button (_("Tap tempo"))
{
- Timecode::BBT_Time when;
- Tempo tempo (map.tempo_at (frame));
- map.bbt_time (frame, when);
+ Tempo tempo (map.tempo_at_frame (frame));
+ Timecode::BBT_Time when (map.bbt_at_frame (frame));
- init (when, tempo.
beats_per_minute(), tempo.note_type(), TempoSection::Constant, true, PositionLockStyle::
MusicTime);
+ init (when, tempo.
note_types_per_minute(), tempo.note_type(), TempoSection::Constant, true,
MusicTime);
}
TempoDialog::TempoDialog (TempoMap& map, TempoSection& section, const string&)
: ArdourDialog (_("Edit Tempo"))
}
TempoDialog::TempoDialog (TempoMap& map, TempoSection& section, const string&)
: ArdourDialog (_("Edit Tempo"))
+ , _map (&map)
+ , _section (§ion)
, bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0)
, bpm_spinner (bpm_adjustment)
, when_bar_label (_("bar:"), ALIGN_LEFT, ALIGN_CENTER)
, bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0)
, bpm_spinner (bpm_adjustment)
, when_bar_label (_("bar:"), ALIGN_LEFT, ALIGN_CENTER)
@@
-59,9
+62,8
@@
TempoDialog::TempoDialog (TempoMap& map, TempoSection& section, const string&)
, pulse_selector_label (_("Pulse note"), ALIGN_LEFT, ALIGN_CENTER)
, tap_tempo_button (_("Tap tempo"))
{
, pulse_selector_label (_("Pulse note"), ALIGN_LEFT, ALIGN_CENTER)
, tap_tempo_button (_("Tap tempo"))
{
- Timecode::BBT_Time when;
- map.bbt_time (map.frame_at_beat (section.beat()), when);
- init (when, section.beats_per_minute(), section.note_type(), section.type(), section.movable(), section.position_lock_style());
+ Timecode::BBT_Time when (map.bbt_at_frame (section.frame()));
+ init (when, section.note_types_per_minute(), section.note_type(), section.type(), section.movable(), section.position_lock_style());
}
void
}
void
@@
-128,9
+130,9
@@
TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type,
strings.clear();
strings.clear();
- lock_styles.insert (make_pair (_("music"),
PositionLockStyle::
MusicTime));
+ lock_styles.insert (make_pair (_("music"), MusicTime));
strings.push_back (_("music"));
strings.push_back (_("music"));
- lock_styles.insert (make_pair (_("audio"),
PositionLockStyle::
AudioTime));
+ lock_styles.insert (make_pair (_("audio"), AudioTime));
strings.push_back (_("audio"));
set_popdown_strings (lock_style, strings);
LockStyles::iterator ls;
strings.push_back (_("audio"));
set_popdown_strings (lock_style, strings);
LockStyles::iterator ls;
@@
-192,17
+194,24
@@
TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type,
Label* when_label = manage (new Label(_("Tempo begins at"), ALIGN_LEFT, ALIGN_CENTER));
table->attach (*when_label, 0, 1, row, row+1);
Label* when_label = manage (new Label(_("Tempo begins at"), ALIGN_LEFT, ALIGN_CENTER));
table->attach (*when_label, 0, 1, row, row+1);
+
+ ++row;
+ ++row;
+
+ Label* lock_style_label = manage (new Label(_("Lock Style:"), ALIGN_LEFT, ALIGN_CENTER));
+ table->attach (*lock_style_label, 0, 1, row, row + 1);
+ table->attach (lock_style, 1, 5, row, row + 1);
+
+ --row;
}
}
+
Label* tempo_type_label = manage (new Label(_("Tempo Type:"), ALIGN_LEFT, ALIGN_CENTER));
Label* tempo_type_label = manage (new Label(_("Tempo Type:"), ALIGN_LEFT, ALIGN_CENTER));
- table->attach (*tempo_type_label, 0, 1, row
+1, row+2
);
- table->attach (tempo_type, 1,
2, row+1, row + 2
);
- get_vbox()->set_border_width (12);
-
get_vbox()->pack_end (*table)
;
+ table->attach (*tempo_type_label, 0, 1, row
, row + 1
);
+ table->attach (tempo_type, 1,
5, row, row + 1
);
+
+
++row
;
- Label* lock_style_label = manage (new Label(_("Lock Style:"), ALIGN_LEFT, ALIGN_CENTER));
- table->attach (*lock_style_label, 0, 1, row+2, row+3);
- table->attach (lock_style, 1, 2, row+2, row + 3);
get_vbox()->set_border_width (12);
get_vbox()->pack_end (*table);
get_vbox()->set_border_width (12);
get_vbox()->pack_end (*table);
@@
-269,7
+278,15
@@
TempoDialog::bpm_button_release (GdkEventButton*)
bool
TempoDialog::entry_key_release (GdkEventKey*)
{
bool
TempoDialog::entry_key_release (GdkEventKey*)
{
- set_response_sensitive (RESPONSE_ACCEPT, is_user_input_valid());
+ Timecode::BBT_Time bbt;
+ get_bbt_time (bbt);
+
+ if (_section && is_user_input_valid()) {
+ set_response_sensitive (RESPONSE_ACCEPT, _map->can_solve_bbt (_section, bbt));
+ } else {
+ set_response_sensitive (RESPONSE_ACCEPT, is_user_input_valid());
+ }
+
return false;
}
return false;
}
@@
-328,7
+345,7
@@
TempoDialog::get_lock_style ()
if (x == lock_styles.end()) {
error << string_compose(_("incomprehensible lock style (%1)"), lock_style.get_active_text()) << endmsg;
if (x == lock_styles.end()) {
error << string_compose(_("incomprehensible lock style (%1)"), lock_style.get_active_text()) << endmsg;
- return
PositionLockStyle::
MusicTime;
+ return MusicTime;
}
return x->second;
}
return x->second;
@@
-401,19
+418,18
@@
TempoDialog::tap_tempo_focus_out (GdkEventFocus* )
MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string&)
: ArdourDialog (_("New Meter"))
{
MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string&)
: ArdourDialog (_("New Meter"))
{
- Timecode::BBT_Time when;
frame = map.round_to_bar(frame, RoundNearest);
frame = map.round_to_bar(frame, RoundNearest);
- Meter meter (map.meter_at(frame));
+ Timecode::BBT_Time when (map.bbt_at_frame (frame));
+ Meter meter (map.meter_at_frame (frame));
- map.bbt_time (frame, when);
- init (when, meter.divisions_per_bar(), meter.note_divisor(), true, PositionLockStyle::MusicTime);
+ init (when, meter.divisions_per_bar(), meter.note_divisor(), true, MusicTime);
}
MeterDialog::MeterDialog (TempoMap& map, MeterSection& section, const string&)
: ArdourDialog (_("Edit Meter"))
{
}
MeterDialog::MeterDialog (TempoMap& map, MeterSection& section, const string&)
: ArdourDialog (_("Edit Meter"))
{
- Timecode::BBT_Time when;
- map.bbt_time (map.frame_at_beat (section.beat()), when);
+ Timecode::BBT_Time when
(map.bbt_at_frame (section.frame()))
;
+
init (when, section.divisions_per_bar(), section.note_divisor(), section.movable(), section.position_lock_style());
}
init (when, section.divisions_per_bar(), section.note_divisor(), section.movable(), section.position_lock_style());
}
@@
-463,9
+479,9
@@
MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double divisor, b
strings.clear();
strings.clear();
- lock_styles.insert (make_pair (_("music"),
PositionLockStyle::
MusicTime));
+ lock_styles.insert (make_pair (_("music"), MusicTime));
strings.push_back (_("music"));
strings.push_back (_("music"));
- lock_styles.insert (make_pair (_("audio"),
PositionLockStyle::
AudioTime));
+ lock_styles.insert (make_pair (_("audio"), AudioTime));
strings.push_back (_("audio"));
set_popdown_strings (lock_style, strings);
LockStyles::iterator ls;
strings.push_back (_("audio"));
set_popdown_strings (lock_style, strings);
LockStyles::iterator ls;
@@
-502,9
+518,6
@@
MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double divisor, b
table->attach (*lock_label, 0, 1, 3, 4, FILL|EXPAND, FILL|EXPAND);
table->attach (lock_style, 1, 2, 3, 4, FILL|EXPAND, SHRINK);
table->attach (*lock_label, 0, 1, 3, 4, FILL|EXPAND, FILL|EXPAND);
table->attach (lock_style, 1, 2, 3, 4, FILL|EXPAND, SHRINK);
- } else {
- table->attach (*lock_label, 0, 1, 2, 3, FILL|EXPAND, FILL|EXPAND);
- table->attach (lock_style, 1, 2, 2, 3, FILL|EXPAND, SHRINK);
}
get_vbox()->set_border_width (12);
}
get_vbox()->set_border_width (12);
@@
-636,7
+649,7
@@
MeterDialog::get_lock_style ()
if (x == lock_styles.end()) {
error << string_compose(_("incomprehensible meter lock style (%1)"), lock_style.get_active_text()) << endmsg;
if (x == lock_styles.end()) {
error << string_compose(_("incomprehensible meter lock style (%1)"), lock_style.get_active_text()) << endmsg;
- return
PositionLockStyle::
MusicTime;
+ return MusicTime;
}
return x->second;
}
return x->second;