mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Whitespace fixes in gtk2_ardour/ardour_ui.cc
git-svn-id: svn://localhost/ardour2/trunk@1861 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
00fc7b1fa2
commit
89eb386adc
1 changed files with 79 additions and 79 deletions
|
|
@ -227,7 +227,7 @@ ARDOUR_UI::set_engine (AudioEngine& e)
|
||||||
engine->Halted.connect (mem_fun(*this, &ARDOUR_UI::engine_halted));
|
engine->Halted.connect (mem_fun(*this, &ARDOUR_UI::engine_halted));
|
||||||
engine->SampleRateChanged.connect (mem_fun(*this, &ARDOUR_UI::update_sample_rate));
|
engine->SampleRateChanged.connect (mem_fun(*this, &ARDOUR_UI::update_sample_rate));
|
||||||
|
|
||||||
ActionManager::init ();
|
ActionManager::init ();
|
||||||
new_session_dialog = new NewSessionDialog();
|
new_session_dialog = new NewSessionDialog();
|
||||||
|
|
||||||
_tooltips.enable();
|
_tooltips.enable();
|
||||||
|
|
@ -437,34 +437,34 @@ ARDOUR_UI::save_ardour_state ()
|
||||||
gint
|
gint
|
||||||
ARDOUR_UI::autosave_session ()
|
ARDOUR_UI::autosave_session ()
|
||||||
{
|
{
|
||||||
if (!Config->get_periodic_safety_backups())
|
if (!Config->get_periodic_safety_backups())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (session) {
|
|
||||||
session->maybe_write_autosave();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
if (session) {
|
||||||
|
session->maybe_write_autosave();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ARDOUR_UI::update_autosave ()
|
ARDOUR_UI::update_autosave ()
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (mem_fun (*this, &ARDOUR_UI::update_autosave));
|
ENSURE_GUI_THREAD (mem_fun (*this, &ARDOUR_UI::update_autosave));
|
||||||
|
|
||||||
if (session->dirty()) {
|
|
||||||
if (_autosave_connection.connected()) {
|
|
||||||
_autosave_connection.disconnect();
|
|
||||||
}
|
|
||||||
|
|
||||||
_autosave_connection = Glib::signal_timeout().connect (mem_fun (*this, &ARDOUR_UI::autosave_session),
|
if (session->dirty()) {
|
||||||
Config->get_periodic_safety_backup_interval() * 1000);
|
if (_autosave_connection.connected()) {
|
||||||
|
_autosave_connection.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
_autosave_connection = Glib::signal_timeout().connect (mem_fun (*this, &ARDOUR_UI::autosave_session),
|
||||||
if (_autosave_connection.connected()) {
|
Config->get_periodic_safety_backup_interval() * 1000);
|
||||||
_autosave_connection.disconnect();
|
|
||||||
}
|
} else {
|
||||||
}
|
if (_autosave_connection.connected()) {
|
||||||
|
_autosave_connection.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1825,13 +1825,13 @@ ARDOUR_UI::new_session (std::string predetermined_path)
|
||||||
new_session_dialog->set_current_page (0);
|
new_session_dialog->set_current_page (0);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
response = new_session_dialog->run ();
|
response = new_session_dialog->run ();
|
||||||
|
|
||||||
if (!check_audioengine()) {
|
if (!check_audioengine()) {
|
||||||
new_session_dialog->hide ();
|
new_session_dialog->hide ();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_session_is_new = false;
|
_session_is_new = false;
|
||||||
|
|
||||||
if (response == Gtk::RESPONSE_CANCEL || response == Gtk::RESPONSE_DELETE_EVENT) {
|
if (response == Gtk::RESPONSE_CANCEL || response == Gtk::RESPONSE_DELETE_EVENT) {
|
||||||
|
|
@ -1844,55 +1844,55 @@ ARDOUR_UI::new_session (std::string predetermined_path)
|
||||||
|
|
||||||
} else if (response == Gtk::RESPONSE_NONE) {
|
} else if (response == Gtk::RESPONSE_NONE) {
|
||||||
|
|
||||||
/* Clear was pressed */
|
/* Clear was pressed */
|
||||||
new_session_dialog->reset();
|
new_session_dialog->reset();
|
||||||
|
|
||||||
} else if (response == Gtk::RESPONSE_YES) {
|
} else if (response == Gtk::RESPONSE_YES) {
|
||||||
|
|
||||||
/* YES == OPEN, but there's no enum for that */
|
/* YES == OPEN, but there's no enum for that */
|
||||||
|
|
||||||
|
session_name = new_session_dialog->session_name();
|
||||||
|
|
||||||
session_name = new_session_dialog->session_name();
|
|
||||||
|
|
||||||
if (session_name.empty()) {
|
if (session_name.empty()) {
|
||||||
response = Gtk::RESPONSE_NONE;
|
response = Gtk::RESPONSE_NONE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
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] == '/')) {
|
||||||
load_session (Glib::path_get_dirname (session_name), session_name);
|
load_session (Glib::path_get_dirname (session_name), session_name);
|
||||||
} else {
|
} else {
|
||||||
session_path = new_session_dialog->session_folder();
|
session_path = new_session_dialog->session_folder();
|
||||||
load_session (session_path, session_name);
|
load_session (session_path, session_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (response == Gtk::RESPONSE_OK) {
|
} else if (response == Gtk::RESPONSE_OK) {
|
||||||
|
|
||||||
session_name = new_session_dialog->session_name();
|
session_name = new_session_dialog->session_name();
|
||||||
|
|
||||||
if (new_session_dialog->get_current_page() == 1) {
|
if (new_session_dialog->get_current_page() == 1) {
|
||||||
|
|
||||||
/* XXX this is a bit of a hack..
|
/* XXX this is a bit of a hack..
|
||||||
i really want the new sesion dialog to return RESPONSE_YES
|
i really want the new sesion dialog to return RESPONSE_YES
|
||||||
if we're on page 1 (the load page)
|
if we're on page 1 (the load page)
|
||||||
Unfortunately i can't see how atm..
|
Unfortunately i can't see how atm..
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (session_name.empty()) {
|
if (session_name.empty()) {
|
||||||
response = Gtk::RESPONSE_NONE;
|
response = Gtk::RESPONSE_NONE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
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] == '/')) {
|
||||||
load_session (Glib::path_get_dirname (session_name), session_name);
|
load_session (Glib::path_get_dirname (session_name), session_name);
|
||||||
} else {
|
} else {
|
||||||
session_path = new_session_dialog->session_folder();
|
session_path = new_session_dialog->session_folder();
|
||||||
load_session (session_path, session_name);
|
load_session (session_path, session_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (session_name.empty()) {
|
if (session_name.empty()) {
|
||||||
|
|
@ -1901,8 +1901,8 @@ ARDOUR_UI::new_session (std::string predetermined_path)
|
||||||
}
|
}
|
||||||
|
|
||||||
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] == '/')) {
|
||||||
|
|
||||||
session_path = Glib::path_get_dirname (session_name);
|
session_path = Glib::path_get_dirname (session_name);
|
||||||
session_name = Glib::path_get_basename (session_name);
|
session_name = Glib::path_get_basename (session_name);
|
||||||
|
|
@ -1912,74 +1912,74 @@ ARDOUR_UI::new_session (std::string predetermined_path)
|
||||||
session_path = new_session_dialog->session_folder();
|
session_path = new_session_dialog->session_folder();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//XXX This is needed because session constructor wants a
|
//XXX This is needed because session constructor wants a
|
||||||
//non-existant path. hopefully this will be fixed at some point.
|
//non-existant path. hopefully this will be fixed at some point.
|
||||||
|
|
||||||
session_path = Glib::build_filename (session_path, session_name);
|
session_path = Glib::build_filename (session_path, session_name);
|
||||||
|
|
||||||
if (g_file_test (session_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
|
if (g_file_test (session_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
|
||||||
|
|
||||||
Glib::ustring str = string_compose (_("This session\n%1\nalready exists. Do you want to open it?"), session_path);
|
Glib::ustring str = string_compose (_("This session\n%1\nalready exists. Do you want to open it?"), session_path);
|
||||||
|
|
||||||
MessageDialog msg (str,
|
MessageDialog msg (str,
|
||||||
false,
|
false,
|
||||||
Gtk::MESSAGE_WARNING,
|
Gtk::MESSAGE_WARNING,
|
||||||
Gtk::BUTTONS_YES_NO,
|
Gtk::BUTTONS_YES_NO,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
|
||||||
msg.set_name (X_("CleanupDialog"));
|
msg.set_name (X_("CleanupDialog"));
|
||||||
msg.set_wmclass (X_("existing_session"), "Ardour");
|
msg.set_wmclass (X_("existing_session"), "Ardour");
|
||||||
msg.set_position (Gtk::WIN_POS_MOUSE);
|
msg.set_position (Gtk::WIN_POS_MOUSE);
|
||||||
|
|
||||||
switch (msg.run()) {
|
switch (msg.run()) {
|
||||||
case RESPONSE_YES:
|
case RESPONSE_YES:
|
||||||
load_session (session_path, session_name);
|
load_session (session_path, session_name);
|
||||||
goto done;
|
goto done;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
response = RESPONSE_NONE;
|
response = RESPONSE_NONE;
|
||||||
new_session_dialog->reset ();
|
new_session_dialog->reset ();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_session_is_new = true;
|
_session_is_new = true;
|
||||||
|
|
||||||
std::string template_name = new_session_dialog->session_template_name();
|
std::string template_name = new_session_dialog->session_template_name();
|
||||||
|
|
||||||
if (new_session_dialog->use_session_template()) {
|
if (new_session_dialog->use_session_template()) {
|
||||||
|
|
||||||
load_session (session_path, session_name, &template_name);
|
load_session (session_path, session_name, &template_name);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
uint32_t cchns;
|
uint32_t cchns;
|
||||||
uint32_t mchns;
|
uint32_t mchns;
|
||||||
AutoConnectOption iconnect;
|
AutoConnectOption iconnect;
|
||||||
AutoConnectOption oconnect;
|
AutoConnectOption oconnect;
|
||||||
|
|
||||||
if (new_session_dialog->create_control_bus()) {
|
if (new_session_dialog->create_control_bus()) {
|
||||||
cchns = (uint32_t) new_session_dialog->control_channel_count();
|
cchns = (uint32_t) new_session_dialog->control_channel_count();
|
||||||
} else {
|
} else {
|
||||||
cchns = 0;
|
cchns = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_session_dialog->create_master_bus()) {
|
if (new_session_dialog->create_master_bus()) {
|
||||||
mchns = (uint32_t) new_session_dialog->master_channel_count();
|
mchns = (uint32_t) new_session_dialog->master_channel_count();
|
||||||
} else {
|
} else {
|
||||||
mchns = 0;
|
mchns = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_session_dialog->connect_inputs()) {
|
if (new_session_dialog->connect_inputs()) {
|
||||||
iconnect = AutoConnectPhysical;
|
iconnect = AutoConnectPhysical;
|
||||||
} else {
|
} else {
|
||||||
iconnect = AutoConnectOption (0);
|
iconnect = AutoConnectOption (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @todo some minor tweaks.
|
/// @todo some minor tweaks.
|
||||||
|
|
||||||
if (new_session_dialog->connect_outs_to_master()) {
|
if (new_session_dialog->connect_outs_to_master()) {
|
||||||
oconnect = AutoConnectMaster;
|
oconnect = AutoConnectMaster;
|
||||||
} else if (new_session_dialog->connect_outs_to_physical()) {
|
} else if (new_session_dialog->connect_outs_to_physical()) {
|
||||||
|
|
@ -1987,19 +1987,19 @@ ARDOUR_UI::new_session (std::string predetermined_path)
|
||||||
} else {
|
} else {
|
||||||
oconnect = AutoConnectOption (0);
|
oconnect = AutoConnectOption (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t nphysin = (uint32_t) new_session_dialog->input_limit_count();
|
uint32_t nphysin = (uint32_t) new_session_dialog->input_limit_count();
|
||||||
uint32_t nphysout = (uint32_t) new_session_dialog->output_limit_count();
|
uint32_t nphysout = (uint32_t) new_session_dialog->output_limit_count();
|
||||||
|
|
||||||
if (build_session (session_path,
|
if (build_session (session_path,
|
||||||
session_name,
|
session_name,
|
||||||
cchns,
|
cchns,
|
||||||
mchns,
|
mchns,
|
||||||
iconnect,
|
iconnect,
|
||||||
oconnect,
|
oconnect,
|
||||||
nphysin,
|
nphysin,
|
||||||
nphysout,
|
nphysout,
|
||||||
engine->frame_rate() * 60 * 5)) {
|
engine->frame_rate() * 60 * 5)) {
|
||||||
|
|
||||||
response = Gtk::RESPONSE_NONE;
|
response = Gtk::RESPONSE_NONE;
|
||||||
new_session_dialog->reset ();
|
new_session_dialog->reset ();
|
||||||
|
|
@ -2008,7 +2008,7 @@ ARDOUR_UI::new_session (std::string predetermined_path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (response == Gtk::RESPONSE_NONE);
|
} while (response == Gtk::RESPONSE_NONE);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue