diff options
author | Carl Hetherington <carl@carlh.net> | 2009-07-04 12:40:26 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-07-04 12:40:26 +0000 |
commit | 36564e4f910bc31fa23a6e73da8440f6ad78a2fc (patch) | |
tree | a04b741577686802733c0804311943be44bc65cb /gtk2_ardour | |
parent | 12bf437c6eb6677f10ef7d09b1e096cf67ed73b1 (diff) |
Use std::string for order key map.
git-svn-id: svn://localhost/ardour2/branches/3.0@5318 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_routes.cc | 22 | ||||
-rw-r--r-- | gtk2_ardour/editor_routes.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/mixer_ui.h | 4 |
4 files changed, 16 insertions, 18 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 23e12b1135..161d8c61fb 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -152,8 +152,6 @@ EditorRoutes::show_menu () _menu->popup (1, gtk_get_current_event_time()); } -const char* _order_key = N_("editor"); - void EditorRoutes::redisplay () { @@ -181,7 +179,7 @@ EditorRoutes::redisplay () to tracks. */ - route->set_order_key (_order_key, n); + route->set_order_key (N_ ("editor"), n); } bool visible = (*i)[_columns.visible]; @@ -218,7 +216,7 @@ EditorRoutes::redisplay () } if (!_redisplay_does_not_reset_order_keys && !_redisplay_does_not_sync_order_keys) { - _editor->current_session()->sync_order_keys (_order_key); + _editor->current_session()->sync_order_keys (N_ ("editor")); } } @@ -264,8 +262,8 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes) _ignore_reorder = true; /* added a new fresh one at the end */ - if ((*x)->route()->order_key(_order_key) == -1) { - (*x)->route()->set_order_key (_order_key, _model->children().size()-1); + if ((*x)->route()->order_key (N_ ("editor")) == -1) { + (*x)->route()->set_order_key (N_ ("editor"), _model->children().size()-1); } _ignore_reorder = false; @@ -402,7 +400,7 @@ EditorRoutes::reordered (TreeModel::Path const & path, TreeModel::iterator const void -EditorRoutes::sync_order_keys (char const * src) +EditorRoutes::sync_order_keys (string const & src) { vector<int> neworder; TreeModel::Children rows = _model->children(); @@ -410,7 +408,7 @@ EditorRoutes::sync_order_keys (char const * src) ARDOUR::Session* s = _editor->current_session (); - if ((strcmp (src, _order_key) == 0) || !s || (s->state_of_the_state() & Session::Loading) || rows.empty()) { + if (src != N_ ("editor") || !s || (s->state_of_the_state() & Session::Loading) || rows.empty()) { return; } @@ -425,7 +423,7 @@ EditorRoutes::sync_order_keys (char const * src) boost::shared_ptr<Route> route = (*ri)[_columns.route]; int old_key = order; - int new_key = route->order_key (_order_key); + int new_key = route->order_key (N_ ("editor")); neworder[new_key] = old_key; @@ -622,7 +620,7 @@ EditorRoutes::selection_filter (Glib::RefPtr<TreeModel> const &, TreeModel::Path struct EditorOrderRouteSorter { bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) { /* use of ">" forces the correct sort order */ - return a->order_key (_order_key) < b->order_key (_order_key); + return a->order_key (N_ ("editor")) < b->order_key (N_ ("editor")); } }; @@ -794,12 +792,12 @@ EditorRoutes::move_selected_tracks (bool up) } for (leading = view_routes.begin(); leading != view_routes.end(); ++leading) { - neworder.push_back (leading->second->order_key (_order_key)); + neworder.push_back (leading->second->order_key (N_ ("editor"))); } _model->reorder (neworder); - _editor->current_session()->sync_order_keys (_order_key); + _editor->current_session()->sync_order_keys (N_ ("editor")); } void diff --git a/gtk2_ardour/editor_routes.h b/gtk2_ardour/editor_routes.h index b493b0a905..f416f8f195 100644 --- a/gtk2_ardour/editor_routes.h +++ b/gtk2_ardour/editor_routes.h @@ -54,7 +54,7 @@ private: void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *); bool button_press (GdkEventButton *); void route_name_changed (boost::weak_ptr<ARDOUR::Route>); - void sync_order_keys (char const *); + void sync_order_keys (std::string const &); void route_removed (TimeAxisView *); void handle_gui_changes (std::string const &, void *); void update_rec_display (); diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index d43bd92401..3010f0b0a1 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -374,7 +374,7 @@ Mixer_UI::remove_strip (MixerStrip* strip) strip_redisplay_does_not_sync_order_keys = false; } -const char* +string Mixer_UI::get_order_key() { return X_("signal"); @@ -388,13 +388,13 @@ Mixer_UI::get_order_key() } void -Mixer_UI::sync_order_keys (const char *src) +Mixer_UI::sync_order_keys (string const & src) { vector<int> neworder; TreeModel::Children rows = track_model->children(); TreeModel::Children::iterator ri; - if ((strcmp (src, get_order_key()) == 0) || !session || (session->state_of_the_state() & Session::Loading) || rows.empty()) { + if (src != get_order_key() || !session || (session->state_of_the_state() & Session::Loading) || rows.empty()) { return; } diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index 1ebe0e031b..894b9b364f 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -80,7 +80,7 @@ class Mixer_UI : public Gtk::Window RouteRedirectSelection& selection() { return _selection; } - static const char* get_order_key(); + static std::string get_order_key(); private: ARDOUR::Session *session; @@ -243,7 +243,7 @@ class Mixer_UI : public Gtk::Window Width _strip_width; - void sync_order_keys (const char *src); + void sync_order_keys (std::string const &); bool strip_redisplay_does_not_reset_order_keys; bool strip_redisplay_does_not_sync_order_keys; bool ignore_sync; |