From c2956012ff838644229e4c926f3bbb44e1d78892 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 7 Dec 2011 03:22:35 +0000 Subject: add "enabled" column to editor route groups list and check logic git-svn-id: svn://localhost/ardour2/branches/3.0@10928 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_route_groups.cc | 59 ++++++++++++++++++++------------- gtk2_ardour/editor_route_groups.h | 2 ++ gtk2_ardour/export_filename_selector.cc | 44 ++++++++++++++++++++---- gtk2_ardour/export_filename_selector.h | 1 + 4 files changed, 76 insertions(+), 30 deletions(-) diff --git a/gtk2_ardour/editor_route_groups.cc b/gtk2_ardour/editor_route_groups.cc index a98a120f45..f1745a49b5 100644 --- a/gtk2_ardour/editor_route_groups.cc +++ b/gtk2_ardour/editor_route_groups.cc @@ -76,6 +76,7 @@ EditorRouteGroups::EditorRouteGroups (Editor* e) _display.append_column ("", _columns.text); _display.append_column ("", _columns.is_visible); + _display.append_column ("", _columns.active_state); _display.append_column ("", _columns.gain); _display.append_column ("", _columns.gain_relative); _display.append_column ("", _columns.mute); @@ -84,7 +85,7 @@ EditorRouteGroups::EditorRouteGroups (Editor* e) _display.append_column ("", _columns.monitoring); _display.append_column ("", _columns.select); _display.append_column ("", _columns.edits); - _display.append_column ("", _columns.active_state); + _display.append_column ("", _columns.active_shared); TreeViewColumn* col; Gtk::Label* l; @@ -93,15 +94,16 @@ EditorRouteGroups::EditorRouteGroups (Editor* e) { 0, _("Col"), _("Group Tab Color") }, { 1, _("Name"), _("Name of Group") }, { 2, _("V"), _("Group is visible?") }, - { 3, S_("group|G"), _("Sharing Gain?") }, - { 4, S_("relative|Rel"), _("Relevative Gain Changes?") }, - { 5, S_("mute|M"), _("Sharing Mute?") }, - { 6, S_("solo|S"), _("Sharing Solo?") }, - { 7, _("Rec"), _("Sharing Record-enable Status?") }, - { 8, S_("monitoring|Mon"), _("Sharing Monitoring Choice?") }, - { 9, S_("selection|Sel"), _("Sharing Selected Status?") }, - { 10, S_("editing|E"), _("Sharing Editing?") }, - { 11, S_("active|A"), _("Sharing Active Status?") }, + { 3, _("On"), _("Group is enabled?") }, + { 4, S_("group|G"), _("Sharing Gain?") }, + { 5, S_("relative|Rel"), _("Relevative Gain Changes?") }, + { 6, S_("mute|M"), _("Sharing Mute?") }, + { 7, S_("solo|S"), _("Sharing Solo?") }, + { 8, _("Rec"), _("Sharing Record-enable Status?") }, + { 9, S_("monitoring|Mon"), _("Sharing Monitoring Choice?") }, + { 10, S_("selection|Sel"), _("Sharing Selected Status?") }, + { 11, S_("editing|E"), _("Sharing Editing?") }, + { 12, S_("active|A"), _("Sharing Active Status?") }, { -1, 0, 0 } }; @@ -308,56 +310,63 @@ EditorRouteGroups::button_press_event (GdkEventButton* ev) case 3: + val = (*iter)[_columns.active_state]; + group->set_active (!val, this); + ret = true; + break; + + case 4: val = (*iter)[_columns.gain]; group->set_gain (!val); ret = true; break; - case 4: + case 5: val = (*iter)[_columns.gain_relative]; group->set_relative (!val, this); ret = true; break; - case 5: + case 6: val = (*iter)[_columns.mute]; group->set_mute (!val); ret = true; break; - case 6: + case 7: val = (*iter)[_columns.solo]; group->set_solo (!val); ret = true; break; - case 7: + case 8: val = (*iter)[_columns.record]; group->set_recenable (!val); ret = true; break; - case 8: + case 9: val = (*iter)[_columns.monitoring]; group->set_monitoring (!val); ret = true; break; - case 9: + case 10: val = (*iter)[_columns.select]; group->set_select (!val); ret = true; break; - case 10: + case 11: val = (*iter)[_columns.edits]; group->set_edit (!val); ret = true; break; - case 11: - val = (*iter)[_columns.active_state]; - group->set_active (!val, this); + case 12: + val = (*iter)[_columns.active_shared]; + cerr << "set group active to " << !val << endl; + group->set_route_active (!val); ret = true; break; @@ -400,8 +409,10 @@ EditorRouteGroups::row_change (const Gtk::TreeModel::Path& path, const Gtk::Tree plist.add (Properties::select, val); val = (*iter)[_columns.edits]; plist.add (Properties::edit, val); - val = (*iter)[_columns.active_state]; + val = (*iter)[_columns.active_shared]; plist.add (Properties::route_active, val); + val = (*iter)[_columns.active_state]; + plist.add (Properties::active, val); val = (*iter)[_columns.is_visible]; plist.add (Properties::hidden, !val); @@ -426,7 +437,8 @@ EditorRouteGroups::add (RouteGroup* group) row[_columns.monitoring] = group->is_monitoring(); row[_columns.select] = group->is_select (); row[_columns.edits] = group->is_edit (); - row[_columns.active_state] = group->is_route_active (); + row[_columns.active_shared] = group->is_route_active (); + row[_columns.active_state] = group->is_active (); row[_columns.is_visible] = !group->is_hidden(); row[_columns.gdkcolor] = GroupTabs::group_color (group); @@ -496,7 +508,8 @@ EditorRouteGroups::property_changed (RouteGroup* group, const PropertyChange& ch (*iter)[_columns.monitoring] = group->is_monitoring (); (*iter)[_columns.select] = group->is_select (); (*iter)[_columns.edits] = group->is_edit (); - (*iter)[_columns.active_state] = group->is_route_active (); + (*iter)[_columns.active_shared] = group->is_route_active (); + (*iter)[_columns.active_state] = group->is_active (); (*iter)[_columns.is_visible] = !group->is_hidden(); (*iter)[_columns.gdkcolor] = GroupTabs::group_color (group); diff --git a/gtk2_ardour/editor_route_groups.h b/gtk2_ardour/editor_route_groups.h index fc29c9bb78..94ab3658f3 100644 --- a/gtk2_ardour/editor_route_groups.h +++ b/gtk2_ardour/editor_route_groups.h @@ -50,6 +50,7 @@ private: add (monitoring); add (select); add (edits); + add (active_shared); add (active_state); add (routegroup); } @@ -65,6 +66,7 @@ private: Gtk::TreeModelColumn monitoring; Gtk::TreeModelColumn select; Gtk::TreeModelColumn edits; + Gtk::TreeModelColumn active_shared; Gtk::TreeModelColumn active_state; Gtk::TreeModelColumn routegroup; }; diff --git a/gtk2_ardour/export_filename_selector.cc b/gtk2_ardour/export_filename_selector.cc index 2912ce75e6..789b7eb435 100644 --- a/gtk2_ardour/export_filename_selector.cc +++ b/gtk2_ardour/export_filename_selector.cc @@ -18,6 +18,8 @@ */ +#include + #include "export_filename_selector.h" #include "ardour/export_handler.h" @@ -93,6 +95,7 @@ ExportFilenameSelector::ExportFilenameSelector () : label_entry.signal_changed().connect (sigc::mem_fun (*this, &ExportFilenameSelector::update_label)); path_entry.signal_changed().connect (sigc::mem_fun (*this, &ExportFilenameSelector::update_folder)); + path_entry.signal_activate().connect (sigc::mem_fun (*this, &ExportFilenameSelector::check_folder), false); session_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFilenameSelector::change_session_selection)); @@ -225,6 +228,23 @@ ExportFilenameSelector::update_folder () CriticalSelectionChanged(); } +void +ExportFilenameSelector::check_folder () +{ + if (!filename) { + return; + } + + if (!Glib::file_test (path_entry.get_text(), Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) { + Gtk::MessageDialog msg (string_compose (_("%1: this is only the directory/folder name, not the filename.\n\ +The filename will be chosen from the information just above the folder selector."), path_entry.get_text())); + msg.run (); + path_entry.set_text (Glib::path_get_dirname (path_entry.get_text())); + filename->set_folder (path_entry.get_text()); + CriticalSelectionChanged(); + } +} + void ExportFilenameSelector::change_date_format () { @@ -295,13 +315,23 @@ ExportFilenameSelector::open_browse_dialog () dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK); - int result = dialog.run(); - - if (result == Gtk::RESPONSE_OK) { - std::string filename = dialog.get_filename(); - - if (filename.length()) { - path_entry.set_text (filename); + while (true) { + int result = dialog.run(); + + if (result == Gtk::RESPONSE_OK) { + std::string filename = dialog.get_filename(); + + if (!Glib::file_test (filename, Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) { + Gtk::MessageDialog msg (string_compose (_("%1: this is only the directory/folder name, not the filename.\n\ +The filename will be chosen from the information just above the folder selector."), filename)); + msg.run (); + continue; + } + + if (filename.length()) { + path_entry.set_text (filename); + break; + } } } diff --git a/gtk2_ardour/export_filename_selector.h b/gtk2_ardour/export_filename_selector.h index 4db87d943b..8522f79b20 100644 --- a/gtk2_ardour/export_filename_selector.h +++ b/gtk2_ardour/export_filename_selector.h @@ -48,6 +48,7 @@ class ExportFilenameSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr void update_label (); void update_folder (); + void check_folder (); void change_date_format (); void change_time_format (); -- cgit v1.2.3