farewell NSD, we loved you sometimes, almost never
git-svn-id: svn://localhost/ardour2/branches/3.0@4992 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
3ae378a17c
commit
0513474072
|
@ -204,7 +204,6 @@ midi_time_axis.cc
|
|||
mixer_strip.cc
|
||||
mixer_ui.cc
|
||||
nag.cc
|
||||
new_session_dialog.cc
|
||||
option_editor.cc
|
||||
opts.cc
|
||||
panner.cc
|
||||
|
|
|
@ -84,7 +84,6 @@ typedef uint64_t microseconds_t;
|
|||
#include "prompter.h"
|
||||
#include "opts.h"
|
||||
#include "add_route_dialog.h"
|
||||
#include "new_session_dialog.h"
|
||||
#include "about.h"
|
||||
#include "splash.h"
|
||||
#include "utils.h"
|
||||
|
@ -95,6 +94,7 @@ typedef uint64_t microseconds_t;
|
|||
#include "gain_meter.h"
|
||||
#include "route_time_axis.h"
|
||||
#include "startup.h"
|
||||
#include "engine_dialog.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -196,7 +196,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
|||
session_selector_window = 0;
|
||||
last_key_press_time = 0;
|
||||
_will_create_new_session_automatically = false;
|
||||
new_session_dialog = 0;
|
||||
add_route_dialog = 0;
|
||||
route_params = 0;
|
||||
option_editor = 0;
|
||||
|
@ -285,7 +284,12 @@ ARDOUR_UI::run_startup ()
|
|||
}
|
||||
|
||||
_startup->present ();
|
||||
|
||||
main().run();
|
||||
|
||||
/* we don't return here until the startup assistant is finished */
|
||||
|
||||
_startup->hide ();
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -407,7 +411,6 @@ ARDOUR_UI::~ARDOUR_UI ()
|
|||
delete editor;
|
||||
delete mixer;
|
||||
delete add_route_dialog;
|
||||
delete new_session_dialog;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -523,8 +526,8 @@ ARDOUR_UI::save_ardour_state ()
|
|||
XMLNode* node = new XMLNode (keyboard->get_state());
|
||||
Config->add_extra_xml (*node);
|
||||
Config->add_extra_xml (get_transport_controllable_state());
|
||||
if (new_session_dialog && new_session_dialog->engine_control.was_used()) {
|
||||
Config->add_extra_xml (new_session_dialog->engine_control.get_state());
|
||||
if (_startup && _startup->engine_control().was_used()) {
|
||||
Config->add_extra_xml (_startup->engine_control().get_state());
|
||||
}
|
||||
Config->save_state();
|
||||
ui_config->save_state ();
|
||||
|
@ -643,13 +646,11 @@ ARDOUR_UI::startup ()
|
|||
{
|
||||
string name, path;
|
||||
|
||||
new_session_dialog = new NewSessionDialog();
|
||||
|
||||
bool backend_audio_is_running = EngineControl::engine_running();
|
||||
XMLNode* audio_setup = Config->extra_xml ("AudioSetup");
|
||||
|
||||
if (audio_setup) {
|
||||
new_session_dialog->engine_control.set_state (*audio_setup);
|
||||
_startup->engine_control().set_state (*audio_setup);
|
||||
}
|
||||
|
||||
if (!get_session_parameters (backend_audio_is_running, ARDOUR_COMMAND_LINE::new_session)) {
|
||||
|
@ -2035,7 +2036,7 @@ ARDOUR_UI::fontconfig_dialog ()
|
|||
Glib::ustring fontconfig = Glib::build_filename (Glib::get_home_dir(), ".fontconfig");
|
||||
|
||||
if (!Glib::file_test (fontconfig, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
|
||||
MessageDialog msg (*new_session_dialog,
|
||||
MessageDialog msg (*_startup,
|
||||
_("Welcome to Ardour.\n\n"
|
||||
"The program will take a bit longer to start up\n"
|
||||
"while the system fonts are checked.\n\n"
|
||||
|
@ -2113,7 +2114,7 @@ ARDOUR_UI::load_cmdline_session (const Glib::ustring& session_name, const Glib::
|
|||
/* lets just try to load it */
|
||||
|
||||
if (create_engine ()) {
|
||||
backend_audio_error (false, new_session_dialog);
|
||||
backend_audio_error (false, _startup);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2169,19 +2170,19 @@ ARDOUR_UI::build_session_from_nsd (const Glib::ustring& session_path, const Glib
|
|||
|
||||
/* get settings from advanced section of NSD */
|
||||
|
||||
if (new_session_dialog->create_control_bus()) {
|
||||
cchns = (uint32_t) new_session_dialog->control_channel_count();
|
||||
if (_startup->create_control_bus()) {
|
||||
cchns = (uint32_t) _startup->control_channel_count();
|
||||
} else {
|
||||
cchns = 0;
|
||||
}
|
||||
|
||||
if (new_session_dialog->create_master_bus()) {
|
||||
mchns = (uint32_t) new_session_dialog->master_channel_count();
|
||||
if (_startup->create_master_bus()) {
|
||||
mchns = (uint32_t) _startup->master_channel_count();
|
||||
} else {
|
||||
mchns = 0;
|
||||
}
|
||||
|
||||
if (new_session_dialog->connect_inputs()) {
|
||||
if (_startup->connect_inputs()) {
|
||||
iconnect = AutoConnectPhysical;
|
||||
} else {
|
||||
iconnect = AutoConnectOption (0);
|
||||
|
@ -2189,16 +2190,16 @@ ARDOUR_UI::build_session_from_nsd (const Glib::ustring& session_path, const Glib
|
|||
|
||||
/// @todo some minor tweaks.
|
||||
|
||||
if (new_session_dialog->connect_outs_to_master()) {
|
||||
if (_startup->connect_outs_to_master()) {
|
||||
oconnect = AutoConnectMaster;
|
||||
} else if (new_session_dialog->connect_outs_to_physical()) {
|
||||
} else if (_startup->connect_outs_to_physical()) {
|
||||
oconnect = AutoConnectPhysical;
|
||||
} else {
|
||||
oconnect = AutoConnectOption (0);
|
||||
}
|
||||
|
||||
nphysin = (uint32_t) new_session_dialog->input_limit_count();
|
||||
nphysout = (uint32_t) new_session_dialog->output_limit_count();
|
||||
nphysin = (uint32_t) _startup->input_limit_count();
|
||||
nphysout = (uint32_t) _startup->output_limit_count();
|
||||
}
|
||||
|
||||
if (build_session (session_path,
|
||||
|
@ -2231,33 +2232,6 @@ ARDOUR_UI::loading_message (const std::string& msg)
|
|||
flush_pending ();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::idle_load (const Glib::ustring& path)
|
||||
{
|
||||
if (session) {
|
||||
if (Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) {
|
||||
/* /path/to/foo => /path/to/foo, foo */
|
||||
load_session (path, basename_nosuffix (path));
|
||||
} else {
|
||||
/* /path/to/foo/foo.ardour => /path/to/foo, foo */
|
||||
load_session (Glib::path_get_dirname (path), basename_nosuffix (path));
|
||||
}
|
||||
} else {
|
||||
|
||||
ARDOUR_COMMAND_LINE::session_name = path;
|
||||
|
||||
if (new_session_dialog) {
|
||||
|
||||
|
||||
/* make it break out of Dialog::run() and
|
||||
start again.
|
||||
*/
|
||||
|
||||
new_session_dialog->response (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** @param offer_quit true to offer a Cancel button, otherwise call it Quit */
|
||||
bool
|
||||
ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be_new, bool offer_cancel)
|
||||
|
@ -2268,194 +2242,79 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
|
|||
Glib::ustring template_name;
|
||||
int response;
|
||||
|
||||
begin:
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
_session_is_new = false;
|
||||
|
||||
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
|
||||
session_name = _startup->session_name (should_be_new);
|
||||
|
||||
parse_cmdline_path (ARDOUR_COMMAND_LINE::session_name, session_name, session_path, existing_session);
|
||||
|
||||
/* don't ever reuse this */
|
||||
|
||||
ARDOUR_COMMAND_LINE::session_name = string();
|
||||
|
||||
if (existing_session && backend_audio_is_running) {
|
||||
|
||||
/* just load the thing already */
|
||||
|
||||
if (load_cmdline_session (session_name, session_path, existing_session) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* make the NSD use whatever information we have */
|
||||
|
||||
new_session_dialog->set_session_name (session_name);
|
||||
new_session_dialog->set_session_folder (session_path);
|
||||
if (session_name.empty()) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
/* if the user mistakenly typed path information into the session filename entry,
|
||||
convert what they typed into a path & a name
|
||||
*/
|
||||
|
||||
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] == '/')) {
|
||||
|
||||
session_path = Glib::path_get_dirname (session_name);
|
||||
session_name = Glib::path_get_basename (session_name);
|
||||
|
||||
} else {
|
||||
|
||||
session_path = _startup->session_folder();
|
||||
}
|
||||
|
||||
template_name = Glib::ustring();
|
||||
|
||||
/* loading failed, or we need the NSD for something */
|
||||
if (create_engine ()) {
|
||||
/* FAIL */
|
||||
}
|
||||
|
||||
if (should_be_new) {
|
||||
|
||||
new_session_dialog->set_modal (false);
|
||||
new_session_dialog->set_position (WIN_POS_CENTER);
|
||||
new_session_dialog->set_current_page (0);
|
||||
new_session_dialog->set_existing_session (existing_session);
|
||||
new_session_dialog->reset_recent();
|
||||
new_session_dialog->set_offer_cancel (offer_cancel);
|
||||
|
||||
do {
|
||||
new_session_dialog->set_have_engine (backend_audio_is_running);
|
||||
new_session_dialog->present ();
|
||||
end_loading_messages ();
|
||||
response = new_session_dialog->run ();
|
||||
//XXX This is needed because session constructor wants a
|
||||
//non-existant path. hopefully this will be fixed at some point.
|
||||
|
||||
_session_is_new = false;
|
||||
session_path = Glib::build_filename (session_path, session_name);
|
||||
|
||||
/* handle possible negative responses */
|
||||
|
||||
switch (response) {
|
||||
case 1:
|
||||
/* sent by idle_load, meaning restart the whole process again */
|
||||
new_session_dialog->hide();
|
||||
new_session_dialog->reset();
|
||||
goto begin;
|
||||
break;
|
||||
|
||||
case Gtk::RESPONSE_CANCEL:
|
||||
case Gtk::RESPONSE_DELETE_EVENT:
|
||||
if (!session) {
|
||||
if (engine && engine->running()) {
|
||||
engine->stop (true);
|
||||
}
|
||||
quit();
|
||||
}
|
||||
new_session_dialog->hide ();
|
||||
return false;
|
||||
if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
|
||||
|
||||
case Gtk::RESPONSE_NONE:
|
||||
/* "Clear" was pressed */
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
fontconfig_dialog();
|
||||
|
||||
if (!backend_audio_is_running) {
|
||||
int ret = new_session_dialog->engine_control.setup_engine ();
|
||||
if (ret < 0) {
|
||||
return false;
|
||||
} else if (ret > 0) {
|
||||
response = Gtk::RESPONSE_REJECT;
|
||||
goto try_again;
|
||||
}
|
||||
}
|
||||
|
||||
if (create_engine ()) {
|
||||
|
||||
backend_audio_error (!backend_audio_is_running, new_session_dialog);
|
||||
flush_pending ();
|
||||
|
||||
new_session_dialog->set_existing_session (false);
|
||||
new_session_dialog->set_current_page (2);
|
||||
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
backend_audio_is_running = true;
|
||||
|
||||
if (response == Gtk::RESPONSE_OK) {
|
||||
|
||||
session_name = new_session_dialog->session_name();
|
||||
|
||||
if (session_name.empty()) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
if (ask_about_loading_existing_session (session_path)) {
|
||||
goto loadit;
|
||||
} else {
|
||||
response = RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
/* if the user mistakenly typed path information into the session filename entry,
|
||||
convert what they typed into a path & a name
|
||||
*/
|
||||
|
||||
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] == '/')) {
|
||||
|
||||
session_path = Glib::path_get_dirname (session_name);
|
||||
session_name = Glib::path_get_basename (session_name);
|
||||
|
||||
} else {
|
||||
|
||||
session_path = new_session_dialog->session_folder();
|
||||
}
|
||||
|
||||
template_name = Glib::ustring();
|
||||
switch (new_session_dialog->which_page()) {
|
||||
|
||||
case NewSessionDialog::OpenPage:
|
||||
case NewSessionDialog::EnginePage:
|
||||
goto loadit;
|
||||
break;
|
||||
|
||||
case NewSessionDialog::NewPage: /* nominally the "new" session creator, but could be in use for an old session */
|
||||
|
||||
should_be_new = true;
|
||||
|
||||
//XXX This is needed because session constructor wants a
|
||||
//non-existant path. hopefully this will be fixed at some point.
|
||||
|
||||
session_path = Glib::build_filename (session_path, session_name);
|
||||
|
||||
if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
|
||||
|
||||
if (ask_about_loading_existing_session (session_path)) {
|
||||
goto loadit;
|
||||
} else {
|
||||
response = RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
}
|
||||
|
||||
_session_is_new = true;
|
||||
|
||||
if (new_session_dialog->use_session_template()) {
|
||||
|
||||
template_name = new_session_dialog->session_template_name();
|
||||
goto loadit;
|
||||
|
||||
} else {
|
||||
if (build_session_from_nsd (session_path, session_name)) {
|
||||
response = RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
loadit:
|
||||
new_session_dialog->hide ();
|
||||
|
||||
if (load_session (session_path, session_name, template_name)) {
|
||||
/* force a retry */
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
}
|
||||
|
||||
try_again:
|
||||
if (response == Gtk::RESPONSE_NONE) {
|
||||
new_session_dialog->set_existing_session (false);
|
||||
new_session_dialog->reset ();
|
||||
}
|
||||
}
|
||||
|
||||
_session_is_new = true;
|
||||
|
||||
} while (response == Gtk::RESPONSE_NONE || response == Gtk::RESPONSE_REJECT);
|
||||
|
||||
if (_startup->use_session_template()) {
|
||||
|
||||
template_name = _startup->session_template_name();
|
||||
goto loadit;
|
||||
|
||||
} else {
|
||||
if (build_session_from_nsd (session_path, session_name)) {
|
||||
response = RESPONSE_NONE;
|
||||
goto try_again;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
loadit:
|
||||
if (load_session (session_path, session_name, template_name)) {
|
||||
/* force a retry */
|
||||
}
|
||||
|
||||
try_again:
|
||||
|
||||
done:
|
||||
show();
|
||||
new_session_dialog->hide();
|
||||
new_session_dialog->reset();
|
||||
goto_editor_window ();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,6 @@ class RouteParams_UI;
|
|||
class About;
|
||||
class Splash;
|
||||
class AddRouteDialog;
|
||||
class NewSessionDialog;
|
||||
class LocationUI;
|
||||
class ThemeManager;
|
||||
class BundleManager;
|
||||
|
@ -122,7 +121,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
void show_about ();
|
||||
void hide_about ();
|
||||
|
||||
void idle_load (const Glib::ustring& path);
|
||||
void finish();
|
||||
|
||||
int load_session (const Glib::ustring& path, const Glib::ustring& snapshot, Glib::ustring mix_template = Glib::ustring());
|
||||
|
@ -532,8 +530,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
|
||||
bool _will_create_new_session_automatically;
|
||||
|
||||
NewSessionDialog* new_session_dialog;
|
||||
|
||||
void open_session ();
|
||||
void open_recent_session ();
|
||||
void save_template ();
|
||||
|
|
|
@ -218,6 +218,8 @@ EngineControl::EngineControl ()
|
|||
realtime_button.signal_toggled().connect (mem_fun (*this, &EngineControl::realtime_changed));
|
||||
realtime_changed ();
|
||||
|
||||
#if PROVIDE_TOO_MANY_OPTIONS
|
||||
|
||||
#ifndef __APPLE__
|
||||
label = manage (new Label (_("Realtime Priority")));
|
||||
label->set_alignment (1.0, 0.5);
|
||||
|
@ -262,6 +264,7 @@ EngineControl::EngineControl ()
|
|||
options_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
|
||||
++row;
|
||||
|
||||
#endif /* PROVIDE_TOO_MANY_OPTIONS */
|
||||
label = manage (new Label (_("Number of ports")));
|
||||
label->set_alignment (1.0, 0.5);
|
||||
options_packer.attach (ports_spinner, 1, 2, row, row + 1, FILL|EXPAND, AttachOptions(0));
|
||||
|
@ -377,8 +380,10 @@ EngineControl::build_command_line (vector<string>& cmd)
|
|||
uint32_t msecs;
|
||||
secs = atof (str);
|
||||
msecs = (uint32_t) floor (secs * 1000.0);
|
||||
cmd.push_back ("-t");
|
||||
cmd.push_back (to_string (msecs, std::dec));
|
||||
if (msecs > 0) {
|
||||
cmd.push_back ("-t");
|
||||
cmd.push_back (to_string (msecs, std::dec));
|
||||
}
|
||||
}
|
||||
|
||||
if (no_memory_lock_button.get_active()) {
|
||||
|
|
|
@ -382,9 +382,7 @@ int main (int argc, char *argv[])
|
|||
exit (1);
|
||||
}
|
||||
|
||||
#ifdef SOMEBODY_WANTS_TO_FIX_THIS
|
||||
ui->run_startup ();
|
||||
#endif
|
||||
|
||||
ui->run (text_receiver);
|
||||
ui = 0;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,226 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2005 Paul Davis
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
// -*- c++ -*-
|
||||
|
||||
#ifndef NEW_SESSION_DIALOG_H
|
||||
#define NEW_SESSION_DIALOG_H
|
||||
|
||||
#include <string>
|
||||
#include <gtkmm/treeview.h>
|
||||
#include <gtkmm/treestore.h>
|
||||
#include <gtkmm/treepath.h>
|
||||
#include <gtkmm/scrolledwindow.h>
|
||||
#include <gtkmm/notebook.h>
|
||||
#include <gtkmm/table.h>
|
||||
#include <gtkmm/alignment.h>
|
||||
#include <gtkmm/frame.h>
|
||||
#include <gtkmm/expander.h>
|
||||
|
||||
#include "ardour/utils.h"
|
||||
|
||||
#include <glibmm/refptr.h>
|
||||
|
||||
#include "ardour_dialog.h"
|
||||
#include "engine_dialog.h"
|
||||
|
||||
namespace Gtk {
|
||||
class Entry;
|
||||
class FileChooserButton;
|
||||
class SpinButton;
|
||||
class CheckButton;
|
||||
class RadioButton;
|
||||
class TreeView;
|
||||
class Notebook;
|
||||
}
|
||||
|
||||
class NewSessionDialog : public ArdourDialog
|
||||
{
|
||||
public:
|
||||
|
||||
enum Pages {
|
||||
NewPage = 0x1,
|
||||
OpenPage = 0x2,
|
||||
EnginePage = 0x4
|
||||
};
|
||||
|
||||
NewSessionDialog();
|
||||
~NewSessionDialog ();
|
||||
|
||||
int run ();
|
||||
|
||||
void set_session_name(const Glib::ustring& name);
|
||||
void set_session_folder(const Glib::ustring& folder);
|
||||
|
||||
std::string session_name() const;
|
||||
std::string session_folder() const;
|
||||
|
||||
bool use_session_template() const;
|
||||
std::string session_template_name() const;
|
||||
|
||||
// advanced.
|
||||
|
||||
bool create_master_bus() const;
|
||||
int master_channel_count() const;
|
||||
|
||||
bool create_control_bus() const;
|
||||
int control_channel_count() const;
|
||||
|
||||
bool connect_inputs() const;
|
||||
bool limit_inputs_used_for_connection() const;
|
||||
int input_limit_count() const;
|
||||
|
||||
bool connect_outputs() const;
|
||||
bool limit_outputs_used_for_connection() const;
|
||||
int output_limit_count() const;
|
||||
|
||||
bool connect_outs_to_master() const;
|
||||
bool connect_outs_to_physical() const ;
|
||||
Pages which_page () const;
|
||||
|
||||
int get_current_page();
|
||||
void set_current_page (int);
|
||||
void reset_recent();
|
||||
|
||||
// reset everything to default values.
|
||||
void reset();
|
||||
|
||||
EngineControl engine_control;
|
||||
void set_have_engine (bool yn);
|
||||
void set_existing_session (bool yn);
|
||||
void set_offer_cancel (bool yn);
|
||||
|
||||
protected:
|
||||
|
||||
void reset_name();
|
||||
void reset_template();
|
||||
|
||||
Gtk::Label * session_name_label;
|
||||
Gtk::Label * session_location_label;
|
||||
Gtk::Label * session_template_label;
|
||||
Gtk::Label * chan_count_label_1;
|
||||
Gtk::Label * chan_count_label_2;
|
||||
Gtk::Label * chan_count_label_3;
|
||||
Gtk::Label * chan_count_label_4;
|
||||
Gtk::Table * advanced_table;
|
||||
Gtk::HBox * input_port_limit_hbox;
|
||||
Gtk::VBox * input_port_vbox;
|
||||
Gtk::Table * input_table;
|
||||
Gtk::HBox * input_hbox;
|
||||
|
||||
Gtk::Label * bus_label;
|
||||
Gtk::Frame * bus_frame;
|
||||
Gtk::Table * bus_table;
|
||||
Gtk::HBox * bus_hbox;
|
||||
|
||||
Gtk::Label * input_label;
|
||||
Gtk::Frame * input_frame;
|
||||
Gtk::HBox * output_port_limit_hbox;
|
||||
Gtk::VBox * output_port_vbox;
|
||||
Gtk::VBox * output_conn_vbox;
|
||||
Gtk::VBox * output_vbox;
|
||||
Gtk::HBox * output_hbox;
|
||||
|
||||
Gtk::Label * output_label;
|
||||
Gtk::Frame * output_frame;
|
||||
Gtk::VBox * advanced_vbox;
|
||||
Gtk::Label * advanced_label;
|
||||
Gtk::Expander * advanced_expander;
|
||||
Gtk::Table * new_session_table;
|
||||
Gtk::HBox * open_session_hbox;
|
||||
Gtk::ScrolledWindow * recent_scrolledwindow;
|
||||
|
||||
Gtk::Label * recent_sesion_label;
|
||||
Gtk::Frame * recent_frame;
|
||||
Gtk::VBox * open_session_vbox;
|
||||
Gtk::Entry* m_name;
|
||||
Gtk::FileChooserButton* m_folder;
|
||||
Gtk::FileChooserButton* m_template;
|
||||
Gtk::Label * open_session_file_label;
|
||||
|
||||
Gtk::CheckButton* m_create_master_bus;
|
||||
Gtk::SpinButton* m_master_bus_channel_count;
|
||||
|
||||
Gtk::CheckButton* m_create_control_bus;
|
||||
Gtk::SpinButton* m_control_bus_channel_count;
|
||||
|
||||
Gtk::CheckButton* m_connect_inputs;
|
||||
Gtk::CheckButton* m_limit_input_ports;
|
||||
Gtk::SpinButton* m_input_limit_count;
|
||||
|
||||
Gtk::CheckButton* m_connect_outputs;
|
||||
Gtk::CheckButton* m_limit_output_ports;
|
||||
Gtk::SpinButton* m_output_limit_count;
|
||||
|
||||
Gtk::RadioButton* m_connect_outputs_to_master;
|
||||
Gtk::RadioButton* m_connect_outputs_to_physical;
|
||||
Gtk::Button* m_okbutton;
|
||||
|
||||
Gtk::FileChooserButton* m_open_filechooser;
|
||||
Gtk::TreeView* m_treeview;
|
||||
Gtk::Notebook* m_notebook;
|
||||
|
||||
private:
|
||||
|
||||
Pages page_set;
|
||||
|
||||
struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
RecentSessionModelColumns() {
|
||||
add (visible_name);
|
||||
add (fullpath);
|
||||
}
|
||||
Gtk::TreeModelColumn<std::string> visible_name;
|
||||
Gtk::TreeModelColumn<std::string> fullpath;
|
||||
};
|
||||
|
||||
RecentSessionModelColumns recent_columns;
|
||||
Glib::RefPtr<Gtk::TreeStore> recent_model;
|
||||
|
||||
bool in_destructor;
|
||||
|
||||
void recent_session_selection_changed ();
|
||||
void nsd_redisplay_recent_sessions();
|
||||
void nsd_recent_session_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
|
||||
struct RecentSessionsSorter {
|
||||
bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
|
||||
return cmp_nocase(a.first, b.first) == -1;
|
||||
}
|
||||
};
|
||||
void on_new_session_name_entry_changed();
|
||||
void notebook_page_changed (GtkNotebookPage*, uint);
|
||||
void treeview_selection_changed ();
|
||||
void file_chosen ();
|
||||
void template_chosen ();
|
||||
void recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*);
|
||||
void connect_inputs_clicked ();
|
||||
void connect_outputs_clicked ();
|
||||
void limit_inputs_clicked ();
|
||||
void limit_outputs_clicked ();
|
||||
void master_bus_button_clicked ();
|
||||
void monitor_bus_button_clicked ();
|
||||
|
||||
bool on_new_session_page;
|
||||
bool have_engine;
|
||||
Glib::ustring engine_page_session_folder;
|
||||
Glib::ustring engine_page_session_name;
|
||||
|
||||
Gtk::Button* quit_or_cancel_button;
|
||||
};
|
||||
|
||||
#endif // NEW_SESSION_DIALOG_H
|
|
@ -1,3 +1,4 @@
|
|||
#include <fstream>
|
||||
#include <algorithm>
|
||||
|
||||
#include <gtkmm/main.h>
|
||||
|
@ -14,6 +15,7 @@
|
|||
#include "ardour/template_utils.h"
|
||||
|
||||
#include "startup.h"
|
||||
#include "engine_dialog.h"
|
||||
#include "i18n.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -34,7 +36,25 @@ ArdourStartup::ArdourStartup ()
|
|||
Ardour will play NO role in monitoring"))
|
||||
, monitor_via_ardour_button (_("Ask Ardour to playback material as it is being recorded"))
|
||||
, new_folder_chooser (FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
||||
, _output_limit_count_adj (1, 0, 100, 1, 10, 0)
|
||||
, _input_limit_count_adj (1, 0, 100, 1, 10, 0)
|
||||
, _control_bus_channel_count_adj (2, 0, 100, 1, 10, 0)
|
||||
, _master_bus_channel_count_adj (2, 0, 100, 1, 10, 0)
|
||||
|
||||
{
|
||||
audio_page_index = -1;
|
||||
initial_choice_index = -1;
|
||||
new_user_page_index = -1;
|
||||
default_folder_page_index = -1;
|
||||
monitoring_page_index = -1;
|
||||
session_page_index = -1;
|
||||
final_page_index = -1;
|
||||
session_options_page_index = -1;
|
||||
|
||||
engine_dialog = 0;
|
||||
config_modified = false;
|
||||
default_dir_chooser = 0;
|
||||
|
||||
set_keep_above (true);
|
||||
set_position (WIN_POS_CENTER);
|
||||
|
||||
|
@ -54,19 +74,35 @@ Ardour will play NO role in monitoring"))
|
|||
|
||||
sys::path been_here_before = user_config_directory();
|
||||
been_here_before /= ".a3"; // XXXX use more specific version so we can catch upgrades
|
||||
|
||||
if (!exists (been_here_before)) {
|
||||
// XXX touch been_here_before;
|
||||
bool new_user = !exists (been_here_before);
|
||||
bool need_audio_setup = !EngineControl::engine_running();
|
||||
|
||||
if (new_user) {
|
||||
/* "touch" the file */
|
||||
ofstream fout (been_here_before.to_string().c_str());
|
||||
setup_new_user_page ();
|
||||
setup_first_time_config_page ();
|
||||
setup_monitoring_choice_page ();
|
||||
|
||||
if (need_audio_setup) {
|
||||
setup_audio_page ();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (need_audio_setup) {
|
||||
setup_audio_page ();
|
||||
}
|
||||
|
||||
setup_initial_choice_page ();
|
||||
}
|
||||
|
||||
setup_session_page ();
|
||||
setup_more_options_page ();
|
||||
setup_final_page ();
|
||||
|
||||
if (new_user) {
|
||||
setup_final_page ();
|
||||
}
|
||||
|
||||
the_startup = this;
|
||||
}
|
||||
|
@ -75,18 +111,70 @@ ArdourStartup::~ArdourStartup ()
|
|||
{
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
ArdourStartup::session_name (bool& should_be_new)
|
||||
{
|
||||
if (ic_new_session_button.get_active()) {
|
||||
should_be_new = true;
|
||||
return new_name_entry.get_text ();
|
||||
} else {
|
||||
should_be_new = false;
|
||||
|
||||
TreeIter iter = recent_session_display.get_selection()->get_selected();
|
||||
|
||||
if (iter) {
|
||||
return (*iter)[recent_session_columns.visible_name];
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
ArdourStartup::session_folder ()
|
||||
{
|
||||
if (ic_new_session_button.get_active()) {
|
||||
return new_folder_chooser.get_current_folder();
|
||||
} else {
|
||||
TreeIter iter = recent_session_display.get_selection()->get_selected();
|
||||
|
||||
if (iter) {
|
||||
return (*iter)[recent_session_columns.fullpath];
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::setup_audio_page ()
|
||||
{
|
||||
engine_dialog = manage (new EngineControl);
|
||||
|
||||
engine_dialog->show_all ();
|
||||
|
||||
audio_page_index = append_page (*engine_dialog);
|
||||
set_page_type (*engine_dialog, ASSISTANT_PAGE_CONTENT);
|
||||
set_page_title (*engine_dialog, _("Audio Setup"));
|
||||
|
||||
/* the default parameters should work, so the page is potentially complete */
|
||||
|
||||
set_page_complete (*engine_dialog, true);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::setup_new_user_page ()
|
||||
{
|
||||
Label* foomatic = manage (new Label (_("\
|
||||
Ardour is a digital audio workstation. You can use it to\n\
|
||||
Label* foomatic = manage (new Label);
|
||||
|
||||
foomatic->set_markup (_("\
|
||||
<span size=\"larger\">Ardour is a digital audio workstation. You can use it to\n\
|
||||
record, edit and mix multi-track audio. You can produce your\n\
|
||||
own CDs, mix video soundtracks, or just experiment with new\n\
|
||||
ideas about music and sound.\n\
|
||||
\n\
|
||||
There are a few things that need to configured before you start\n\
|
||||
using the program.\
|
||||
")));
|
||||
using the program.</span>\
|
||||
"));
|
||||
|
||||
HBox* hbox = manage (new HBox);
|
||||
HBox* vbox = manage (new HBox);
|
||||
|
@ -101,17 +189,25 @@ using the program.\
|
|||
hbox->show ();
|
||||
vbox->show ();
|
||||
|
||||
append_page (*vbox);
|
||||
new_user_page_index = append_page (*vbox);
|
||||
set_page_type (*vbox, ASSISTANT_PAGE_INTRO);
|
||||
set_page_title (*vbox, _("Welcome to Ardour"));
|
||||
set_page_header_image (*vbox, icon_pixbuf);
|
||||
set_page_complete (*vbox, true);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::default_dir_changed ()
|
||||
{
|
||||
Config->set_default_session_parent_dir (default_dir_chooser->get_current_folder());
|
||||
config_modified = true;
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::setup_first_time_config_page ()
|
||||
{
|
||||
Gtk::FileChooserButton* fcb = manage (new FileChooserButton (_("Default session folder"), FILE_CHOOSER_ACTION_SELECT_FOLDER));
|
||||
default_dir_chooser = manage (new FileChooserButton (_("Default folder for Ardour sessions"),
|
||||
FILE_CHOOSER_ACTION_SELECT_FOLDER));
|
||||
Gtk::Label* txt = manage (new Label);
|
||||
HBox* hbox1 = manage (new HBox);
|
||||
VBox* vbox = manage (new VBox);
|
||||
|
@ -126,16 +222,26 @@ Where would you like new Ardour sessions to be stored by default?\n\
|
|||
hbox1->set_border_width (6);
|
||||
vbox->set_border_width (6);
|
||||
|
||||
hbox1->pack_start (*fcb, false, true);
|
||||
hbox1->pack_start (*default_dir_chooser, false, true);
|
||||
vbox->pack_start (*txt, false, true);
|
||||
vbox->pack_start (*hbox1, false, true);
|
||||
|
||||
fcb->show ();
|
||||
string def = Config->get_default_session_parent_dir();
|
||||
|
||||
/* XXX really need glob here */
|
||||
|
||||
if (def == "~") {
|
||||
def = Glib::get_home_dir();
|
||||
}
|
||||
default_dir_chooser->set_current_folder (def);
|
||||
default_dir_chooser->signal_current_folder_changed().connect (mem_fun (*this, &ArdourStartup::default_dir_changed));
|
||||
default_dir_chooser->show ();
|
||||
|
||||
txt->show ();
|
||||
hbox1->show ();
|
||||
vbox->show ();
|
||||
|
||||
append_page (*vbox);
|
||||
default_folder_page_index = append_page (*vbox);
|
||||
set_page_title (*vbox, _("Default folder for new sessions"));
|
||||
set_page_header_image (*vbox, icon_pixbuf);
|
||||
set_page_type (*vbox, ASSISTANT_PAGE_CONTENT);
|
||||
|
@ -162,16 +268,16 @@ configuration of that equipment. The two most common are presented here.\n\
|
|||
Please choose whichever one is right for your setup.\n\n\
|
||||
<i>You can change this preference at any time, via the Options menu</i>");
|
||||
|
||||
mon_vbox.pack_start (monitor_label);
|
||||
mon_vbox.pack_start (monitor_via_hardware_button);
|
||||
mon_vbox.pack_start (monitor_via_ardour_button);
|
||||
mon_vbox.pack_start (monitor_label, false, false);
|
||||
mon_vbox.pack_start (monitor_via_hardware_button, false, false);
|
||||
mon_vbox.pack_start (monitor_via_ardour_button, false, false);
|
||||
|
||||
mon_vbox.show ();
|
||||
monitor_label.show ();
|
||||
monitor_via_ardour_button.show ();
|
||||
monitor_via_hardware_button.show ();
|
||||
|
||||
append_page (mon_vbox);
|
||||
monitoring_page_index = append_page (mon_vbox);
|
||||
set_page_title (mon_vbox, _("Monitoring Choices"));
|
||||
set_page_header_image (mon_vbox, icon_pixbuf);
|
||||
|
||||
|
@ -191,14 +297,23 @@ ArdourStartup::setup_initial_choice_page ()
|
|||
RadioButton::Group g (ic_new_session_button.get_group());
|
||||
ic_existing_session_button.set_group (g);
|
||||
|
||||
ic_vbox.pack_start (ic_new_session_button);
|
||||
ic_vbox.pack_start (ic_existing_session_button);
|
||||
HBox* centering_hbox = manage (new HBox);
|
||||
VBox* centering_vbox = manage (new VBox);
|
||||
|
||||
centering_vbox->pack_start (ic_new_session_button, false, true);
|
||||
centering_vbox->pack_start (ic_existing_session_button, false, true);
|
||||
centering_vbox->show ();
|
||||
|
||||
centering_hbox->pack_start (*centering_vbox, true, true);
|
||||
centering_hbox->show ();
|
||||
|
||||
ic_vbox.pack_start (*centering_hbox, true, true);
|
||||
|
||||
ic_new_session_button.show ();
|
||||
ic_existing_session_button.show ();
|
||||
ic_vbox.show ();
|
||||
|
||||
append_page (ic_vbox);
|
||||
initial_choice_index = append_page (ic_vbox);
|
||||
set_page_title (ic_vbox, _("What would you like to do?"));
|
||||
set_page_header_image (ic_vbox, icon_pixbuf);
|
||||
|
||||
|
@ -219,7 +334,9 @@ ArdourStartup::setup_session_page ()
|
|||
session_vbox.show ();
|
||||
session_hbox.show ();
|
||||
|
||||
append_page (session_vbox);
|
||||
session_page_index = append_page (session_vbox);
|
||||
/* initial setting */
|
||||
set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -227,7 +344,7 @@ ArdourStartup::setup_final_page ()
|
|||
{
|
||||
final_page.set_text ("Ardour is ready for use");
|
||||
final_page.show ();
|
||||
append_page (final_page);
|
||||
final_page_index = append_page (final_page);
|
||||
set_page_complete (final_page, true);
|
||||
set_page_header_image (final_page, icon_pixbuf);
|
||||
set_page_type (final_page, ASSISTANT_PAGE_CONFIRM);
|
||||
|
@ -254,6 +371,25 @@ ArdourStartup::on_apply ()
|
|||
|
||||
// XXX do stuff and then ....
|
||||
|
||||
if (engine_dialog) {
|
||||
engine_dialog->setup_engine ();
|
||||
}
|
||||
|
||||
if (config_modified) {
|
||||
|
||||
if (default_dir_chooser) {
|
||||
Config->set_default_session_parent_dir (default_dir_chooser->get_current_folder());
|
||||
}
|
||||
|
||||
if (monitor_via_hardware_button.get_active()) {
|
||||
Config->set_monitoring_model (ExternalMonitoring);
|
||||
} else if (monitor_via_ardour_button.get_active()) {
|
||||
Config->set_monitoring_model (SoftwareMonitoring);
|
||||
}
|
||||
|
||||
Config->save_state ();
|
||||
}
|
||||
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
|
@ -261,6 +397,7 @@ void
|
|||
ArdourStartup::on_prepare (Gtk::Widget* page)
|
||||
{
|
||||
if (page == &session_vbox) {
|
||||
|
||||
if (ic_new_session_button.get_active()) {
|
||||
/* new session requested */
|
||||
setup_new_session_page ();
|
||||
|
@ -268,7 +405,7 @@ ArdourStartup::on_prepare (Gtk::Widget* page)
|
|||
/* existing session requested */
|
||||
setup_existing_session_page ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -294,6 +431,7 @@ ArdourStartup::setup_new_session_page ()
|
|||
new_name_entry.show ();
|
||||
|
||||
new_name_entry.signal_changed().connect (mem_fun (*this, &ArdourStartup::new_name_changed));
|
||||
new_name_entry.signal_activate().connect (mem_fun (*this, &ArdourStartup::move_along_now));
|
||||
|
||||
HBox* hbox2 = manage (new HBox);
|
||||
Label* label2 = manage (new Label);
|
||||
|
@ -303,7 +441,16 @@ ArdourStartup::setup_new_session_page ()
|
|||
hbox2->pack_start (new_folder_chooser, true, true);
|
||||
|
||||
label2->set_text (_("Create session folder in:"));
|
||||
new_folder_chooser.set_current_folder(getenv ("HOME"));
|
||||
|
||||
string def = Config->get_default_session_parent_dir();
|
||||
|
||||
/* XXX really need glob here */
|
||||
|
||||
if (def == "~") {
|
||||
def = Glib::get_home_dir();
|
||||
}
|
||||
|
||||
new_folder_chooser.set_current_folder (def);
|
||||
new_folder_chooser.set_title (_("Select folder for session"));
|
||||
|
||||
hbox2->show();
|
||||
|
@ -360,6 +507,9 @@ ArdourStartup::setup_new_session_page ()
|
|||
session_new_vbox.show ();
|
||||
session_hbox.pack_start (session_new_vbox, false, false);
|
||||
set_page_title (session_vbox, _("New Session"));
|
||||
set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
|
||||
|
||||
new_name_entry.grab_focus ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -396,11 +546,10 @@ ArdourStartup::redisplay_recent_sessions ()
|
|||
session_directories.push_back ((*i).second);
|
||||
}
|
||||
|
||||
for (vector<sys::path>::const_iterator i = session_directories.begin();
|
||||
i != session_directories.end(); ++i)
|
||||
for (vector<sys::path>::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i)
|
||||
{
|
||||
std::vector<sys::path> state_file_paths;
|
||||
|
||||
|
||||
// now get available states for this session
|
||||
|
||||
get_state_files_in_directory (*i, state_file_paths);
|
||||
|
@ -418,7 +567,6 @@ ArdourStartup::redisplay_recent_sessions ()
|
|||
/* check whether session still exists */
|
||||
if (!Glib::file_test(fullpath.c_str(), Glib::FILE_TEST_EXISTS)) {
|
||||
/* session doesn't exist */
|
||||
cerr << "skipping non-existent session " << fullpath << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -490,6 +638,7 @@ ArdourStartup::setup_existing_session_page ()
|
|||
|
||||
recent_scroller.show();
|
||||
redisplay_recent_sessions ();
|
||||
recent_session_display.signal_row_activated().connect (mem_fun (*this, &ArdourStartup::recent_row_activated));
|
||||
|
||||
session_hbox.pack_start (recent_scroller, true, true);
|
||||
set_page_title (session_vbox, _("Select a session"));
|
||||
|
@ -500,8 +649,11 @@ void
|
|||
ArdourStartup::more_new_session_options_button_clicked ()
|
||||
{
|
||||
if (more_new_session_options_button.get_active()) {
|
||||
more_options_vbox.show ();
|
||||
more_options_vbox.show_all ();
|
||||
set_page_type (more_options_vbox, ASSISTANT_PAGE_CONFIRM);
|
||||
set_page_type (session_vbox, ASSISTANT_PAGE_CONTENT);
|
||||
} else {
|
||||
set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
|
||||
more_options_vbox.hide ();
|
||||
}
|
||||
}
|
||||
|
@ -509,24 +661,354 @@ ArdourStartup::more_new_session_options_button_clicked ()
|
|||
void
|
||||
ArdourStartup::setup_more_options_page ()
|
||||
{
|
||||
Label* foomatic = manage (new Label);
|
||||
foomatic->set_text (_("Here be more options...."));
|
||||
foomatic->show ();
|
||||
|
||||
more_options_vbox.set_border_width (12);
|
||||
more_options_hbox.set_border_width (12);
|
||||
|
||||
more_options_hbox.pack_start (*foomatic, true, true);
|
||||
more_options_vbox.pack_start (more_options_hbox, true, true);
|
||||
|
||||
more_options_hbox.show ();
|
||||
_output_limit_count.set_adjustment (_output_limit_count_adj);
|
||||
_input_limit_count.set_adjustment (_input_limit_count_adj);
|
||||
_control_bus_channel_count.set_adjustment (_control_bus_channel_count_adj);
|
||||
_master_bus_channel_count.set_adjustment (_master_bus_channel_count_adj);
|
||||
|
||||
chan_count_label_1.set_text (_("channels"));
|
||||
chan_count_label_2.set_text (_("channels"));
|
||||
chan_count_label_3.set_text (_("channels"));
|
||||
chan_count_label_4.set_text (_("channels"));
|
||||
|
||||
chan_count_label_1.set_alignment(0,0.5);
|
||||
chan_count_label_1.set_padding(0,0);
|
||||
chan_count_label_1.set_line_wrap(false);
|
||||
|
||||
chan_count_label_2.set_alignment(0,0.5);
|
||||
chan_count_label_2.set_padding(0,0);
|
||||
chan_count_label_2.set_line_wrap(false);
|
||||
|
||||
chan_count_label_3.set_alignment(0,0.5);
|
||||
chan_count_label_3.set_padding(0,0);
|
||||
chan_count_label_3.set_line_wrap(false);
|
||||
|
||||
chan_count_label_4.set_alignment(0,0.5);
|
||||
chan_count_label_4.set_padding(0,0);
|
||||
chan_count_label_4.set_line_wrap(false);
|
||||
|
||||
bus_label.set_markup (_("<b>Busses</b>"));
|
||||
input_label.set_markup (_("<b>Inputs</b>"));
|
||||
output_label.set_markup (_("<b>Outputs</b>"));
|
||||
|
||||
_create_control_bus.set_label (_("Create monitor bus"));
|
||||
_create_control_bus.set_flags(Gtk::CAN_FOCUS);
|
||||
_create_control_bus.set_relief(Gtk::RELIEF_NORMAL);
|
||||
_create_control_bus.set_mode(true);
|
||||
_create_control_bus.set_active(false);
|
||||
_create_control_bus.set_border_width(0);
|
||||
|
||||
_control_bus_channel_count.set_flags(Gtk::CAN_FOCUS);
|
||||
_control_bus_channel_count.set_update_policy(Gtk::UPDATE_ALWAYS);
|
||||
_control_bus_channel_count.set_numeric(true);
|
||||
_control_bus_channel_count.set_digits(0);
|
||||
_control_bus_channel_count.set_wrap(false);
|
||||
_control_bus_channel_count.set_sensitive(false);
|
||||
|
||||
_master_bus_channel_count.set_flags(Gtk::CAN_FOCUS);
|
||||
_master_bus_channel_count.set_update_policy(Gtk::UPDATE_ALWAYS);
|
||||
_master_bus_channel_count.set_numeric(true);
|
||||
_master_bus_channel_count.set_digits(0);
|
||||
_master_bus_channel_count.set_wrap(false);
|
||||
|
||||
_create_master_bus.set_label (_("Create master bus"));
|
||||
_create_master_bus.set_flags(Gtk::CAN_FOCUS);
|
||||
_create_master_bus.set_relief(Gtk::RELIEF_NORMAL);
|
||||
_create_master_bus.set_mode(true);
|
||||
_create_master_bus.set_active(true);
|
||||
_create_master_bus.set_border_width(0);
|
||||
|
||||
advanced_table.set_row_spacings(0);
|
||||
advanced_table.set_col_spacings(0);
|
||||
|
||||
_connect_inputs.set_label (_("Automatically connect to physical_inputs"));
|
||||
_connect_inputs.set_flags(Gtk::CAN_FOCUS);
|
||||
_connect_inputs.set_relief(Gtk::RELIEF_NORMAL);
|
||||
_connect_inputs.set_mode(true);
|
||||
_connect_inputs.set_active(true);
|
||||
_connect_inputs.set_border_width(0);
|
||||
|
||||
_limit_input_ports.set_label (_("Use only"));
|
||||
_limit_input_ports.set_flags(Gtk::CAN_FOCUS);
|
||||
_limit_input_ports.set_relief(Gtk::RELIEF_NORMAL);
|
||||
_limit_input_ports.set_mode(true);
|
||||
_limit_input_ports.set_sensitive(true);
|
||||
_limit_input_ports.set_border_width(0);
|
||||
|
||||
_input_limit_count.set_flags(Gtk::CAN_FOCUS);
|
||||
_input_limit_count.set_update_policy(Gtk::UPDATE_ALWAYS);
|
||||
_input_limit_count.set_numeric(true);
|
||||
_input_limit_count.set_digits(0);
|
||||
_input_limit_count.set_wrap(false);
|
||||
_input_limit_count.set_sensitive(false);
|
||||
|
||||
bus_hbox.pack_start (bus_table, Gtk::PACK_SHRINK, 18);
|
||||
|
||||
bus_label.set_alignment(0, 0.5);
|
||||
bus_label.set_padding(0,0);
|
||||
bus_label.set_line_wrap(false);
|
||||
bus_label.set_selectable(false);
|
||||
bus_label.set_use_markup(true);
|
||||
bus_frame.set_shadow_type(Gtk::SHADOW_NONE);
|
||||
bus_frame.set_label_align(0,0.5);
|
||||
bus_frame.add(bus_hbox);
|
||||
bus_frame.set_label_widget(bus_label);
|
||||
|
||||
bus_table.set_row_spacings (0);
|
||||
bus_table.set_col_spacings (0);
|
||||
bus_table.attach (_create_master_bus, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
bus_table.attach (_master_bus_channel_count, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
bus_table.attach (chan_count_label_1, 2, 3, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 0);
|
||||
bus_table.attach (_create_control_bus, 0, 1, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
bus_table.attach (_control_bus_channel_count, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
|
||||
bus_table.attach (chan_count_label_2, 2, 3, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 0);
|
||||
|
||||
input_port_limit_hbox.pack_start(_limit_input_ports, Gtk::PACK_SHRINK, 6);
|
||||
input_port_limit_hbox.pack_start(_input_limit_count, Gtk::PACK_SHRINK, 0);
|
||||
input_port_limit_hbox.pack_start(chan_count_label_3, Gtk::PACK_SHRINK, 6);
|
||||
input_port_vbox.pack_start(_connect_inputs, Gtk::PACK_SHRINK, 0);
|
||||
input_port_vbox.pack_start(input_port_limit_hbox, Gtk::PACK_EXPAND_PADDING, 0);
|
||||
input_table.set_row_spacings(0);
|
||||
input_table.set_col_spacings(0);
|
||||
input_table.attach(input_port_vbox, 0, 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 6, 6);
|
||||
|
||||
input_hbox.pack_start (input_table, Gtk::PACK_SHRINK, 18);
|
||||
|
||||
input_label.set_alignment(0, 0.5);
|
||||
input_label.set_padding(0,0);
|
||||
input_label.set_line_wrap(false);
|
||||
input_label.set_selectable(false);
|
||||
input_label.set_use_markup(true);
|
||||
input_frame.set_shadow_type(Gtk::SHADOW_NONE);
|
||||
input_frame.set_label_align(0,0.5);
|
||||
input_frame.add(input_hbox);
|
||||
input_frame.set_label_widget(input_label);
|
||||
|
||||
_connect_outputs.set_label (_("Automatically connect outputs"));
|
||||
_connect_outputs.set_flags(Gtk::CAN_FOCUS);
|
||||
_connect_outputs.set_relief(Gtk::RELIEF_NORMAL);
|
||||
_connect_outputs.set_mode(true);
|
||||
_connect_outputs.set_active(true);
|
||||
_connect_outputs.set_border_width(0);
|
||||
_limit_output_ports.set_label (_("Use only"));
|
||||
_limit_output_ports.set_flags(Gtk::CAN_FOCUS);
|
||||
_limit_output_ports.set_relief(Gtk::RELIEF_NORMAL);
|
||||
_limit_output_ports.set_mode(true);
|
||||
_limit_output_ports.set_sensitive(true);
|
||||
_limit_output_ports.set_border_width(0);
|
||||
_output_limit_count.set_flags(Gtk::CAN_FOCUS);
|
||||
_output_limit_count.set_update_policy(Gtk::UPDATE_ALWAYS);
|
||||
_output_limit_count.set_numeric(false);
|
||||
_output_limit_count.set_digits(0);
|
||||
_output_limit_count.set_wrap(false);
|
||||
_output_limit_count.set_sensitive(false);
|
||||
output_port_limit_hbox.pack_start(_limit_output_ports, Gtk::PACK_SHRINK, 6);
|
||||
output_port_limit_hbox.pack_start(_output_limit_count, Gtk::PACK_SHRINK, 0);
|
||||
output_port_limit_hbox.pack_start(chan_count_label_4, Gtk::PACK_SHRINK, 6);
|
||||
|
||||
_connect_outputs_to_master.set_label (_("... to master bus"));
|
||||
_connect_outputs_to_master.set_flags(Gtk::CAN_FOCUS);
|
||||
_connect_outputs_to_master.set_relief(Gtk::RELIEF_NORMAL);
|
||||
_connect_outputs_to_master.set_mode(true);
|
||||
_connect_outputs_to_master.set_active(false);
|
||||
_connect_outputs_to_master.set_border_width(0);
|
||||
|
||||
_connect_outputs_to_master.set_group (connect_outputs_group);
|
||||
_connect_outputs_to_physical.set_group (connect_outputs_group);
|
||||
|
||||
_connect_outputs_to_physical.set_label (_("... to physical outputs"));
|
||||
_connect_outputs_to_physical.set_flags(Gtk::CAN_FOCUS);
|
||||
_connect_outputs_to_physical.set_relief(Gtk::RELIEF_NORMAL);
|
||||
_connect_outputs_to_physical.set_mode(true);
|
||||
_connect_outputs_to_physical.set_active(false);
|
||||
_connect_outputs_to_physical.set_border_width(0);
|
||||
|
||||
output_conn_vbox.pack_start(_connect_outputs, Gtk::PACK_SHRINK, 0);
|
||||
output_conn_vbox.pack_start(_connect_outputs_to_master, Gtk::PACK_SHRINK, 0);
|
||||
output_conn_vbox.pack_start(_connect_outputs_to_physical, Gtk::PACK_SHRINK, 0);
|
||||
output_vbox.set_border_width(6);
|
||||
|
||||
output_port_vbox.pack_start(output_port_limit_hbox, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
output_vbox.pack_start(output_conn_vbox);
|
||||
output_vbox.pack_start(output_port_vbox);
|
||||
|
||||
output_label.set_alignment(0, 0.5);
|
||||
output_label.set_padding(0,0);
|
||||
output_label.set_line_wrap(false);
|
||||
output_label.set_selectable(false);
|
||||
output_label.set_use_markup(true);
|
||||
output_frame.set_shadow_type(Gtk::SHADOW_NONE);
|
||||
output_frame.set_label_align(0,0.5);
|
||||
|
||||
output_hbox.pack_start (output_vbox, Gtk::PACK_SHRINK, 18);
|
||||
|
||||
output_frame.add(output_hbox);
|
||||
output_frame.set_label_widget(output_label);
|
||||
|
||||
more_options_vbox.pack_start(advanced_table, Gtk::PACK_SHRINK, 0);
|
||||
more_options_vbox.pack_start(bus_frame, Gtk::PACK_SHRINK, 6);
|
||||
more_options_vbox.pack_start(input_frame, Gtk::PACK_SHRINK, 6);
|
||||
more_options_vbox.pack_start(output_frame, Gtk::PACK_SHRINK, 0);
|
||||
|
||||
/* signals */
|
||||
|
||||
_connect_inputs.signal_clicked().connect (mem_fun (*this, &ArdourStartup::connect_inputs_clicked));
|
||||
_connect_outputs.signal_clicked().connect (mem_fun (*this, &ArdourStartup::connect_outputs_clicked));
|
||||
_limit_input_ports.signal_clicked().connect (mem_fun (*this, &ArdourStartup::limit_inputs_clicked));
|
||||
_limit_output_ports.signal_clicked().connect (mem_fun (*this, &ArdourStartup::limit_outputs_clicked));
|
||||
_create_master_bus.signal_clicked().connect (mem_fun (*this, &ArdourStartup::master_bus_button_clicked));
|
||||
_create_control_bus.signal_clicked().connect (mem_fun (*this, &ArdourStartup::monitor_bus_button_clicked));
|
||||
|
||||
/* note that more_options_vbox is NOT visible by
|
||||
* default. this is entirely by design - this page
|
||||
* should be skipped unless explicitly requested.
|
||||
*/
|
||||
|
||||
append_page (more_options_vbox);
|
||||
session_options_page_index = append_page (more_options_vbox);
|
||||
set_page_title (more_options_vbox, _("Advanced Session Options"));
|
||||
set_page_complete (more_options_vbox, true);
|
||||
}
|
||||
|
||||
bool
|
||||
ArdourStartup::create_master_bus() const
|
||||
{
|
||||
return _create_master_bus.get_active();
|
||||
}
|
||||
|
||||
int
|
||||
ArdourStartup::master_channel_count() const
|
||||
{
|
||||
return _master_bus_channel_count.get_value_as_int();
|
||||
}
|
||||
|
||||
bool
|
||||
ArdourStartup::create_control_bus() const
|
||||
{
|
||||
return _create_control_bus.get_active();
|
||||
}
|
||||
|
||||
int
|
||||
ArdourStartup::control_channel_count() const
|
||||
{
|
||||
return _control_bus_channel_count.get_value_as_int();
|
||||
}
|
||||
|
||||
bool
|
||||
ArdourStartup::connect_inputs() const
|
||||
{
|
||||
return _connect_inputs.get_active();
|
||||
}
|
||||
|
||||
bool
|
||||
ArdourStartup::limit_inputs_used_for_connection() const
|
||||
{
|
||||
return _limit_input_ports.get_active();
|
||||
}
|
||||
|
||||
int
|
||||
ArdourStartup::input_limit_count() const
|
||||
{
|
||||
return _input_limit_count.get_value_as_int();
|
||||
}
|
||||
|
||||
bool
|
||||
ArdourStartup::connect_outputs() const
|
||||
{
|
||||
return _connect_outputs.get_active();
|
||||
}
|
||||
|
||||
bool
|
||||
ArdourStartup::limit_outputs_used_for_connection() const
|
||||
{
|
||||
return _limit_output_ports.get_active();
|
||||
}
|
||||
|
||||
int
|
||||
ArdourStartup::output_limit_count() const
|
||||
{
|
||||
return _output_limit_count.get_value_as_int();
|
||||
}
|
||||
|
||||
bool
|
||||
ArdourStartup::connect_outs_to_master() const
|
||||
{
|
||||
return _connect_outputs_to_master.get_active();
|
||||
}
|
||||
|
||||
bool
|
||||
ArdourStartup::connect_outs_to_physical() const
|
||||
{
|
||||
return _connect_outputs_to_physical.get_active();
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::connect_inputs_clicked ()
|
||||
{
|
||||
_limit_input_ports.set_sensitive(_connect_inputs.get_active());
|
||||
|
||||
if (_connect_inputs.get_active() && _limit_input_ports.get_active()) {
|
||||
_input_limit_count.set_sensitive(true);
|
||||
} else {
|
||||
_input_limit_count.set_sensitive(false);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::connect_outputs_clicked ()
|
||||
{
|
||||
_limit_output_ports.set_sensitive(_connect_outputs.get_active());
|
||||
|
||||
if (_connect_outputs.get_active() && _limit_output_ports.get_active()) {
|
||||
_output_limit_count.set_sensitive(true);
|
||||
} else {
|
||||
_output_limit_count.set_sensitive(false);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::limit_inputs_clicked ()
|
||||
{
|
||||
_input_limit_count.set_sensitive(_limit_input_ports.get_active());
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::limit_outputs_clicked ()
|
||||
{
|
||||
_output_limit_count.set_sensitive(_limit_output_ports.get_active());
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::master_bus_button_clicked ()
|
||||
{
|
||||
_master_bus_channel_count.set_sensitive(_create_master_bus.get_active());
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::monitor_bus_button_clicked ()
|
||||
{
|
||||
_control_bus_channel_count.set_sensitive(_create_control_bus.get_active());
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::move_along_now ()
|
||||
{
|
||||
gint cur = get_current_page ();
|
||||
|
||||
if (cur == session_page_index) {
|
||||
if (more_new_session_options_button.get_active()) {
|
||||
set_current_page (session_options_page_index);
|
||||
} else {
|
||||
on_apply ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col)
|
||||
{
|
||||
set_page_complete (session_vbox, true);
|
||||
move_along_now ();
|
||||
}
|
||||
|
|
|
@ -14,14 +14,47 @@
|
|||
#include <gtkmm/treeview.h>
|
||||
#include <gtkmm/treestore.h>
|
||||
#include <gtkmm/checkbutton.h>
|
||||
#include <gtkmm/table.h>
|
||||
#include <gtkmm/frame.h>
|
||||
#include <gtkmm/spinbutton.h>
|
||||
|
||||
class EngineControl;
|
||||
|
||||
class ArdourStartup : public Gtk::Assistant {
|
||||
public:
|
||||
ArdourStartup ();
|
||||
~ArdourStartup ();
|
||||
|
||||
Glib::ustring session_name (bool& should_be_new);
|
||||
Glib::ustring session_folder ();
|
||||
|
||||
bool use_session_template() { return false; }
|
||||
Glib::ustring session_template_name() { return ""; }
|
||||
|
||||
EngineControl& engine_control() { return *engine_dialog; }
|
||||
|
||||
// advanced session options
|
||||
|
||||
bool create_master_bus() const;
|
||||
int master_channel_count() const;
|
||||
|
||||
bool create_control_bus() const;
|
||||
int control_channel_count() const;
|
||||
|
||||
bool connect_inputs() const;
|
||||
bool limit_inputs_used_for_connection() const;
|
||||
int input_limit_count() const;
|
||||
|
||||
bool connect_outputs() const;
|
||||
bool limit_outputs_used_for_connection() const;
|
||||
int output_limit_count() const;
|
||||
|
||||
bool connect_outs_to_master() const;
|
||||
bool connect_outs_to_physical() const ;
|
||||
|
||||
private:
|
||||
bool applying;
|
||||
bool config_modified;
|
||||
|
||||
void on_apply ();
|
||||
void on_cancel ();
|
||||
|
@ -40,6 +73,8 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
void setup_first_time_config_page ();
|
||||
|
||||
/* first page */
|
||||
Gtk::FileChooserButton* default_dir_chooser;
|
||||
void default_dir_changed();
|
||||
void setup_first_page ();
|
||||
|
||||
/* initial choice page */
|
||||
|
@ -88,6 +123,12 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
Gtk::ScrolledWindow recent_scroller;
|
||||
void redisplay_recent_sessions ();
|
||||
void recent_session_row_selected ();
|
||||
void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
|
||||
|
||||
/* audio setup page */
|
||||
|
||||
void setup_audio_page ();
|
||||
EngineControl* engine_dialog;
|
||||
|
||||
/* new sessions */
|
||||
|
||||
|
@ -104,7 +145,64 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
/* more options for new sessions */
|
||||
|
||||
Gtk::VBox more_options_vbox;
|
||||
Gtk::HBox more_options_hbox;
|
||||
|
||||
Gtk::Label chan_count_label_1;
|
||||
Gtk::Label chan_count_label_2;
|
||||
Gtk::Label chan_count_label_3;
|
||||
Gtk::Label chan_count_label_4;
|
||||
Gtk::Table advanced_table;
|
||||
Gtk::HBox input_port_limit_hbox;
|
||||
Gtk::VBox input_port_vbox;
|
||||
Gtk::Table input_table;
|
||||
Gtk::HBox input_hbox;
|
||||
|
||||
Gtk::Label bus_label;
|
||||
Gtk::Frame bus_frame;
|
||||
Gtk::Table bus_table;
|
||||
Gtk::HBox bus_hbox;
|
||||
|
||||
Gtk::Label input_label;
|
||||
Gtk::Frame input_frame;
|
||||
Gtk::HBox output_port_limit_hbox;
|
||||
Gtk::VBox output_port_vbox;
|
||||
Gtk::VBox output_conn_vbox;
|
||||
Gtk::VBox output_vbox;
|
||||
Gtk::HBox output_hbox;
|
||||
|
||||
Gtk::Label output_label;
|
||||
Gtk::Frame output_frame;
|
||||
Gtk::VBox advanced_vbox;
|
||||
Gtk::Label advanced_label;
|
||||
|
||||
Gtk::CheckButton _create_master_bus;
|
||||
Gtk::SpinButton _master_bus_channel_count;
|
||||
|
||||
Gtk::CheckButton _create_control_bus;
|
||||
Gtk::SpinButton _control_bus_channel_count;
|
||||
|
||||
Gtk::CheckButton _connect_inputs;
|
||||
Gtk::CheckButton _limit_input_ports;
|
||||
Gtk::SpinButton _input_limit_count;
|
||||
|
||||
Gtk::CheckButton _connect_outputs;
|
||||
Gtk::CheckButton _limit_output_ports;
|
||||
Gtk::SpinButton _output_limit_count;
|
||||
|
||||
Gtk::RadioButtonGroup connect_outputs_group;
|
||||
Gtk::RadioButton _connect_outputs_to_master;
|
||||
Gtk::RadioButton _connect_outputs_to_physical;
|
||||
|
||||
Gtk::Adjustment _output_limit_count_adj;
|
||||
Gtk::Adjustment _input_limit_count_adj;
|
||||
Gtk::Adjustment _control_bus_channel_count_adj;
|
||||
Gtk::Adjustment _master_bus_channel_count_adj;
|
||||
|
||||
void connect_inputs_clicked ();
|
||||
void connect_outputs_clicked ();
|
||||
void limit_inputs_clicked ();
|
||||
void limit_outputs_clicked ();
|
||||
void master_bus_button_clicked ();
|
||||
void monitor_bus_button_clicked ();
|
||||
void setup_more_options_page ();
|
||||
|
||||
/* final page */
|
||||
|
@ -116,8 +214,19 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
|
||||
Glib::RefPtr<Pango::Layout> layout;
|
||||
|
||||
/* page indices */
|
||||
|
||||
gint audio_page_index;
|
||||
gint new_user_page_index;
|
||||
gint default_folder_page_index;
|
||||
gint monitoring_page_index;
|
||||
gint session_page_index;
|
||||
gint initial_choice_index;
|
||||
gint final_page_index;
|
||||
gint session_options_page_index;
|
||||
|
||||
void move_along_now ();
|
||||
|
||||
};
|
||||
|
||||
#endif /* __gtk2_ardour_startup_h__ */
|
||||
|
|
|
@ -158,7 +158,6 @@ def build(bld):
|
|||
mixer_strip.cc
|
||||
mixer_ui.cc
|
||||
nag.cc
|
||||
new_session_dialog.cc
|
||||
option_editor.cc
|
||||
opts.cc
|
||||
panner.cc
|
||||
|
|
Loading…
Reference in New Issue