From b362ff220cbd1a17f1b6621b624d3801101fad3e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 23 Sep 2013 14:41:52 -0400 Subject: [PATCH] major rearrangement of startup/session loading code first-time user code remains in ArdourStartup session selection/setup moved to SessionDialog many other cleanups, logic improvements, and so forth to the overall session loading process. Not 100% finished yet. --- gtk2_ardour/ardour_ui.cc | 123 ++-- gtk2_ardour/ardour_ui.h | 11 +- gtk2_ardour/engine_dialog.cc | 1 + gtk2_ardour/session_dialog.cc | 997 ++++++++++++++++++++++++++++++++ gtk2_ardour/session_dialog.h | 231 ++++++++ gtk2_ardour/small-splash.png | Bin 0 -> 26238 bytes gtk2_ardour/startup.cc | 1015 ++------------------------------- gtk2_ardour/startup.h | 173 +----- gtk2_ardour/utils.cc | 2 +- gtk2_ardour/wscript | 1 + 10 files changed, 1354 insertions(+), 1200 deletions(-) create mode 100644 gtk2_ardour/session_dialog.cc create mode 100644 gtk2_ardour/session_dialog.h create mode 100644 gtk2_ardour/small-splash.png diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 133b61c17f..129b77f0a4 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -109,6 +109,7 @@ typedef uint64_t microseconds_t; #include "rc_option_editor.h" #include "route_time_axis.h" #include "route_params_ui.h" +#include "session_dialog.h" #include "session_metadata_dialog.h" #include "session_option_editor.h" #include "shuttle_control.h" @@ -156,7 +157,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) /* start of private members */ - , _startup (0) , nsm (0) , _was_dirty (false) , _mixer_on_top (false) @@ -775,10 +775,33 @@ ARDOUR_UI::startup () delete nsm; nsm = 0; } - } - else if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) { - exit (1); + } else { + + if (ArdourStartup::required()) { + ArdourStartup s; + s.present (); + main().run(); + s.hide (); + switch (s.response ()) { + case Gtk::RESPONSE_REJECT: + exit (1); + default: + break; + } + } + + /* we need to create this early because it may need to set the + * audio backend end up. + */ + + audio_midi_setup.get (true); + + /* go get a session */ + + if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) { + exit (1); + } } use_config (); @@ -2431,7 +2454,7 @@ ARDOUR_UI::ask_about_loading_existing_session (const std::string& session_path) } int -ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::string& session_name) +ARDOUR_UI::build_session_from_dialog (SessionDialog& sd, const std::string& session_path, const std::string& session_name) { BusProfile bus_profile; @@ -2447,13 +2470,13 @@ ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::s /* get settings from advanced section of NSD */ - if (_startup->create_master_bus()) { - bus_profile.master_out_channels = (uint32_t) _startup->master_channel_count(); + if (sd.create_master_bus()) { + bus_profile.master_out_channels = (uint32_t) sd.master_channel_count(); } else { bus_profile.master_out_channels = 0; } - if (_startup->connect_inputs()) { + if (sd.connect_inputs()) { bus_profile.input_ac = AutoConnectPhysical; } else { bus_profile.input_ac = AutoConnectOption (0); @@ -2461,16 +2484,16 @@ ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::s bus_profile.output_ac = AutoConnectOption (0); - if (_startup->connect_outputs ()) { - if (_startup->connect_outs_to_master()) { + if (sd.connect_outputs ()) { + if (sd.connect_outs_to_master()) { bus_profile.output_ac = AutoConnectMaster; - } else if (_startup->connect_outs_to_physical()) { + } else if (sd.connect_outs_to_physical()) { bus_profile.output_ac = AutoConnectPhysical; } } - bus_profile.requested_physical_in = (uint32_t) _startup->input_limit_count(); - bus_profile.requested_physical_out = (uint32_t) _startup->output_limit_count(); + bus_profile.requested_physical_in = (uint32_t) sd.input_limit_count(); + bus_profile.requested_physical_out = (uint32_t) sd.output_limit_count(); } if (build_session (session_path, session_name, bus_profile)) { @@ -2529,6 +2552,8 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri template_name = load_template; } + SessionDialog session_dialog (should_be_new, session_name, session_path, load_template); + while (ret != 0) { if (!ARDOUR_COMMAND_LINE::session_name.empty()) { @@ -2553,31 +2578,28 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri session_name = ""; } - delete _startup; - _startup = new ArdourStartup (should_be_new, session_name, session_path, load_template); - - if (!_startup->ready_without_display()) { - _startup->present (); - main().run(); - _startup->hide (); - } - - switch (_startup->response()) { - case RESPONSE_OK: - break; - default: - if (quit_on_cancel) { - exit (1); - } else { - return ret; + if (should_be_new || session_name.empty()) { + /* need the dialog to get info from user */ + + switch (session_dialog.run()) { + case RESPONSE_ACCEPT: + break; + default: + if (quit_on_cancel) { + exit (1); + } else { + return ret; + } } + + session_dialog.hide (); } /* if we run the startup dialog again, offer more than just "new session" */ should_be_new = false; - session_name = _startup->session_name (likely_new); + session_name = session_dialog.session_name (likely_new); if (nsm) { likely_new = true; @@ -2595,8 +2617,8 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri continue; } - if (_startup->use_session_template()) { - template_name = _startup->session_template_name(); + if (session_dialog.use_session_template()) { + template_name = session_dialog.session_template_name(); _session_is_new = true; } @@ -2613,12 +2635,12 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri } else { - session_path = _startup->session_folder(); + session_path = session_dialog.session_folder(); char illegal = Session::session_name_is_legal (session_name); if (illegal) { - MessageDialog msg (*_startup, + MessageDialog msg (session_dialog, string_compose (_("To ensure compatibility with various systems\n" "session names may not contain a '%1' character"), illegal)); @@ -2645,12 +2667,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri } else { if (!likely_new) { - if (_startup) { - pop_back_splash (*_startup); - } else { - hide_splash (); - } - + pop_back_splash (session_dialog); MessageDialog msg (string_compose (_("There is no existing session at \"%1\""), session_path)); msg.run (); ARDOUR_COMMAND_LINE::session_name = ""; // cancel that @@ -2659,8 +2676,8 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri char illegal = Session::session_name_is_legal(session_name); if (illegal) { - pop_back_splash (*_startup); - MessageDialog msg (*_startup, string_compose(_("To ensure compatibility with various systems\n" + pop_back_splash (session_dialog); + MessageDialog msg (session_dialog, string_compose(_("To ensure compatibility with various systems\n" "session names may not contain a '%1' character"), illegal)); msg.run (); ARDOUR_COMMAND_LINE::session_name = ""; // cancel that @@ -2672,7 +2689,9 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri if (likely_new && template_name.empty()) { - ret = build_session_from_nsd (session_path, session_name); + cerr << "building a session from dialog\n"; + + ret = build_session_from_dialog (session_dialog, session_path, session_name); } else { @@ -2779,22 +2798,12 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name, Gtk::MESSAGE_INFO, BUTTONS_OK); + msg.set_keep_above (true); msg.set_title (_("Loading Error")); - msg.set_secondary_text (_("Click the Refresh button to try again.")); - msg.add_button (Stock::REFRESH, 1); msg.set_position (Gtk::WIN_POS_CENTER); pop_back_splash (msg); msg.present (); - - int response = msg.run (); - - switch (response) { - case 1: - break; - default: - exit (1); - } - + (void) msg.run (); msg.hide (); goto out; @@ -4080,6 +4089,8 @@ ARDOUR_UI::reset_route_peak_display (Route* route) int ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate) { + cerr << "Do AMS\n"; + audio_midi_setup->set_desired_sample_rate (desired_sample_rate); switch (audio_midi_setup->run()) { diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 47d0f4f4e8..191df0d31d 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -83,7 +83,6 @@ class AddRouteDialog; class AddVideoDialog; class VideoTimeLine; class SystemExec; -class ArdourStartup; class ArdourKeyboard; class AudioClock; class BigClockWindow; @@ -98,6 +97,7 @@ class Mixer_UI; class PublicEditor; class RCOptionEditor; class RouteParams_UI; +class SessionDialog; class SessionOptionEditor; class ShuttleControl; class Splash; @@ -153,7 +153,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr bool get_smart_mode () const; int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = ""); - int build_session_from_nsd (const std::string& session_name, const std::string& session_path); + int build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path); bool ask_about_loading_existing_session (const std::string& session_path); /// @return true if session was successfully unloaded. @@ -312,11 +312,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void toggle_session_options_window (); private: - ArdourStartup* _startup; - Gtk::Tooltips _tooltips; + Gtk::Tooltips _tooltips; NSM_Client *nsm; - bool _was_dirty; - bool _mixer_on_top; + bool _was_dirty; + bool _mixer_on_top; bool first_time_engine_run; void goto_editor_window (); diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index b10cc626b6..79bda1bcc5 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -234,6 +234,7 @@ EngineControl::EngineControl () ARDOUR::AudioEngine::instance()->Stopped.connect (stopped_connection, MISSING_INVALIDATOR, boost::bind (&EngineControl::engine_stopped, this), gui_context()); ARDOUR::AudioEngine::instance()->Halted.connect (stopped_connection, MISSING_INVALIDATOR, boost::bind (&EngineControl::engine_stopped, this), gui_context()); + cerr << "AMS about to change backend\n"; backend_changed (); if (audio_setup) { diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc new file mode 100644 index 0000000000..481b587b71 --- /dev/null +++ b/gtk2_ardour/session_dialog.cc @@ -0,0 +1,997 @@ +/* + Copyright (C) 2013 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifdef WAF_BUILD +#include "gtk2ardour-config.h" +#endif + +#include +#include + +#include + +#include "pbd/failed_constructor.h" +#include "pbd/file_utils.h" +#include "pbd/replace_all.h" +#include "pbd/whitespace.h" +#include "pbd/stacktrace.h" +#include "pbd/openuri.h" + +#include "ardour/audioengine.h" +#include "ardour/filesystem_paths.h" +#include "ardour/recent_sessions.h" +#include "ardour/session.h" +#include "ardour/session_state_utils.h" +#include "ardour/template_utils.h" +#include "ardour/filename_extensions.h" + +#include "ardour_ui.h" +#include "session_dialog.h" +#include "opts.h" +#include "engine_dialog.h" +#include "i18n.h" +#include "utils.h" + +using namespace std; +using namespace Gtk; +using namespace Gdk; +using namespace Glib; +using namespace PBD; +using namespace ARDOUR; + +static string poor_mans_glob (string path) +{ + string copy = path; + replace_all (copy, "~", Glib::get_home_dir()); + return copy; +} + +SessionDialog::SessionDialog (bool require_new, const std::string& session_name, const std::string& session_path, const std::string& template_name) + : ArdourDialog (_("Session Setup")) + , new_only (require_new) + , _provided_session_name (session_name) + , _provided_session_path (session_path) + , new_folder_chooser (FILE_CHOOSER_ACTION_SELECT_FOLDER) + , more_new_session_options_button (_("Advanced options ...")) + , _output_limit_count_adj (1, 0, 100, 1, 10, 0) + , _input_limit_count_adj (1, 0, 100, 1, 10, 0) + , _master_bus_channel_count_adj (2, 0, 100, 1, 10, 0) + , _existing_session_chooser_used (false) +{ + if (!session_name.empty() && !require_new) { + response (RESPONSE_OK); + return; + } + + set_keep_above (true); + set_position (WIN_POS_CENTER); + + string image_path; + + if (find_file_in_search_path (ardour_data_search_path(), "small-splash.png", image_path)) { + Gtk::Image* image; + if ((image = manage (new Gtk::Image (image_path))) != 0) { + get_vbox()->pack_start (*image, false, false); + } + } + + setup_new_session_page (); + + if (!new_only) { + setup_initial_choice_box (); + get_vbox()->pack_start (ic_vbox, true, true); + } else { + get_vbox()->pack_start (session_new_vbox, true, true); + } + + if (!template_name.empty()) { + use_template_button.set_active (false); + load_template_override = template_name; + } + + get_vbox()->show_all (); + + cancel_button = add_button (Stock::QUIT, RESPONSE_CANCEL); + back_button = add_button (Stock::GO_BACK, RESPONSE_NO); + open_button = add_button (Stock::OPEN, RESPONSE_ACCEPT); + + back_button->signal_button_press_event().connect (sigc::mem_fun (*this, &SessionDialog::back_button_pressed), false); + + open_button->set_sensitive (false); + back_button->set_sensitive (false); + + /* fill data models and how/hide accordingly */ + + populate_session_templates (); + + if (!template_model->children().empty()) { + use_template_button.show(); + template_chooser.show (); + } else { + use_template_button.hide(); + template_chooser.hide (); + } + + if (recent_session_model) { + int cnt = redisplay_recent_sessions (); + if (cnt > 0) { + recent_scroller.show(); + recent_label.show (); + + if (cnt > 4) { + recent_scroller.set_size_request (-1, 300); + } + } else { + recent_scroller.hide(); + recent_label.hide (); + } + } +} + +SessionDialog::~SessionDialog() +{ +} + +bool +SessionDialog::use_session_template () +{ + if (!load_template_override.empty()) { + return true; + } + + if (use_template_button.get_active()) { + return true; + } + + return false; +} + +std::string +SessionDialog::session_template_name () +{ + if (!load_template_override.empty()) { + string the_path (ARDOUR::user_template_directory()); + return Glib::build_filename (the_path, load_template_override + ARDOUR::template_suffix); + } + + if (use_template_button.get_active()) { + TreeModel::iterator iter = template_chooser.get_active (); + TreeModel::Row row = (*iter); + string s = row[session_template_columns.path]; + return s; + } + + return string(); +} + +std::string +SessionDialog::session_name (bool& should_be_new) +{ + if (!_provided_session_name.empty() && !new_only) { + return _provided_session_name; + } + + /* Try recent session selection */ + + TreeIter iter = recent_session_display.get_selection()->get_selected(); + + if (iter) { + should_be_new = false; + return (*iter)[recent_session_columns.visible_name]; + } + + if (_existing_session_chooser_used) { + /* existing session chosen from file chooser */ + should_be_new = false; + return existing_session_chooser.get_filename (); + } else { + should_be_new = true; + string val = new_name_entry.get_text (); + strip_whitespace_edges (val); + return val; + } +} + +std::string +SessionDialog::session_folder () +{ + if (!_provided_session_path.empty() && !new_only) { + return _provided_session_path; + } + + /* Try recent session selection */ + + TreeIter iter = recent_session_display.get_selection()->get_selected(); + + if (iter) { + return (*iter)[recent_session_columns.fullpath]; + } + + if (_existing_session_chooser_used) { + /* existing session chosen from file chooser */ + return existing_session_chooser.get_current_folder (); + } else { + std::string legal_session_folder_name = legalize_for_path (new_name_entry.get_text()); + return Glib::build_filename (new_folder_chooser.get_current_folder(), legal_session_folder_name); + } +} + +void +SessionDialog::setup_initial_choice_box () +{ + ic_vbox.set_spacing (6); + ic_vbox.set_border_width (24); + + HBox* centering_hbox = manage (new HBox); + VBox* centering_vbox = manage (new VBox); + + centering_vbox->set_spacing (6); + + Label* new_label = manage (new Label); + new_label->set_markup (string_compose ("%1", _("Create a new session"))); + + ic_new_session_button.add (*new_label); + ic_new_session_button.signal_clicked().connect (sigc::mem_fun (*this, &SessionDialog::new_session_button_clicked)); + + centering_vbox->pack_start (ic_new_session_button, false, true); + + /* Possible update message */ + + if (ARDOUR_UI::instance()->announce_string() != "" ) { + + Gtk::Frame *info_frame = manage(new Gtk::Frame); + info_frame->set_shadow_type(SHADOW_ETCHED_OUT); + centering_vbox->pack_start (*info_frame, false, false, 20); + + Box *info_box = manage (new VBox); + info_box->set_border_width (12); + info_box->set_spacing (6); + info_box->set_name("mixbus_info_box"); + + info_box->pack_start (info_scroller_label, false, false); + + info_frame->add (*info_box); + info_frame->show_all(); + + info_scroller_count = 0; + info_scroller_connection = Glib::signal_timeout().connect (mem_fun(*this, &SessionDialog::info_scroller_update), 50); + + Gtk::Button *updates_button = manage (new Gtk::Button (_("Check the website for more..."))); + + updates_button->signal_clicked().connect (mem_fun(*this, &SessionDialog::updates_button_clicked) ); + ARDOUR_UI::instance()->tooltips().set_tip (*updates_button, _("Click to open the program website in your web browser")); + + info_box->pack_start (*updates_button, false, false); + } + + /* recent session scroller */ + + recent_label.set_no_show_all (true); + recent_scroller.set_no_show_all (true); + + recent_label.set_markup (string_compose ("%1", _("... or load a recent session"))); + recent_label.set_alignment (0, 0.5); + + recent_session_model = TreeStore::create (recent_session_columns); + + recent_session_display.set_model (recent_session_model); + recent_session_display.append_column (_("Recent Sessions"), recent_session_columns.visible_name); + recent_session_display.set_headers_visible (false); + recent_session_display.get_selection()->set_mode (SELECTION_SINGLE); + + recent_session_display.get_selection()->signal_changed().connect (sigc::mem_fun (*this, &SessionDialog::recent_session_row_selected)); + + recent_scroller.add (recent_session_display); + recent_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + recent_scroller.set_shadow_type (Gtk::SHADOW_IN); + + recent_session_display.show(); + recent_session_display.signal_row_activated().connect (sigc::mem_fun (*this, &SessionDialog::recent_row_activated)); + + centering_vbox->pack_start (recent_label, false, false, 12); + centering_vbox->pack_start (recent_scroller, false, true); + + /* Browse button */ + + existing_session_chooser.set_title (_("Select session file")); + existing_session_chooser.signal_file_set().connect (sigc::mem_fun (*this, &SessionDialog::existing_session_selected)); + existing_session_chooser.set_current_folder(poor_mans_glob (Config->get_default_session_parent_dir())); + + FileFilter session_filter; + session_filter.add_pattern ("*.ardour"); + session_filter.set_name (string_compose (_("%1 sessions"), PROGRAM_NAME)); + existing_session_chooser.add_filter (session_filter); + existing_session_chooser.set_filter (session_filter); + +#ifdef GTKOSX + existing_session_chooser.add_shortcut_folder ("/Volumes"); +#endif + + Label* browse_label = manage (new Label); + browse_label->set_markup (string_compose ("%1", _("... or browse for existing sessions"))); + browse_label->set_alignment (0, 0.5); + + centering_vbox->pack_start (*browse_label, false, false, 12); + centering_vbox->pack_start (existing_session_chooser, false, false); + + /* pack it all up */ + + centering_hbox->pack_start (*centering_vbox, true, true); + ic_vbox.pack_start (*centering_hbox, true, true); + ic_vbox.show_all (); +} + +void +SessionDialog::session_selected () +{ + /* HACK HACK HACK ... change the "Apply" button label + to say "Open" + */ + + Gtk::Widget* tl = ic_vbox.get_toplevel(); + Gtk::Window* win; + if ((win = dynamic_cast(tl)) != 0) { + /* ::get_default_widget() is not wrapped in gtkmm */ + Gtk::Widget* def = wrap (gtk_window_get_default_widget (win->gobj())); + Gtk::Button* button; + if ((button = dynamic_cast(def)) != 0) { + button->set_label (_("Open")); + } + } +} + +void +SessionDialog::new_session_button_clicked () +{ + _existing_session_chooser_used = false; + recent_session_display.get_selection()->unselect_all (); + + get_vbox()->remove (ic_vbox); + get_vbox()->pack_start (session_new_vbox, true, true); + back_button->set_sensitive (true); + new_name_entry.grab_focus (); +} + +bool +SessionDialog::back_button_pressed (GdkEventButton*) +{ + get_vbox()->remove (session_new_vbox); + back_button->set_sensitive (false); + get_vbox()->pack_start (ic_vbox); + + return true; +} + +void +SessionDialog::populate_session_templates () +{ + vector templates; + + find_session_templates (templates); + + template_model->clear (); + + for (vector::iterator x = templates.begin(); x != templates.end(); ++x) { + TreeModel::Row row; + + row = *(template_model->append ()); + + row[session_template_columns.name] = (*x).name; + row[session_template_columns.path] = (*x).path; + } + + if (!templates.empty()) { + /* select first row */ + template_chooser.set_active (0); + } +} + +void +SessionDialog::setup_new_session_page () +{ + session_new_vbox.set_border_width (12); + session_new_vbox.set_spacing (18); + + VBox *vbox1 = manage (new VBox); + HBox* hbox1 = manage (new HBox); + Label* label1 = manage (new Label); + + vbox1->set_spacing (6); + + hbox1->set_spacing (6); + hbox1->pack_start (*label1, false, false); + hbox1->pack_start (new_name_entry, true, true); + + label1->set_text (_("Session name:")); + + if (!ARDOUR_COMMAND_LINE::session_name.empty()) { + new_name_entry.set_text (Glib::path_get_basename (ARDOUR_COMMAND_LINE::session_name)); + /* name provided - they can move right along */ + open_button->set_sensitive (true); + } + + new_name_entry.signal_changed().connect (sigc::mem_fun (*this, &SessionDialog::new_name_changed)); + new_name_entry.signal_activate().connect (sigc::mem_fun (*this, &SessionDialog::new_name_activated)); + + vbox1->pack_start (*hbox1, true, true); + + /* --- */ + + HBox* hbox2 = manage (new HBox); + Label* label2 = manage (new Label); + + hbox2->set_spacing (6); + hbox2->pack_start (*label2, false, false); + hbox2->pack_start (new_folder_chooser, true, true); + + label2->set_text (_("Create session folder in:")); + + if (!ARDOUR_COMMAND_LINE::session_name.empty()) { + new_folder_chooser.set_current_folder (poor_mans_glob (Glib::path_get_dirname (ARDOUR_COMMAND_LINE::session_name))); + } else if (ARDOUR_UI::instance()->session_loaded) { + // point the new session file chooser at the parent directory of the current session + string session_parent_dir = Glib::path_get_dirname(ARDOUR_UI::instance()->the_session()->path()); + string::size_type last_dir_sep = session_parent_dir.rfind(G_DIR_SEPARATOR); + session_parent_dir = session_parent_dir.substr(0, last_dir_sep); + new_folder_chooser.set_current_folder (session_parent_dir); + string default_session_folder = poor_mans_glob (Config->get_default_session_parent_dir()); + + try { + /* add_shortcut_folder throws an exception if the folder being added already has a shortcut */ + new_folder_chooser.add_shortcut_folder (default_session_folder); + } + catch (Glib::Error & e) { + std::cerr << "new_folder_chooser.add_shortcut_folder (" << default_session_folder << ") threw Glib::Error " << e.what() << std::endl; + } + } else { + new_folder_chooser.set_current_folder (poor_mans_glob (Config->get_default_session_parent_dir())); + } + new_folder_chooser.show (); + new_folder_chooser.set_title (_("Select folder for session")); + +#ifdef __APPLE__ + new_folder_chooser.add_shortcut_folder ("/Volumes"); +#endif + + vbox1->pack_start (*hbox2, false, false); + + session_new_vbox.pack_start (*vbox1, false, false); + + /* --- */ + + VBox *vbox2 = manage (new VBox); + HBox* hbox3 = manage (new HBox); + template_model = ListStore::create (session_template_columns); + + vbox2->set_spacing (6); + + VBox *vbox3 = manage (new VBox); + + vbox3->set_spacing (6); + + /* we may want to hide this and show it at various + times depending on the existence of templates. + */ + template_chooser.set_no_show_all (true); + use_template_button.set_no_show_all (true); + + HBox* hbox4a = manage (new HBox); + use_template_button.set_label (_("Use this template")); + + TreeModel::Row row = *template_model->prepend (); + row[session_template_columns.name] = (_("no template")); + row[session_template_columns.path] = string(); + + hbox4a->set_spacing (6); + hbox4a->pack_start (use_template_button, false, false); + hbox4a->pack_start (template_chooser, true, true); + + template_chooser.set_model (template_model); + + Gtk::CellRendererText* text_renderer = Gtk::manage (new Gtk::CellRendererText); + text_renderer->property_editable() = false; + + template_chooser.pack_start (*text_renderer); + template_chooser.add_attribute (text_renderer->property_text(), session_template_columns.name); + template_chooser.set_active (0); + + vbox3->pack_start (*hbox4a, false, false); + + /* --- */ + + HBox* hbox5 = manage (new HBox); + + hbox5->set_spacing (6); + hbox5->pack_start (more_new_session_options_button, false, false); + + setup_more_options_box (); + more_new_session_options_button.add (more_options_vbox); + + vbox3->pack_start (*hbox5, false, false); + hbox3->pack_start (*vbox3, true, true, 8); + vbox2->pack_start (*hbox3, false, false); + + /* --- */ + + session_new_vbox.pack_start (*vbox2, false, false); + session_new_vbox.show_all (); +} + +void +SessionDialog::new_name_changed () +{ + if (!new_name_entry.get_text().empty()) { + session_selected (); + open_button->set_sensitive (true); + } else { + open_button->set_sensitive (false); + } +} + +void +SessionDialog::new_name_activated () +{ + response (RESPONSE_ACCEPT); +} + +int +SessionDialog::redisplay_recent_sessions () +{ + std::vector session_directories; + RecentSessionsSorter cmp; + + recent_session_display.set_model (Glib::RefPtr(0)); + recent_session_model->clear (); + + ARDOUR::RecentSessions rs; + ARDOUR::read_recent_sessions (rs); + + if (rs.empty()) { + recent_session_display.set_model (recent_session_model); + return 0; + } + // + // sort them alphabetically + sort (rs.begin(), rs.end(), cmp); + + for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) { + session_directories.push_back ((*i).second); + } + + int session_snapshot_count = 0; + + for (vector::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i) + { + std::vector state_file_paths; + + // now get available states for this session + + get_state_files_in_directory (*i, state_file_paths); + + vector* states; + vector item; + string fullpath = *i; + + /* remove any trailing / */ + + if (fullpath[fullpath.length()-1] == '/') { + fullpath = fullpath.substr (0, fullpath.length()-1); + } + + /* check whether session still exists */ + if (!Glib::file_test(fullpath.c_str(), Glib::FILE_TEST_EXISTS)) { + /* session doesn't exist */ + continue; + } + + /* now get available states for this session */ + + if ((states = Session::possible_states (fullpath)) == 0) { + /* no state file? */ + continue; + } + + std::vector state_file_names(get_file_names_no_extension (state_file_paths)); + + Gtk::TreeModel::Row row = *(recent_session_model->append()); + + row[recent_session_columns.visible_name] = Glib::path_get_basename (fullpath); + row[recent_session_columns.fullpath] = fullpath; + row[recent_session_columns.tip] = Glib::Markup::escape_text (fullpath); + + ++session_snapshot_count; + + if (state_file_names.size() > 1) { + + // add the children + + for (std::vector::iterator i2 = state_file_names.begin(); + i2 != state_file_names.end(); ++i2) { + + Gtk::TreeModel::Row child_row = *(recent_session_model->append (row.children())); + + child_row[recent_session_columns.visible_name] = *i2; + child_row[recent_session_columns.fullpath] = fullpath; + child_row[recent_session_columns.tip] = Glib::Markup::escape_text (fullpath); + ++session_snapshot_count; + } + } + } + + recent_session_display.set_tooltip_column(1); // recent_session_columns.tip + recent_session_display.set_model (recent_session_model); + return session_snapshot_count; + // return rs.size(); +} + +void +SessionDialog::recent_session_row_selected () +{ + if (recent_session_display.get_selection()->count_selected_rows() > 0) { + open_button->set_sensitive (true); + session_selected (); + } else { + open_button->set_sensitive (false); + } +} + +void +SessionDialog::setup_more_options_box () +{ + more_options_vbox.set_border_width (24); + + _output_limit_count.set_adjustment (_output_limit_count_adj); + _input_limit_count.set_adjustment (_input_limit_count_adj); + _master_bus_channel_count.set_adjustment (_master_bus_channel_count_adj); + + chan_count_label_1.set_text (_("channels")); + chan_count_label_3.set_text (_("channels")); + chan_count_label_4.set_text (_("channels")); + + chan_count_label_1.set_alignment(0,0.5); + chan_count_label_1.set_padding(0,0); + chan_count_label_1.set_line_wrap(false); + + chan_count_label_3.set_alignment(0,0.5); + chan_count_label_3.set_padding(0,0); + chan_count_label_3.set_line_wrap(false); + + chan_count_label_4.set_alignment(0,0.5); + chan_count_label_4.set_padding(0,0); + chan_count_label_4.set_line_wrap(false); + + bus_label.set_markup (_("Busses")); + input_label.set_markup (_("Inputs")); + output_label.set_markup (_("Outputs")); + + _master_bus_channel_count.set_flags(Gtk::CAN_FOCUS); + _master_bus_channel_count.set_update_policy(Gtk::UPDATE_ALWAYS); + _master_bus_channel_count.set_numeric(true); + _master_bus_channel_count.set_digits(0); + _master_bus_channel_count.set_wrap(false); + + _create_master_bus.set_label (_("Create master bus")); + _create_master_bus.set_flags(Gtk::CAN_FOCUS); + _create_master_bus.set_relief(Gtk::RELIEF_NORMAL); + _create_master_bus.set_mode(true); + _create_master_bus.set_active(true); + _create_master_bus.set_border_width(0); + + advanced_table.set_row_spacings(0); + advanced_table.set_col_spacings(0); + + _connect_inputs.set_label (_("Automatically connect to physical inputs")); + _connect_inputs.set_flags(Gtk::CAN_FOCUS); + _connect_inputs.set_relief(Gtk::RELIEF_NORMAL); + _connect_inputs.set_mode(true); + _connect_inputs.set_active(Config->get_input_auto_connect() != ManualConnect); + _connect_inputs.set_border_width(0); + + _limit_input_ports.set_label (_("Use only")); + _limit_input_ports.set_flags(Gtk::CAN_FOCUS); + _limit_input_ports.set_relief(Gtk::RELIEF_NORMAL); + _limit_input_ports.set_mode(true); + _limit_input_ports.set_sensitive(true); + _limit_input_ports.set_border_width(0); + + _input_limit_count.set_flags(Gtk::CAN_FOCUS); + _input_limit_count.set_update_policy(Gtk::UPDATE_ALWAYS); + _input_limit_count.set_numeric(true); + _input_limit_count.set_digits(0); + _input_limit_count.set_wrap(false); + _input_limit_count.set_sensitive(false); + + bus_hbox.pack_start (bus_table, Gtk::PACK_SHRINK, 18); + + bus_label.set_alignment(0, 0.5); + bus_label.set_padding(0,0); + bus_label.set_line_wrap(false); + bus_label.set_selectable(false); + bus_label.set_use_markup(true); + bus_frame.set_shadow_type(Gtk::SHADOW_NONE); + bus_frame.set_label_align(0,0.5); + bus_frame.add(bus_hbox); + bus_frame.set_label_widget(bus_label); + + bus_table.set_row_spacings (0); + bus_table.set_col_spacings (0); + bus_table.attach (_create_master_bus, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); + bus_table.attach (_master_bus_channel_count, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); + bus_table.attach (chan_count_label_1, 2, 3, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 0); + + input_port_limit_hbox.pack_start(_limit_input_ports, Gtk::PACK_SHRINK, 6); + input_port_limit_hbox.pack_start(_input_limit_count, Gtk::PACK_SHRINK, 0); + input_port_limit_hbox.pack_start(chan_count_label_3, Gtk::PACK_SHRINK, 6); + input_port_vbox.pack_start(_connect_inputs, Gtk::PACK_SHRINK, 0); + input_port_vbox.pack_start(input_port_limit_hbox, Gtk::PACK_EXPAND_PADDING, 0); + input_table.set_row_spacings(0); + input_table.set_col_spacings(0); + input_table.attach(input_port_vbox, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 6); + + input_hbox.pack_start (input_table, Gtk::PACK_SHRINK, 18); + + input_label.set_alignment(0, 0.5); + input_label.set_padding(0,0); + input_label.set_line_wrap(false); + input_label.set_selectable(false); + input_label.set_use_markup(true); + input_frame.set_shadow_type(Gtk::SHADOW_NONE); + input_frame.set_label_align(0,0.5); + input_frame.add(input_hbox); + input_frame.set_label_widget(input_label); + + _connect_outputs.set_label (_("Automatically connect outputs")); + _connect_outputs.set_flags(Gtk::CAN_FOCUS); + _connect_outputs.set_relief(Gtk::RELIEF_NORMAL); + _connect_outputs.set_mode(true); + _connect_outputs.set_active(Config->get_output_auto_connect() != ManualConnect); + _connect_outputs.set_border_width(0); + _limit_output_ports.set_label (_("Use only")); + _limit_output_ports.set_flags(Gtk::CAN_FOCUS); + _limit_output_ports.set_relief(Gtk::RELIEF_NORMAL); + _limit_output_ports.set_mode(true); + _limit_output_ports.set_sensitive(true); + _limit_output_ports.set_border_width(0); + _output_limit_count.set_flags(Gtk::CAN_FOCUS); + _output_limit_count.set_update_policy(Gtk::UPDATE_ALWAYS); + _output_limit_count.set_numeric(false); + _output_limit_count.set_digits(0); + _output_limit_count.set_wrap(false); + _output_limit_count.set_sensitive(false); + output_port_limit_hbox.pack_start(_limit_output_ports, Gtk::PACK_SHRINK, 6); + output_port_limit_hbox.pack_start(_output_limit_count, Gtk::PACK_SHRINK, 0); + output_port_limit_hbox.pack_start(chan_count_label_4, Gtk::PACK_SHRINK, 6); + + _connect_outputs_to_master.set_label (_("... to master bus")); + _connect_outputs_to_master.set_flags(Gtk::CAN_FOCUS); + _connect_outputs_to_master.set_relief(Gtk::RELIEF_NORMAL); + _connect_outputs_to_master.set_mode(true); + _connect_outputs_to_master.set_active(Config->get_output_auto_connect() == AutoConnectMaster); + _connect_outputs_to_master.set_border_width(0); + + _connect_outputs_to_master.set_group (connect_outputs_group); + _connect_outputs_to_physical.set_group (connect_outputs_group); + + _connect_outputs_to_physical.set_label (_("... to physical outputs")); + _connect_outputs_to_physical.set_flags(Gtk::CAN_FOCUS); + _connect_outputs_to_physical.set_relief(Gtk::RELIEF_NORMAL); + _connect_outputs_to_physical.set_mode(true); + _connect_outputs_to_physical.set_active(Config->get_output_auto_connect() == AutoConnectPhysical); + _connect_outputs_to_physical.set_border_width(0); + + output_conn_vbox.pack_start(_connect_outputs, Gtk::PACK_SHRINK, 0); + output_conn_vbox.pack_start(_connect_outputs_to_master, Gtk::PACK_SHRINK, 0); + output_conn_vbox.pack_start(_connect_outputs_to_physical, Gtk::PACK_SHRINK, 0); + output_vbox.set_border_width(6); + + output_port_vbox.pack_start(output_port_limit_hbox, Gtk::PACK_SHRINK, 0); + + output_vbox.pack_start(output_conn_vbox); + output_vbox.pack_start(output_port_vbox); + + output_label.set_alignment(0, 0.5); + output_label.set_padding(0,0); + output_label.set_line_wrap(false); + output_label.set_selectable(false); + output_label.set_use_markup(true); + output_frame.set_shadow_type(Gtk::SHADOW_NONE); + output_frame.set_label_align(0,0.5); + + output_hbox.pack_start (output_vbox, Gtk::PACK_SHRINK, 18); + + output_frame.add(output_hbox); + output_frame.set_label_widget(output_label); + + more_options_vbox.pack_start(advanced_table, Gtk::PACK_SHRINK, 0); + more_options_vbox.pack_start(bus_frame, Gtk::PACK_SHRINK, 6); + more_options_vbox.pack_start(input_frame, Gtk::PACK_SHRINK, 6); + more_options_vbox.pack_start(output_frame, Gtk::PACK_SHRINK, 0); + + /* signals */ + + _connect_inputs.signal_clicked().connect (sigc::mem_fun (*this, &SessionDialog::connect_inputs_clicked)); + _connect_outputs.signal_clicked().connect (sigc::mem_fun (*this, &SessionDialog::connect_outputs_clicked)); + _limit_input_ports.signal_clicked().connect (sigc::mem_fun (*this, &SessionDialog::limit_inputs_clicked)); + _limit_output_ports.signal_clicked().connect (sigc::mem_fun (*this, &SessionDialog::limit_outputs_clicked)); + _create_master_bus.signal_clicked().connect (sigc::mem_fun (*this, &SessionDialog::master_bus_button_clicked)); + + /* note that more_options_vbox is "visible" by default even + * though it may not be displayed to the user, this is so the dialog + * doesn't resize. + */ + more_options_vbox.show_all (); +} + +bool +SessionDialog::create_master_bus() const +{ + return _create_master_bus.get_active(); +} + +int +SessionDialog::master_channel_count() const +{ + return _master_bus_channel_count.get_value_as_int(); +} + +bool +SessionDialog::connect_inputs() const +{ + return _connect_inputs.get_active(); +} + +bool +SessionDialog::limit_inputs_used_for_connection() const +{ + return _limit_input_ports.get_active(); +} + +int +SessionDialog::input_limit_count() const +{ + return _input_limit_count.get_value_as_int(); +} + +bool +SessionDialog::connect_outputs() const +{ + return _connect_outputs.get_active(); +} + +bool +SessionDialog::limit_outputs_used_for_connection() const +{ + return _limit_output_ports.get_active(); +} + +int +SessionDialog::output_limit_count() const +{ + return _output_limit_count.get_value_as_int(); +} + +bool +SessionDialog::connect_outs_to_master() const +{ + return _connect_outputs_to_master.get_active(); +} + +bool +SessionDialog::connect_outs_to_physical() const +{ + return _connect_outputs_to_physical.get_active(); +} + +void +SessionDialog::connect_inputs_clicked () +{ + _limit_input_ports.set_sensitive(_connect_inputs.get_active()); + + if (_connect_inputs.get_active() && _limit_input_ports.get_active()) { + _input_limit_count.set_sensitive(true); + } else { + _input_limit_count.set_sensitive(false); + } +} + +void +SessionDialog::connect_outputs_clicked () +{ + bool const co = _connect_outputs.get_active (); + _limit_output_ports.set_sensitive(co); + _connect_outputs_to_master.set_sensitive(co); + _connect_outputs_to_physical.set_sensitive(co); + + if (co && _limit_output_ports.get_active()) { + _output_limit_count.set_sensitive(true); + } else { + _output_limit_count.set_sensitive(false); + } +} + +void +SessionDialog::limit_inputs_clicked () +{ + _input_limit_count.set_sensitive(_limit_input_ports.get_active()); +} + +void +SessionDialog::limit_outputs_clicked () +{ + _output_limit_count.set_sensitive(_limit_output_ports.get_active()); +} + +void +SessionDialog::master_bus_button_clicked () +{ + bool const yn = _create_master_bus.get_active(); + + _master_bus_channel_count.set_sensitive(yn); + _connect_outputs_to_master.set_sensitive(yn); +} + +void +SessionDialog::recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*) +{ + response (RESPONSE_ACCEPT); +} + +void +SessionDialog::existing_session_selected () +{ + _existing_session_chooser_used = true; + /* mark this sensitive in case we come back here after a failed open + * attempt and the user has hacked up the fix. sigh. + */ + open_button->set_sensitive (true); + response (RESPONSE_ACCEPT); +} + +void +SessionDialog::updates_button_clicked () +{ + //now open a browser window so user can see more + PBD::open_uri (Config->get_updates_url()); +} + +bool +SessionDialog::info_scroller_update() +{ + info_scroller_count++; + + char buf[512]; + snprintf (buf, std::min(info_scroller_count,sizeof(buf)-1), "%s", ARDOUR_UI::instance()->announce_string().c_str() ); + buf[info_scroller_count] = 0; + info_scroller_label.set_text (buf); + info_scroller_label.show(); + + if (info_scroller_count > ARDOUR_UI::instance()->announce_string().length()) { + info_scroller_connection.disconnect(); + } + + return true; +} + +bool +SessionDialog::on_delete_event (GdkEventAny* ev) +{ + response (RESPONSE_CANCEL); + return ArdourDialog::on_delete_event (ev); +} + diff --git a/gtk2_ardour/session_dialog.h b/gtk2_ardour/session_dialog.h new file mode 100644 index 0000000000..ac4c1a7925 --- /dev/null +++ b/gtk2_ardour/session_dialog.h @@ -0,0 +1,231 @@ +/* + Copyright (C) 2010 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __gtk2_ardour_session_dialog_h__ +#define __gtk2_ardour_session_dialog_h__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ardour/utils.h" + +#include "ardour_dialog.h" + +class EngineControl; + +class SessionDialog : public ArdourDialog { + public: + SessionDialog (bool require_new, const std::string& session_name, const std::string& session_path, const std::string& template_name); + ~SessionDialog (); + + std::string session_name (bool& should_be_new); + std::string session_folder (); + + bool use_session_template(); + std::string session_template_name(); + + // advanced session options + + bool create_master_bus() const; + int master_channel_count() const; + + bool connect_inputs() const; + bool limit_inputs_used_for_connection() const; + int input_limit_count() const; + + bool connect_outputs() const; + bool limit_outputs_used_for_connection() const; + int output_limit_count() const; + + bool connect_outs_to_master() const; + bool connect_outs_to_physical() const; + + private: + bool new_only; + std::string _provided_session_name; + std::string _provided_session_path; + + bool on_delete_event (GdkEventAny*); + + Gtk::Button* cancel_button; + Gtk::Button* open_button; + Gtk::Button* back_button; + Gtk::Button* quit_button; + + bool back_button_pressed (GdkEventButton*); + + /* initial choice page */ + + void setup_initial_choice_box (); + Gtk::VBox ic_vbox; + Gtk::Button ic_new_session_button; + void new_session_button_clicked (); + + /* recent sessions */ + + void setup_existing_session_page (); + + struct RecentSessionsSorter { + bool operator() (std::pair a, std::pair b) const { + return cmp_nocase(a.first, b.first) == -1; + } + }; + + struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord { + RecentSessionModelColumns() { + add (visible_name); + add (tip); + add (fullpath); + } + Gtk::TreeModelColumn visible_name; + Gtk::TreeModelColumn tip; + Gtk::TreeModelColumn fullpath; + }; + + RecentSessionModelColumns recent_session_columns; + Gtk::TreeView recent_session_display; + Glib::RefPtr recent_session_model; + Gtk::ScrolledWindow recent_scroller; + Gtk::Label recent_label; + Gtk::FileChooserButton existing_session_chooser; + int redisplay_recent_sessions (); + void recent_session_row_selected (); + void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col); + + void existing_session_selected (); + void session_selected (); + + /* new sessions */ + + void setup_new_session_page (); + Gtk::Entry new_name_entry; + Gtk::FileChooserButton new_folder_chooser; + + struct SessionTemplateColumns : public Gtk::TreeModel::ColumnRecord { + SessionTemplateColumns () { + add (name); + add (path); + } + + Gtk::TreeModelColumn name; + Gtk::TreeModelColumn path; + }; + + SessionTemplateColumns session_template_columns; + Glib::RefPtr template_model; + Gtk::ComboBox template_chooser; + + Gtk::VBox session_new_vbox; + Gtk::VBox session_existing_vbox; + Gtk::Expander more_new_session_options_button; + Gtk::CheckButton use_template_button; + std::string load_template_override; + + void more_new_session_options_button_clicked(); + void new_name_changed (); + void new_name_activated (); + void populate_session_templates (); + + /* more options for new sessions */ + + Gtk::VBox more_options_vbox; + + Gtk::Label chan_count_label_1; + Gtk::Label chan_count_label_3; + Gtk::Label chan_count_label_4; + Gtk::Table advanced_table; + Gtk::HBox input_port_limit_hbox; + Gtk::VBox input_port_vbox; + Gtk::Table input_table; + Gtk::HBox input_hbox; + + Gtk::Label bus_label; + Gtk::Frame bus_frame; + Gtk::Table bus_table; + Gtk::HBox bus_hbox; + + Gtk::Label input_label; + Gtk::Frame input_frame; + Gtk::HBox output_port_limit_hbox; + Gtk::VBox output_port_vbox; + Gtk::VBox output_conn_vbox; + Gtk::VBox output_vbox; + Gtk::HBox output_hbox; + + Gtk::Label output_label; + Gtk::Frame output_frame; + Gtk::VBox advanced_vbox; + Gtk::Label advanced_label; + + Gtk::CheckButton _create_master_bus; + Gtk::SpinButton _master_bus_channel_count; + + Gtk::CheckButton _connect_inputs; + Gtk::CheckButton _limit_input_ports; + Gtk::SpinButton _input_limit_count; + + Gtk::CheckButton _connect_outputs; + Gtk::CheckButton _limit_output_ports; + Gtk::SpinButton _output_limit_count; + + Gtk::RadioButtonGroup connect_outputs_group; + Gtk::RadioButton _connect_outputs_to_master; + Gtk::RadioButton _connect_outputs_to_physical; + + Gtk::Adjustment _output_limit_count_adj; + Gtk::Adjustment _input_limit_count_adj; + Gtk::Adjustment _master_bus_channel_count_adj; + + void connect_inputs_clicked (); + void connect_outputs_clicked (); + void limit_inputs_clicked (); + void limit_outputs_clicked (); + void master_bus_button_clicked (); + void setup_more_options_box (); + + /* always there */ + + Glib::RefPtr layout; + + bool _existing_session_chooser_used; ///< set to true when the existing session chooser has been used + + Gtk::Label info_scroller_label; + std::string::size_type info_scroller_count; + bool info_scroller_update(); + sigc::connection info_scroller_connection; + void updates_button_clicked (); +}; + +#endif /* __gtk2_ardour_session_dialog_h__ */ diff --git a/gtk2_ardour/small-splash.png b/gtk2_ardour/small-splash.png new file mode 100644 index 0000000000000000000000000000000000000000..0a3c33ea77de9ad1bf58f8338eb1a158c0addae4 GIT binary patch literal 26238 zcmV)0K+eC3P)Px#32;bRa{vGh*8l(w*8xH(n|J^K00(qQO+^RY2^SC|ACxvgqW}OP07*naRCwB~ zy?LB&S5+-K$K3m?s?(q3gf5{8p-Tu|656Mt(g=#6z(oWldIJfFm>{9M_CEF5-S>M} zz2Z~v^??dp=|U4lktUHw!Jr}p=@ZgI$T`(_U$e&jV|8<_z4uoYey^xss8jVd``c@- zx#k>m%rWu6hhHe+iy|Td^Is7WQbYvi*ZFV77t1GN|9>2Ksp@fiJm=f~N|(mDZ~tw- za`)5Ed+1(YE_#G92E(fROAQYP%eU(_POUFQ%~Qx=T>dxJU%OW6x>luK zTS1S5u{V)@3*BdPEIdB@trC5{vRIeiy`pAU*QSKh$k6KxQ9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)fPhq~_Hku0zG4V|X zr8LAgDHsmS{Pq3#1`(xm=-=1@^0x!)EgXNO8u1&xx++8N>tPzomWqZL9t&TZNRCM7 zA;VFl6ZM8EUFQn1 zexvcy=O@$9veWUGs^^OIsScW2{_%(z)qFhDHGCVz^%*(U4Zsh%O4As2sE3-r^ZjW4 za(d}&HCEQ?L0hw^03r1#6Lr9`8NKu{g0MNMiVc_CqxP;bM1{FG83YXV!B@BTNBJVS zDo#e%E4>^*sGp|#?X_uCy>9)&OJS1(tJ>Iup8$pN>S3q`nl|)MPhd*7Wf7j%LC};# zAd4hrN6j3g1)@F=bEA+$k(41yZPXG?&y%fM`m!-v;~uWJoDK~CqDn!f#|(s4^O*6R tP~uO > window_icons; - Glib::RefPtr icon; - - if ((icon = ::get_icon ("ardour_icon_16px")) != 0) { - window_icons.push_back (icon); - } - if ((icon = ::get_icon ("ardour_icon_22px")) != 0) { - window_icons.push_back (icon); - } - if ((icon = ::get_icon ("ardour_icon_32px")) != 0) { - window_icons.push_back (icon); - } - if ((icon = ::get_icon ("ardour_icon_48px")) != 0) { - window_icons.push_back (icon); - } - if (!window_icons.empty ()) { - set_default_icon_list (window_icons); - } - -#ifdef __APPLE__ - setup_prerelease_page (); -#endif - if (new_user) { - - setup_new_user_page (); - setup_first_time_config_page (); - setup_monitoring_choice_page (); - setup_monitor_section_choice_page (); - setup_final_page (); - setup_new_session_page (); - - } else { - - if (!new_only) { - setup_initial_choice_page (); - } - setup_new_session_page (); - } - - if (!template_name.empty()) { - use_template_button.set_active (false); - load_template_override = template_name; - } + if ((icon_pixbuf = ::get_icon ("ardour_icon_48px")) == 0) { + throw failed_constructor(); } + + list > window_icons; + Glib::RefPtr icon; + + if ((icon = ::get_icon ("ardour_icon_16px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_22px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_32px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_48px")) != 0) { + window_icons.push_back (icon); + } + if (!window_icons.empty ()) { + set_default_icon_list (window_icons); + } + +#ifdef __APPLE__ + setup_prerelease_page (); +#endif + + setup_new_user_page (); + setup_first_time_config_page (); + setup_monitoring_choice_page (); + setup_monitor_section_choice_page (); + setup_final_page (); the_startup = this; } @@ -157,9 +123,16 @@ ArdourStartup::~ArdourStartup () } bool -ArdourStartup::ready_without_display () const +ArdourStartup::required () { - return !new_user && !need_session_info; + return !Glib::file_test (been_here_before_path(), Glib::FILE_TEST_EXISTS); +} + +std::string +ArdourStartup::been_here_before_path () +{ + // XXXX use more specific version so we can catch upgrades + return Glib::build_filename (user_config_directory (), ".a3"); } void @@ -195,89 +168,6 @@ Full information on all the above can be found on the support page at\n\ set_page_complete (*vbox, true); } -bool -ArdourStartup::use_session_template () -{ - if (!load_template_override.empty()) { - return true; - } - - if (use_template_button.get_active()) { - return true; - } - return false; -} - -std::string -ArdourStartup::session_template_name () -{ - if (!load_template_override.empty()) { - string the_path (ARDOUR::user_template_directory()); - return Glib::build_filename (the_path, load_template_override + ARDOUR::template_suffix); - } - - if (use_template_button.get_active()) { - TreeModel::iterator iter = template_chooser.get_active (); - TreeModel::Row row = (*iter); - string s = row[session_template_columns.path]; - return s; - } - - return string(); -} - -std::string -ArdourStartup::session_name (bool& should_be_new) -{ - if (ready_without_display()) { - return _provided_session_name; - } - - /* Try recent session selection */ - - TreeIter iter = recent_session_display.get_selection()->get_selected(); - - if (iter) { - should_be_new = false; - return (*iter)[recent_session_columns.visible_name]; - } - - if (_existing_session_chooser_used) { - /* existing session chosen from file chooser */ - should_be_new = false; - return existing_session_chooser.get_filename (); - } else { - should_be_new = true; - string val = new_name_entry.get_text (); - strip_whitespace_edges (val); - return val; - } -} - -std::string -ArdourStartup::session_folder () -{ - if (ready_without_display()) { - return _provided_session_path; - } - - /* Try recent session selection */ - - TreeIter iter = recent_session_display.get_selection()->get_selected(); - - if (iter) { - return (*iter)[recent_session_columns.fullpath]; - } - - if (_existing_session_chooser_used) { - /* existing session chosen from file chooser */ - return existing_session_chooser.get_current_folder (); - } else { - std::string legal_session_folder_name = legalize_for_path (new_name_entry.get_text()); - return Glib::build_filename (new_folder_chooser.get_current_folder(), legal_session_folder_name); - } -} - void ArdourStartup::setup_new_user_page () { @@ -482,159 +372,12 @@ greater control in monitoring without affecting the mix.")); set_page_complete (mon_sec_vbox, true); } -void -ArdourStartup::setup_initial_choice_page () -{ - ic_vbox.set_spacing (6); - ic_vbox.set_border_width (24); - - /* append the page early because the recent session display will cause - calls to set_page_complete() on this page. - */ - - initial_choice_index = append_page (ic_vbox); - set_page_title (ic_vbox, string_compose("%1 %2", PROGRAM_NAME, VERSIONSTRING)); - set_page_header_image (ic_vbox, icon_pixbuf); - - - HBox* centering_hbox = manage (new HBox); - VBox* centering_vbox = manage (new VBox); - - centering_vbox->set_spacing (6); - - Label* new_label = manage (new Label); - new_label->set_markup (string_compose ("%1", _("Create a new session"))); - new_label->set_alignment (0, 0.5); - - ic_new_session_button.set_label (_("Configure the new session ...")); - ic_new_session_button.signal_clicked().connect (sigc::mem_fun (*this, &ArdourStartup::new_session_button_clicked)); - - centering_vbox->pack_start (*new_label, false, false, 12); - centering_vbox->pack_start (ic_new_session_button, false, true); - - /* Possible update message */ - - if (ARDOUR_UI::instance()->announce_string() != "" ) { - - Gtk::Frame *info_frame = manage(new Gtk::Frame); - info_frame->set_shadow_type(SHADOW_ETCHED_OUT); - centering_vbox->pack_start (*info_frame, false, false, 20); - - Box *info_box = manage (new VBox); - info_box->set_border_width (12); - info_box->set_spacing (6); - info_box->set_name("mixbus_info_box"); - - info_box->pack_start (info_scroller_label, false, false); - - info_frame->add (*info_box); - info_frame->show_all(); - - info_scroller_count = 0; - info_scroller_connection = Glib::signal_timeout().connect (mem_fun(*this, &ArdourStartup::info_scroller_update), 50); - - Gtk::Button *updates_button = manage (new Gtk::Button (_("Check the website for more..."))); - - updates_button->signal_clicked().connect (mem_fun(*this, &ArdourStartup::updates_button_clicked) ); - ARDOUR_UI::instance()->tooltips().set_tip (*updates_button, _("Click to open the program website in your web browser")); - - info_box->pack_start (*updates_button, false, false); - } - - /* recent session scroller */ - - recent_label.set_no_show_all (true); - recent_scroller.set_no_show_all (true); - - recent_label.set_markup (string_compose ("%1", _("Load a recent session"))); - recent_label.set_alignment (0, 0.5); - - recent_session_model = TreeStore::create (recent_session_columns); - - recent_session_display.set_model (recent_session_model); - recent_session_display.append_column (_("Recent Sessions"), recent_session_columns.visible_name); - recent_session_display.set_headers_visible (false); - recent_session_display.get_selection()->set_mode (SELECTION_SINGLE); - - recent_session_display.get_selection()->signal_changed().connect (sigc::mem_fun (*this, &ArdourStartup::recent_session_row_selected)); - - recent_scroller.add (recent_session_display); - recent_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); - recent_scroller.set_shadow_type (Gtk::SHADOW_IN); - - recent_session_display.show(); - recent_session_display.signal_row_activated().connect (sigc::mem_fun (*this, &ArdourStartup::recent_row_activated)); - - centering_vbox->pack_start (recent_label, false, false, 12); - centering_vbox->pack_start (recent_scroller, false, true); - - /* Browse button */ - - existing_session_chooser.set_title (_("Select session file")); - existing_session_chooser.signal_file_set().connect (sigc::mem_fun (*this, &ArdourStartup::existing_session_selected)); - existing_session_chooser.set_current_folder(poor_mans_glob (Config->get_default_session_parent_dir())); - - FileFilter session_filter; - session_filter.add_pattern ("*.ardour"); - session_filter.set_name (string_compose (_("%1 sessions"), PROGRAM_NAME)); - existing_session_chooser.add_filter (session_filter); - existing_session_chooser.set_filter (session_filter); - -#ifdef GTKOSX - existing_session_chooser.add_shortcut_folder ("/Volumes"); -#endif - - Label* browse_label = manage (new Label); - browse_label->set_markup (string_compose ("%1", _("Browse for other sessions"))); - browse_label->set_alignment (0, 0.5); - - centering_vbox->pack_start (*browse_label, false, false, 12); - centering_vbox->pack_start (existing_session_chooser, false, false); - - /* pack it all up */ - - centering_hbox->pack_start (*centering_vbox, true, true); - ic_vbox.pack_start (*centering_hbox, true, true); - ic_vbox.show_all (); - - /* user could just click on "Forward" if default - * choice is correct. - */ - - set_page_complete (ic_vbox, true); -} - -void -ArdourStartup::session_selected () -{ - /* HACK HACK HACK ... change the "Apply" button label - to say "Open" - */ - - Gtk::Widget* tl = ic_vbox.get_toplevel(); - Gtk::Window* win; - if ((win = dynamic_cast(tl)) != 0) { - /* ::get_default_widget() is not wrapped in gtkmm */ - Gtk::Widget* def = wrap (gtk_window_get_default_widget (win->gobj())); - Gtk::Button* button; - if ((button = dynamic_cast(def)) != 0) { - button->set_label (_("Open")); - } - } -} - -void -ArdourStartup::new_session_button_clicked () -{ - _existing_session_chooser_used = false; - recent_session_display.get_selection()->unselect_all (); - set_current_page (new_session_page_index); -} - void ArdourStartup::setup_final_page () { - final_page.set_text (string_compose (_("%1 is ready for use"), PROGRAM_NAME)); + string msg = string_compose (_("%1 is ready for use"), PROGRAM_NAME); + + final_page.set_markup (string_compose ("%1", msg)); final_page.show (); final_page_index = append_page (final_page); set_page_complete (final_page, true); @@ -649,24 +392,6 @@ ArdourStartup::on_cancel () gtk_main_quit (); } -void -ArdourStartup::on_prepare (Gtk::Widget* page) -{ - if (page == &session_new_vbox) { - - /* if the user already defined a name by using the recent - * session list or browsing to an existing session - * then we are done. - */ - - bool expect_new_ignored; - - if (!session_name (expect_new_ignored).empty()) { - on_apply (); - } - } -} - bool ArdourStartup::on_delete_event (GdkEventAny*) { @@ -708,574 +433,6 @@ ArdourStartup::on_apply () gtk_main_quit (); } -void -ArdourStartup::populate_session_templates () -{ - vector templates; - - find_session_templates (templates); - - template_model->clear (); - - for (vector::iterator x = templates.begin(); x != templates.end(); ++x) { - TreeModel::Row row; - - row = *(template_model->append ()); - - row[session_template_columns.name] = (*x).name; - row[session_template_columns.path] = (*x).path; - } - - if (!templates.empty()) { - /* select first row */ - template_chooser.set_active (0); - } -} - -void -ArdourStartup::setup_new_session_page () -{ - session_new_vbox.set_border_width (12); - session_new_vbox.set_spacing (18); - - VBox *vbox1 = manage (new VBox); - HBox* hbox1 = manage (new HBox); - Label* label1 = manage (new Label); - - vbox1->set_spacing (6); - - hbox1->set_spacing (6); - hbox1->pack_start (*label1, false, false); - hbox1->pack_start (new_name_entry, true, true); - - label1->set_text (_("Session name:")); - - - if (!ARDOUR_COMMAND_LINE::session_name.empty()) { - new_name_entry.set_text (Glib::path_get_basename (ARDOUR_COMMAND_LINE::session_name)); - /* name provided - they can move right along */ - set_page_complete (session_new_vbox, true); - } - - new_name_entry.signal_changed().connect (sigc::mem_fun (*this, &ArdourStartup::new_name_changed)); - new_name_entry.signal_activate().connect (sigc::mem_fun (*this, &ArdourStartup::move_along_now)); - - vbox1->pack_start (*hbox1, true, true); - - /* --- */ - - HBox* hbox2 = manage (new HBox); - Label* label2 = manage (new Label); - - hbox2->set_spacing (6); - hbox2->pack_start (*label2, false, false); - hbox2->pack_start (new_folder_chooser, true, true); - - label2->set_text (_("Create session folder in:")); - - if (!ARDOUR_COMMAND_LINE::session_name.empty()) { - new_folder_chooser.set_current_folder (poor_mans_glob (Glib::path_get_dirname (ARDOUR_COMMAND_LINE::session_name))); - } else if (ARDOUR_UI::instance()->session_loaded) { - // point the new session file chooser at the parent directory of the current session - string session_parent_dir = Glib::path_get_dirname(ARDOUR_UI::instance()->the_session()->path()); - string::size_type last_dir_sep = session_parent_dir.rfind(G_DIR_SEPARATOR); - session_parent_dir = session_parent_dir.substr(0, last_dir_sep); - new_folder_chooser.set_current_folder (session_parent_dir); - string default_session_folder = poor_mans_glob (Config->get_default_session_parent_dir()); - - try { - /* add_shortcut_folder throws an exception if the folder being added already has a shortcut */ - new_folder_chooser.add_shortcut_folder (default_session_folder); - } - catch (Glib::Error & e) { - std::cerr << "new_folder_chooser.add_shortcut_folder (" << default_session_folder << ") threw Glib::Error " << e.what() << std::endl; - } - } else { - new_folder_chooser.set_current_folder (poor_mans_glob (Config->get_default_session_parent_dir())); - } - new_folder_chooser.show (); - new_folder_chooser.set_title (_("Select folder for session")); - -#ifdef __APPLE__ - new_folder_chooser.add_shortcut_folder ("/Volumes"); -#endif - - vbox1->pack_start (*hbox2, false, false); - - session_new_vbox.pack_start (*vbox1, false, false); - - /* --- */ - - VBox *vbox2 = manage (new VBox); - HBox* hbox3 = manage (new HBox); - template_model = ListStore::create (session_template_columns); - - vbox2->set_spacing (6); - - VBox *vbox3 = manage (new VBox); - - vbox3->set_spacing (6); - - /* we may want to hide this and show it at various - times depending on the existence of templates. - */ - template_chooser.set_no_show_all (true); - use_template_button.set_no_show_all (true); - - HBox* hbox4a = manage (new HBox); - use_template_button.set_label (_("Use this template")); - - TreeModel::Row row = *template_model->prepend (); - row[session_template_columns.name] = (_("no template")); - row[session_template_columns.path] = string(); - - hbox4a->set_spacing (6); - hbox4a->pack_start (use_template_button, false, false); - hbox4a->pack_start (template_chooser, true, true); - - template_chooser.set_model (template_model); - - Gtk::CellRendererText* text_renderer = Gtk::manage (new Gtk::CellRendererText); - text_renderer->property_editable() = false; - - template_chooser.pack_start (*text_renderer); - template_chooser.add_attribute (text_renderer->property_text(), session_template_columns.name); - template_chooser.set_active (0); - - vbox3->pack_start (*hbox4a, false, false); - - /* --- */ - - HBox* hbox5 = manage (new HBox); - - hbox5->set_spacing (6); - hbox5->pack_start (more_new_session_options_button, false, false); - - setup_more_options_box (); - more_new_session_options_button.add (more_options_vbox); - - vbox3->pack_start (*hbox5, false, false); - hbox3->pack_start (*vbox3, true, true, 8); - vbox2->pack_start (*hbox3, false, false); - - /* --- */ - - session_new_vbox.pack_start (*vbox2, false, false); - session_new_vbox.show_all (); - - new_session_page_index = append_page (session_new_vbox); - set_page_type (session_new_vbox, ASSISTANT_PAGE_CONTENT); - set_page_title (session_new_vbox, _("New Session")); - - set_page_type (session_new_vbox, ASSISTANT_PAGE_CONFIRM); -} - -void -ArdourStartup::new_name_changed () -{ - if (!new_name_entry.get_text().empty()) { - session_selected (); - set_page_complete (session_new_vbox, true); - } else { - set_page_complete (session_new_vbox, false); - } -} - -int -ArdourStartup::redisplay_recent_sessions () -{ - std::vector session_directories; - RecentSessionsSorter cmp; - - recent_session_display.set_model (Glib::RefPtr(0)); - recent_session_model->clear (); - - ARDOUR::RecentSessions rs; - ARDOUR::read_recent_sessions (rs); - - if (rs.empty()) { - recent_session_display.set_model (recent_session_model); - return 0; - } - // - // sort them alphabetically - sort (rs.begin(), rs.end(), cmp); - - for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) { - session_directories.push_back ((*i).second); - } - - int session_snapshot_count = 0; - - for (vector::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i) - { - std::vector state_file_paths; - - // now get available states for this session - - get_state_files_in_directory (*i, state_file_paths); - - vector* states; - vector item; - string fullpath = *i; - - /* remove any trailing / */ - - if (fullpath[fullpath.length()-1] == '/') { - fullpath = fullpath.substr (0, fullpath.length()-1); - } - - /* check whether session still exists */ - if (!Glib::file_test(fullpath.c_str(), Glib::FILE_TEST_EXISTS)) { - /* session doesn't exist */ - continue; - } - - /* now get available states for this session */ - - if ((states = Session::possible_states (fullpath)) == 0) { - /* no state file? */ - continue; - } - - std::vector state_file_names(get_file_names_no_extension (state_file_paths)); - - Gtk::TreeModel::Row row = *(recent_session_model->append()); - - row[recent_session_columns.visible_name] = Glib::path_get_basename (fullpath); - row[recent_session_columns.fullpath] = fullpath; - row[recent_session_columns.tip] = Glib::Markup::escape_text (fullpath); - - ++session_snapshot_count; - - if (state_file_names.size() > 1) { - - // add the children - - for (std::vector::iterator i2 = state_file_names.begin(); - i2 != state_file_names.end(); ++i2) { - - Gtk::TreeModel::Row child_row = *(recent_session_model->append (row.children())); - - child_row[recent_session_columns.visible_name] = *i2; - child_row[recent_session_columns.fullpath] = fullpath; - child_row[recent_session_columns.tip] = Glib::Markup::escape_text (fullpath); - ++session_snapshot_count; - } - } - } - - recent_session_display.set_tooltip_column(1); // recent_session_columns.tip - recent_session_display.set_model (recent_session_model); - return session_snapshot_count; - // return rs.size(); -} - -void -ArdourStartup::recent_session_row_selected () -{ - if (recent_session_display.get_selection()->count_selected_rows() > 0) { - set_page_complete (ic_vbox, true); - session_selected (); - } else { - set_page_complete (ic_vbox, false); - } -} - -void -ArdourStartup::setup_more_options_box () -{ - more_options_vbox.set_border_width (24); - - _output_limit_count.set_adjustment (_output_limit_count_adj); - _input_limit_count.set_adjustment (_input_limit_count_adj); - _master_bus_channel_count.set_adjustment (_master_bus_channel_count_adj); - - chan_count_label_1.set_text (_("channels")); - chan_count_label_3.set_text (_("channels")); - chan_count_label_4.set_text (_("channels")); - - chan_count_label_1.set_alignment(0,0.5); - chan_count_label_1.set_padding(0,0); - chan_count_label_1.set_line_wrap(false); - - chan_count_label_3.set_alignment(0,0.5); - chan_count_label_3.set_padding(0,0); - chan_count_label_3.set_line_wrap(false); - - chan_count_label_4.set_alignment(0,0.5); - chan_count_label_4.set_padding(0,0); - chan_count_label_4.set_line_wrap(false); - - bus_label.set_markup (_("Busses")); - input_label.set_markup (_("Inputs")); - output_label.set_markup (_("Outputs")); - - _master_bus_channel_count.set_flags(Gtk::CAN_FOCUS); - _master_bus_channel_count.set_update_policy(Gtk::UPDATE_ALWAYS); - _master_bus_channel_count.set_numeric(true); - _master_bus_channel_count.set_digits(0); - _master_bus_channel_count.set_wrap(false); - - _create_master_bus.set_label (_("Create master bus")); - _create_master_bus.set_flags(Gtk::CAN_FOCUS); - _create_master_bus.set_relief(Gtk::RELIEF_NORMAL); - _create_master_bus.set_mode(true); - _create_master_bus.set_active(true); - _create_master_bus.set_border_width(0); - - advanced_table.set_row_spacings(0); - advanced_table.set_col_spacings(0); - - _connect_inputs.set_label (_("Automatically connect to physical inputs")); - _connect_inputs.set_flags(Gtk::CAN_FOCUS); - _connect_inputs.set_relief(Gtk::RELIEF_NORMAL); - _connect_inputs.set_mode(true); - _connect_inputs.set_active(Config->get_input_auto_connect() != ManualConnect); - _connect_inputs.set_border_width(0); - - _limit_input_ports.set_label (_("Use only")); - _limit_input_ports.set_flags(Gtk::CAN_FOCUS); - _limit_input_ports.set_relief(Gtk::RELIEF_NORMAL); - _limit_input_ports.set_mode(true); - _limit_input_ports.set_sensitive(true); - _limit_input_ports.set_border_width(0); - - _input_limit_count.set_flags(Gtk::CAN_FOCUS); - _input_limit_count.set_update_policy(Gtk::UPDATE_ALWAYS); - _input_limit_count.set_numeric(true); - _input_limit_count.set_digits(0); - _input_limit_count.set_wrap(false); - _input_limit_count.set_sensitive(false); - - bus_hbox.pack_start (bus_table, Gtk::PACK_SHRINK, 18); - - bus_label.set_alignment(0, 0.5); - bus_label.set_padding(0,0); - bus_label.set_line_wrap(false); - bus_label.set_selectable(false); - bus_label.set_use_markup(true); - bus_frame.set_shadow_type(Gtk::SHADOW_NONE); - bus_frame.set_label_align(0,0.5); - bus_frame.add(bus_hbox); - bus_frame.set_label_widget(bus_label); - - bus_table.set_row_spacings (0); - bus_table.set_col_spacings (0); - bus_table.attach (_create_master_bus, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); - bus_table.attach (_master_bus_channel_count, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); - bus_table.attach (chan_count_label_1, 2, 3, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 0); - - input_port_limit_hbox.pack_start(_limit_input_ports, Gtk::PACK_SHRINK, 6); - input_port_limit_hbox.pack_start(_input_limit_count, Gtk::PACK_SHRINK, 0); - input_port_limit_hbox.pack_start(chan_count_label_3, Gtk::PACK_SHRINK, 6); - input_port_vbox.pack_start(_connect_inputs, Gtk::PACK_SHRINK, 0); - input_port_vbox.pack_start(input_port_limit_hbox, Gtk::PACK_EXPAND_PADDING, 0); - input_table.set_row_spacings(0); - input_table.set_col_spacings(0); - input_table.attach(input_port_vbox, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 6); - - input_hbox.pack_start (input_table, Gtk::PACK_SHRINK, 18); - - input_label.set_alignment(0, 0.5); - input_label.set_padding(0,0); - input_label.set_line_wrap(false); - input_label.set_selectable(false); - input_label.set_use_markup(true); - input_frame.set_shadow_type(Gtk::SHADOW_NONE); - input_frame.set_label_align(0,0.5); - input_frame.add(input_hbox); - input_frame.set_label_widget(input_label); - - _connect_outputs.set_label (_("Automatically connect outputs")); - _connect_outputs.set_flags(Gtk::CAN_FOCUS); - _connect_outputs.set_relief(Gtk::RELIEF_NORMAL); - _connect_outputs.set_mode(true); - _connect_outputs.set_active(Config->get_output_auto_connect() != ManualConnect); - _connect_outputs.set_border_width(0); - _limit_output_ports.set_label (_("Use only")); - _limit_output_ports.set_flags(Gtk::CAN_FOCUS); - _limit_output_ports.set_relief(Gtk::RELIEF_NORMAL); - _limit_output_ports.set_mode(true); - _limit_output_ports.set_sensitive(true); - _limit_output_ports.set_border_width(0); - _output_limit_count.set_flags(Gtk::CAN_FOCUS); - _output_limit_count.set_update_policy(Gtk::UPDATE_ALWAYS); - _output_limit_count.set_numeric(false); - _output_limit_count.set_digits(0); - _output_limit_count.set_wrap(false); - _output_limit_count.set_sensitive(false); - output_port_limit_hbox.pack_start(_limit_output_ports, Gtk::PACK_SHRINK, 6); - output_port_limit_hbox.pack_start(_output_limit_count, Gtk::PACK_SHRINK, 0); - output_port_limit_hbox.pack_start(chan_count_label_4, Gtk::PACK_SHRINK, 6); - - _connect_outputs_to_master.set_label (_("... to master bus")); - _connect_outputs_to_master.set_flags(Gtk::CAN_FOCUS); - _connect_outputs_to_master.set_relief(Gtk::RELIEF_NORMAL); - _connect_outputs_to_master.set_mode(true); - _connect_outputs_to_master.set_active(Config->get_output_auto_connect() == AutoConnectMaster); - _connect_outputs_to_master.set_border_width(0); - - _connect_outputs_to_master.set_group (connect_outputs_group); - _connect_outputs_to_physical.set_group (connect_outputs_group); - - _connect_outputs_to_physical.set_label (_("... to physical outputs")); - _connect_outputs_to_physical.set_flags(Gtk::CAN_FOCUS); - _connect_outputs_to_physical.set_relief(Gtk::RELIEF_NORMAL); - _connect_outputs_to_physical.set_mode(true); - _connect_outputs_to_physical.set_active(Config->get_output_auto_connect() == AutoConnectPhysical); - _connect_outputs_to_physical.set_border_width(0); - - output_conn_vbox.pack_start(_connect_outputs, Gtk::PACK_SHRINK, 0); - output_conn_vbox.pack_start(_connect_outputs_to_master, Gtk::PACK_SHRINK, 0); - output_conn_vbox.pack_start(_connect_outputs_to_physical, Gtk::PACK_SHRINK, 0); - output_vbox.set_border_width(6); - - output_port_vbox.pack_start(output_port_limit_hbox, Gtk::PACK_SHRINK, 0); - - output_vbox.pack_start(output_conn_vbox); - output_vbox.pack_start(output_port_vbox); - - output_label.set_alignment(0, 0.5); - output_label.set_padding(0,0); - output_label.set_line_wrap(false); - output_label.set_selectable(false); - output_label.set_use_markup(true); - output_frame.set_shadow_type(Gtk::SHADOW_NONE); - output_frame.set_label_align(0,0.5); - - output_hbox.pack_start (output_vbox, Gtk::PACK_SHRINK, 18); - - output_frame.add(output_hbox); - output_frame.set_label_widget(output_label); - - more_options_vbox.pack_start(advanced_table, Gtk::PACK_SHRINK, 0); - more_options_vbox.pack_start(bus_frame, Gtk::PACK_SHRINK, 6); - more_options_vbox.pack_start(input_frame, Gtk::PACK_SHRINK, 6); - more_options_vbox.pack_start(output_frame, Gtk::PACK_SHRINK, 0); - - /* signals */ - - _connect_inputs.signal_clicked().connect (sigc::mem_fun (*this, &ArdourStartup::connect_inputs_clicked)); - _connect_outputs.signal_clicked().connect (sigc::mem_fun (*this, &ArdourStartup::connect_outputs_clicked)); - _limit_input_ports.signal_clicked().connect (sigc::mem_fun (*this, &ArdourStartup::limit_inputs_clicked)); - _limit_output_ports.signal_clicked().connect (sigc::mem_fun (*this, &ArdourStartup::limit_outputs_clicked)); - _create_master_bus.signal_clicked().connect (sigc::mem_fun (*this, &ArdourStartup::master_bus_button_clicked)); - - /* note that more_options_vbox is "visible" by default even - * though it may not be displayed to the user, this is so the dialog - * doesn't resize. - */ - more_options_vbox.show_all (); -} - -bool -ArdourStartup::create_master_bus() const -{ - return _create_master_bus.get_active(); -} - -int -ArdourStartup::master_channel_count() const -{ - return _master_bus_channel_count.get_value_as_int(); -} - -bool -ArdourStartup::connect_inputs() const -{ - return _connect_inputs.get_active(); -} - -bool -ArdourStartup::limit_inputs_used_for_connection() const -{ - return _limit_input_ports.get_active(); -} - -int -ArdourStartup::input_limit_count() const -{ - return _input_limit_count.get_value_as_int(); -} - -bool -ArdourStartup::connect_outputs() const -{ - return _connect_outputs.get_active(); -} - -bool -ArdourStartup::limit_outputs_used_for_connection() const -{ - return _limit_output_ports.get_active(); -} - -int -ArdourStartup::output_limit_count() const -{ - return _output_limit_count.get_value_as_int(); -} - -bool -ArdourStartup::connect_outs_to_master() const -{ - return _connect_outputs_to_master.get_active(); -} - -bool -ArdourStartup::connect_outs_to_physical() const -{ - return _connect_outputs_to_physical.get_active(); -} - -void -ArdourStartup::connect_inputs_clicked () -{ - _limit_input_ports.set_sensitive(_connect_inputs.get_active()); - - if (_connect_inputs.get_active() && _limit_input_ports.get_active()) { - _input_limit_count.set_sensitive(true); - } else { - _input_limit_count.set_sensitive(false); - } -} - -void -ArdourStartup::connect_outputs_clicked () -{ - bool const co = _connect_outputs.get_active (); - _limit_output_ports.set_sensitive(co); - _connect_outputs_to_master.set_sensitive(co); - _connect_outputs_to_physical.set_sensitive(co); - - if (co && _limit_output_ports.get_active()) { - _output_limit_count.set_sensitive(true); - } else { - _output_limit_count.set_sensitive(false); - } -} - -void -ArdourStartup::limit_inputs_clicked () -{ - _input_limit_count.set_sensitive(_limit_input_ports.get_active()); -} - -void -ArdourStartup::limit_outputs_clicked () -{ - _output_limit_count.set_sensitive(_limit_output_ports.get_active()); -} - -void -ArdourStartup::master_bus_button_clicked () -{ - bool const yn = _create_master_bus.get_active(); - - _master_bus_channel_count.set_sensitive(yn); - _connect_outputs_to_master.set_sensitive(yn); -} void ArdourStartup::move_along_now () @@ -1283,83 +440,5 @@ ArdourStartup::move_along_now () on_apply (); } -void -ArdourStartup::recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*) -{ - set_page_complete (ic_vbox, true); - move_along_now (); -} -void -ArdourStartup::existing_session_selected () -{ - _existing_session_chooser_used = true; - - session_selected (); - set_page_complete (ic_vbox, true); - move_along_now (); -} - -std::string -ArdourStartup::been_here_before_path () const -{ - // XXXX use more specific version so we can catch upgrades - return Glib::build_filename (user_config_directory (), ".a3"); -} - -void -ArdourStartup::updates_button_clicked () -{ - //now open a browser window so user can see more - PBD::open_uri (Config->get_updates_url()); -} - -bool -ArdourStartup::info_scroller_update() -{ - info_scroller_count++; - - char buf[512]; - snprintf (buf, std::min(info_scroller_count,sizeof(buf)-1), "%s", ARDOUR_UI::instance()->announce_string().c_str() ); - buf[info_scroller_count] = 0; - info_scroller_label.set_text (buf); - info_scroller_label.show(); - - if (info_scroller_count > ARDOUR_UI::instance()->announce_string().length()) { - info_scroller_connection.disconnect(); - } - - return true; -} - -void -ArdourStartup::on_map () -{ - Gtk::Assistant::on_map (); - - populate_session_templates (); - - if (!template_model->children().empty()) { - use_template_button.show(); - template_chooser.show (); - } else { - use_template_button.hide(); - template_chooser.hide (); - } - - if (recent_session_model) { - int cnt = redisplay_recent_sessions (); - if (cnt > 0) { - recent_scroller.show(); - recent_label.show (); - - if (cnt > 4) { - recent_scroller.set_size_request (-1, 300); - } - } else { - recent_scroller.hide(); - recent_label.hide (); - } - } -} diff --git a/gtk2_ardour/startup.h b/gtk2_ardour/startup.h index 361d00e9e1..c5a9a30162 100644 --- a/gtk2_ardour/startup.h +++ b/gtk2_ardour/startup.h @@ -46,32 +46,10 @@ class EngineControl; class ArdourStartup : public Gtk::Assistant { public: - ArdourStartup (bool require_new, const std::string& session_name, const std::string& session_path, const std::string& template_name); + ArdourStartup (); ~ArdourStartup (); - bool ready_without_display () const; - - std::string session_name (bool& should_be_new); - std::string session_folder (); - - bool use_session_template(); - std::string session_template_name(); - - // advanced session options - - bool create_master_bus() const; - int master_channel_count() const; - - bool connect_inputs() const; - bool limit_inputs_used_for_connection() const; - int input_limit_count() const; - - bool connect_outputs() const; - bool limit_outputs_used_for_connection() const; - int output_limit_count() const; - - bool connect_outs_to_master() const; - bool connect_outs_to_physical() const; + static bool required (); gint response () const { return _response; @@ -81,18 +59,12 @@ class ArdourStartup : public Gtk::Assistant { gint _response; bool config_modified; bool new_user; - bool need_session_info; - bool new_only; - std::string _provided_session_name; - std::string _provided_session_path; - std::string been_here_before_path () const; + static std::string been_here_before_path (); void on_apply (); void on_cancel (); bool on_delete_event (GdkEventAny*); - void on_prepare (Gtk::Widget*); - void on_map (); static ArdourStartup *the_startup; @@ -110,13 +82,7 @@ class ArdourStartup : public Gtk::Assistant { Gtk::FileChooserButton* default_dir_chooser; void default_dir_changed(); void setup_first_page (); - - /* initial choice page */ - - void setup_initial_choice_page (); - Gtk::VBox ic_vbox; - Gtk::Button ic_new_session_button; - void new_session_button_clicked (); + Gtk::FileChooserButton new_folder_chooser; /* monitoring choices */ @@ -134,128 +100,6 @@ class ArdourStartup : public Gtk::Assistant { Gtk::RadioButton no_monitor_section_button; void setup_monitor_section_choice_page (); - - /* recent sessions */ - - void setup_existing_session_page (); - - struct RecentSessionsSorter { - bool operator() (std::pair a, std::pair b) const { - return cmp_nocase(a.first, b.first) == -1; - } - }; - - struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord { - RecentSessionModelColumns() { - add (visible_name); - add (tip); - add (fullpath); - } - Gtk::TreeModelColumn visible_name; - Gtk::TreeModelColumn tip; - Gtk::TreeModelColumn fullpath; - }; - - RecentSessionModelColumns recent_session_columns; - Gtk::TreeView recent_session_display; - Glib::RefPtr recent_session_model; - Gtk::ScrolledWindow recent_scroller; - Gtk::Label recent_label; - Gtk::FileChooserButton existing_session_chooser; - int redisplay_recent_sessions (); - void recent_session_row_selected (); - void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col); - - void existing_session_selected (); - void session_selected (); - - /* new sessions */ - - void setup_new_session_page (); - Gtk::Entry new_name_entry; - Gtk::FileChooserButton new_folder_chooser; - - struct SessionTemplateColumns : public Gtk::TreeModel::ColumnRecord { - SessionTemplateColumns () { - add (name); - add (path); - } - - Gtk::TreeModelColumn name; - Gtk::TreeModelColumn path; - }; - - SessionTemplateColumns session_template_columns; - Glib::RefPtr template_model; - Gtk::ComboBox template_chooser; - - Gtk::VBox session_new_vbox; - Gtk::VBox session_existing_vbox; - Gtk::Expander more_new_session_options_button; - Gtk::CheckButton use_template_button; - std::string load_template_override; - - void more_new_session_options_button_clicked(); - void new_name_changed (); - void populate_session_templates (); - - /* more options for new sessions */ - - Gtk::VBox more_options_vbox; - - Gtk::Label chan_count_label_1; - Gtk::Label chan_count_label_3; - Gtk::Label chan_count_label_4; - Gtk::Table advanced_table; - Gtk::HBox input_port_limit_hbox; - Gtk::VBox input_port_vbox; - Gtk::Table input_table; - Gtk::HBox input_hbox; - - Gtk::Label bus_label; - Gtk::Frame bus_frame; - Gtk::Table bus_table; - Gtk::HBox bus_hbox; - - Gtk::Label input_label; - Gtk::Frame input_frame; - Gtk::HBox output_port_limit_hbox; - Gtk::VBox output_port_vbox; - Gtk::VBox output_conn_vbox; - Gtk::VBox output_vbox; - Gtk::HBox output_hbox; - - Gtk::Label output_label; - Gtk::Frame output_frame; - Gtk::VBox advanced_vbox; - Gtk::Label advanced_label; - - Gtk::CheckButton _create_master_bus; - Gtk::SpinButton _master_bus_channel_count; - - Gtk::CheckButton _connect_inputs; - Gtk::CheckButton _limit_input_ports; - Gtk::SpinButton _input_limit_count; - - Gtk::CheckButton _connect_outputs; - Gtk::CheckButton _limit_output_ports; - Gtk::SpinButton _output_limit_count; - - Gtk::RadioButtonGroup connect_outputs_group; - Gtk::RadioButton _connect_outputs_to_master; - Gtk::RadioButton _connect_outputs_to_physical; - - Gtk::Adjustment _output_limit_count_adj; - Gtk::Adjustment _input_limit_count_adj; - Gtk::Adjustment _master_bus_channel_count_adj; - - void connect_inputs_clicked (); - void connect_outputs_clicked (); - void limit_inputs_clicked (); - void limit_outputs_clicked (); - void master_bus_button_clicked (); - void setup_more_options_box (); - /* final page */ void setup_final_page (); @@ -272,21 +116,12 @@ class ArdourStartup : public Gtk::Assistant { gint default_folder_page_index; gint monitoring_page_index; gint monitor_section_page_index; - gint new_session_page_index; - gint initial_choice_index; gint final_page_index; - gint session_options_page_index; void move_along_now (); - bool _existing_session_chooser_used; ///< set to true when the existing session chooser has been used void setup_prerelease_page (); - Gtk::Label info_scroller_label; - std::string::size_type info_scroller_count; - bool info_scroller_update(); - sigc::connection info_scroller_connection; - void updates_button_clicked (); }; #endif /* __gtk2_ardour_startup_h__ */ diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 304b8508c6..c81aff85ab 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -401,7 +401,7 @@ emulate_key_event (Gtk::Widget* w, unsigned int keyval) ev.state = 0; ev.keyval = keyval; ev.length = 0; - ev.string = (const gchar*) ""; + ev.string = const_cast (""); ev.hardware_keycode = keymapkey[0].keycode; ev.group = keymapkey[0].group; g_free(keymapkey); diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 1f4c7940f8..be7164cf05 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -203,6 +203,7 @@ gtk2_ardour_sources = [ 'search_path_option.cc', 'selection.cc', 'send_ui.cc', + 'session_dialog.cc', 'session_import_dialog.cc', 'session_metadata_dialog.cc', 'session_option_editor.cc',