mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +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 ();
|
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)
|
ARDOUR_UI::run_startup (bool should_be_new)
|
||||||
{
|
{
|
||||||
if (_startup == 0) {
|
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 */
|
/* we don't return here until the startup assistant is finished */
|
||||||
|
|
||||||
_startup->hide ();
|
_startup->hide ();
|
||||||
|
|
||||||
|
return _startup->applying ();
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -654,7 +657,7 @@ ARDOUR_UI::startup ()
|
||||||
_startup->engine_control()->set_state (*audio_setup);
|
_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);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2261,8 +2264,9 @@ ARDOUR_UI::loading_message (const std::string& /*msg*/)
|
||||||
flush_pending ();
|
flush_pending ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @param quit_on_cancel true if exit() should be called if the user clicks `cancel' in the new session dialog */
|
||||||
int
|
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_name;
|
||||||
Glib::ustring session_path;
|
Glib::ustring session_path;
|
||||||
|
|
@ -2270,6 +2274,8 @@ ARDOUR_UI::get_session_parameters (bool should_be_new)
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
bool likely_new = false;
|
bool likely_new = false;
|
||||||
|
|
||||||
|
cout << "get_session_parameters\n";
|
||||||
|
|
||||||
while (ret != 0) {
|
while (ret != 0) {
|
||||||
|
|
||||||
if (!should_be_new && !ARDOUR_COMMAND_LINE::session_name.empty()) {
|
if (!should_be_new && !ARDOUR_COMMAND_LINE::session_name.empty()) {
|
||||||
|
|
@ -2289,7 +2295,14 @@ ARDOUR_UI::get_session_parameters (bool should_be_new)
|
||||||
|
|
||||||
} else {
|
} 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" */
|
/* 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;
|
_session_is_new = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (session_name[0] == '/' ||
|
if (session_name[0] == '/' ||
|
||||||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
|
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') ||
|
||||||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
|
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) {
|
||||||
|
|
@ -2378,7 +2390,7 @@ ARDOUR_UI::close_session()
|
||||||
unload_session (true);
|
unload_session (true);
|
||||||
|
|
||||||
ARDOUR_COMMAND_LINE::session_name = "";
|
ARDOUR_COMMAND_LINE::session_name = "";
|
||||||
get_session_parameters (false);
|
get_session_parameters (true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||||
ARDOUR_UI (int *argcp, char **argvp[]);
|
ARDOUR_UI (int *argcp, char **argvp[]);
|
||||||
~ARDOUR_UI();
|
~ARDOUR_UI();
|
||||||
|
|
||||||
void run_startup (bool should_be_new);
|
bool run_startup (bool should_be_new);
|
||||||
|
|
||||||
void show ();
|
void show ();
|
||||||
bool shown() { return shown_flag; }
|
bool shown() { return shown_flag; }
|
||||||
|
|
@ -140,7 +140,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||||
_will_create_new_session_automatically = yn;
|
_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);
|
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 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);
|
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 */
|
/* 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_("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));
|
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 ()
|
ArdourStartup::ArdourStartup ()
|
||||||
: applying (false)
|
: _applying (false)
|
||||||
, ic_new_session_button (_("Open a new session"))
|
, ic_new_session_button (_("Open a new session"))
|
||||||
, ic_existing_session_button (_("Open an existing 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\
|
, 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
|
void
|
||||||
ArdourStartup::on_cancel ()
|
ArdourStartup::on_cancel ()
|
||||||
{
|
{
|
||||||
exit (1);
|
gtk_main_quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ArdourStartup::on_close ()
|
ArdourStartup::on_close ()
|
||||||
{
|
{
|
||||||
if (!applying) {
|
gtk_main_quit ();
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ArdourStartup::on_apply ()
|
ArdourStartup::on_apply ()
|
||||||
{
|
{
|
||||||
applying = true;
|
_applying = true;
|
||||||
|
|
||||||
// XXX do stuff and then ....
|
// XXX do stuff and then ....
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,12 @@ class ArdourStartup : public Gtk::Assistant {
|
||||||
bool connect_outs_to_master() 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:
|
private:
|
||||||
bool applying;
|
bool _applying;
|
||||||
bool config_modified;
|
bool config_modified;
|
||||||
bool new_user;
|
bool new_user;
|
||||||
bool new_only;
|
bool new_only;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue