remove tempo-mapping bar, tempo_meta group. this reverts 8fbf2c and related

This commit is contained in:
Ben Loftis 2023-09-05 13:25:57 -05:00 committed by Robin Gareus
parent 784d2ecce4
commit da4d2a645f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
17 changed files with 11 additions and 200 deletions

View File

@ -198,19 +198,6 @@ enum InsertTimeOption {
#undef INSERTTIMEOPT
#define INSERTTIMEOPT(a) /*empty*/
#undef TEMPOEDITBEHAVIOR
#define TEMPOEDITBEHAVIOR(a) a,
enum TempoEditBehavior {
#include "editing_syms.h"
};
extern const char *tempoeditbehaviorstrs[];
inline const char* enum2str(TempoEditBehavior m) {return tempoeditbehaviorstrs[m];}
TempoEditBehavior str2tempoeditbehavior(const std::string &);
#undef TEMPOEDITBEHAVIOR
#define TEMPOEDITBEHAVIOR(a) /*empty*/
/////////////////////
// These don't need their state saved. yet...
enum CutCopyOp {

View File

@ -32,7 +32,6 @@ DEFINE_ENUM_CONVERT(Editing::SnapMode)
DEFINE_ENUM_CONVERT(Editing::EditPoint)
DEFINE_ENUM_CONVERT(Editing::RegionListSortType)
DEFINE_ENUM_CONVERT(Editing::MouseMode)
DEFINE_ENUM_CONVERT(Editing::TempoEditBehavior)
} // namespace PBD

View File

@ -108,7 +108,4 @@ EDITPOINT(EditAtMouse)
INSERTTIMEOPT(LeaveIntersected)
INSERTTIMEOPT(MoveIntersected)
INSERTTIMEOPT(SplitIntersected)
TEMPOEDITBEHAVIOR(TempoMapping)
TEMPOEDITBEHAVIOR(TempoChanging)
INSERTTIMEOPT(SplitIntersected)

View File

@ -321,7 +321,6 @@ Editor::Editor ()
, visible_timebars (0)
, editor_ruler_menu (0)
, tempo_bar (0)
, mapping_bar (0)
, meter_bar (0)
, marker_bar (0)
, range_marker_bar (0)
@ -474,7 +473,6 @@ Editor::Editor ()
, _stepping_axis_view (0)
, quantize_dialog (0)
, _main_menu_disabler (0)
, _tempo_edit_behavior (UIConfiguration::instance().get_tempo_edit_behavior())
, domain_bounce_info (nullptr)
{
/* we are a singleton */
@ -893,9 +891,6 @@ Editor::Editor ()
UIConfiguration::instance().map_parameters (pc);
setup_fade_images ();
/* force correct state for tempo edit behavior */
tempo_edit_behavior_toggled (_tempo_edit_behavior);
}
Editor::~Editor()
@ -6806,8 +6801,6 @@ Editor::ui_parameter_changed (string parameter)
_track_canvas->request_redraw (_track_canvas->visible_area());
} else if (parameter == "use-note-color-for-velocity") {
/* handled individually by each MidiRegionView */
} else if (parameter == "tempo-edit-behavior") {
set_tempo_edit_behavior (UIConfiguration::instance().get_tempo_edit_behavior());
} else if (parameter == "show-selection-marker") {
update_ruler_visibility ();
}

View File

@ -624,9 +624,6 @@ public:
void remove_region_marker (ARDOUR::CueMarker&);
void make_region_markers_global (bool as_cd_markers);
Editing::TempoEditBehavior tempo_edit_behavior() const { return _tempo_edit_behavior; }
void set_tempo_edit_behavior (Editing::TempoEditBehavior teb);
protected:
void map_transport_state ();
void map_position_change (samplepos_t);
@ -920,9 +917,7 @@ private:
Gtk::EventBox time_bars_event_box;
Gtk::VBox time_bars_vbox;
ArdourCanvas::Container* tempo_meta_group;
ArdourCanvas::Container* tempo_group;
ArdourCanvas::Container* mapping_group;
ArdourCanvas::Container* meter_group;
ArdourCanvas::Container* marker_group;
ArdourCanvas::Container* range_marker_group;
@ -1067,7 +1062,6 @@ private:
Gtk::Menu* editor_ruler_menu;
ArdourCanvas::Rectangle* tempo_bar;
ArdourCanvas::Rectangle* mapping_bar;
ArdourCanvas::Rectangle* meter_bar;
ArdourCanvas::Rectangle* marker_bar;
ArdourCanvas::Rectangle* range_marker_bar;
@ -2558,9 +2552,6 @@ private:
Editing::GridType determine_mapping_grid_snap (Temporal::timepos_t t);
void choose_mapping_drag (ArdourCanvas::Item*, GdkEvent*);
Editing::TempoEditBehavior _tempo_edit_behavior;
void tempo_edit_behavior_toggled (Editing::TempoEditBehavior);
template<typename T>
Temporal::TimeDomain drag_time_domain (T* thing_with_time_domain) {
return thing_with_time_domain ? thing_with_time_domain->time_domain() : Temporal::AudioTime;

View File

@ -206,10 +206,6 @@ Editor::register_actions ()
*/
ActionManager::register_action (editor_actions, "lock", S_("Session|Lock"), sigc::mem_fun (*this, &Editor::lock));
RadioAction::Group tempo_edit_group;
ActionManager::register_radio_action (editor_actions, tempo_edit_group, "tempo-edit-is-mapping", _("Map Tempo"), sigc::bind (sigc::mem_fun (*this, &Editor::tempo_edit_behavior_toggled), Editing::TempoMapping));
ActionManager::register_radio_action (editor_actions, tempo_edit_group, "tempo-edit-is-changing", _("Change Tempo"), sigc::bind (sigc::mem_fun (*this, &Editor::tempo_edit_behavior_toggled), Editing::TempoChanging));
toggle_reg_sens (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), sigc::mem_fun (*this, &Editor::editor_mixer_button_toggled));
toggle_reg_sens (editor_actions, "show-editor-list", _("Show Editor List"), sigc::mem_fun (*this, &Editor::editor_list_button_toggled));

View File

@ -168,14 +168,10 @@ Editor::initialize_canvas ()
CANVAS_DEBUG_NAME (transport_marker_group, "transport marker group");
range_marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 3.0) + 1.0));
CANVAS_DEBUG_NAME (range_marker_group, "range marker group");
tempo_meta_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 4.0) + 1.0));
CANVAS_DEBUG_NAME (tempo_meta_group, "tempo meta group");
tempo_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 4.0) + 1.0));
CANVAS_DEBUG_NAME (tempo_group, "tempo group");
section_marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
CANVAS_DEBUG_NAME (section_marker_group, "Arranger marker group");
tempo_group = new ArdourCanvas::Container (tempo_meta_group, ArdourCanvas::Duple (0.0, 0.0));
CANVAS_DEBUG_NAME (tempo_group, "tempo group");
mapping_group = new ArdourCanvas::Container (tempo_meta_group, ArdourCanvas::Duple (0.0, 0.0));
CANVAS_DEBUG_NAME (mapping_group, "mapping group");
meter_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
CANVAS_DEBUG_NAME (meter_group, "meter group");
@ -193,21 +189,6 @@ Editor::initialize_canvas ()
tempo_bar->set_outline(false);
tempo_bar->set_outline_what(ArdourCanvas::Rectangle::BOTTOM);
mapping_bar = new ArdourCanvas::Rectangle (mapping_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
CANVAS_DEBUG_NAME (mapping_bar, "Mapping Bar");
mapping_bar->set_fill(true);
mapping_bar->set_outline(false);
mapping_bar->set_outline_what(ArdourCanvas::Rectangle::BOTTOM);
switch (UIConfiguration::instance().get_tempo_edit_behavior()) {
case Editing::TempoMapping:
tempo_group->hide ();
break;
case Editing::TempoChanging:
mapping_group->hide ();
break;
}
range_marker_bar = new ArdourCanvas::Rectangle (range_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
CANVAS_DEBUG_NAME (range_marker_bar, "Range Marker Bar");
@ -271,7 +252,6 @@ Editor::initialize_canvas ()
transport_punchout_line->hide();
tempo_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), tempo_bar, TempoBarItem, "tempo bar"));
mapping_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), mapping_bar, MappingBarItem, "mapping bar"));
meter_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), meter_bar, MeterBarItem, "meter bar"));
marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), marker_bar, MarkerBarItem, "marker bar"));
cd_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), cd_marker_bar, CdMarkerBarItem, "cd marker bar"));
@ -1090,8 +1070,6 @@ Editor::color_handler()
tempo_bar->set_fill_color (UIConfiguration::instance().color_mod ("tempo bar", "marker bar"));
mapping_bar->set_fill_color (UIConfiguration::instance().color_mod ("mapping bar", "marker bar"));
marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("marker bar", "marker bar"));
marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
@ -1386,9 +1364,6 @@ Editor::which_canvas_cursor(ItemType type) const
case AutomationTrackItem:
cursor = which_track_cursor ();
break;
case MappingBarItem:
cursor = _cursors->trimmer;
break;
case PlayheadCursorItem:
cursor = _cursors->grabber;
break;

View File

@ -44,7 +44,6 @@ enum ItemType {
TempoMarkerItem,
MeterBarItem,
TempoBarItem,
MappingBarItem,
RegionViewNameHighlight,
RegionViewName,
StartSelectionTrimItem,

View File

@ -833,10 +833,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
return true;
break;
case MappingBarItem:
choose_mapping_drag (item, event);
return true;
case TempoBarItem:
case TempoCurveItem:
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
@ -1736,7 +1732,6 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
case CdMarkerBarItem:
case SectionMarkerBarItem:
case TempoBarItem:
case MappingBarItem:
case TempoCurveItem:
case MeterBarItem:
case VideoBarItem:
@ -1874,7 +1869,6 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
return true;
case GridZoneItem:
case MappingBarItem:
return true;
case TempoBarItem:
@ -2044,8 +2038,6 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
choose_canvas_cursor_on_entry (item_type);
switch (item_type) {
case MappingBarItem:
break;
case GridZoneItem:
break;
@ -2194,7 +2186,6 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type)
}
switch (item_type) {
case MappingBarItem:
case GridZoneItem:
break;
@ -2420,6 +2411,7 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, bool from_aut
}
}
/* show snapped cursor */
timepos_t t (where);
bool move_snapped_cursor = true;
if (move_snapped_cursor) {

View File

@ -261,8 +261,6 @@ Editor::popup_ruler_menu (timepos_t const & where, ItemType t)
case TempoCurveItem:
ruler_items.push_back (MenuElem (_("Add New Tempo"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_tempo_event), where)));
ruler_items.push_back (SeparatorElem ());
/* fallthrough */
case MappingBarItem:
ruler_items.push_back (MenuElem (_("Clear All Tempos"), sigc::mem_fun (*this, &Editor::clear_tempo_markers)));
ruler_items.push_back (SeparatorElem ());
ruler_items.push_back (MenuElem (_("Clear All Earlier Tempos"), sigc::bind (sigc::mem_fun (*this, &Editor::clear_tempo_markers_before), where, true)));
@ -537,17 +535,17 @@ Editor::update_ruler_visibility ()
}
if (ruler_tempo_action->get_active()) {
old_unit_pos = tempo_meta_group->position().y;
old_unit_pos = tempo_group->position().y;
if (tbpos != old_unit_pos) {
tempo_meta_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
tempo_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
}
tempo_meta_group->show();
tempo_group->show();
tempo_label.show();
tbpos += timebar_height;
tbgpos += timebar_height;
visible_timebars++;
} else {
tempo_meta_group->hide();
tempo_group->hide();
tempo_label.hide();
}

View File

@ -164,7 +164,7 @@ Editor::make_tempo_marker (Temporal::TempoPoint const * ts, TempoPoint const *&
const std::string tname (X_(""));
char const * color_name = X_("tempo marker");
tempo_marks.insert (before, new TempoMarker (*this, *tempo_group, *mapping_group, color_name, tname, *ts, ts->sample (sr), tc_color));
tempo_marks.insert (before, new TempoMarker (*this, *tempo_group, color_name, tname, *ts, ts->sample (sr), tc_color));
/* XXX the point of this code was "a jump in tempo by more than 1 ntpm results in a red
tempo mark pointer." (3a7bc1fd3f32f0)
@ -958,69 +958,6 @@ Editor::mid_tempo_per_region_update (RegionView* rv)
rv->tempo_map_changed ();
}
void
Editor::set_tempo_edit_behavior (TempoEditBehavior teb)
{
/* As with all things radio-action related, we carry out the change by
toggling the action, and then actually do the model-view changes in
the actions' toggled handler.
*/
Glib::RefPtr<Action> act;
switch (teb) {
case TempoMapping:
act = ActionManager::get_action (X_("Editor"), X_("tempo-edit-is-mapping"));
break;
case TempoChanging:
act = ActionManager::get_action (X_("Editor"), X_("tempo-edit-is-changing"));
}
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
/* go there and back to ensure that the toggled handler is called to set up mouse_mode */
tact->set_active (false);
tact->set_active (true);
}
void
Editor::tempo_edit_behavior_toggled (TempoEditBehavior teb)
{
Glib::RefPtr<Action> act;
switch (teb) {
case TempoMapping:
act = ActionManager::get_action (X_("Editor"), X_("tempo-edit-is-mapping"));
break;
case TempoChanging:
act = ActionManager::get_action (X_("Editor"), X_("tempo-edit-is-changing"));
}
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
if (!tact->get_active()) {
/* this was just the notification that the old mode has been
* left. we'll get called again with the new mode active in a
* jiffy.
*/
return;
}
/* change the ruler shown in the tempo position */
_tempo_edit_behavior = teb;
switch (teb) {
case TempoMapping:
tempo_group->hide ();
mapping_group->show ();
break;
case TempoChanging:
tempo_group->show ();
mapping_group->hide ();
break;
}
}
void
Editor::clear_tempo_markers_before (timepos_t where, bool stop_at_music_times)
{

View File

@ -60,7 +60,6 @@ setup_gtk_ardour_enums ()
StartupFSM::DialogID startup_dialog;
Gtk::ResponseType dialog_response;
AddRouteDialog::TypeWanted type_wanted;
TempoEditBehavior tempo_edit_behavior;
#define REGISTER(e) enum_writer.register_distinct (typeid(e).name(), i, s); i.clear(); s.clear()
#define REGISTER_BITS(e) enum_writer.register_bits (typeid(e).name(), i, s); i.clear(); s.clear()
@ -164,7 +163,6 @@ setup_gtk_ardour_enums ()
REGISTER_ENUM (BBTMarkerItem);
REGISTER_ENUM (MeterBarItem);
REGISTER_ENUM (TempoBarItem);
REGISTER_ENUM (MappingBarItem);
REGISTER_ENUM (RegionViewNameHighlight);
REGISTER_ENUM (RegionViewName);
REGISTER_ENUM (StartSelectionTrimItem);
@ -232,8 +230,4 @@ setup_gtk_ardour_enums ()
REGISTER_CLASS_ENUM (AddRouteDialog, VCAMaster);
REGISTER_CLASS_ENUM (AddRouteDialog, FoldbackBus);
REGISTER (type_wanted);
REGISTER_CLASS_ENUM (Editing, TempoMapping);
REGISTER_CLASS_ENUM (Editing, TempoChanging);
REGISTER (tempo_edit_behavior);
}

View File

@ -1129,7 +1129,6 @@ LuaInstance::register_classes (lua_State* L)
#define IMPORTMODE(NAME) .addConst (stringify(NAME), (Editing::ImportMode)Editing::NAME)
#define IMPORTPOSITION(NAME) .addConst (stringify(NAME), (Editing::ImportPosition)Editing::NAME)
#define IMPORTDISPOSITION(NAME) .addConst (stringify(NAME), (Editing::ImportDisposition)Editing::NAME)
#define TEMPOEDITBEHAVIOR(NAME) .addConst (stringify(NAME), (Editing::TempoEditBehavior)Editing::NAME)
luabridge::getGlobalNamespace (L)
.beginNamespace ("Editing")
# include "editing_syms.h"

View File

@ -778,34 +778,18 @@ SelectionMarker::SelectionMarker (PublicEditor& editor, ArdourCanvas::Item& pare
/***********************************************************************/
TempoMarker::TempoMarker (PublicEditor& editor, ArdourCanvas::Item& parent, ArdourCanvas::Item& text_parent, std::string const& color_name, const string& text, Temporal::TempoPoint const & temp, samplepos_t sample, uint32_t curve_color)
TempoMarker::TempoMarker (PublicEditor& editor, ArdourCanvas::Item& parent, std::string const& color_name, const string& text, Temporal::TempoPoint const & temp, samplepos_t sample, uint32_t curve_color)
: MetricMarker (editor, parent, color_name, text, Tempo, temp.time(), false)
, _tempo (&temp)
, _mapping_text (new ArdourCanvas::Text (&text_parent))
{
group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_tempo_marker_event), group, this));
/* points[1].x gives the width of the marker */
_curve = new TempoCurve (editor, *group, curve_color, temp, true, (*points)[1].x);
_curve->the_item().lower_to_bottom ();
_mapping_text->set_color (0xffffff);
_mapping_text->set_font_description (ARDOUR_UI_UTILS::get_font_for_style (N_("MarkerText")));
_mapping_text->set_position (ArdourCanvas::Duple (unit_position, 0.0));
_mapping_text->set_ignore_events (true);
char buf[64];
TempoCurve::format_tempo (_tempo->note_types_per_minute(), _tempo->note_type(), buf, sizeof (buf));
_mapping_text->set (buf);
}
TempoMarker::~TempoMarker ()
{
/* the mapping text is a little unusual in that we do not leave its
parent (the editor's mapping_group) to manage its lifetime. We must
explicitly remove and delete it.
*/
_mapping_text->parent()->remove (_mapping_text);
delete _mapping_text;
delete _curve;
}
@ -813,20 +797,12 @@ void
TempoMarker::reposition ()
{
MetricMarker::reposition ();
_mapping_text->set_position (ArdourCanvas::Duple (std::max (3., unit_position), _mapping_text->position().y));
}
void
TempoMarker::update ()
{
set_position (_tempo->time());
_mapping_text->set_position (ArdourCanvas::Duple (std::max (3., unit_position), _mapping_text->position().y));
char buf[64];
TempoCurve::format_tempo (_tempo->note_types_per_minute(), _tempo->note_type(), buf, sizeof (buf));
_mapping_text->set (buf);
}
TempoCurve&

View File

@ -196,7 +196,7 @@ class MetricMarker : public ArdourMarker
class TempoMarker : public MetricMarker
{
public:
TempoMarker (PublicEditor& editor, ArdourCanvas::Item & parent, ArdourCanvas::Item & text_parent, std::string const& color_name, const std::string& text, Temporal::TempoPoint const &, samplepos_t sample, uint32_t curve_color);
TempoMarker (PublicEditor& editor, ArdourCanvas::Item & parent, std::string const& color_name, const std::string& text, Temporal::TempoPoint const &, samplepos_t sample, uint32_t curve_color);
~TempoMarker ();
void reset_tempo (Temporal::TempoPoint const & t);
@ -211,7 +211,6 @@ class TempoMarker : public MetricMarker
private:
Temporal::TempoPoint const * _tempo;
TempoCurve* _curve;
ArdourCanvas::Text* _mapping_text;
};
class MeterMarker : public MetricMarker

View File

@ -4534,22 +4534,6 @@ These settings will only take effect after %1 is restarted.\n\
add_option (_("Metronome"), bo);
add_option (_("Metronome"), new OptionEditorBlank ());
/* TEMPO RELATED STUFF */
add_option (_("Metronome"), new OptionEditorHeading (_("Tempo")));
ComboOption<Editing::TempoEditBehavior>* teb = new ComboOption<Editing::TempoEditBehavior> (
"default-tempo-edit-behavior",
_("Default tempo ruler state for new sessions"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_tempo_edit_behavior),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_tempo_edit_behavior));
teb->add (Editing::TempoMapping, _("mapping a recorded performance"));
teb->add (Editing::TempoChanging, _("constructing a tempo map from scratch"));
add_option (_("Metronome"), teb);
Gtkmm2ext::UI::instance()->set_tip (teb->tip_widget(),
_("Choose between constructing a tempo map from scratch or mapping a recorded performance as the default tempo ruler state"));
/* CONTROL SURFACES *********************************************************/
add_option (_("Control Surfaces"), new OptionEditorHeading (_("Control Surfaces")));

View File

@ -155,11 +155,6 @@ UI_CONFIG_VARIABLE (bool, ask_cut_copy_section_tempo_map, "ask-cut-copy-section-
UI_CONFIG_VARIABLE (std::string, freesound_dir, "freesound-dir", "")
UI_CONFIG_VARIABLE (int, max_note_height, "max-note-height", 20)
UI_CONFIG_VARIABLE (bool, prefer_tap_tempo, "prefer-tap-tempo", false)
#ifdef MIXBUS
UI_CONFIG_VARIABLE (Editing::TempoEditBehavior, tempo_edit_behavior, "tempo-edit-behavior", Editing::TempoMapping)
#else
UI_CONFIG_VARIABLE (Editing::TempoEditBehavior, tempo_edit_behavior, "tempo-edit-behavior", Editing::TempoChanging)
#endif
/* these are visibility-type selections in the New Track dialog that we should make persistent for the user's choices */
UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true)