mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Stop ardour exiting in the case where you have a loaded session, then select New Session, cancel.
git-svn-id: svn://localhost/ardour2/branches/3.0@5808 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
917f02e5f6
commit
41b8a010da
5 changed files with 31 additions and 17 deletions
|
|
@ -281,7 +281,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
|||
platform_setup ();
|
||||
}
|
||||
|
||||
void
|
||||
/** @return true if a session was chosen and `apply' clicked, otherwise false if `cancel' was clicked */
|
||||
bool
|
||||
ARDOUR_UI::run_startup (bool should_be_new)
|
||||
{
|
||||
if (_startup == 0) {
|
||||
|
|
@ -296,6 +297,8 @@ ARDOUR_UI::run_startup (bool should_be_new)
|
|||
/* we don't return here until the startup assistant is finished */
|
||||
|
||||
_startup->hide ();
|
||||
|
||||
return _startup->applying ();
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -654,7 +657,7 @@ ARDOUR_UI::startup ()
|
|||
_startup->engine_control()->set_state (*audio_setup);
|
||||
}
|
||||
|
||||
if (get_session_parameters (ARDOUR_COMMAND_LINE::new_session)) {
|
||||
if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session)) {
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
|
@ -2261,8 +2264,9 @@ ARDOUR_UI::loading_message (const std::string& /*msg*/)
|
|||
flush_pending ();
|
||||
}
|
||||
|
||||
/** @param quit_on_cancel true if exit() should be called if the user clicks `cancel' in the new session dialog */
|
||||
int
|
||||
ARDOUR_UI::get_session_parameters (bool should_be_new)
|
||||
ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new)
|
||||
{
|
||||
Glib::ustring session_name;
|
||||
Glib::ustring session_path;
|
||||
|
|
@ -2270,6 +2274,8 @@ ARDOUR_UI::get_session_parameters (bool should_be_new)
|
|||
int ret = -1;
|
||||
bool likely_new = false;
|
||||
|
||||
cout << "get_session_parameters\n";
|
||||
|
||||
while (ret != 0) {
|
||||
|
||||
if (!should_be_new && !ARDOUR_COMMAND_LINE::session_name.empty()) {
|
||||
|
|
@ -2289,7 +2295,14 @@ ARDOUR_UI::get_session_parameters (bool should_be_new)
|
|||
|
||||
} else {
|
||||
|
||||
run_startup (should_be_new);
|
||||
bool const apply = run_startup (should_be_new);
|
||||
if (!apply) {
|
||||
if (quit_on_cancel) {
|
||||
exit (1);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we run the startup dialog again, offer more than just "new session" */
|
||||
|
||||
|
|
@ -2307,7 +2320,6 @@ ARDOUR_UI::get_session_parameters (bool should_be_new)
|
|||
_session_is_new = true;
|
||||
}
|
||||
|
||||
|
||||
if (session_name[0] == '/' ||
|
||||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
|
||||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
|
||||
|
|
@ -2378,7 +2390,7 @@ ARDOUR_UI::close_session()
|
|||
unload_session (true);
|
||||
|
||||
ARDOUR_COMMAND_LINE::session_name = "";
|
||||
get_session_parameters (false);
|
||||
get_session_parameters (true, false);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
ARDOUR_UI (int *argcp, char **argvp[]);
|
||||
~ARDOUR_UI();
|
||||
|
||||
void run_startup (bool should_be_new);
|
||||
bool run_startup (bool should_be_new);
|
||||
|
||||
void show ();
|
||||
bool shown() { return shown_flag; }
|
||||
|
|
@ -140,7 +140,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
_will_create_new_session_automatically = yn;
|
||||
}
|
||||
|
||||
int get_session_parameters (bool should_be_new = false);
|
||||
int get_session_parameters (bool quit_on_cancel, bool should_be_new = false);
|
||||
void parse_cmdline_path (const Glib::ustring& cmdline_path, Glib::ustring& session_name, Glib::ustring& session_path, bool& existing_session);
|
||||
int load_cmdline_session (const Glib::ustring& session_name, const Glib::ustring& session_path, bool& existing_session);
|
||||
int build_session_from_nsd (const Glib::ustring& session_name, const Glib::ustring& session_path);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ ARDOUR_UI::install_actions ()
|
|||
|
||||
/* the real actions */
|
||||
|
||||
act = ActionManager::register_action (main_actions, X_("New"), _("New..."), hide_return (bind (mem_fun(*this, &ARDOUR_UI::get_session_parameters), true)));
|
||||
act = ActionManager::register_action (main_actions, X_("New"), _("New..."), hide_return (bind (mem_fun(*this, &ARDOUR_UI::get_session_parameters), false, true)));
|
||||
|
||||
ActionManager::register_action (main_actions, X_("Open"), _("Open..."), mem_fun(*this, &ARDOUR_UI::open_session));
|
||||
ActionManager::register_action (main_actions, X_("Recent"), _("Recent..."), mem_fun(*this, &ARDOUR_UI::open_recent_session));
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ static string poor_mans_glob (string path)
|
|||
|
||||
|
||||
ArdourStartup::ArdourStartup ()
|
||||
: applying (false)
|
||||
: _applying (false)
|
||||
, ic_new_session_button (_("Open a new session"))
|
||||
, ic_existing_session_button (_("Open an existing session"))
|
||||
, monitor_via_hardware_button (_("Use an external mixer or the hardware mixer of your audio interface.\n\
|
||||
|
|
@ -418,21 +418,19 @@ ArdourStartup::setup_final_page ()
|
|||
void
|
||||
ArdourStartup::on_cancel ()
|
||||
{
|
||||
exit (1);
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::on_close ()
|
||||
{
|
||||
if (!applying) {
|
||||
exit (1);
|
||||
}
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::on_apply ()
|
||||
{
|
||||
applying = true;
|
||||
_applying = true;
|
||||
|
||||
// XXX do stuff and then ....
|
||||
|
||||
|
|
|
|||
|
|
@ -54,10 +54,14 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
int output_limit_count() const;
|
||||
|
||||
bool connect_outs_to_master() const;
|
||||
bool connect_outs_to_physical() const ;
|
||||
bool connect_outs_to_physical() const;
|
||||
|
||||
bool applying () const {
|
||||
return _applying;
|
||||
}
|
||||
|
||||
private:
|
||||
bool applying;
|
||||
bool _applying;
|
||||
bool config_modified;
|
||||
bool new_user;
|
||||
bool new_only;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue