, tap_tempo_button (_("Tap tempo"))
{
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());
+ init (when, section.note_types_per_minute(), section.note_type(), section.type(), section.initial(), section.position_lock_style());
}
void
-TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, TempoSection::Type type, bool movable, PositionLockStyle style)
+TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, TempoSection::Type type, bool initial, PositionLockStyle style)
{
vector<string> strings;
NoteTypes::iterator x;
snprintf (buf, sizeof (buf), "%" PRIu32, when.beats);
when_beat_entry.set_text (buf);
- if (movable) {
+ if (!initial) {
when_bar_entry.set_width_chars(4);
when_beat_entry.set_width_chars (4);
when_bar_entry.set_alignment (1.0);
{
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.initial(), section.position_lock_style());
}
void
-MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double divisor, bool movable, PositionLockStyle style)
+MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double divisor, bool initial, PositionLockStyle style)
{
char buf[64];
vector<string> strings;
when_bar_entry.set_text (buf);
when_bar_entry.set_alignment (1.0);
- if (movable) {
+ if (!initial) {
Label* when_label = manage (new Label(_("Meter begins at bar:"), ALIGN_LEFT, ALIGN_CENTER));
table->attach (*when_label, 0, 1, 2, 3, FILL | EXPAND, FILL | EXPAND);
throw failed_constructor();
}
- set_movable (string_is_affirmative (prop->value()));
+ set_initial (!string_is_affirmative (prop->value()));
if ((prop = node.property ("active")) == 0) {
warning << _("TempoSection XML node has no \"active\" property") << endmsg;
}
if ((prop = node.property ("lock-style")) == 0) {
- if (movable()) {
+ if (!initial()) {
set_position_lock_style (MusicTime);
} else {
set_position_lock_style (AudioTime);
root->add_property ("beats-per-minute", buf);
snprintf (buf, sizeof (buf), "%lf", _note_type);
root->add_property ("note-type", buf);
- snprintf (buf, sizeof (buf), "%s", movable()?"yes":"no");
+ snprintf (buf, sizeof (buf), "%s", !initial()?"yes":"no");
root->add_property ("movable", buf);
snprintf (buf, sizeof (buf), "%s", active()?"yes":"no");
root->add_property ("active", buf);
throw failed_constructor();
}
- set_movable (string_is_affirmative (prop->value()));
+ set_initial (!string_is_affirmative (prop->value()));
if ((prop = node.property ("lock-style")) == 0) {
warning << _("MeterSection XML node has no \"lock-style\" property") << endmsg;
- if (movable()) {
+ if (!initial()) {
set_position_lock_style (MusicTime);
} else {
set_position_lock_style (AudioTime);
root->add_property ("lock-style", enum_2_string (position_lock_style()));
snprintf (buf, sizeof (buf), "%lf", _divisions_per_bar);
root->add_property ("divisions-per-bar", buf);
- snprintf (buf, sizeof (buf), "%s", movable()?"yes":"no");
+ snprintf (buf, sizeof (buf), "%s", !initial()?"yes":"no");
root->add_property ("movable", buf);
return *root;
TempoSection *t = new TempoSection (0.0, 0.0, _default_tempo.note_types_per_minute(), _default_tempo.note_type(), TempoSection::Ramp, AudioTime, fr);
MeterSection *m = new MeterSection (0.0, 0.0, 0.0, start, _default_meter.divisions_per_bar(), _default_meter.note_divisor(), AudioTime, fr);
- t->set_movable (false);
- m->set_movable (false);
+ t->set_initial (true);
+ m->set_initial (true);
/* note: frame time is correct (zero) for both of these */
for (i = _metrics.begin(); i != _metrics.end(); ++i) {
if (dynamic_cast<TempoSection*> (*i) != 0) {
if (tempo.frame() == (*i)->frame()) {
- if ((*i)->movable()) {
+ if (!(*i)->initial()) {
delete (*i);
_metrics.erase (i);
return true;
for (Metrics::iterator i = _metrics.begin(); i != _metrics.end(); ++i) {
if (dynamic_cast<MeterSection*> (*i) != 0) {
if (meter.frame() == (*i)->frame()) {
- if ((*i)->movable()) {
+ if (!(*i)->initial()) {
delete (*i);
_metrics.erase (i);
return true;
bool const ipm = insert_tempo->position_lock_style() == MusicTime;
if ((ipm && tempo->pulse() == insert_tempo->pulse()) || (!ipm && tempo->frame() == insert_tempo->frame())) {
- if (!tempo->movable()) {
+ if (tempo->initial()) {
/* can't (re)move this section, so overwrite
* its data content (but not its properties as
if ((ipm && meter->beat() == insert_meter->beat()) || (!ipm && meter->frame() == insert_meter->frame())) {
- if (!meter->movable()) {
+ if (meter->initial()) {
/* can't (re)move this section, so overwrite
* its data content (but not its properties as
Glib::Threads::RWLock::WriterLock lm (lock);
const double beat = beat_at_bbt_locked (_metrics, where);
- if (ms.movable()) {
+ if (!ms.initial()) {
remove_meter_locked (ms);
add_meter_locked (meter, beat, where, pls, true);
} else {
if (!t->active()) {
continue;
}
- if (!t->movable()) {
+ if (t->initial()) {
return *t;
}
}
if (!t->active()) {
continue;
}
- if (!t->movable()) {
+ if (t->initial()) {
return *t;
}
}
if (!t->active()) {
continue;
}
- if (!t->movable()) {
+ if (t->initial()) {
if (!prev_t) {
t->set_pulse (0.0);
prev_t = t;
TempoSection* t;
if ((*ii)->is_tempo()) {
t = static_cast<TempoSection*> (*ii);
- if ((t->locked_to_meter() || !t->movable()) && t->frame() == meter->frame()) {
+ if ((t->locked_to_meter() || t->initial()) && t->frame() == meter->frame()) {
meter_locked_tempo = t;
break;
}
, BBT_Time ((beats / prev_m->divisions_per_bar()) + prev_m->bbt().bars, 1, 0));
pulse = prev_m->pulse() + (beats / prev_m->note_divisor());
- } else if (meter->movable()) {
+ } else if (!meter->initial()) {
b_bbt = make_pair (meter->beat(), meter->bbt());
pulse = prev_m->pulse() + (beats / prev_m->note_divisor());
}
TempoSection* t;
if ((*i)->is_tempo()) {
t = static_cast<TempoSection*> (*i);
- if (!t->movable()) {
+ if (t->initial()) {
t->set_active (true);
continue;
}
- if (t->movable() && t->active () && t->position_lock_style() == AudioTime && t->frame() < frame) {
+ if (!t->initial() && t->active () && t->position_lock_style() == AudioTime && t->frame() < frame) {
t->set_active (false);
t->set_pulse (0.0);
- } else if (t->movable() && t->position_lock_style() == AudioTime && t->frame() > frame) {
+ } else if (!t->initial() && t->position_lock_style() == AudioTime && t->frame() > frame) {
t->set_active (true);
- } else if (t->movable() && t->position_lock_style() == AudioTime && t->frame() == frame) {
+ } else if (!t->initial() && t->position_lock_style() == AudioTime && t->frame() == frame) {
return false;
}
}
MeterSection* m;
if (!(*i)->is_tempo()) {
m = static_cast<MeterSection*> (*i);
- if (!m->movable()) {
+ if (m->initial()) {
first_m_minute = m->minute();
break;
}
}
}
- if (section->movable() && minute <= first_m_minute) {
+ if (!section->initial() && minute <= first_m_minute) {
return false;
}
if (!t->active()) {
continue;
}
- if (!t->movable()) {
+ if (t->initial()) {
t->set_pulse (0.0);
prev_t = t;
continue;
bool
TempoMap::solve_map_minute (Metrics& imaginary, MeterSection* section, const double& minute)
{
- /* disallow moving first meter past any subsequent one, and any movable meter before the first one */
+ /* disallow moving first meter past any subsequent one, and any initial meter before the first one */
const MeterSection* other = &meter_section_at_minute_locked (imaginary, minute);
- if ((!section->movable() && other->movable()) || (!other->movable() && section->movable() && other->minute() >= minute)) {
+ if ((section->initial() && !other->initial()) || (other->initial() && !section->initial() && other->minute() >= minute)) {
return false;
}
- if (!section->movable()) {
+ if (section->initial()) {
/* lock the first tempo to our first meter */
if (!set_active_tempos (imaginary, section->frame_at_minute (minute))) {
return false;
TempoSection* t;
if ((*ii)->is_tempo()) {
t = static_cast<TempoSection*> (*ii);
- if ((t->locked_to_meter() || !t->movable()) && t->minute() == section->minute()) {
+ if ((t->locked_to_meter() || t->initial()) && t->minute() == section->minute()) {
meter_locked_tempo = t;
break;
}
if (!(*i)->is_tempo()) {
m = static_cast<MeterSection*> (*i);
if (m == section){
- if (prev_m && section->movable()) {
+ if (prev_m && !section->initial()) {
const double beats = (pulse_at_minute_locked (imaginary, minute) - prev_m->pulse()) * prev_m->note_divisor();
if (beats + prev_m->beat() < section->beat()) {
/* set the section pulse according to its musical position,
}
}
} else {
- /* not movable (first meter atm) */
+ /* initial (first meter atm) */
tempo_copy->set_minute (minute);
tempo_copy->set_pulse (0.0);
TempoSection* t;
if ((*ii)->is_tempo()) {
t = static_cast<TempoSection*> (*ii);
- if ((t->locked_to_meter() || !t->movable()) && t->frame() == m->frame()) {
+ if ((t->locked_to_meter() || t->initial()) && t->frame() == m->frame()) {
meter_locked_tempo = t;
break;
}
, BBT_Time ((beats / prev_m->divisions_per_bar()) + prev_m->bbt().bars, 1, 0));
new_pulse = prev_m->pulse() + (beats / prev_m->note_divisor());
- } else if (m->movable()) {
+ } else if (!m->initial()) {
b_bbt = make_pair (m->beat(), m->bbt());
new_pulse = prev_m->pulse() + (beats / prev_m->note_divisor());
}
TempoSection* t;
if ((m = dynamic_cast<MeterSection*>(*i)) != 0) {
- if (!m->movable()) {
+ if (m->initial()) {
pair<double, BBT_Time> bbt = make_pair (0.0, BBT_Time (1, 1, 0));
m->set_beat (bbt);
m->set_pulse (0.0);
continue;
}
- if (!t->movable()) {
+ if (t->initial()) {
t->set_pulse (0.0);
t->set_minute (0.0);
t->set_position_lock_style (AudioTime);
if ((t = dynamic_cast<const TempoSection*>(*i)) != 0) {
o << "Tempo @ " << *i << t->note_types_per_minute() << " BPM (pulse = 1/" << t->note_type()
<< " type= " << enum_2_string (t->type()) << ") " << " at pulse= " << t->pulse()
- << " minute= " << t->minute() << " frame= " << t->frame() << " (movable? " << t->movable() << ')'
+ << " minute= " << t->minute() << " frame= " << t->frame() << " (initial? " << t->initial() << ')'
<< " pos lock: " << enum_2_string (t->position_lock_style()) << std::endl;
if (prev_t) {
o << " current : " << t->note_types_per_minute()
} else if ((m = dynamic_cast<const MeterSection*>(*i)) != 0) {
o << "Meter @ " << *i << ' ' << m->divisions_per_bar() << '/' << m->note_divisor() << " at " << m->bbt()
<< " frame= " << m->frame() << " pulse: " << m->pulse() << " beat : " << m->beat()
- << " pos lock: " << enum_2_string (m->position_lock_style()) << " (movable? " << m->movable() << ')' << endl;
+ << " pos lock: " << enum_2_string (m->position_lock_style()) << " (initial? " << m->initial() << ')' << endl;
}
}
o << "------" << std::endl;
TempoMap::insert_time (framepos_t where, framecnt_t amount)
{
for (Metrics::reverse_iterator i = _metrics.rbegin(); i != _metrics.rend(); ++i) {
- if ((*i)->frame() >= where && (*i)->movable ()) {
+ if ((*i)->frame() >= where && !(*i)->initial ()) {
MeterSection* ms;
TempoSection* ts;