mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
introduce the idea of an "unnamed" session (GUI edition)
This commit is contained in:
parent
5766989319
commit
5d4ad01b58
5 changed files with 18 additions and 13 deletions
|
|
@ -120,7 +120,7 @@ ARDOUR_UI::build_session_from_dialog (SessionDialog& sd, const std::string& sess
|
|||
bus_profile.master_out_channels = (uint32_t) sd.master_channel_count();
|
||||
}
|
||||
|
||||
build_session (session_path, session_name, session_template, bus_profile);
|
||||
build_session (session_path, session_name, session_template, bus_profile, false, !sd.was_new_name_edited());
|
||||
}
|
||||
|
||||
/** This is only ever used once Ardour is already running with a session
|
||||
|
|
@ -552,7 +552,7 @@ ARDOUR_UI::load_session_stage_two (const std::string& path, const std::string& s
|
|||
}
|
||||
|
||||
int
|
||||
ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name, const std::string& session_template, BusProfile const& bus_profile, bool from_startup_fsm)
|
||||
ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name, const std::string& session_template, BusProfile const& bus_profile, bool from_startup_fsm, bool unnamed)
|
||||
{
|
||||
int x;
|
||||
|
||||
|
|
@ -571,11 +571,11 @@ ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name,
|
|||
* asked for the SR (even if try-autostart-engine is set)
|
||||
*/
|
||||
if (from_startup_fsm && AudioEngine::instance()->running ()) {
|
||||
return build_session_stage_two (path, snap_name, session_template, bus_profile);
|
||||
return build_session_stage_two (path, snap_name, session_template, bus_profile, unnamed);
|
||||
}
|
||||
/* Sample-rate cannot be changed when JACK is running */
|
||||
if (!ARDOUR::AudioEngine::instance()->setup_required () && AudioEngine::instance()->running ()) {
|
||||
return build_session_stage_two (path, snap_name, session_template, bus_profile);
|
||||
return build_session_stage_two (path, snap_name, session_template, bus_profile, unnamed);
|
||||
}
|
||||
|
||||
/* Work-around missing "OK" button:
|
||||
|
|
@ -591,7 +591,7 @@ ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name,
|
|||
audio_midi_setup->set_position (WIN_POS_CENTER);
|
||||
audio_midi_setup->set_modal ();
|
||||
audio_midi_setup->present ();
|
||||
_engine_dialog_connection = audio_midi_setup->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::audio_midi_setup_for_new_session_done), path, snap_name, session_template, bus_profile));
|
||||
_engine_dialog_connection = audio_midi_setup->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::audio_midi_setup_for_new_session_done), path, snap_name, session_template, bus_profile, unnamed));
|
||||
|
||||
/* not done yet, but we're avoiding modal dialogs */
|
||||
return 0;
|
||||
|
|
@ -599,7 +599,7 @@ ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name,
|
|||
|
||||
|
||||
void
|
||||
ARDOUR_UI::audio_midi_setup_for_new_session_done (int response, std::string path, std::string snap_name, std::string template_name, BusProfile const& bus_profile)
|
||||
ARDOUR_UI::audio_midi_setup_for_new_session_done (int response, std::string path, std::string snap_name, std::string template_name, BusProfile const& bus_profile, bool unnamed)
|
||||
{
|
||||
_engine_dialog_connection.disconnect ();
|
||||
|
||||
|
|
@ -617,18 +617,18 @@ ARDOUR_UI::audio_midi_setup_for_new_session_done (int response, std::string path
|
|||
audio_midi_setup->set_modal (false);
|
||||
audio_midi_setup->hide();
|
||||
|
||||
build_session_stage_two (path, snap_name, template_name, bus_profile);
|
||||
build_session_stage_two (path, snap_name, template_name, bus_profile, unnamed);
|
||||
}
|
||||
|
||||
int
|
||||
ARDOUR_UI::build_session_stage_two (std::string const& path, std::string const& snap_name, std::string const& session_template, BusProfile const& bus_profile)
|
||||
ARDOUR_UI::build_session_stage_two (std::string const& path, std::string const& snap_name, std::string const& session_template, BusProfile const& bus_profile, bool unnamed)
|
||||
{
|
||||
Session* new_session;
|
||||
|
||||
bool meta_session = !session_template.empty() && session_template.substr (0, 11) == "urn:ardour:";
|
||||
|
||||
try {
|
||||
new_session = new Session (*AudioEngine::instance(), path, snap_name, bus_profile.master_out_channels > 0 ? &bus_profile : NULL, meta_session ? "" : session_template);
|
||||
new_session = new Session (*AudioEngine::instance(), path, snap_name, bus_profile.master_out_channels > 0 ? &bus_profile : NULL, meta_session ? "" : session_template, unnamed);
|
||||
}
|
||||
catch (SessionException const& e) {
|
||||
stringstream ss;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue