diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-06 16:32:02 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-06 16:32:02 -0400 |
commit | d74255343e9f74a2797391b0b6931a49678b5efa (patch) | |
tree | 4a62c5a055cfee96e3fc679d3c105f96abe3d0c0 /gtk2_ardour | |
parent | 2d5e605bf124c82f77a5a893e540bc176164947d (diff) |
fix up some aspects of loading from a cmdline session name
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 19 | ||||
-rw-r--r-- | gtk2_ardour/session_dialog.cc | 3 |
2 files changed, 15 insertions, 7 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index e98e3e00a0..e74b8efe98 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2558,6 +2558,18 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri template_name = load_template; } + session_name = basename_nosuffix (ARDOUR_COMMAND_LINE::session_name); + session_path = ARDOUR_COMMAND_LINE::session_name; + + if (!session_path.empty()) { + if (Glib::file_test (session_path.c_str(), Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test (session_path.c_str(), Glib::FILE_TEST_IS_REGULAR)) { + /* session/snapshot file, change path to be dir */ + session_path = Glib::path_get_dirname (session_path); + } + } + } + SessionDialog session_dialog (should_be_new, session_name, session_path, load_template, cancel_not_quit); while (ret != 0) { @@ -2606,7 +2618,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri should_be_new = false; session_name = session_dialog.session_name (likely_new); - + if (nsm) { likely_new = true; } @@ -2658,6 +2670,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { + if (likely_new && !nsm) { std::string existing = Glib::build_filename (session_path, session_name); @@ -2695,8 +2708,6 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri if (likely_new && template_name.empty()) { - cerr << "building a session from dialog\n"; - ret = build_session_from_dialog (session_dialog, session_path, session_name); } else { @@ -4095,8 +4106,6 @@ 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/session_dialog.cc b/gtk2_ardour/session_dialog.cc index 51c7e24f80..dae19067a7 100644 --- a/gtk2_ardour/session_dialog.cc +++ b/gtk2_ardour/session_dialog.cc @@ -185,6 +185,7 @@ std::string SessionDialog::session_name (bool& should_be_new) { if (!_provided_session_name.empty() && !new_only) { + should_be_new = false; return _provided_session_name; } @@ -276,8 +277,6 @@ SessionDialog::setup_initial_choice_box () info_box->pack_start (info_scroller_label, false, false); - cerr << "Frame should be visible\n"; - info_scroller_count = 0; info_scroller_connection = Glib::signal_timeout().connect (mem_fun(*this, &SessionDialog::info_scroller_update), 50); |