tempo/meter edits: no position fields if marker is part of a BBT marker
This commit is contained in:
parent
f9e1357fed
commit
16dfb95617
|
@ -608,6 +608,20 @@ Editor::edit_meter_section (Temporal::MeterPoint& section)
|
||||||
|
|
||||||
Temporal::Beats new_pos;
|
Temporal::Beats new_pos;
|
||||||
|
|
||||||
|
MusicTimePoint* mtp;
|
||||||
|
|
||||||
|
if ((mtp = dynamic_cast<Temporal::MusicTimePoint*> (§ion))) {
|
||||||
|
|
||||||
|
/* ignore positional changes, that must be done via the MTP */
|
||||||
|
const Temporal::MeterPoint mp (meter, *mtp);
|
||||||
|
MusicTimePoint replacement (*mtp);
|
||||||
|
*((Temporal::MeterPoint*)&replacement) = mp;
|
||||||
|
TempoMapChange tmc (*this, _("edit BBT meter"));
|
||||||
|
tmc.map().replace_bartime (replacement);
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (!mpp) {
|
if (!mpp) {
|
||||||
/* first meter, cannot move */
|
/* first meter, cannot move */
|
||||||
new_pos = section.beats ();
|
new_pos = section.beats ();
|
||||||
|
|
|
@ -213,7 +213,9 @@ TempoDialog::init (const Temporal::BBT_Time& when, double bpm, double end_bpm, d
|
||||||
snprintf (buf, sizeof (buf), "%" PRIu32, when.beats);
|
snprintf (buf, sizeof (buf), "%" PRIu32, when.beats);
|
||||||
when_beat_entry.set_text (buf);
|
when_beat_entry.set_text (buf);
|
||||||
|
|
||||||
if (!initial) {
|
/* no position edit fields for initial tempo or BBT markers */
|
||||||
|
|
||||||
|
if (!initial && !(_section && dynamic_cast<MusicTimePoint*> (_section))) {
|
||||||
when_bar_entry.set_width_chars(4);
|
when_bar_entry.set_width_chars(4);
|
||||||
when_beat_entry.set_width_chars (4);
|
when_beat_entry.set_width_chars (4);
|
||||||
when_bar_entry.set_alignment (1.0);
|
when_bar_entry.set_alignment (1.0);
|
||||||
|
@ -622,17 +624,17 @@ MeterDialog::MeterDialog (TempoMap::SharedPtr const & map, timepos_t const & pos
|
||||||
Temporal::BBT_Argument when (map->round_to_bar (map->bbt_at (pos)));
|
Temporal::BBT_Argument when (map->round_to_bar (map->bbt_at (pos)));
|
||||||
Meter const & meter (map->meter_at (when));
|
Meter const & meter (map->meter_at (when));
|
||||||
|
|
||||||
init (when, meter.divisions_per_bar(), meter.note_value(), false, pos.time_domain());
|
init (when, meter.divisions_per_bar(), meter.note_value(), false, false, pos.time_domain());
|
||||||
}
|
}
|
||||||
|
|
||||||
MeterDialog::MeterDialog (Temporal::MeterPoint& section, const string&)
|
MeterDialog::MeterDialog (Temporal::MeterPoint& section, const string&)
|
||||||
: ArdourDialog (_("Edit Time Signature"))
|
: ArdourDialog (_("Edit Time Signature"))
|
||||||
{
|
{
|
||||||
init (section.bbt(), section.divisions_per_bar(), section.note_value(), section.map().is_initial(section), Temporal::BeatTime);
|
init (section.bbt(), section.divisions_per_bar(), section.note_value(), section.map().is_initial(section), dynamic_cast<MusicTimePoint*> (§ion), Temporal::BeatTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MeterDialog::init (const Temporal::BBT_Time& when, double bpb, double divisor, bool initial, TimeDomain style)
|
MeterDialog::init (const Temporal::BBT_Time& when, double bpb, double divisor, bool initial, bool music_time_point, TimeDomain style)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
|
@ -708,7 +710,9 @@ MeterDialog::init (const Temporal::BBT_Time& when, double bpb, double divisor, b
|
||||||
when_bar_entry.set_text (buf);
|
when_bar_entry.set_text (buf);
|
||||||
when_bar_entry.set_alignment (1.0);
|
when_bar_entry.set_alignment (1.0);
|
||||||
|
|
||||||
if (!initial) {
|
/* no position edit fields for initial tempo or BBT markers */
|
||||||
|
|
||||||
|
if (!initial && !music_time_point) {
|
||||||
Label* when_label = manage (new Label(_("Time Signature begins at bar:"), ALIGN_START, ALIGN_CENTER));
|
Label* when_label = manage (new Label(_("Time Signature begins at bar:"), ALIGN_START, ALIGN_CENTER));
|
||||||
|
|
||||||
table->attach (*when_label, 0, 1, 2, 3, FILL | EXPAND, FILL | EXPAND);
|
table->attach (*when_label, 0, 1, 2, 3, FILL | EXPAND, FILL | EXPAND);
|
||||||
|
|
|
@ -157,7 +157,7 @@ public:
|
||||||
bool get_bbt_time (Temporal::BBT_Time&);
|
bool get_bbt_time (Temporal::BBT_Time&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init (const Temporal::BBT_Time&, double, double, bool, Temporal::TimeDomain style);
|
void init (const Temporal::BBT_Time&, double, double, bool, bool, Temporal::TimeDomain style);
|
||||||
bool is_user_input_valid() const;
|
bool is_user_input_valid() const;
|
||||||
bool entry_key_press (GdkEventKey* );
|
bool entry_key_press (GdkEventKey* );
|
||||||
bool entry_key_release (GdkEventKey* );
|
bool entry_key_release (GdkEventKey* );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user