mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
Fixed template dialog annoyance.
Fixed Location saving in templates. git-svn-id: svn://localhost/ardour2/trunk@1068 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
975e44f924
commit
a8deaab02f
4 changed files with 24 additions and 3 deletions
|
|
@ -1582,7 +1582,6 @@ ARDOUR_UI::save_template ()
|
||||||
prompter.set_prompt (_("Name for mix template:"));
|
prompter.set_prompt (_("Name for mix template:"));
|
||||||
prompter.set_initial_text(session->name() + _("-template"));
|
prompter.set_initial_text(session->name() + _("-template"));
|
||||||
prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
|
prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
|
||||||
prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
|
|
||||||
|
|
||||||
switch (prompter.run()) {
|
switch (prompter.run()) {
|
||||||
case RESPONSE_ACCEPT:
|
case RESPONSE_ACCEPT:
|
||||||
|
|
|
||||||
|
|
@ -928,6 +928,8 @@ class Session : public PBD::StatefulDestructible
|
||||||
private:
|
private:
|
||||||
int create (bool& new_session, string* mix_template, nframes_t initial_length);
|
int create (bool& new_session, string* mix_template, nframes_t initial_length);
|
||||||
|
|
||||||
|
nframes_t compute_initial_length ();
|
||||||
|
|
||||||
static const char* _template_suffix;
|
static const char* _template_suffix;
|
||||||
static const char* _statefile_suffix;
|
static const char* _statefile_suffix;
|
||||||
static const char* _pending_suffix;
|
static const char* _pending_suffix;
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ Session::Session (AudioEngine &eng,
|
||||||
|
|
||||||
new_session = !g_file_test (_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
|
new_session = !g_file_test (_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
|
||||||
if (new_session) {
|
if (new_session) {
|
||||||
if (create (new_session, mix_template, _engine.frame_rate() * 60 * 5)) {
|
if (create (new_session, mix_template, compute_initial_length())) {
|
||||||
cerr << "create failed\n";
|
cerr << "create failed\n";
|
||||||
throw failed_constructor ();
|
throw failed_constructor ();
|
||||||
}
|
}
|
||||||
|
|
@ -3768,3 +3768,10 @@ Session::add_automation_list(AutomationList *al)
|
||||||
{
|
{
|
||||||
automation_lists[al->id()] = al;
|
automation_lists[al->id()] = al;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nframes_t
|
||||||
|
Session::compute_initial_length ()
|
||||||
|
{
|
||||||
|
return _engine.frame_rate() * 60 * 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -880,7 +880,20 @@ Session::state(bool full_state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node->add_child_nocopy (_locations.get_state());
|
if (full_state) {
|
||||||
|
node->add_child_nocopy (_locations.get_state());
|
||||||
|
} else {
|
||||||
|
// for a template, just create a new Locations, populate it
|
||||||
|
// with the default start and end, and get the state for that.
|
||||||
|
Locations loc;
|
||||||
|
Location* start = new Location(0, 0, _("start"), Location::Flags ((Location::IsMark|Location::IsStart)));
|
||||||
|
Location* end = new Location(0, 0, _("end"), Location::Flags ((Location::IsMark|Location::IsEnd)));
|
||||||
|
start->set_end(0);
|
||||||
|
loc.add (start);
|
||||||
|
end->set_end(compute_initial_length());
|
||||||
|
loc.add (end);
|
||||||
|
node->add_child_nocopy (loc.get_state());
|
||||||
|
}
|
||||||
|
|
||||||
child = node->add_child ("Connections");
|
child = node->add_child ("Connections");
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue