mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
temporal: remove the concept of a time domain for the tempo map (GUI edition)
This commit is contained in:
parent
e3501a05f8
commit
2ec6d45d6d
4 changed files with 17 additions and 60 deletions
|
|
@ -3449,22 +3449,15 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move)
|
||||||
|
|
||||||
_editor->begin_reversible_command (_("copy meter mark"));
|
_editor->begin_reversible_command (_("copy meter mark"));
|
||||||
|
|
||||||
timepos_t pos;
|
const timepos_t pos (map->quarters_at (bbt));
|
||||||
|
|
||||||
if (map->time_domain() == AudioTime) {
|
|
||||||
pos = timepos_t (map->sample_at (bbt));
|
|
||||||
} else {
|
|
||||||
pos = timepos_t (map->quarters_at (bbt));
|
|
||||||
}
|
|
||||||
|
|
||||||
_marker->reset_meter (map->set_meter (meter, pos));
|
_marker->reset_meter (map->set_meter (meter, pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* only snap to bars. leave snap mode alone for audio locked meters.*/
|
/* only snap to bars. */
|
||||||
if (map->time_domain() != AudioTime) {
|
|
||||||
_editor->set_grid_to (GridTypeBar);
|
_editor->set_grid_to (GridTypeBar);
|
||||||
_editor->set_snap_mode (SnapMagnetic);
|
_editor->set_snap_mode (SnapMagnetic);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_movable && (!first_move || !_copy)) {
|
if (_movable && (!first_move || !_copy)) {
|
||||||
|
|
|
||||||
|
|
@ -1980,11 +1980,8 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
entered_marker = m_marker;
|
entered_marker = m_marker;
|
||||||
if (m_marker->meter().map().time_domain() == BeatTime) {
|
/* "music" currently serves as a stand-in for "entered". */
|
||||||
m_marker->set_color_rgba (UIConfiguration::instance().color ("meter marker"));
|
m_marker->set_color_rgba (UIConfiguration::instance().color ("meter marker music"));
|
||||||
} else {
|
|
||||||
m_marker->set_color_rgba (UIConfiguration::instance().color ("meter marker music"));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TempoMarkerItem:
|
case TempoMarkerItem:
|
||||||
|
|
@ -1992,11 +1989,8 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
entered_marker = t_marker;
|
entered_marker = t_marker;
|
||||||
if (t_marker->tempo().map().time_domain() == BeatTime) {
|
/* "music" currently serves as a stand-in for "entered". */
|
||||||
t_marker->set_color_rgba (UIConfiguration::instance().color ("tempo marker"));
|
t_marker->set_color_rgba (UIConfiguration::instance().color ("tempo marker music"));
|
||||||
} else {
|
|
||||||
t_marker->set_color_rgba (UIConfiguration::instance().color ("tempo marker music"));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FadeInHandleItem:
|
case FadeInHandleItem:
|
||||||
|
|
@ -2107,24 +2101,16 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type)
|
||||||
if ((m_marker = static_cast<MeterMarker *> (item->get_data ("marker"))) == 0) {
|
if ((m_marker = static_cast<MeterMarker *> (item->get_data ("marker"))) == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
m_marker->set_color_rgba (UIConfiguration::instance().color ("meter marker"));
|
||||||
entered_marker = 0;
|
entered_marker = 0;
|
||||||
if (m_marker->meter().map().time_domain() == BeatTime) {
|
|
||||||
m_marker->set_color_rgba (UIConfiguration::instance().color ("meter marker music"));
|
|
||||||
} else {
|
|
||||||
m_marker->set_color_rgba (UIConfiguration::instance().color ("meter marker"));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TempoMarkerItem:
|
case TempoMarkerItem:
|
||||||
if ((t_marker = static_cast<TempoMarker *> (item->get_data ("marker"))) == 0) {
|
if ((t_marker = static_cast<TempoMarker *> (item->get_data ("marker"))) == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
t_marker->set_color_rgba (UIConfiguration::instance().color ("tempo marker"));
|
||||||
entered_marker = 0;
|
entered_marker = 0;
|
||||||
if (t_marker->tempo().map().time_domain() == BeatTime) {
|
|
||||||
t_marker->set_color_rgba (UIConfiguration::instance().color ("tempo marker music"));
|
|
||||||
} else {
|
|
||||||
t_marker->set_color_rgba (UIConfiguration::instance().color ("tempo marker"));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FadeInTrimHandleItem:
|
case FadeInTrimHandleItem:
|
||||||
|
|
|
||||||
|
|
@ -164,11 +164,7 @@ Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::M
|
||||||
void
|
void
|
||||||
Editor::make_bbt_marker (MusicTimePoint const * mtp)
|
Editor::make_bbt_marker (MusicTimePoint const * mtp)
|
||||||
{
|
{
|
||||||
if (mtp->map().time_domain() == BeatTime) {
|
bbt_marks.push_back (new BBTMarker (*this, *bbt_ruler, UIConfiguration::instance().color ("meter marker"), "foo!", *mtp));
|
||||||
bbt_marks.push_back (new BBTMarker (*this, *bbt_ruler, UIConfiguration::instance().color ("meter marker music"), "bar!", *mtp));
|
|
||||||
} else {
|
|
||||||
bbt_marks.push_back (new BBTMarker (*this, *bbt_ruler, UIConfiguration::instance().color ("meter marker"), "foo!", *mtp));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -177,11 +173,7 @@ Editor::make_meter_marker (Temporal::MeterPoint const * ms)
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
snprintf (buf, sizeof(buf), "%d/%d", ms->divisions_per_bar(), ms->note_value ());
|
snprintf (buf, sizeof(buf), "%d/%d", ms->divisions_per_bar(), ms->note_value ());
|
||||||
if (ms->map().time_domain() == BeatTime) {
|
meter_marks.push_back (new MeterMarker (*this, *meter_group, UIConfiguration::instance().color ("meter marker"), buf, *ms));
|
||||||
meter_marks.push_back (new MeterMarker (*this, *meter_group, UIConfiguration::instance().color ("meter marker music"), buf, *ms));
|
|
||||||
} else {
|
|
||||||
meter_marks.push_back (new MeterMarker (*this, *meter_group, UIConfiguration::instance().color ("meter marker"), buf, *ms));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -193,17 +185,7 @@ Editor::make_tempo_marker (Temporal::TempoPoint const * ts, double& min_tempo, d
|
||||||
min_tempo = min (min_tempo, ts->end_note_types_per_minute());
|
min_tempo = min (min_tempo, ts->end_note_types_per_minute());
|
||||||
|
|
||||||
const std::string tname (X_(""));
|
const std::string tname (X_(""));
|
||||||
char const * color_name;
|
char const * color_name = X_("tempo marker");
|
||||||
|
|
||||||
/* XXX not sure this is the right thing to do here (differentiate time
|
|
||||||
* domains with color).
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (ts->map().time_domain() == BeatTime) {
|
|
||||||
color_name = X_("tempo marker music");
|
|
||||||
} else {
|
|
||||||
color_name = X_("tempo marker music");
|
|
||||||
}
|
|
||||||
|
|
||||||
tempo_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color (color_name), tname, *ts, ts->sample (sr), tc_color));
|
tempo_marks.push_back (new TempoMarker (*this, *tempo_group, UIConfiguration::instance().color (color_name), tname, *ts, ts->sample (sr), tc_color));
|
||||||
|
|
||||||
|
|
@ -642,11 +624,7 @@ Editor::mouse_add_new_meter_event (timepos_t pos)
|
||||||
|
|
||||||
XMLNode &before = map->get_state();
|
XMLNode &before = map->get_state();
|
||||||
|
|
||||||
if (map->time_domain() == BeatTime) {
|
pos = timepos_t (map->quarters_at (requested));
|
||||||
pos = timepos_t (map->quarters_at (requested));
|
|
||||||
} else {
|
|
||||||
pos = timepos_t (map->sample_at (requested));
|
|
||||||
}
|
|
||||||
|
|
||||||
map->set_meter (Meter (bpb, note_type), pos);
|
map->set_meter (Meter (bpb, note_type), pos);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ TempoDialog::TempoDialog (TempoMap::SharedPtr const & map, TempoPoint& point, co
|
||||||
, tap_tempo_button (_("Tap tempo"))
|
, tap_tempo_button (_("Tap tempo"))
|
||||||
{
|
{
|
||||||
Temporal::BBT_Time when (map->bbt_at (point.time()));
|
Temporal::BBT_Time when (map->bbt_at (point.time()));
|
||||||
init (when, _section->note_types_per_minute(), _section->end_note_types_per_minute(), _section->note_type(), _section->type(), map->is_initial (point), map->time_domain());
|
init (when, _section->note_types_per_minute(), _section->end_note_types_per_minute(), _section->note_type(), _section->type(), map->is_initial (point), Temporal::BeatTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -498,7 +498,7 @@ MeterDialog::MeterDialog (TempoMap::SharedPtr const & map, timepos_t const & pos
|
||||||
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), section.map().time_domain());
|
init (section.bbt(), section.divisions_per_bar(), section.note_value(), section.map().is_initial(section), Temporal::BeatTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue