splice mode is undefined, undocumented, and buggy. ripple does most of what we want. remove splice for now. leave code because it may be revived later

This commit is contained in:
Ben Loftis 2014-07-01 16:43:00 -05:00
parent 960e5a3c7c
commit 190542c1d0
4 changed files with 27 additions and 23 deletions

View file

@ -3040,7 +3040,7 @@ Editor::build_edit_mode_menu ()
using namespace Menu_Helpers;
edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_to_string(Slide), sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Slide)));
edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_to_string(Splice), sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Splice)));
// edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_to_string(Splice), sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Splice)));
edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_to_string(Ripple), sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Ripple)));
edit_mode_selector.AddMenuElem (MenuElem ( edit_mode_to_string(Lock), sigc::bind (sigc::mem_fun(*this, &Editor::edit_mode_selection_done), (EditMode) Lock)));
}
@ -3356,7 +3356,7 @@ Editor::cycle_edit_mode ()
Config->set_edit_mode (Ripple);
}
break;
case Splice:
// case Splice:
case Ripple:
Config->set_edit_mode (Lock);
break;

View file

@ -480,10 +480,9 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change Edit Point"), sigc::bind (sigc::mem_fun (*this, &Editor::cycle_edit_point), false));
ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change Edit Point Including Marker"), sigc::bind (sigc::mem_fun (*this, &Editor::cycle_edit_point), true));
if (!Profile->get_sae()) {
ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Splice));
ActionManager::register_action (editor_actions, "set-edit-ripple", _("Ripple"), bind (mem_fun (*this, &Editor::set_edit_mode), Ripple));
}
// ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Splice));
ActionManager::register_action (editor_actions, "set-edit-ripple", _("Ripple"), bind (mem_fun (*this, &Editor::set_edit_mode), Ripple));
ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Slide));
ActionManager::register_action (editor_actions, "set-edit-lock", _("Lock"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Lock));
ActionManager::register_action (editor_actions, "toggle-edit-mode", _("Toggle Edit Mode"), sigc::mem_fun (*this, &Editor::cycle_edit_mode));

View file

@ -238,6 +238,11 @@ setup_enum_writer ()
REGISTER_ENUM (Ripple); // XXX do the old enum values have to stay in order?
REGISTER_ENUM (Lock);
REGISTER (_EditMode);
/*
* Splice mode is undefined, undocumented, and basically fubar'ed
* perhaps someday we will make it work. but for now, avoid it
*/
enum_writer.add_to_hack_table ("Splice", "Slide");
REGISTER_ENUM (Start);
REGISTER_ENUM (End);

View file

@ -279,6 +279,23 @@ EnumWriter::read_distinct (EnumRegistration& er, string str)
vector<int>::iterator i;
vector<string>::iterator s;
/* first, check to see if there a hack for the name we're looking up */
map<string,string>::iterator x;
if ((x = hack_table.find (str)) != hack_table.end()) {
cerr << "found hack for " << str << " = " << x->second << endl;
str = x->second;
for (i = er.values.begin(), s = er.names.begin(); i != er.values.end(); ++i, ++s) {
if (str == (*s) || nocase_cmp (str, *s) == 0) {
return (*i);
}
}
}
/* catch old-style hex numerics */
if (str.length() > 2 && str[0] == '0' && str[1] == 'x') {
@ -299,23 +316,6 @@ EnumWriter::read_distinct (EnumRegistration& er, string str)
}
}
/* failed to find it as-is. check to see if there a hack for the name we're looking up */
map<string,string>::iterator x;
if ((x = hack_table.find (str)) != hack_table.end()) {
cerr << "found hack for " << str << " = " << x->second << endl;
str = x->second;
for (i = er.values.begin(), s = er.names.begin(); i != er.values.end(); ++i, ++s) {
if (str == (*s) || nocase_cmp (str, *s) == 0) {
return (*i);
}
}
}
throw unknown_enumeration(str);
}