13
0

Fix some messed up code (spacey tabs).

(There is faar more of this... FIX YOUR EDITORS!)


git-svn-id: svn://localhost/ardour2/branches/3.0@8086 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2010-11-25 20:37:39 +00:00
parent c862d320ff
commit 8b68ed57ec
34 changed files with 1328 additions and 1332 deletions

View File

@ -156,7 +156,7 @@ static const char* authors[] = {
N_("Nimal Ratnayake"),
N_("Dave Robillard"),
N_("Taybin Rutkin"),
N_("Andreas Ruge"),
N_("Andreas Ruge"),
N_("Sampo Savolainen"),
N_("Per Sigmond"),
N_("Lincoln Spiteri"),
@ -169,7 +169,7 @@ static const char* authors[] = {
};
static const char* translators[] = {
N_("French:\n\tAlain Fréhel <alain.frehel@free.fr>\n\tChristophe Combelles <ccomb@free.fr>\n\tMartin Blanchard\n"),
N_("French:\n\tAlain Fréhel <alain.frehel@free.fr>\n\tChristophe Combelles <ccomb@free.fr>\n\tMartin Blanchard\n"),
N_("German:\n\tKarsten Petersen <kapet@kapet.de>\
\n\tSebastian Arnold <mail@sebastian-arnold.net>\
\n\tRobert Schwede<schwede@ironshark.com>\n"),
@ -182,8 +182,8 @@ static const char* translators[] = {
N_("Greek:\n\t Klearchos Gourgourinis <muadib@in.gr>\n"),
N_("Swedish:\n\t Petter Sundlöf <petter.sundlof@gmail.com>\n"),
N_("Polish:\n\t Piotr Zaryk <pzaryk@gmail.com>\n"),
N_("Czech:\n\t Pavel Fric <pavelfric@seznam.cz>\n"),
N_("Norwegian:\n\t Eivind Ødegård\n"),
N_("Czech:\n\t Pavel Fric <pavelfric@seznam.cz>\n"),
N_("Norwegian:\n\t Eivind Ødegård\n"),
0
};

View File

@ -91,7 +91,7 @@ ActionManager::init ()
if (!loaded) {
cerr << string_compose (_("%1 will not work without a valid ardour.menus file"), PROGRAM_NAME) << endl;
error << string_compose (_("%1 will not work without a valid ardour.menus file"), PROGRAM_NAME) << endmsg;
error << string_compose (_("%1 will not work without a valid ardour.menus file"), PROGRAM_NAME) << endmsg;
exit(1);
}
}

View File

@ -226,9 +226,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
session_loaded = false;
last_speed_displayed = -1.0f;
ignore_dual_punch = false;
original_big_clock_width = -1;
original_big_clock_height = -1;
original_big_clock_font_size = 0;
original_big_clock_width = -1;
original_big_clock_height = -1;
original_big_clock_font_size = 0;
roll_button.unset_flags (Gtk::CAN_FOCUS);
stop_button.unset_flags (Gtk::CAN_FOCUS);
@ -247,7 +247,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
shuttle_style_menu = 0;
shuttle_unit_menu = 0;
// We do not have jack linked in yet so;
// We do not have jack linked in yet so;
last_shuttle_request = last_peak_grab = 0; // get_microseconds();
@ -270,7 +270,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
ARDOUR::Session::Quit.connect (forever_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::finish, this), gui_context ());
/* handle requests to deal with missing files */
/* handle requests to deal with missing files */
ARDOUR::Session::MissingFile.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::missing_file, this, _1, _2, _3));
@ -306,7 +306,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
reset_dpi();
TimeAxisViewItem::set_constant_heights ();
TimeAxisViewItem::set_constant_heights ();
/* The following must happen after ARDOUR::init() so that Config is set up */
@ -343,9 +343,9 @@ ARDOUR_UI::run_startup (bool should_be_new, string load_template)
}
_startup->set_new_only (should_be_new);
if (!load_template.empty()) {
_startup->set_load_template( load_template );
}
if (!load_template.empty()) {
_startup->set_load_template( load_template );
}
_startup->present ();
main().run();
@ -385,7 +385,7 @@ ARDOUR_UI::create_engine ()
engine->Halted.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false));
ARDOUR::Port::set_connecting_blocked (ARDOUR_COMMAND_LINE::no_connect_ports);
ARDOUR::Port::set_connecting_blocked (ARDOUR_COMMAND_LINE::no_connect_ports);
post_engine ();
@ -505,7 +505,7 @@ ARDOUR_UI::configure_timeout ()
return true;
} else {
have_configure_timeout = false;
cerr << "config event-driven save\n";
cerr << "config event-driven save\n";
save_ardour_state ();
return false;
}
@ -593,13 +593,13 @@ ARDOUR_UI::autosave_session ()
return 1;
}
if (!Config->get_periodic_safety_backups()) {
return 1;
if (!Config->get_periodic_safety_backups()) {
return 1;
}
if (_session) {
_session->maybe_write_autosave();
}
if (_session) {
_session->maybe_write_autosave();
}
return 1;
}
@ -680,16 +680,16 @@ Please consider the possibilities, and perhaps (re)start JACK."));
void
ARDOUR_UI::startup ()
{
Application* app = Application::instance ();
Application* app = Application::instance ();
app->ShouldQuit.connect (sigc::mem_fun (*this, &ARDOUR_UI::queue_finish));
app->ShouldLoad.connect (sigc::mem_fun (*this, &ARDOUR_UI::idle_load));
app->ShouldQuit.connect (sigc::mem_fun (*this, &ARDOUR_UI::queue_finish));
app->ShouldLoad.connect (sigc::mem_fun (*this, &ARDOUR_UI::idle_load));
#ifdef PHONE_HOME
call_the_mothership (VERSIONSTRING);
call_the_mothership (VERSIONSTRING);
#endif
app->ready ();
app->ready ();
if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) {
exit (1);
@ -749,12 +749,13 @@ ARDOUR_UI::check_memory_locking ()
if (ram == 0 || ((double) limits.rlim_cur / ram) < 0.75) {
MessageDialog msg (string_compose (_("WARNING: Your system has a limit for maximum amount of locked memory. "
"This might cause %1 to run out of memory before your system "
"runs out of memory. \n\n"
"You can view the memory limit with 'ulimit -l', "
"and it is normally controlled by /etc/security/limits.conf"),
PROGRAM_NAME).c_str());
MessageDialog msg (
string_compose (_("WARNING: Your system has a limit for maximum amount of locked memory. "
"This might cause %1 to run out of memory before your system "
"runs out of memory. \n\n"
"You can view the memory limit with 'ulimit -l', "
"and it is normally controlled by /etc/security/limits.conf"),
PROGRAM_NAME).c_str());
VBox* vbox = msg.get_vbox();
HBox hbox;
@ -796,7 +797,7 @@ void
ARDOUR_UI::finish()
{
if (_session) {
int tries = 0;
int tries = 0;
if (_session->transport_rolling() && (++tries < 8)) {
_session->request_stop (false, true);
@ -841,7 +842,7 @@ If you still wish to quit, please use the\n\n\
if (_session) {
// _session->set_deletion_in_progress ();
_session->set_clean ();
_session->set_clean ();
_session->remove_pending_capture_state ();
delete _session;
_session = 0;
@ -1103,7 +1104,7 @@ ARDOUR_UI::redisplay_recent_sessions ()
sort (rs.begin(), rs.end(), cmp);
for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) {
session_directories.push_back ((*i).second);
session_directories.push_back ((*i).second);
}
for (vector<sys::path>::const_iterator i = session_directories.begin();
@ -1260,8 +1261,8 @@ ARDOUR_UI::check_audioengine ()
if (engine) {
if (!engine->connected()) {
MessageDialog msg (string_compose (_("%1 is not connected to JACK\n"
"You cannot open or close sessions in this condition"),
PROGRAM_NAME));
"You cannot open or close sessions in this condition"),
PROGRAM_NAME));
pop_back_splash ();
msg.run ();
return false;
@ -1598,9 +1599,9 @@ ARDOUR_UI::transport_roll ()
/* XXX it is not possible to just leave seamless loop and keep
playing at present (nov 4th 2009)
*/
if (!Config->get_seamless_loop()) {
_session->request_play_loop (false, true);
}
if (!Config->get_seamless_loop()) {
_session->request_play_loop (false, true);
}
} else if (_session->get_play_range () && !join_play_range_button.get_active()) {
/* stop playing a range if we currently are */
_session->request_play_range (0, true);
@ -1657,7 +1658,7 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
_session->request_play_loop (false, true);
} else if (_session->get_play_range ()) {
affect_transport = false;
_session->request_play_range (0, true);
_session->request_play_range (0, true);
}
}
@ -1909,22 +1910,22 @@ ARDOUR_UI::engine_running ()
void
ARDOUR_UI::engine_halted (const char* reason, bool free_reason)
{
if (!Gtkmm2ext::UI::instance()->caller_is_ui_thread()) {
/* we can't rely on the original string continuing to exist when we are called
again in the GUI thread, so make a copy and note that we need to
free it later.
*/
char *copy = strdup (reason);
Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&ARDOUR_UI::engine_halted, this, copy, true));
return;
}
if (!Gtkmm2ext::UI::instance()->caller_is_ui_thread()) {
/* we can't rely on the original string continuing to exist when we are called
again in the GUI thread, so make a copy and note that we need to
free it later.
*/
char *copy = strdup (reason);
Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&ARDOUR_UI::engine_halted, this, copy, true));
return;
}
ActionManager::set_sensitive (ActionManager::jack_sensitive_actions, false);
ActionManager::set_sensitive (ActionManager::jack_opposite_sensitive_actions, true);
update_sample_rate (0);
string msgstr;
string msgstr;
/* if the reason is a non-empty string, it means that the backend was shutdown
rather than just Ardour.
@ -1944,9 +1945,9 @@ JACK, reconnect and save the session."), PROGRAM_NAME);
pop_back_splash ();
msg.run ();
if (free_reason) {
free ((char*) reason);
}
if (free_reason) {
free ((char*) reason);
}
}
int32_t
@ -2057,16 +2058,16 @@ ARDOUR_UI::snapshot_session (bool switch_to_it)
prompter.set_title (_("Take Snapshot"));
prompter.set_prompt (_("Name of new snapshot"));
if (!switch_to_it) {
char timebuf[128];
time_t n;
struct tm local_time;
if (!switch_to_it) {
char timebuf[128];
time_t n;
struct tm local_time;
time (&n);
localtime_r (&n, &local_time);
strftime (timebuf, sizeof(timebuf), "%FT%T", &local_time);
prompter.set_initial_text (timebuf);
}
time (&n);
localtime_r (&n, &local_time);
strftime (timebuf, sizeof(timebuf), "%FT%T", &local_time);
prompter.set_initial_text (timebuf);
}
again:
switch (prompter.run()) {
@ -2076,20 +2077,20 @@ ARDOUR_UI::snapshot_session (bool switch_to_it)
bool do_save = (snapname.length() != 0);
if (do_save) {
if (snapname.find ('/') != string::npos) {
MessageDialog msg (_("To ensure compatibility with various systems\n"
"snapshot names may not contain a '/' character"));
msg.run ();
goto again;
}
if (snapname.find ('\\') != string::npos) {
MessageDialog msg (_("To ensure compatibility with various systems\n"
"snapshot names may not contain a '\\' character"));
msg.run ();
goto again;
}
}
if (do_save) {
if (snapname.find ('/') != string::npos) {
MessageDialog msg (_("To ensure compatibility with various systems\n"
"snapshot names may not contain a '/' character"));
msg.run ();
goto again;
}
if (snapname.find ('\\') != string::npos) {
MessageDialog msg (_("To ensure compatibility with various systems\n"
"snapshot names may not contain a '\\' character"));
msg.run ();
goto again;
}
}
vector<sys::path> p;
get_state_files_in_directory (_session->session_directory().root_path(), p);
@ -2149,7 +2150,7 @@ ARDOUR_UI::save_state_canfail (string name, bool switch_to_it)
return ret;
}
}
cerr << "SS canfail\n";
cerr << "SS canfail\n";
save_ardour_state (); /* XXX cannot fail? yeah, right ... */
return 0;
}
@ -2185,9 +2186,9 @@ ARDOUR_UI::transport_rec_enable_blink (bool onoff)
return;
}
if (_session->step_editing()) {
return;
}
if (_session->step_editing()) {
return;
}
Session::RecordState const r = _session->record_status ();
bool const h = _session->have_rec_enabled_track ();
@ -2265,14 +2266,14 @@ ARDOUR_UI::fontconfig_dialog ()
if (!Glib::file_test (fontconfig, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
MessageDialog msg (*_startup,
string_compose (_("Welcome to %1.\n\n"
"The program will take a bit longer to start up\n"
"while the system fonts are checked.\n\n"
"This will only be done once, and you will\n"
"not see this message again\n"), PROGRAM_NAME),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);
string_compose (_("Welcome to %1.\n\n"
"The program will take a bit longer to start up\n"
"while the system fonts are checked.\n\n"
"This will only be done once, and you will\n"
"not see this message again\n"), PROGRAM_NAME),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);
pop_back_splash ();
msg.show_all ();
msg.present ();
@ -2378,7 +2379,7 @@ ARDOUR_UI::ask_about_loading_existing_session (const std::string& session_path)
int
ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::string& session_name)
{
BusProfile bus_profile;
BusProfile bus_profile;
if (Profile->get_sae()) {
@ -2486,10 +2487,10 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
int ret = -1;
bool likely_new = false;
if (! load_template.empty()) {
should_be_new = true;
template_name = load_template;
}
if (! load_template.empty()) {
should_be_new = true;
template_name = load_template;
}
while (ret != 0) {
@ -2541,9 +2542,9 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == G_DIR_SEPARATOR) ||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == G_DIR_SEPARATOR)) {
/* absolute path or cwd-relative path specified for session name: infer session folder
from what was given.
*/
/* absolute path or cwd-relative path specified for session name: infer session folder
from what was given.
*/
session_path = Glib::path_get_dirname (session_name);
session_name = Glib::path_get_basename (session_name);
@ -2552,21 +2553,21 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
session_path = _startup->session_folder();
if (session_name.find ('/') != string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '/' character"));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
}
if (session_name.find ('/') != string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '/' character"));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
}
if (session_name.find ('\\') != string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '\\' character"));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
}
if (session_name.find ('\\') != string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '\\' character"));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
}
}
}
@ -2597,21 +2598,21 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
continue;
}
if (session_name.find ('/') != std::string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '/' character"));
msg.run ();
if (session_name.find ('/') != std::string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '/' character"));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
}
continue;
}
if (session_name.find ('\\') != std::string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '\\' character"));
msg.run ();
if (session_name.find ('\\') != std::string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '\\' character"));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
}
continue;
}
_session_is_new = true;
}
@ -2641,8 +2642,8 @@ ARDOUR_UI::close_session()
}
if (unload_session (true)) {
return;
}
return;
}
ARDOUR_COMMAND_LINE::session_name = "";
@ -2711,26 +2712,26 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
catch (...) {
MessageDialog msg (string_compose(_("Session \"%1 (snapshot %2)\" did not load successfully"), path, snap_name),
true,
Gtk::MESSAGE_INFO,
BUTTONS_OK);
MessageDialog msg (string_compose(_("Session \"%1 (snapshot %2)\" did not load successfully"),path, snap_name),
true,
Gtk::MESSAGE_INFO,
BUTTONS_OK);
msg.set_title (_("Loading Error"));
msg.set_secondary_text (_("Click the Refresh button to try again."));
msg.add_button (Stock::REFRESH, 1);
msg.set_secondary_text (_("Click the Refresh button to try again."));
msg.add_button (Stock::REFRESH, 1);
msg.set_position (Gtk::WIN_POS_CENTER);
pop_back_splash ();
msg.present ();
int response = msg.run ();
switch (response) {
case 1:
break;
default:
exit (1);
}
switch (response) {
case 1:
break;
default:
exit (1);
}
msg.hide ();
@ -2799,15 +2800,15 @@ ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name,
/* Give the new session the default GUI state, if such things exist */
XMLNode* n;
n = Config->instant_xml (X_("Editor"));
if (n) {
new_session->add_instant_xml (*n, false);
}
n = Config->instant_xml (X_("Mixer"));
if (n) {
new_session->add_instant_xml (*n, false);
}
XMLNode* n;
n = Config->instant_xml (X_("Editor"));
if (n) {
new_session->add_instant_xml (*n, false);
}
n = Config->instant_xml (X_("Mixer"));
if (n) {
new_session->add_instant_xml (*n, false);
}
set_session (new_session);
@ -2822,9 +2823,9 @@ void
ARDOUR_UI::launch_chat ()
{
#ifdef __APPLE__
open_uri("http://webchat.freenode.net/?channels=ardour-osx");
open_uri("http://webchat.freenode.net/?channels=ardour-osx");
#else
open_uri("http://webchat.freenode.net/?channels=ardour");
open_uri("http://webchat.freenode.net/?channels=ardour");
#endif
}
@ -2836,7 +2837,7 @@ ARDOUR_UI::show_about ()
about->signal_response().connect(sigc::mem_fun (*this, &ARDOUR_UI::about_signal_response) );
}
about->set_transient_for(*editor);
about->set_transient_for(*editor);
about->show_all ();
}
@ -2856,7 +2857,7 @@ void
ARDOUR_UI::hide_about ()
{
if (about) {
about->get_window()->set_cursor ();
about->get_window()->set_cursor ();
about->hide ();
}
}
@ -2960,22 +2961,22 @@ require some unused files to continue to exist."));
*/
const char* bprefix;
double space_adjusted = 0;
double space_adjusted = 0;
if (rep.space < 100000.0f) {
bprefix = X_("kilo");
} else if (rep.space < 1000000.0f * 1000) {
bprefix = X_("mega");
space_adjusted = truncf((float)rep.space / 1000.0);
space_adjusted = truncf((float)rep.space / 1000.0);
} else {
bprefix = X_("giga");
space_adjusted = truncf((float)rep.space / (1000000.0 * 1000));
space_adjusted = truncf((float)rep.space / (1000000.0 * 1000));
}
if (removed > 1) {
txt.set_text (string_compose (plural_msg, removed, _session->path() + "dead_sounds", space_adjusted, bprefix));
txt.set_text (string_compose (plural_msg, removed, _session->path() + "dead_sounds", space_adjusted, bprefix));
} else {
txt.set_text (string_compose (singular_msg, removed, _session->path() + "dead_sounds", space_adjusted, bprefix));
txt.set_text (string_compose (singular_msg, removed, _session->path() + "dead_sounds", space_adjusted, bprefix));
}
dhbox.pack_start (*dimage, true, false, 5);
@ -3304,7 +3305,7 @@ ARDOUR_UI::disk_underrun_handler ()
if (!have_disk_speed_dialog_displayed) {
have_disk_speed_dialog_displayed = true;
MessageDialog* msg = new MessageDialog (*editor,
string_compose (_("The disk system on your computer\n\
string_compose (_("The disk system on your computer\n\
was not able to keep up with %1.\n\
\n\
Specifically, it failed to read data from disk\n\
@ -3464,16 +3465,16 @@ ARDOUR_UI::update_transport_clocks (nframes_t pos)
void
ARDOUR_UI::step_edit_status_change (bool yn)
{
// XXX should really store pre-step edit status of things
// we make insensitive
// XXX should really store pre-step edit status of things
// we make insensitive
if (yn) {
rec_button.set_visual_state (3);
rec_button.set_sensitive (false);
} else {
rec_button.set_visual_state (0);
rec_button.set_sensitive (true);
}
if (yn) {
rec_button.set_visual_state (3);
rec_button.set_sensitive (false);
} else {
rec_button.set_visual_state (0);
rec_button.set_sensitive (true);
}
}
void
@ -3648,38 +3649,38 @@ ARDOUR_UI::setup_profile ()
void
ARDOUR_UI::toggle_translations ()
{
using namespace Glib;
using namespace Glib;
RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("EnableTranslation"));
if (act) {
RefPtr<ToggleAction> ract = RefPtr<ToggleAction>::cast_dynamic (act);
if (ract) {
RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("EnableTranslation"));
if (act) {
RefPtr<ToggleAction> ract = RefPtr<ToggleAction>::cast_dynamic (act);
if (ract) {
string i18n_killer = ARDOUR::translation_kill_path();
string i18n_killer = ARDOUR::translation_kill_path();
bool already_enabled = !ARDOUR::translations_are_disabled ();
bool already_enabled = !ARDOUR::translations_are_disabled ();
if (ract->get_active ()) {
if (ract->get_active ()) {
/* we don't care about errors */
int fd = ::open (i18n_killer.c_str(), O_RDONLY|O_CREAT, 0644);
close (fd);
} else {
int fd = ::open (i18n_killer.c_str(), O_RDONLY|O_CREAT, 0644);
close (fd);
} else {
/* we don't care about errors */
unlink (i18n_killer.c_str());
}
unlink (i18n_killer.c_str());
}
if (already_enabled != ract->get_active()) {
MessageDialog win (already_enabled ? _("Translations disabled") : _("Translations enabled"),
false,
Gtk::MESSAGE_WARNING,
Gtk::BUTTONS_OK);
win.set_secondary_text (string_compose (_("You must restart %1 for this to take effect."), PROGRAM_NAME));
win.set_position (Gtk::WIN_POS_CENTER);
win.present ();
win.run ();
}
}
}
if (already_enabled != ract->get_active()) {
MessageDialog win (already_enabled ? _("Translations disabled") : _("Translations enabled"),
false,
Gtk::MESSAGE_WARNING,
Gtk::BUTTONS_OK);
win.set_secondary_text (string_compose (_("You must restart %1 for this to take effect."), PROGRAM_NAME));
win.set_position (Gtk::WIN_POS_CENTER);
win.present ();
win.run ();
}
}
}
}
/** Add a window proxy to our list, so that its state will be saved.
@ -3705,22 +3706,22 @@ ARDOUR_UI::remove_window_proxy (WindowProxyBase* p)
int
ARDOUR_UI::missing_file (Session*s, std::string str, DataType type)
{
MissingFileDialog dialog (s, str, type);
MissingFileDialog dialog (s, str, type);
dialog.show ();
dialog.present ();
dialog.show ();
dialog.present ();
int result = dialog.run ();
dialog.hide ();
int result = dialog.run ();
dialog.hide ();
switch (result) {
case RESPONSE_OK:
break;
default:
return 1; // quit entire session load
}
switch (result) {
case RESPONSE_OK:
break;
default:
return 1; // quit entire session load
}
result = dialog.get_action ();
result = dialog.get_action ();
return result;
return result;
}

View File

@ -116,9 +116,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void show_splash ();
void hide_splash ();
void launch_chat ();
void launch_manual ();
void launch_reference ();
void launch_chat ();
void launch_manual ();
void launch_reference ();
void show_about ();
void hide_about ();
@ -182,7 +182,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
XMLNode* editor_settings() const;
XMLNode* mixer_settings () const;
XMLNode* keyboard_settings () const;
XMLNode* tearoff_settings (const char*) const;
XMLNode* tearoff_settings (const char*) const;
void save_ardour_state ();
gboolean configure_handler (GdkEventConfigure* conf);
@ -201,7 +201,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void restore_clock_modes ();
void reset_main_clocks ();
void synchronize_sync_source_and_video_pullup ();
void synchronize_sync_source_and_video_pullup ();
void add_route (Gtk::Window* float_window);
@ -318,9 +318,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
AudioClock big_clock;
ActionWindowProxy<Gtk::Window>* big_clock_window;
int original_big_clock_width;
int original_big_clock_height;
double original_big_clock_font_size;
int original_big_clock_width;
int original_big_clock_height;
double original_big_clock_font_size;
void big_clock_size_allocate (Gtk::Allocation&);
bool idle_big_clock_text_resizer (int width, int height);

View File

@ -144,7 +144,7 @@ ARDOUR_UI::setup_tooltips ()
set_tip (primary_clock, _("Primary Clock"));
set_tip (secondary_clock, _("Secondary Clock"));
synchronize_sync_source_and_video_pullup ();
synchronize_sync_source_and_video_pullup ();
editor->setup_tooltips ();
}
@ -195,17 +195,17 @@ ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuff
XMLNode*
ARDOUR_UI::tearoff_settings (const char* name) const
{
XMLNode* ui_node = Config->extra_xml(X_("UI"));
XMLNode* ui_node = Config->extra_xml(X_("UI"));
if (ui_node) {
XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
if (tearoff_node) {
XMLNode* mnode = tearoff_node->child (name);
return mnode;
}
}
if (ui_node) {
XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
if (tearoff_node) {
XMLNode* mnode = tearoff_node->child (name);
return mnode;
}
}
return 0;
return 0;
}
void
@ -470,10 +470,10 @@ ARDOUR_UI::setup_transport ()
transport_tearoff_hbox.pack_end (*img, false, false, 6);
}
XMLNode* tnode = tearoff_settings ("transport");
if (tnode) {
transport_tearoff->set_state (*tnode);
}
XMLNode* tnode = tearoff_settings ("transport");
if (tnode) {
transport_tearoff->set_state (*tnode);
}
}
void
@ -527,20 +527,20 @@ ARDOUR_UI::audition_alert_press (GdkEventButton*)
if (_session) {
_session->cancel_audition();
}
return true;
return true;
}
bool
ARDOUR_UI::solo_alert_press (GdkEventButton*)
{
if (_session) {
if (_session->soloing()) {
_session->set_solo (_session->get_routes(), false);
} else if (_session->listening()) {
_session->set_listen (_session->get_routes(), false);
}
}
return true;
if (_session) {
if (_session->soloing()) {
_session->set_solo (_session->get_routes(), false);
} else if (_session->listening()) {
_session->set_listen (_session->get_routes(), false);
}
}
return true;
}
void

View File

@ -212,7 +212,7 @@ ARDOUR_UI::install_actions ()
ActionManager::register_action (main_actions, X_("WindowMenu"), _("Window"));
ActionManager::register_action (common_actions, X_("Quit"), _("Quit"), (hide_return (sigc::mem_fun(*this, &ARDOUR_UI::finish))));
/* windows visibility actions */
/* windows visibility actions */
ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalEditor"), _("Maximise Editor Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editing_space));
act = ActionManager::register_toggle_action (common_actions, X_("KeepTearoffs"), _("Toolbars when Maximised"), mem_fun (*this, &ARDOUR_UI::toggle_keep_tearoffs));
@ -237,8 +237,8 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::register_action (common_actions, X_("About"), _("About"), sigc::mem_fun(*this, &ARDOUR_UI::show_about));
ActionManager::register_action (common_actions, X_("Chat"), _("Chat"), sigc::mem_fun(*this, &ARDOUR_UI::launch_chat));
ActionManager::register_action (common_actions, X_("Manual"), _("Manual"), mem_fun(*this, &ARDOUR_UI::launch_manual));
ActionManager::register_action (common_actions, X_("Reference"), _("Reference"), mem_fun(*this, &ARDOUR_UI::launch_reference));
ActionManager::register_action (common_actions, X_("Manual"), _("Manual"), mem_fun(*this, &ARDOUR_UI::launch_manual));
ActionManager::register_action (common_actions, X_("Reference"), _("Reference"), mem_fun(*this, &ARDOUR_UI::launch_reference));
ActionManager::register_toggle_action (common_actions, X_("ToggleThemeManager"), _("Theme Manager"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_theme_manager));
ActionManager::register_toggle_action (common_actions, X_("ToggleKeyEditor"), _("Key Bindings"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_key_editor));
ActionManager::register_toggle_action (common_actions, X_("ToggleBundleManager"), _("Bundle Manager"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_bundle_manager));
@ -422,15 +422,15 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
if (getenv ("ARDOUR_BUNDLED")) {
act = ActionManager::register_toggle_action (main_actions, X_("EnableTranslation"), _("Enable Translations"), mem_fun (*this, &ARDOUR_UI::toggle_translations));
if (act) {
RefPtr<ToggleAction> ract = RefPtr<ToggleAction>::cast_dynamic (act);
if (ract) {
ract->set_active (!ARDOUR::translations_are_disabled());
}
}
}
if (getenv ("ARDOUR_BUNDLED")) {
act = ActionManager::register_toggle_action (main_actions, X_("EnableTranslation"), _("Enable Translations"), mem_fun (*this, &ARDOUR_UI::toggle_translations));
if (act) {
RefPtr<ToggleAction> ract = RefPtr<ToggleAction>::cast_dynamic (act);
if (ract) {
ract->set_active (!ARDOUR::translations_are_disabled());
}
}
}
ActionManager::add_action_group (shuttle_actions);
ActionManager::add_action_group (option_actions);
@ -616,15 +616,15 @@ ARDOUR_UI::big_clock_realized ()
set_decoration (big_clock_window->get(), (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
big_clock_window->get()->get_window()->get_geometry (x, y, w, big_clock_height, d);
original_big_clock_height = big_clock_height;
original_big_clock_width = w;
original_big_clock_height = big_clock_height;
original_big_clock_width = w;
Pango::FontDescription fd (big_clock.get_style()->get_font());
original_big_clock_font_size = fd.get_size ();
Pango::FontDescription fd (big_clock.get_style()->get_font());
original_big_clock_font_size = fd.get_size ();
if (!fd.get_size_is_absolute ()) {
original_big_clock_font_size /= PANGO_SCALE;
}
if (!fd.get_size_is_absolute ()) {
original_big_clock_font_size /= PANGO_SCALE;
}
big_clock_window->setup ();
}
@ -658,7 +658,7 @@ ARDOUR_UI::idle_big_clock_text_resizer (int, int)
Glib::RefPtr<Gdk::Window> win = big_clock_window->get()->get_window();
Pango::FontDescription fd (big_clock.get_style()->get_font());
int current_size = fd.get_size ();
int x, y, w, h, d;
int x, y, w, h, d;
if (!fd.get_size_is_absolute ()) {
current_size /= PANGO_SCALE;
@ -666,28 +666,28 @@ ARDOUR_UI::idle_big_clock_text_resizer (int, int)
win->get_geometry (x, y, w, h, d);
double scale = min (((double) w / (double) original_big_clock_width),
((double) h / (double) original_big_clock_height));
double scale = min (((double) w / (double) original_big_clock_width),
((double) h / (double) original_big_clock_height));
int size = (int) lrintf (original_big_clock_font_size * scale);
int size = (int) lrintf (original_big_clock_font_size * scale);
if (size != current_size) {
if (size != current_size) {
string family = fd.get_family();
char buf[family.length()+16];
snprintf (buf, family.length()+16, "%s %d", family.c_str(), size);
string family = fd.get_family();
char buf[family.length()+16];
snprintf (buf, family.length()+16, "%s %d", family.c_str(), size);
try {
Pango::FontDescription fd (buf);
Glib::RefPtr<Gtk::RcStyle> rcstyle = big_clock.get_modifier_style ();
rcstyle->set_font (fd);
big_clock.modify_style (rcstyle);
}
try {
Pango::FontDescription fd (buf);
Glib::RefPtr<Gtk::RcStyle> rcstyle = big_clock.get_modifier_style ();
rcstyle->set_font (fd);
big_clock.modify_style (rcstyle);
}
catch (...) {
/* oh well, do nothing */
}
}
catch (...) {
/* oh well, do nothing */
}
}
return false;
}
@ -707,7 +707,7 @@ ARDOUR_UI::save_ardour_state ()
Config->add_extra_xml (*node);
Config->add_extra_xml (get_transport_controllable_state());
XMLNode* window_node = new XMLNode (X_("UI"));
XMLNode* window_node = new XMLNode (X_("UI"));
for (list<WindowProxyBase*>::iterator i = _window_proxies.begin(); i != _window_proxies.end(); ++i) {
if ((*i)->rc_configured()) {
@ -715,31 +715,31 @@ ARDOUR_UI::save_ardour_state ()
}
}
/* tearoffs */
/* tearoffs */
XMLNode* tearoff_node = new XMLNode (X_("Tearoffs"));
XMLNode* tearoff_node = new XMLNode (X_("Tearoffs"));
if (transport_tearoff) {
XMLNode* t = new XMLNode (X_("transport"));
transport_tearoff->add_state (*t);
tearoff_node->add_child_nocopy (*t);
}
if (transport_tearoff) {
XMLNode* t = new XMLNode (X_("transport"));
transport_tearoff->add_state (*t);
tearoff_node->add_child_nocopy (*t);
}
if (mixer && mixer->monitor_section()) {
XMLNode* t = new XMLNode (X_("monitor-section"));
mixer->monitor_section()->tearoff().add_state (*t);
tearoff_node->add_child_nocopy (*t);
}
if (mixer && mixer->monitor_section()) {
XMLNode* t = new XMLNode (X_("monitor-section"));
mixer->monitor_section()->tearoff().add_state (*t);
tearoff_node->add_child_nocopy (*t);
}
if (editor && editor->mouse_mode_tearoff()) {
XMLNode* t = new XMLNode (X_("mouse-mode"));
editor->mouse_mode_tearoff ()->add_state (*t);
tearoff_node->add_child_nocopy (*t);
}
if (editor && editor->mouse_mode_tearoff()) {
XMLNode* t = new XMLNode (X_("mouse-mode"));
editor->mouse_mode_tearoff ()->add_state (*t);
tearoff_node->add_child_nocopy (*t);
}
window_node->add_child_nocopy (*tearoff_node);
window_node->add_child_nocopy (*tearoff_node);
Config->add_extra_xml (*window_node);
Config->add_extra_xml (*window_node);
if (_startup && _startup->engine_control() && _startup->engine_control()->was_used()) {
Config->add_extra_xml (_startup->engine_control()->get_state());

View File

@ -58,19 +58,19 @@ ARDOUR_UI::toggle_keep_tearoffs ()
void
ARDOUR_UI::toggle_external_sync()
{
if (_session) {
if (_session->config.get_video_pullup() != 0.0f) {
if (_session->config.get_sync_source() == JACK) {
MessageDialog msg (_(
"It is not possible to use JACK as the the sync source\n\
if (_session) {
if (_session->config.get_video_pullup() != 0.0f) {
if (_session->config.get_sync_source() == JACK) {
MessageDialog msg (
_("It is not possible to use JACK as the the sync source\n\
when the pull up/down setting is non-zero."));
msg.run ();
return;
}
}
msg.run ();
return;
}
}
ActionManager::toggle_config_state_foo ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::set_external_sync), sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
}
ActionManager::toggle_config_state_foo ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::set_external_sync), sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
}
}
void
@ -414,21 +414,20 @@ ARDOUR_UI::parameter_changed (std::string p)
}
} else if (p == "video-pullup" || p == "timecode-format") {
synchronize_sync_source_and_video_pullup ();
synchronize_sync_source_and_video_pullup ();
reset_main_clocks ();
} else if (p == "sync-source") {
} else if (p == "sync-source") {
synchronize_sync_source_and_video_pullup ();
synchronize_sync_source_and_video_pullup ();
} else if (p == "show-track-meters") {
editor->toggle_meter_updating();
} else if (p == "primary-clock-delta-edit-cursor") {
primary_clock.set_is_duration (Config->get_primary_clock_delta_edit_cursor());
} else if (p == "secondary-clock-delta-edit-cursor") {
secondary_clock.set_is_duration (Config->get_secondary_clock_delta_edit_cursor());
}
primary_clock.set_is_duration (Config->get_primary_clock_delta_edit_cursor());
} else if (p == "secondary-clock-delta-edit-cursor") {
secondary_clock.set_is_duration (Config->get_secondary_clock_delta_edit_cursor());
}
}
void
@ -448,39 +447,39 @@ ARDOUR_UI::reset_main_clocks ()
void
ARDOUR_UI::synchronize_sync_source_and_video_pullup ()
{
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
if (!act) {
return;
}
if (!act) {
return;
}
if (!_session) {
goto just_label;
}
if (!_session) {
goto just_label;
}
if (_session->config.get_video_pullup() == 0.0f) {
/* with no video pull up/down, any sync source is OK */
act->set_sensitive (true);
} else {
/* can't sync to JACK if video pullup != 0.0 */
if (_session->config.get_sync_source() == JACK) {
act->set_sensitive (false);
} else {
act->set_sensitive (true);
}
}
if (_session->config.get_video_pullup() == 0.0f) {
/* with no video pull up/down, any sync source is OK */
act->set_sensitive (true);
} else {
/* can't sync to JACK if video pullup != 0.0 */
if (_session->config.get_sync_source() == JACK) {
act->set_sensitive (false);
} else {
act->set_sensitive (true);
}
}
/* XXX should really be able to set the video pull up
action to insensitive/sensitive, but there is no action.
FIXME
*/
/* XXX should really be able to set the video pull up
action to insensitive/sensitive, but there is no action.
FIXME
*/
just_label:
if (act->get_sensitive ()) {
set_tip (sync_button, _("Enable/Disable external positional sync"));
} else {
set_tip (sync_button, _("Sync to JACK is not possible: video pull up/down is set"));
}
if (act->get_sensitive ()) {
set_tip (sync_button, _("Enable/Disable external positional sync"));
} else {
set_tip (sync_button, _("Sync to JACK is not possible: video pull up/down is set"));
}
}

View File

@ -1203,7 +1203,7 @@ AudioClock::field_button_press_event (GdkEventButton *ev, Field /*field*/)
ValueChanged (); /* EMIT_SIGNAL */
}
/* make absolutely sure that the pointer is grabbed */
/* make absolutely sure that the pointer is grabbed */
gdk_pointer_grab(ev->window,false ,
GdkEventMask( Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK),
NULL,NULL,ev->time);
@ -1910,10 +1910,10 @@ AudioClock::bbt_frame_from_display (nframes_t pos) const
any.bbt.beats = atoi (beats_label.get_text());
any.bbt.ticks = atoi (ticks_label.get_text());
if (is_duration) {
any.bbt.bars++;
any.bbt.beats++;
}
if (is_duration) {
any.bbt.bars++;
any.bbt.beats++;
}
nframes_t ret = _session->convert_to_frames_at (pos, any);
@ -2131,10 +2131,10 @@ AudioClock::on_style_changed (const Glib::RefPtr<Gtk::Style>& old_style)
void
AudioClock::set_is_duration (bool yn)
{
if (yn == is_duration) {
return;
}
if (yn == is_duration) {
return;
}
is_duration = yn;
set (last_when, true, 0, 's');
is_duration = yn;
set (last_when, true, 0, 's');
}

View File

@ -289,7 +289,7 @@ void
AudioRegionView::region_changed (const PropertyChange& what_changed)
{
ENSURE_GUI_THREAD (*this, &AudioRegionView::region_changed, what_changed);
// cerr << "AudioRegionView::region_changed() called" << endl;
// cerr << "AudioRegionView::region_changed() called" << endl;
RegionView::region_changed (what_changed);
@ -297,7 +297,7 @@ AudioRegionView::region_changed (const PropertyChange& what_changed)
region_scale_amplitude_changed ();
}
if (what_changed.contains (ARDOUR::Properties::fade_in)) {
fade_in_changed ();
fade_in_changed ();
}
if (what_changed.contains (ARDOUR::Properties::fade_out)) {
fade_out_changed ();
@ -1057,9 +1057,9 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
gain_line->view_to_model_coord (x, y);
/* XXX STATEFUL: can't convert to stateful diff until we
can represent automation data with it.
*/
/* XXX STATEFUL: can't convert to stateful diff until we
can represent automation data with it.
*/
trackview.session()->begin_reversible_command (_("add gain control point"));
XMLNode &before = audio_region()->envelope()->get_state();
@ -1236,8 +1236,8 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
void
AudioRegionView::entered (bool internal_editing)
{
trackview.editor().set_current_trimmable (_region);
trackview.editor().set_current_movable (_region);
trackview.editor().set_current_trimmable (_region);
trackview.editor().set_current_movable (_region);
if (gain_line && _flags & EnvelopeVisible) {
gain_line->show_all_control_points ();
@ -1252,8 +1252,8 @@ AudioRegionView::entered (bool internal_editing)
void
AudioRegionView::exited ()
{
trackview.editor().set_current_trimmable (boost::shared_ptr<Trimmable>());
trackview.editor().set_current_movable (boost::shared_ptr<Movable>());
trackview.editor().set_current_trimmable (boost::shared_ptr<Trimmable>());
trackview.editor().set_current_movable (boost::shared_ptr<Movable>());
if (gain_line) {
gain_line->hide_all_but_selected_control_points ();

View File

@ -463,9 +463,9 @@ AudioStreamView::setup_rec_box ()
if (src) {
sources.push_back (src);
src->PeakRangeReady.connect (rec_data_ready_connections,
invalidator (*this),
ui_bind (&AudioStreamView::rec_peak_range_ready, this, _1, _2, boost::weak_ptr<Source>(src)),
gui_context());
invalidator (*this),
ui_bind (&AudioStreamView::rec_peak_range_ready, this, _1, _2, boost::weak_ptr<Source>(src)),
gui_context());
}
}

View File

@ -108,7 +108,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session* sess, boost::sh
if (_route->panner()) {
_route->panner()->Changed.connect (*this, invalidator (*this),
boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false), gui_context());
boost::bind (&AudioTimeAxisView::ensure_pan_views, this, false), gui_context());
}
/* map current state of the route */
@ -196,9 +196,9 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
ensure_xml_node ();
ensure_pan_views (show);
} else if (param.type() == PluginAutomation) {
} else if (param.type() == PluginAutomation) {
/* handled elsewhere */
/* handled elsewhere */
} else {
error << "AudioTimeAxisView: unknown automation child " << EventTypeMap::instance().to_symbol(param) << endmsg;

View File

@ -131,18 +131,18 @@ AutomationController::start_touch()
void
AutomationController::end_touch ()
{
if (_controllable->automation_state() == Touch) {
if (_controllable->automation_state() == Touch) {
bool mark = false;
double when = 0;
bool mark = false;
double when = 0;
if (_controllable->session().transport_rolling()) {
mark = true;
when = _controllable->session().transport_frame();
}
if (_controllable->session().transport_rolling()) {
mark = true;
when = _controllable->session().transport_frame();
}
_controllable->stop_touch (mark, when);
}
_controllable->stop_touch (mark, when);
}
}
void

View File

@ -72,7 +72,7 @@ AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanv
_uses_gain_mapping = false;
no_draw = false;
_visible = true;
_is_boolean = false;
_is_boolean = false;
terminal_points_can_slide = true;
_height = 0;
@ -1129,10 +1129,10 @@ AutomationLine::set_list (boost::shared_ptr<ARDOUR::AutomationList> list)
void
AutomationLine::show_all_control_points ()
{
if (_is_boolean) {
// show the line but don't allow any control points
return;
}
if (_is_boolean) {
// show the line but don't allow any control points
return;
}
points_visible = true;

View File

@ -12,17 +12,17 @@ CanvasFlag::CanvasFlag (MidiRegionView& region,
guint fill_color_rgba,
double x,
double y)
: Group(parent, x, y)
, _text(0)
, _height(height)
, _outline_color_rgba(outline_color_rgba)
, _fill_color_rgba(fill_color_rgba)
, _region(region)
, _line(0)
, _rect(0)
: Group(parent, x, y)
, _text(0)
, _height(height)
, _outline_color_rgba(outline_color_rgba)
, _fill_color_rgba(fill_color_rgba)
, _region(region)
, _line(0)
, _rect(0)
{
/* XXX this connection is needed if ::on_event() is changed to actually do anything */
signal_event().connect (sigc::mem_fun (*this, &CanvasFlag::on_event));
/* XXX this connection is needed if ::on_event() is changed to actually do anything */
signal_event().connect (sigc::mem_fun (*this, &CanvasFlag::on_event));
}
void
@ -58,9 +58,9 @@ CanvasFlag::set_text(const string& a_text)
_rect->property_fill_color_rgba() = _fill_color_rgba;
_text->raise_to_top();
/* XXX these two connections are needed if ::on_event() is changed to actually do anything */
//_rect->signal_event().connect (sigc::mem_fun (*this, &CanvasFlag::on_event));
//_text->signal_event().connect (sigc::mem_fun (*this, &CanvasFlag::on_event));
/* XXX these two connections are needed if ::on_event() is changed to actually do anything */
//_rect->signal_event().connect (sigc::mem_fun (*this, &CanvasFlag::on_event));
//_text->signal_event().connect (sigc::mem_fun (*this, &CanvasFlag::on_event));
}
CanvasFlag::~CanvasFlag()
@ -71,18 +71,18 @@ CanvasFlag::~CanvasFlag()
bool
CanvasFlag::on_event(GdkEvent* /*ev*/)
{
/* XXX if you change this function to actually do anything, be sure
to fix the connections commented out elsewhere in this file.
*/
/* XXX if you change this function to actually do anything, be sure
to fix the connections commented out elsewhere in this file.
*/
return false;
}
void
CanvasFlag::set_height (double h)
{
_height = h;
_height = h;
if (_line) {
_line->property_y2() = _height;
}
if (_line) {
_line->property_y2() = _height;
}
}

View File

@ -14,21 +14,21 @@ CanvasHit::CanvasHit (MidiRegionView& region,
double size,
const boost::shared_ptr<NoteType> note,
bool with_events)
: Diamond(group, size)
, CanvasNoteEvent(region, this, note)
: Diamond(group, size)
, CanvasNoteEvent(region, this, note)
{
if (with_events) {
signal_event().connect (sigc::mem_fun (*this, &CanvasHit::on_event));
}
if (with_events) {
signal_event().connect (sigc::mem_fun (*this, &CanvasHit::on_event));
}
}
bool
CanvasHit::on_event(GdkEvent* ev)
{
if (!CanvasNoteEvent::on_event (ev)) {
return _region.get_time_axis_view().editor().canvas_note_event (ev, this);
if (!CanvasNoteEvent::on_event (ev)) {
return _region.get_time_axis_view().editor().canvas_note_event (ev, this);
}
return true;
return true;
}
void

View File

@ -53,14 +53,14 @@ CanvasNoteEvent::CanvasNoteEvent(MidiRegionView& region, Item* item, const boost
, _note(note)
, _selected(false)
, _valid (true)
, _mouse_x_fraction (-1.0)
, _mouse_y_fraction (-1.0)
, _mouse_x_fraction (-1.0)
, _mouse_y_fraction (-1.0)
{
}
CanvasNoteEvent::~CanvasNoteEvent()
{
CanvasNoteEventDeleted (this);
CanvasNoteEventDeleted (this);
if (_text) {
_text->hide();
@ -87,8 +87,8 @@ CanvasNoteEvent::show_velocity()
{
if (!_text) {
_text = new NoEventText (*(_item->property_parent()));
_text->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiNoteVelocityText.get();
_text->property_justification() = Gtk::JUSTIFY_CENTER;
_text->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiNoteVelocityText.get();
_text->property_justification() = Gtk::JUSTIFY_CENTER;
}
_text->property_x() = (x1() + x2()) /2;
@ -143,13 +143,13 @@ CanvasNoteEvent::show_channel_selector(void)
_channel_selector->channel_selected.connect(
sigc::mem_fun(this, &CanvasNoteEvent::on_channel_change));
_channel_selector->clicked.connect (
sigc::mem_fun (this, &CanvasNoteEvent::hide_channel_selector));
_channel_selector->clicked.connect (
sigc::mem_fun (this, &CanvasNoteEvent::hide_channel_selector));
_channel_selector_widget = new Widget(*(_item->property_parent()),
x1(),
y2() + 2,
(Gtk::Widget &) *_channel_selector);
x1(),
y2() + 2,
(Gtk::Widget &) *_channel_selector);
_channel_selector_widget->hide();
_channel_selector_widget->property_height() = 100;
@ -176,10 +176,10 @@ CanvasNoteEvent::set_selected(bool selected)
{
if (!_note) {
return;
}
}
_selected = selected;
set_fill_color (base_color ());
set_fill_color (base_color ());
if (_selected) {
set_outline_color(calculate_outline(ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get()));
@ -203,20 +203,20 @@ CanvasNoteEvent::base_color()
switch (mode) {
case TrackColor:
{
Gdk::Color color = _region.midi_stream_view()->get_region_color();
return UINT_INTERPOLATE (RGBA_TO_UINT(
SCALE_USHORT_TO_UINT8_T(color.get_red()),
SCALE_USHORT_TO_UINT8_T(color.get_green()),
SCALE_USHORT_TO_UINT8_T(color.get_blue()),
opacity),
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5);
}
{
Gdk::Color color = _region.midi_stream_view()->get_region_color();
return UINT_INTERPOLATE (RGBA_TO_UINT(
SCALE_USHORT_TO_UINT8_T(color.get_red()),
SCALE_USHORT_TO_UINT8_T(color.get_green()),
SCALE_USHORT_TO_UINT8_T(color.get_blue()),
opacity),
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5);
}
case ChannelColors:
return UINT_INTERPOLATE (UINT_RGBA_CHANGE_A (CanvasNoteEvent::midi_channel_colors[_note->channel()],
opacity),
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5);
return UINT_INTERPOLATE (UINT_RGBA_CHANGE_A (CanvasNoteEvent::midi_channel_colors[_note->channel()],
opacity),
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5);
default:
return meter_style_fill_color(_note->velocity(), selected());
@ -228,58 +228,58 @@ CanvasNoteEvent::base_color()
void
CanvasNoteEvent::set_mouse_fractions (GdkEvent* ev)
{
double ix, iy;
double bx1, bx2, by1, by2;
bool set_cursor = false;
double ix, iy;
double bx1, bx2, by1, by2;
bool set_cursor = false;
switch (ev->type) {
case GDK_MOTION_NOTIFY:
ix = ev->motion.x;
iy = ev->motion.y;
set_cursor = true;
break;
case GDK_ENTER_NOTIFY:
ix = ev->crossing.x;
iy = ev->crossing.y;
set_cursor = true;
break;
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
ix = ev->button.x;
iy = ev->button.y;
break;
default:
_mouse_x_fraction = -1.0;
_mouse_y_fraction = -1.0;
return;
}
case GDK_MOTION_NOTIFY:
ix = ev->motion.x;
iy = ev->motion.y;
set_cursor = true;
break;
case GDK_ENTER_NOTIFY:
ix = ev->crossing.x;
iy = ev->crossing.y;
set_cursor = true;
break;
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
ix = ev->button.x;
iy = ev->button.y;
break;
default:
_mouse_x_fraction = -1.0;
_mouse_y_fraction = -1.0;
return;
}
_item->get_bounds (bx1, by1, bx2, by2);
_item->w2i (ix, iy);
/* hmm, something wrong here. w2i should give item-local coordinates
but it doesn't. for now, finesse this.
*/
ix = ix - bx1;
iy = iy - by1;
_item->get_bounds (bx1, by1, bx2, by2);
_item->w2i (ix, iy);
/* hmm, something wrong here. w2i should give item-local coordinates
but it doesn't. for now, finesse this.
*/
ix = ix - bx1;
iy = iy - by1;
/* fraction of width/height */
double xf;
double yf;
bool notify = false;
/* fraction of width/height */
double xf;
double yf;
bool notify = false;
xf = ix / (bx2 - bx1);
yf = iy / (by2 - by1);
xf = ix / (bx2 - bx1);
yf = iy / (by2 - by1);
if (xf != _mouse_x_fraction || yf != _mouse_y_fraction) {
notify = true;
}
if (xf != _mouse_x_fraction || yf != _mouse_y_fraction) {
notify = true;
}
_mouse_x_fraction = xf;
_mouse_y_fraction = yf;
_mouse_x_fraction = xf;
_mouse_y_fraction = yf;
if (notify) {
_region.note_mouse_position (_mouse_x_fraction, _mouse_y_fraction, set_cursor);
}
if (notify) {
_region.note_mouse_position (_mouse_x_fraction, _mouse_y_fraction, set_cursor);
}
}
bool
@ -291,29 +291,29 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
switch (ev->type) {
case GDK_ENTER_NOTIFY:
set_mouse_fractions (ev);
set_mouse_fractions (ev);
_region.note_entered (this);
break;
case GDK_LEAVE_NOTIFY:
set_mouse_fractions (ev);
set_mouse_fractions (ev);
_region.note_left (this);
break;
case GDK_MOTION_NOTIFY:
set_mouse_fractions (ev);
break;
case GDK_MOTION_NOTIFY:
set_mouse_fractions (ev);
break;
case GDK_BUTTON_PRESS:
set_mouse_fractions (ev);
set_mouse_fractions (ev);
if (ev->button.button == 3 && Keyboard::no_modifiers_active (ev->button.state)) {
show_channel_selector();
show_channel_selector();
return true;
}
break;
case GDK_BUTTON_RELEASE:
set_mouse_fractions (ev);
set_mouse_fractions (ev);
if (ev->button.button == 3 && Keyboard::no_modifiers_active (ev->button.state)) {
return true;
}
@ -329,8 +329,8 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
bool
CanvasNoteEvent::mouse_near_ends () const
{
return (_mouse_x_fraction >= 0.0 && _mouse_x_fraction < 0.25) ||
(_mouse_x_fraction >= 0.75 && _mouse_x_fraction < 1.0);
return (_mouse_x_fraction >= 0.0 && _mouse_x_fraction < 0.25) ||
(_mouse_x_fraction >= 0.75 && _mouse_x_fraction < 1.0);
}
} // namespace Canvas

View File

@ -12,21 +12,21 @@ CanvasNote::CanvasNote (MidiRegionView& region,
Group& group,
const boost::shared_ptr<NoteType> note,
bool with_events)
: SimpleRect(group), CanvasNoteEvent(region, this, note)
: SimpleRect(group), CanvasNoteEvent(region, this, note)
{
if (with_events) {
signal_event().connect (sigc::mem_fun (*this, &CanvasNote::on_event));
}
if (with_events) {
signal_event().connect (sigc::mem_fun (*this, &CanvasNote::on_event));
}
}
bool
CanvasNote::on_event(GdkEvent* ev)
{
if (!CanvasNoteEvent::on_event (ev)) {
return _region.get_time_axis_view().editor().canvas_note_event (ev, this);
if (!CanvasNoteEvent::on_event (ev)) {
return _region.get_time_axis_view().editor().canvas_note_event (ev, this);
}
return true;
return true;
}
void

View File

@ -20,7 +20,7 @@ CanvasProgramChange::CanvasProgramChange(
double y,
string& model_name,
string& custom_device_mode,
double event_time,
double event_time,
uint8_t channel,
uint8_t program)
: CanvasFlag(
@ -113,27 +113,27 @@ CanvasProgramChange::on_event(GdkEvent* ev)
initialize_popup_menus();
_popup_initialized = true;
}
_popup.popup(ev->button.button, ev->button.time);
_popup.popup(ev->button.button, ev->button.time);
return true;
}
break;
case GDK_KEY_PRESS:
switch (ev->key.keyval) {
case GDK_Up:
case GDK_KP_Up:
case GDK_uparrow:
case GDK_KEY_PRESS:
switch (ev->key.keyval) {
case GDK_Up:
case GDK_KP_Up:
case GDK_uparrow:
_region.previous_program(*this);
break;
case GDK_Down:
case GDK_KP_Down:
case GDK_downarrow:
break;
case GDK_Down:
case GDK_KP_Down:
case GDK_downarrow:
_region.next_program(*this);
break;
default:
break;
}
break;
break;
default:
break;
}
break;
case GDK_SCROLL:
if (ev->scroll.direction == GDK_SCROLL_UP) {

View File

@ -423,10 +423,10 @@ CrossfadeEditor::point_event (GdkEvent* event, Point* point)
if (point == fade[current].points.front() || point == fade[current].points.back()) {
new_x = point->x;
new_y = point->y;
new_y = point->y;
} else {
new_x = (event->motion.x - canvas_border)/effective_width();
new_y = 1.0 - ((event->motion.y - canvas_border)/effective_height());
new_y = 1.0 - ((event->motion.y - canvas_border)/effective_height());
}
point->move_to (x_coordinate (new_x), y_coordinate (new_y),
@ -504,17 +504,17 @@ CrossfadeEditor::add_control_point (double x, double y)
void
CrossfadeEditor::Point::move_to (double nx, double ny, double xfract, double yfract)
{
if ( xfract < 0.0 ) {
xfract = 0.0;
} else if ( xfract > 1.0 ) {
xfract = 1.0;
}
if ( xfract < 0.0 ) {
xfract = 0.0;
} else if ( xfract > 1.0 ) {
xfract = 1.0;
}
if ( yfract < 0.0 ) {
yfract = 0.0;
} else if ( yfract > 1.0 ) {
yfract = 1.0;
}
if ( yfract < 0.0 ) {
yfract = 0.0;
} else if ( yfract > 1.0 ) {
yfract = 1.0;
}
const double half_size = rint(size/2.0);
double x1 = nx - half_size;
@ -873,7 +873,7 @@ CrossfadeEditor::reset ()
set (xfade->fade_in(), In);
set (xfade->fade_out(), Out);
curve_select_clicked (current);
curve_select_clicked (current);
}
void

View File

@ -150,7 +150,7 @@ EditNoteDialog::run ()
_region_view->apply_diff ();
_event->set_selected (_event->selected()); // change color
_event->set_selected (_event->selected()); // change color
return r;
}

View File

@ -217,20 +217,20 @@ show_me_the_size (Requisition* r, const char* what)
static void
pane_size_watcher (Paned* pane)
{
/* if the handle of a pane vanishes into (at least) the tabs of a notebook,
it is no longer accessible. so stop that. this doesn't happen on X11,
just the quartz backend.
/* if the handle of a pane vanishes into (at least) the tabs of a notebook,
it is no longer accessible. so stop that. this doesn't happen on X11,
just the quartz backend.
ugh.
*/
ugh.
*/
int max_width_of_lhs = GTK_WIDGET(pane->gobj())->allocation.width - 25;
int max_width_of_lhs = GTK_WIDGET(pane->gobj())->allocation.width - 25;
gint pos = pane->get_position ();
gint pos = pane->get_position ();
if (pos > max_width_of_lhs) {
pane->set_position (max_width_of_lhs);
}
if (pos > max_width_of_lhs) {
pane->set_position (max_width_of_lhs);
}
}
#endif
@ -362,7 +362,7 @@ Editor::Editor ()
_dragging_edit_point = false;
select_new_marker = false;
rhythm_ferret = 0;
layering_order_editor = 0;
layering_order_editor = 0;
_bundle_manager = 0;
no_save_visual = false;
resize_idle_id = -1;
@ -609,8 +609,8 @@ Editor::Editor ()
edit_pane.signal_size_allocate().connect (sigc::bind (sigc::mem_fun(*this, &Editor::pane_allocation_handler), static_cast<Paned*> (&edit_pane)));
#ifdef GTKOSX
Glib::PropertyProxy<int> proxy = edit_pane.property_position();
proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&edit_pane)));
Glib::PropertyProxy<int> proxy = edit_pane.property_position();
proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&edit_pane)));
#endif
top_hbox.pack_start (toolbar_frame, false, true);
@ -1085,7 +1085,7 @@ Editor::set_session (Session *t)
but use Gtkmm2ext::UI::instance()->call_slot();
*/
_session->StepEditStatusChange.connect (_session_connections, invalidator (*this), ui_bind(&Editor::step_edit_status_change, this, _1), gui_context());
_session->StepEditStatusChange.connect (_session_connections, invalidator (*this), ui_bind(&Editor::step_edit_status_change, this, _1), gui_context());
_session->TransportStateChange.connect (_session_connections, invalidator (*this), boost::bind (&Editor::map_transport_state, this), gui_context());
_session->PositionChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::map_position_change, this, _1), gui_context());
_session->RouteAdded.connect (_session_connections, invalidator (*this), ui_bind (&Editor::handle_new_route, this, _1), gui_context());
@ -1408,8 +1408,8 @@ Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type,
case RegionItem:
case RegionViewName:
case RegionViewNameHighlight:
case LeftFrameHandle:
case RightFrameHandle:
case LeftFrameHandle:
case RightFrameHandle:
if (!with_selection) {
if (region_edit_menu_split_item) {
if (clicked_regionview && clicked_regionview->region()->covers (get_preferred_edit_position())) {
@ -1528,9 +1528,9 @@ Editor::build_track_region_context_menu ()
mode and so offering region context is somewhat confusing.
*/
if ((tr = rtv->track()) && ((pl = tr->playlist())) && !internal_editing()) {
framepos_t const framepos = (framepos_t) floor ((double) get_preferred_edit_position() * tr->speed());
uint32_t regions_at = pl->count_regions_at (framepos);
add_region_context_items (edit_items, regions_at > 1);
framepos_t const framepos = (framepos_t) floor ((double) get_preferred_edit_position() * tr->speed());
uint32_t regions_at = pl->count_regions_at (framepos);
add_region_context_items (edit_items, regions_at > 1);
}
}
@ -1567,7 +1567,7 @@ Editor::build_track_crossfade_context_menu ()
framepos_t framepos = (framepos_t) floor ((double) get_preferred_edit_position() * tr->speed());
uint32_t regions_at = pl->count_regions_at (framepos);
add_region_context_items (edit_items, regions_at > 1);
add_region_context_items (edit_items, regions_at > 1);
}
}
@ -2106,7 +2106,7 @@ Editor::set_state (const XMLNode& node, int /*version*/)
if (_session && (prop = node.property ("playhead"))) {
framepos_t pos;
sscanf (prop->value().c_str(), "%" PRIi64, &pos);
sscanf (prop->value().c_str(), "%" PRIi64, &pos);
playhead_cursor->set_position (pos);
} else {
playhead_cursor->set_position (0);
@ -2194,17 +2194,17 @@ Editor::set_state (const XMLNode& node, int /*version*/)
}
}
if ((prop = node.property ("stationary-playhead"))) {
bool yn = (prop->value() == "yes");
set_stationary_playhead (yn);
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active() != yn) {
tact->set_active (yn);
}
}
}
if ((prop = node.property ("stationary-playhead"))) {
bool yn = (prop->value() == "yes");
set_stationary_playhead (yn);
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active() != yn) {
tact->set_active (yn);
}
}
}
if ((prop = node.property ("region-list-sort-type"))) {
RegionListSortType st;
@ -2329,7 +2329,7 @@ Editor::get_state ()
node->add_property ("show-measures", _show_measures ? "yes" : "no");
node->add_property ("follow-playhead", _follow_playhead ? "yes" : "no");
node->add_property ("stationary-playhead", _stationary_playhead ? "yes" : "no");
node->add_property ("stationary-playhead", _stationary_playhead ? "yes" : "no");
node->add_property ("xfades-visible", _xfade_visibility ? "yes" : "no");
node->add_property ("region-list-sort-type", enum_2_string (_regions->sort_type ()));
node->add_property ("mouse-mode", enum2str(mouse_mode));
@ -2711,13 +2711,13 @@ Editor::setup_toolbar ()
}
_mouse_mode_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
&_mouse_mode_tearoff->tearoff_window()));
&_mouse_mode_tearoff->tearoff_window()));
_mouse_mode_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
&_mouse_mode_tearoff->tearoff_window(), 1));
&_mouse_mode_tearoff->tearoff_window(), 1));
_mouse_mode_tearoff->Hidden.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
&_mouse_mode_tearoff->tearoff_window()));
&_mouse_mode_tearoff->tearoff_window()));
_mouse_mode_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
&_mouse_mode_tearoff->tearoff_window(), 1));
&_mouse_mode_tearoff->tearoff_window(), 1));
mouse_move_button.set_mode (false);
mouse_select_button.set_mode (false);
@ -2844,13 +2844,13 @@ Editor::setup_toolbar ()
}
_tools_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
&_tools_tearoff->tearoff_window()));
&_tools_tearoff->tearoff_window()));
_tools_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
&_tools_tearoff->tearoff_window(), 0));
&_tools_tearoff->tearoff_window(), 0));
_tools_tearoff->Hidden.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
&_tools_tearoff->tearoff_window()));
&_tools_tearoff->tearoff_window()));
_tools_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
&_tools_tearoff->tearoff_window(), 0));
&_tools_tearoff->tearoff_window(), 0));
toolbar_hbox.set_spacing (10);
toolbar_hbox.set_border_width (1);
@ -3250,8 +3250,8 @@ Editor::show_verbose_canvas_cursor_with (const string & txt, int32_t xoffset, in
track_canvas->get_pointer (x, y);
track_canvas->window_to_world (x, y, wx, wy);
wx += xoffset;
wy += yoffset;
wx += xoffset;
wy += yoffset;
/* don't get too close to the edge */
verbose_canvas_cursor->property_x() = clamp_verbose_cursor_x (wx);
@ -3648,24 +3648,24 @@ Editor::set_follow_playhead (bool yn)
void
Editor::toggle_stationary_playhead ()
{
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
set_stationary_playhead (tact->get_active());
}
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
set_stationary_playhead (tact->get_active());
}
}
void
Editor::set_stationary_playhead (bool yn)
{
if (_stationary_playhead != yn) {
if ((_stationary_playhead = yn) == true) {
/* catch up */
// FIXME need a 3.0 equivalent of this 2.X call
// update_current_screen ();
}
instant_save ();
}
if (_stationary_playhead != yn) {
if ((_stationary_playhead = yn) == true) {
/* catch up */
// FIXME need a 3.0 equivalent of this 2.X call
// update_current_screen ();
}
instant_save ();
}
}
void
@ -4527,7 +4527,7 @@ Editor::get_regions_after (RegionSelection& rs, framepos_t where, const TrackVie
if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
Playlist::RegionList* regions = pl->regions_touched (
(framepos_t) floor ( (double)where * tr->speed()), max_framepos);
(framepos_t) floor ( (double)where * tr->speed()), max_framepos);
for (Playlist::RegionList::iterator i = regions->begin(); i != regions->end(); ++i) {
@ -4742,7 +4742,7 @@ Editor::idle_resize ()
}
}
_pending_resize_amount = 0;
_pending_resize_amount = 0;
flush_canvas ();
_group_tabs->set_dirty ();
resize_idle_id = -1;
@ -5023,11 +5023,11 @@ Editor::show_region_in_region_list ()
void
Editor::step_edit_status_change (bool yn)
{
if (yn) {
start_step_editing ();
} else {
stop_step_editing ();
}
if (yn) {
start_step_editing ();
} else {
stop_step_editing ();
}
}
void
@ -5208,33 +5208,33 @@ Editor::super_rapid_screen_update ()
playhead_cursor->set_position (frame);
}
if (!_stationary_playhead) {
if (!_stationary_playhead) {
if (!_dragging_playhead && _follow_playhead && _session->requested_return_frame() < 0) {
reset_x_origin_to_follow_playhead ();
}
if (!_dragging_playhead && _follow_playhead && _session->requested_return_frame() < 0) {
reset_x_origin_to_follow_playhead ();
}
} else {
} else {
/* don't do continuous scroll till the new position is in the rightmost quarter of the
editor canvas
*/
/* don't do continuous scroll till the new position is in the rightmost quarter of the
editor canvas
*/
#if 0
// FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code
double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_unit;
if (target <= 0.0) {
target = 0.0;
}
if (fabs(target - current) < current_page_frames() / frames_per_unit) {
target = (target * 0.15) + (current * 0.85);
} else {
/* relax */
}
// FIXME DO SOMETHING THAT WORKS HERE - this is 2.X code
double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_unit;
if (target <= 0.0) {
target = 0.0;
}
if (fabs(target - current) < current_page_frames() / frames_per_unit) {
target = (target * 0.15) + (current * 0.85);
} else {
/* relax */
}
current = target;
set_horizontal_position (current);
current = target;
set_horizontal_position (current);
#endif
}
}
}
}
@ -5328,31 +5328,31 @@ Editor::change_region_layering_order ()
{
framepos_t const position = get_preferred_edit_position ();
if (!clicked_routeview) {
if (layering_order_editor) {
layering_order_editor->hide ();
}
if (!clicked_routeview) {
if (layering_order_editor) {
layering_order_editor->hide ();
}
return;
}
boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (clicked_routeview->route());
boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (clicked_routeview->route());
if (!track) {
return;
}
if (!track) {
return;
}
boost::shared_ptr<Playlist> pl = track->playlist();
if (!pl) {
return;
}
return;
}
if (layering_order_editor == 0) {
layering_order_editor = new RegionLayeringOrderEditor(*this);
}
if (layering_order_editor == 0) {
layering_order_editor = new RegionLayeringOrderEditor(*this);
}
layering_order_editor->set_context (clicked_routeview->name(), _session, pl, position);
layering_order_editor->maybe_present ();
layering_order_editor->set_context (clicked_routeview->name(), _session, pl, position);
layering_order_editor->maybe_present ();
}
void

View File

@ -207,7 +207,7 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "track-record-enable-toggle", _("Toggle Record Enable"), sigc::mem_fun(*this, &Editor::toggle_record_enable));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
for (int i = 1; i <= 12; ++i) {
string const a = string_compose (X_("save-visual-state-%1"), i);
@ -267,23 +267,23 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "move-selected-tracks-up", _("Move Selected Tracks Up"), sigc::bind (sigc::mem_fun(*_routes, &EditorRoutes::move_selected_tracks), true));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "move-selected-tracks-down", _("Move Selected Tracks Down"), sigc::bind (sigc::mem_fun(*_routes, &EditorRoutes::move_selected_tracks), false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "scroll-tracks-up", _("Scroll Tracks Up"), sigc::mem_fun(*this, &Editor::scroll_tracks_up));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "scroll-tracks-down", _("Scroll Tracks Down"), sigc::mem_fun(*this, &Editor::scroll_tracks_down));
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "step-tracks-up", _("Step Tracks Up"), sigc::mem_fun(*this, &Editor::scroll_tracks_up_line));
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "step-tracks-down", _("Step Tracks Down"), sigc::mem_fun(*this, &Editor::scroll_tracks_down_line));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "scroll-backward", _("Scroll Backward"), sigc::bind (sigc::mem_fun(*this, &Editor::scroll_backward), 0.8f));
ActionManager::session_sensitive_actions.push_back (act);
@ -397,7 +397,7 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "remove-last-capture", _("Remove Last Capture"), (sigc::mem_fun(*this, &Editor::remove_last_capture)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::register_toggle_action (editor_actions, "toggle-stationary-playhead", _("Stationary Playhead"), (mem_fun(*this, &Editor::toggle_stationary_playhead)));
ActionManager::register_toggle_action (editor_actions, "toggle-stationary-playhead", _("Stationary Playhead"), (mem_fun(*this, &Editor::toggle_stationary_playhead)));
act = ActionManager::register_action (editor_actions, "insert-time", _("Insert Time"), (sigc::mem_fun(*this, &Editor::do_insert_time)));
ActionManager::session_sensitive_actions.push_back (act);
@ -416,7 +416,7 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "fit-tracks", _("Fit Selected Tracks"), sigc::mem_fun(*this, &Editor::fit_selected_tracks));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "track-height-largest", _("Largest"), sigc::bind (
sigc::mem_fun(*this, &Editor::set_track_height), HeightLargest));
ActionManager::session_sensitive_actions.push_back (act);
@ -933,38 +933,38 @@ Editor::cycle_snap_choice()
set_snap_to (Editing::SnapToBeatDiv28);
break;
case Editing::SnapToBeatDiv28:
set_snap_to (Editing::SnapToBeatDiv24);
break;
set_snap_to (Editing::SnapToBeatDiv24);
break;
case Editing::SnapToBeatDiv24:
set_snap_to (Editing::SnapToBeatDiv20);
break;
set_snap_to (Editing::SnapToBeatDiv20);
break;
case Editing::SnapToBeatDiv20:
set_snap_to (Editing::SnapToBeatDiv16);
break;
set_snap_to (Editing::SnapToBeatDiv16);
break;
case Editing::SnapToBeatDiv16:
set_snap_to (Editing::SnapToBeatDiv14);
break;
case Editing::SnapToBeatDiv14:
set_snap_to (Editing::SnapToBeatDiv12);
break;
set_snap_to (Editing::SnapToBeatDiv12);
break;
case Editing::SnapToBeatDiv12:
set_snap_to (Editing::SnapToBeatDiv10);
break;
set_snap_to (Editing::SnapToBeatDiv10);
break;
case Editing::SnapToBeatDiv10:
set_snap_to (Editing::SnapToBeatDiv8);
break;
set_snap_to (Editing::SnapToBeatDiv8);
break;
case Editing::SnapToBeatDiv8:
set_snap_to (Editing::SnapToBeatDiv7);
break;
case Editing::SnapToBeatDiv7:
set_snap_to (Editing::SnapToBeatDiv6);
break;
set_snap_to (Editing::SnapToBeatDiv6);
break;
case Editing::SnapToBeatDiv6:
set_snap_to (Editing::SnapToBeatDiv5);
break;
set_snap_to (Editing::SnapToBeatDiv5);
break;
case Editing::SnapToBeatDiv5:
set_snap_to (Editing::SnapToBeatDiv4);
break;
set_snap_to (Editing::SnapToBeatDiv4);
break;
case Editing::SnapToBeatDiv4:
set_snap_to (Editing::SnapToBeatDiv3);
break;

View File

@ -221,11 +221,11 @@ Editor::check_whether_and_how_to_import(string path, bool all_or_nothing)
SourceMap all_sources = _session->get_sources();
bool already_exists = false;
uint32_t existing;
uint32_t existing;
if ((existing = _session->count_sources_by_origin (path)) > 0) {
already_exists = true;
}
if ((existing = _session->count_sources_by_origin (path)) > 0) {
already_exists = true;
}
int function = 1;
@ -329,7 +329,7 @@ Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode
boost::shared_ptr<Track> track;
vector<string> to_import;
int nth = 0;
bool use_timestamp = (pos == -1);
bool use_timestamp = (pos == -1);
current_interthread_info = &import_status;
import_status.current = 1;
@ -358,17 +358,17 @@ Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode
if (cancel) {
ok = false;
} else {
ipw.show ();
ipw.show ();
ok = (import_sndfiles (paths, mode, quality, pos, 1, 1, track, false) == 0);
}
} else {
bool replace = false;
bool replace = false;
for (vector<string>::iterator a = paths.begin(); a != paths.end(); ++a) {
const int check = check_whether_and_how_to_import (*a, true);
const int check = check_whether_and_how_to_import (*a, true);
switch (check) {
case 2:
@ -386,48 +386,48 @@ Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode
/* NOTREACHED*/
}
/* have to reset this for every file we handle */
/* have to reset this for every file we handle */
if (use_timestamp) {
pos = -1;
}
if (use_timestamp) {
pos = -1;
}
ipw.show ();
ipw.show ();
switch (chns) {
case Editing::ImportDistinctFiles:
switch (chns) {
case Editing::ImportDistinctFiles:
to_import.clear ();
to_import.push_back (*a);
to_import.clear ();
to_import.push_back (*a);
if (mode == Editing::ImportToTrack) {
track = get_nth_selected_audio_track (nth++);
}
if (mode == Editing::ImportToTrack) {
track = get_nth_selected_audio_track (nth++);
}
ok = (import_sndfiles (to_import, mode, quality, pos, 1, -1, track, replace) == 0);
break;
ok = (import_sndfiles (to_import, mode, quality, pos, 1, -1, track, replace) == 0);
break;
case Editing::ImportDistinctChannels:
case Editing::ImportDistinctChannels:
to_import.clear ();
to_import.push_back (*a);
to_import.clear ();
to_import.push_back (*a);
ok = (import_sndfiles (to_import, mode, quality, pos, -1, -1, track, replace) == 0);
break;
ok = (import_sndfiles (to_import, mode, quality, pos, -1, -1, track, replace) == 0);
break;
case Editing::ImportSerializeFiles:
case Editing::ImportSerializeFiles:
to_import.clear ();
to_import.push_back (*a);
to_import.clear ();
to_import.push_back (*a);
ok = (import_sndfiles (to_import, mode, quality, pos, 1, 1, track, replace) == 0);
break;
ok = (import_sndfiles (to_import, mode, quality, pos, 1, 1, track, replace) == 0);
break;
case Editing::ImportMergeFiles:
// Not entered, handled in earlier if() branch
break;
}
}
case Editing::ImportMergeFiles:
// Not entered, handled in earlier if() branch
break;
}
}
}
if (ok) {
@ -480,7 +480,7 @@ Editor::do_embed (vector<string> paths, ImportDisposition chns, ImportMode mode,
if (embed_sndfiles (paths, multi, check_sample_rate, mode, pos, 1, 1, track) < -1) {
goto out;
}
break;
break;
case Editing::ImportSerializeFiles:
for (vector<string>::iterator a = paths.begin(); a != paths.end(); ++a) {
@ -712,11 +712,11 @@ Editor::add_sources (vector<string> paths, SourceList& sources, framepos_t& pos,
region_name = region_name_from_path (paths.front(), (sources.size() > 1), false);
/* we checked in import_sndfiles() that there were not too many */
/* we checked in import_sndfiles() that there were not too many */
while (RegionFactory::region_by_name (region_name)) {
region_name = bump_name_once (region_name, '.');
}
while (RegionFactory::region_by_name (region_name)) {
region_name = bump_name_once (region_name, '.');
}
PropertyList plist;
@ -787,49 +787,48 @@ Editor::add_sources (vector<string> paths, SourceList& sources, framepos_t& pos,
}
int n = 0;
framepos_t rlen = 0;
framepos_t rlen = 0;
for (vector<boost::shared_ptr<Region> >::iterator r = regions.begin(); r != regions.end(); ++r, ++n) {
for (vector<boost::shared_ptr<Region> >::iterator r = regions.begin(); r != regions.end(); ++r, ++n) {
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*r);
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*r);
if (use_timestamp && ar) {
if (use_timestamp && ar) {
/* get timestamp for this region */
/* get timestamp for this region */
const boost::shared_ptr<Source> s (ar->sources().front());
const boost::shared_ptr<AudioSource> as = boost::dynamic_pointer_cast<AudioSource> (s);
const boost::shared_ptr<Source> s (ar->sources().front());
const boost::shared_ptr<AudioSource> as = boost::dynamic_pointer_cast<AudioSource> (s);
assert (as);
assert (as);
if (as->natural_position() != 0) {
pos = as->natural_position();
} else if (target_tracks == 1) {
/* hmm, no timestamp available, put it after the previous region
*/
if (n == 0) {
pos = get_preferred_edit_position ();
} else {
pos += rlen;
}
} else {
pos = get_preferred_edit_position ();
}
if (as->natural_position() != 0) {
pos = as->natural_position();
} else if (target_tracks == 1) {
/* hmm, no timestamp available, put it after the previous region
*/
if (n == 0) {
pos = get_preferred_edit_position ();
} else {
pos += rlen;
}
} else {
pos = get_preferred_edit_position ();
}
}
}
finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track);
rlen = (*r)->length();
rlen = (*r)->length();
if (target_tracks != 1) {
track.reset ();
} else {
if (!use_timestamp || !ar) {
/* line each one up right after the other */
pos += (*r)->length();
}
}
if (target_tracks != 1) {
track.reset ();
} else {
if (!use_timestamp || !ar) {
/* line each one up right after the other */
pos += (*r)->length();
}
}
}
/* setup peak file building in another thread */

View File

@ -747,7 +747,7 @@ Editor::stop_canvas_autoscroll ()
bool
Editor::left_track_canvas (GdkEventCrossing */*ev*/)
{
DropDownKeys ();
DropDownKeys ();
set_entered_track (0);
set_entered_regionview (0);
reset_canvas_action_sensitivity (false);
@ -928,9 +928,9 @@ Editor::horizontal_position () const
void
Editor::set_canvas_cursor (Gdk::Cursor* cursor, bool save)
{
if (save) {
current_canvas_cursor = cursor;
}
if (save) {
current_canvas_cursor = cursor;
}
if (is_drawable()) {
track_canvas->get_window()->set_cursor (*cursor);

View File

@ -773,13 +773,13 @@ Editor::canvas_frame_handle_event (GdkEvent* event, ArdourCanvas::Item* item, Re
perspective. XXX change this ??
*/
ItemType type;
ItemType type;
if (item->get_data ("isleft")) {
type = LeftFrameHandle;
} else {
type = RightFrameHandle;
}
if (item->get_data ("isleft")) {
type = LeftFrameHandle;
} else {
type = RightFrameHandle;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
@ -839,7 +839,7 @@ Editor::canvas_region_view_name_highlight_event (GdkEvent* event, ArdourCanvas::
break;
case GDK_MOTION_NOTIFY:
motion_handler (item, event);
ret = true; // force this to avoid progagating the event into the regionview
ret = true; // force this to avoid progagating the event into the regionview
break;
case GDK_ENTER_NOTIFY:
set_entered_regionview (rv);

View File

@ -84,7 +84,7 @@ EditorCursor::set_length (double units)
void
EditorCursor::set_y_axis (double position)
{
points.front().set_y (position);
points.front().set_y (position);
points.back().set_y (position + length);
canvas_item.property_points() = points;
}

View File

@ -226,8 +226,8 @@ Drag::start_grab (GdkEvent* event, Gdk::Cursor *cursor)
_last_pointer_y = _grab_y;
_item->grab (Gdk::POINTER_MOTION_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK,
*cursor,
event->button.time);
*cursor,
event->button.time);
if (_editor->session() && _editor->session()->transport_rolling()) {
_was_rolling = true;
@ -375,8 +375,8 @@ RegionDrag::RegionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<Re
}
}
/* the list of views can be empty at this point if this is a region list-insert drag
*/
/* the list of views can be empty at this point if this is a region list-insert drag
*/
for (list<RegionView*>::const_iterator i = v.begin(); i != v.end(); ++i) {
_views.push_back (DraggingView (*i, this));
@ -1011,7 +1011,7 @@ RegionMoveDrag::finished_no_copy (
if (_views.empty()) {
break;
break;
} else {
i = _views.begin();
}
@ -1220,7 +1220,7 @@ RegionInsertDrag::finished (GdkEvent *, bool)
boost::shared_ptr<Playlist> playlist = dest_rtv->playlist();
_editor->begin_reversible_command (_("insert region"));
playlist->clear_changes ();
playlist->clear_changes ();
playlist->add_region (_primary->region (), _last_frame_position);
_editor->session()->add_command (new StatefulDiffCommand (playlist));
_editor->commit_reversible_command ();
@ -1348,46 +1348,46 @@ void
RegionCreateDrag::motion (GdkEvent* event, bool first_move)
{
if (first_move) {
add_region();
add_region();
} else {
if (_region) {
framepos_t const f = adjusted_current_frame (event);
if (f < grab_frame()) {
_region->set_position (f, this);
}
if (_region) {
framepos_t const f = adjusted_current_frame (event);
if (f < grab_frame()) {
_region->set_position (f, this);
}
/* again, don't use a zero-length region (see above) */
framecnt_t const len = abs (f - grab_frame ());
_region->set_length (len < 1 ? 1 : len, this);
}
}
/* again, don't use a zero-length region (see above) */
framecnt_t const len = abs (f - grab_frame ());
_region->set_length (len < 1 ? 1 : len, this);
}
}
}
void
RegionCreateDrag::finished (GdkEvent*, bool movement_occurred)
{
if (!movement_occurred) {
add_region ();
add_region ();
}
if (_region) {
_editor->commit_reversible_command ();
}
if (_region) {
_editor->commit_reversible_command ();
}
}
void
RegionCreateDrag::add_region ()
{
if (_editor->session()) {
const TempoMap& map (_editor->session()->tempo_map());
framecnt_t pos = grab_frame();
const Meter& m = map.meter_at (pos);
/* not that the frame rate used here can be affected by pull up/down which
might be wrong.
*/
framecnt_t len = m.frames_per_bar (map.tempo_at (pos), _editor->session()->frame_rate());
_region = _view->add_region (grab_frame(), len, false);
}
if (_editor->session()) {
const TempoMap& map (_editor->session()->tempo_map());
framecnt_t pos = grab_frame();
const Meter& m = map.meter_at (pos);
/* not that the frame rate used here can be affected by pull up/down which
might be wrong.
*/
framecnt_t len = m.frames_per_bar (map.tempo_at (pos), _editor->session()->frame_rate());
_region = _view->add_region (grab_frame(), len, false);
}
}
void
@ -1408,13 +1408,13 @@ NoteResizeDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*ignored*/)
{
Gdk::Cursor* cursor;
ArdourCanvas::CanvasNote* cnote = dynamic_cast<ArdourCanvas::CanvasNote*>(_item);
float x_fraction = cnote->mouse_x_fraction ();
float x_fraction = cnote->mouse_x_fraction ();
if (x_fraction > 0.0 && x_fraction < 0.25) {
cursor = _editor->cursors()->left_side_trim;
} else {
cursor = _editor->cursors()->right_side_trim;
}
if (x_fraction > 0.0 && x_fraction < 0.25) {
cursor = _editor->cursors()->left_side_trim;
} else {
cursor = _editor->cursors()->right_side_trim;
}
Drag::start_grab (event, cursor);
@ -1534,18 +1534,18 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
_operation = ContentsTrim;
Drag::start_grab (event, _editor->cursors()->trimmer);
Drag::start_grab (event, _editor->cursors()->trimmer);
} else {
/* These will get overridden for a point trim.*/
if (pf < (region_start + region_length/2)) {
/* closer to start */
_operation = StartTrim;
Drag::start_grab (event, _editor->cursors()->left_side_trim);
Drag::start_grab (event, _editor->cursors()->left_side_trim);
} else {
/* closer to end */
_operation = EndTrim;
Drag::start_grab (event, _editor->cursors()->right_side_trim);
}
Drag::start_grab (event, _editor->cursors()->right_side_trim);
}
}
switch (_operation) {
@ -1607,7 +1607,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
RegionView* rv = i->view;
rv->fake_set_opaque (false);
rv->enable_display (false);
rv->region()->clear_changes ();
rv->region()->clear_changes ();
AudioRegionView* const arv = dynamic_cast<AudioRegionView*> (rv);
@ -1699,9 +1699,9 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
i->view->thaw_after_trim ();
i->view->enable_display (true);
i->view->fake_set_opaque (true);
if (_have_transaction) {
_editor->session()->add_command (new StatefulDiffCommand (i->view->region()));
}
if (_have_transaction) {
_editor->session()->add_command (new StatefulDiffCommand (i->view->region()));
}
}
}
for (set<boost::shared_ptr<Playlist> >::iterator p = _editor->motion_frozen_playlists.begin(); p != _editor->motion_frozen_playlists.end(); ++p) {
@ -3229,7 +3229,7 @@ SelectionDrag::motion (GdkEvent* event, bool first_move)
if (_copy) {
/* adding to the selection */
_editor->set_selected_track_as_side_effect (Selection::Add);
_editor->set_selected_track_as_side_effect (Selection::Add);
//_editor->selection->add (_editor->clicked_axisview);
_editor->clicked_selection = _editor->selection->add (start, end);
_copy = false;
@ -3237,8 +3237,8 @@ SelectionDrag::motion (GdkEvent* event, bool first_move)
/* new selection */
if (_editor->clicked_axisview && !_editor->selection->selected (_editor->clicked_axisview)) {
//_editor->selection->set (_editor->clicked_axisview);
_editor->set_selected_track_as_side_effect (Selection::Set);
//_editor->selection->set (_editor->clicked_axisview);
_editor->set_selected_track_as_side_effect (Selection::Set);
}
_editor->clicked_selection = _editor->selection->set (start, end);
@ -3247,7 +3247,7 @@ SelectionDrag::motion (GdkEvent* event, bool first_move)
/* select the track that we're in */
if (find (_added_time_axes.begin(), _added_time_axes.end(), pending_time_axis.first) == _added_time_axes.end()) {
// _editor->set_selected_track_as_side_effect (Selection::Add);
// _editor->set_selected_track_as_side_effect (Selection::Add);
_editor->selection->add (pending_time_axis.first);
_added_time_axes.push_back (pending_time_axis.first);
}
@ -3383,7 +3383,7 @@ RangeMarkerBarDrag::RangeMarkerBarDrag (Editor* e, ArdourCanvas::Item* i, Operat
DEBUG_TRACE (DEBUG::Drags, "New RangeMarkerBarDrag\n");
_drag_rect = new ArdourCanvas::SimpleRect (*_editor->time_line_group, 0.0, 0.0, 0.0,
physical_screen_height (_editor->get_window()));
physical_screen_height (_editor->get_window()));
_drag_rect->hide ();
_drag_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeDragRect.get();
@ -3742,9 +3742,9 @@ NoteDrag::total_dy () const
}
}
/* more positive value = higher pitch and higher y-axis position on track,
which is the inverse of the X-centric geometric universe
*/
/* more positive value = higher pitch and higher y-axis position on track,
which is the inverse of the X-centric geometric universe
*/
return -ndy;
}
@ -3764,16 +3764,16 @@ NoteDrag::motion (GdkEvent *, bool)
_cumulative_dx += tdx;
_cumulative_dy += tdy;
int8_t note_delta = total_dy();
int8_t note_delta = total_dy();
_region->move_selection (tdx, tdy, note_delta);
char buf[12];
snprintf (buf, sizeof (buf), "%s (%d)", Evoral::midi_note_name (_primary->note()->note() + note_delta).c_str(),
(int) floor (_primary->note()->note() + note_delta));
char buf[12];
snprintf (buf, sizeof (buf), "%s (%d)", Evoral::midi_note_name (_primary->note()->note() + note_delta).c_str(),
(int) floor (_primary->note()->note() + note_delta));
_editor->show_verbose_canvas_cursor_with (buf);
}
}
}
void

View File

@ -209,9 +209,9 @@ Editor::write_region (string path, boost::shared_ptr<AudioRegion> region)
try {
fs = boost::dynamic_pointer_cast<AudioFileSource> (
SourceFactory::createWritable (DataType::AUDIO, *_session,
path, string(), true,
false, _session->frame_rate()));
SourceFactory::createWritable (DataType::AUDIO, *_session,
path, string(), true,
false, _session->frame_rate()));
}
catch (failed_constructor& err) {
@ -348,9 +348,9 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
try {
fs = boost::dynamic_pointer_cast<AudioFileSource> (
SourceFactory::createWritable (DataType::AUDIO, *_session,
path, string(), true,
false, _session->frame_rate()));
SourceFactory::createWritable (DataType::AUDIO, *_session,
path, string(), true,
false, _session->frame_rate()));
}
catch (failed_constructor& err) {

View File

@ -185,48 +185,48 @@ Editor::set_selected_mixer_strip (TimeAxisView& view)
}
// if this is an automation track, then we shold the mixer strip should
// show the parent
// if this is an automation track, then we shold the mixer strip should
// show the parent
boost::shared_ptr<ARDOUR::Route> route;
AutomationTimeAxisView* atv;
boost::shared_ptr<ARDOUR::Route> route;
AutomationTimeAxisView* atv;
if ((atv = dynamic_cast<AutomationTimeAxisView*>(&view)) != 0) {
if ((atv = dynamic_cast<AutomationTimeAxisView*>(&view)) != 0) {
AudioTimeAxisView *parent = dynamic_cast<AudioTimeAxisView*>(view.get_parent());
AudioTimeAxisView *parent = dynamic_cast<AudioTimeAxisView*>(view.get_parent());
if (parent) {
route = parent->route ();
}
if (parent) {
route = parent->route ();
}
} else {
} else {
AudioTimeAxisView* at = dynamic_cast<AudioTimeAxisView*> (&view);
AudioTimeAxisView* at = dynamic_cast<AudioTimeAxisView*> (&view);
if (at) {
route = at->route();
} else {
MidiTimeAxisView* mt = dynamic_cast<MidiTimeAxisView*> (&view);
if (mt) {
route = mt->route();
}
}
}
if (at) {
route = at->route();
} else {
MidiTimeAxisView* mt = dynamic_cast<MidiTimeAxisView*> (&view);
if (mt) {
route = mt->route();
}
}
}
if (current_mixer_strip->route() == route) {
return;
}
if (route) {
current_mixer_strip->set_route (route);
current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this);
}
if (route) {
current_mixer_strip->set_route (route);
current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this);
}
}
void
Editor::current_mixer_strip_hidden ()
{
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
if (act) {
Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
tact->set_active (false);

View File

@ -200,10 +200,10 @@ Editor::which_grabber_cursor ()
c = _cursors->grabber_edit_point;
break;
default:
boost::shared_ptr<Movable> m = _movable.lock();
if (m && m->locked()) {
c = _cursors->speaker;
}
boost::shared_ptr<Movable> m = _movable.lock();
if (m && m->locked()) {
c = _cursors->speaker;
}
break;
}
}
@ -214,24 +214,23 @@ Editor::which_grabber_cursor ()
void
Editor::set_current_trimmable (boost::shared_ptr<Trimmable> t)
{
boost::shared_ptr<Trimmable> st = _trimmable.lock();
boost::shared_ptr<Trimmable> st = _trimmable.lock();
if (!st || st == t) {
_trimmable = t;
set_canvas_cursor ();
}
if (!st || st == t) {
_trimmable = t;
set_canvas_cursor ();
}
}
void
Editor::set_current_movable (boost::shared_ptr<Movable> m)
{
boost::shared_ptr<Movable> sm = _movable.lock();
boost::shared_ptr<Movable> sm = _movable.lock();
if (!sm || sm != m) {
_movable = m;
set_canvas_cursor ();
}
if (!sm || sm != m) {
_movable = m;
set_canvas_cursor ();
}
}
void
@ -310,7 +309,7 @@ Editor::set_canvas_cursor ()
}
}
set_canvas_cursor (current_canvas_cursor, true);
set_canvas_cursor (current_canvas_cursor, true);
}
void
@ -371,31 +370,31 @@ Editor::mouse_mode_toggled (MouseMode m)
instant_save ();
if (!internal_editing()) {
if (mouse_mode != MouseRange && _join_object_range_state == JOIN_OBJECT_RANGE_NONE) {
if (!internal_editing()) {
if (mouse_mode != MouseRange && _join_object_range_state == JOIN_OBJECT_RANGE_NONE) {
/* in all modes except range and joined object/range, hide the range selection,
show the object (region) selection.
*/
/* in all modes except range and joined object/range, hide the range selection,
show the object (region) selection.
*/
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
(*i)->set_should_show_selection (true);
}
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->hide_selection ();
}
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
(*i)->set_should_show_selection (true);
}
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->hide_selection ();
}
} else {
} else {
/*
in range or object/range mode, show the range selection.
*/
/*
in range or object/range mode, show the range selection.
*/
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
(*i)->show_selection (selection->time);
}
}
}
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
(*i)->show_selection (selection->time);
}
}
}
set_canvas_cursor ();
@ -523,8 +522,8 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp
case RegionViewNameHighlight:
case RegionViewName:
case LeftFrameHandle:
case RightFrameHandle:
case LeftFrameHandle:
case RightFrameHandle:
if (mouse_mode != MouseRange || _join_object_range_state == JOIN_OBJECT_RANGE_OBJECT) {
set_selected_regionview_from_click (press, op, true);
} else if (event->type == GDK_BUTTON_PRESS) {
@ -710,45 +709,45 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
}
break;
case NoteItem:
if (internal_editing()) {
/* trim notes if we're in internal edit mode and near the ends of the note */
ArdourCanvas::CanvasNote* cn = dynamic_cast<ArdourCanvas::CanvasNote*> (item);
cerr << "NoteItem button press, cursor = " << current_canvas_cursor << endl;
if (cn->mouse_near_ends()) {
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
} else {
_drags->set (new NoteDrag (this, item), event);
}
}
case NoteItem:
if (internal_editing()) {
/* trim notes if we're in internal edit mode and near the ends of the note */
ArdourCanvas::CanvasNote* cn = dynamic_cast<ArdourCanvas::CanvasNote*> (item);
cerr << "NoteItem button press, cursor = " << current_canvas_cursor << endl;
if (cn->mouse_near_ends()) {
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
} else {
_drags->set (new NoteDrag (this, item), event);
}
}
return true;
case StreamItem:
if (internal_editing()) {
case StreamItem:
if (internal_editing()) {
if (dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) {
_drags->set (new RegionCreateDrag (this, item, clicked_axisview), event);
return true;
}
} else {
} else {
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
return true;
}
break;
break;
case RegionViewNameHighlight:
case LeftFrameHandle:
case RightFrameHandle:
if (!clicked_regionview->region()->locked()) {
RegionSelection s = get_equivalent_regions (selection->regions, Properties::edit.property_id);
_drags->set (new TrimDrag (this, item, clicked_regionview, s.by_layer()), event);
return true;
}
break;
case RegionViewNameHighlight:
case LeftFrameHandle:
case RightFrameHandle:
if (!clicked_regionview->region()->locked()) {
RegionSelection s = get_equivalent_regions (selection->regions, Properties::edit.property_id);
_drags->set (new TrimDrag (this, item, clicked_regionview, s.by_layer()), event);
return true;
}
break;
default:
if (!internal_editing()) {
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
}
if (!internal_editing()) {
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
}
}
return true;
break;
@ -757,12 +756,12 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
switch (item_type) {
case NoteItem:
if (internal_editing()) {
ArdourCanvas::CanvasNote* cn = dynamic_cast<ArdourCanvas::CanvasNote*> (item);
if (cn->mouse_near_ends()) {
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
} else {
_drags->set (new NoteDrag (this, item), event);
}
ArdourCanvas::CanvasNote* cn = dynamic_cast<ArdourCanvas::CanvasNote*> (item);
if (cn->mouse_near_ends()) {
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
} else {
_drags->set (new NoteDrag (this, item), event);
}
return true;
}
break;
@ -1693,7 +1692,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
}
set_canvas_cursor (_cursors->fade_in);
}
break;
break;
case FadeOutHandleItem:
if (mouse_mode == MouseObject && !internal_editing()) {
@ -1752,7 +1751,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
Location *loc;
RegionView* rv;
bool is_start;
bool ret = true;
bool ret = true;
switch (item_type) {
case ControlPointItem:
@ -1764,7 +1763,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
}
if (is_drawable()) {
set_canvas_cursor (current_canvas_cursor);
set_canvas_cursor (current_canvas_cursor);
}
hide_verbose_canvas_cursor ();
@ -1787,7 +1786,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
_over_region_trim_target = false;
if (is_drawable()) {
set_canvas_cursor (current_canvas_cursor);
set_canvas_cursor (current_canvas_cursor);
}
break;
@ -1800,7 +1799,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
line->property_fill_color_rgba() = al->get_line_color();
}
if (is_drawable()) {
set_canvas_cursor (current_canvas_cursor);
set_canvas_cursor (current_canvas_cursor);
}
break;
@ -1810,7 +1809,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
if (!reinterpret_cast<RegionView *> (item->get_data ("regionview"))->name_active()) {
if (is_drawable() && mouse_mode == MouseObject) {
set_canvas_cursor (current_canvas_cursor);
set_canvas_cursor (current_canvas_cursor);
}
}
break;
@ -1822,7 +1821,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
case TempoBarItem:
case MarkerBarItem:
if (is_drawable()) {
set_canvas_cursor (current_canvas_cursor);
set_canvas_cursor (current_canvas_cursor);
}
break;
@ -1854,12 +1853,12 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
rect->property_outline_pixels() = 0;
}
}
set_canvas_cursor (current_canvas_cursor);
set_canvas_cursor (current_canvas_cursor);
break;
case AutomationTrackItem:
if (is_drawable()) {
set_canvas_cursor (current_canvas_cursor);
set_canvas_cursor (current_canvas_cursor);
clear_entered_track = true;
Glib::signal_idle().connect (sigc::mem_fun(*this, &Editor::left_automation_track));
}
@ -2468,9 +2467,9 @@ Editor::mouse_brush_insert_region (RegionView* rv, framepos_t pos)
boost::shared_ptr<Playlist> playlist = rtv->playlist();
double speed = rtv->track()->speed();
playlist->clear_changes ();
playlist->clear_changes ();
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region()));
playlist->add_region (new_region, (framepos_t) (pos * speed));
playlist->add_region (new_region, (framepos_t) (pos * speed));
_session->add_command (new StatefulDiffCommand (playlist));
// playlist is frozen, so we have to update manually XXX this is disgusting
@ -2493,9 +2492,9 @@ Editor::add_region_drag (ArdourCanvas::Item* item, GdkEvent* event, RegionView*
{
assert (region_view);
if (!region_view->region()->playlist()) {
return;
}
if (!region_view->region()->playlist()) {
return;
}
_region_motion_group->raise_to_top ();
@ -2515,9 +2514,9 @@ Editor::add_region_copy_drag (ArdourCanvas::Item* item, GdkEvent* event, RegionV
{
assert (region_view);
if (!region_view->region()->playlist()) {
return;
}
if (!region_view->region()->playlist()) {
return;
}
_region_motion_group->raise_to_top ();
@ -2530,9 +2529,9 @@ Editor::add_region_brush_drag (ArdourCanvas::Item* item, GdkEvent* event, Region
{
assert (region_view);
if (!region_view->region()->playlist()) {
return;
}
if (!region_view->region()->playlist()) {
return;
}
if (Config->get_edit_mode() == Splice) {
return;
@ -2586,7 +2585,7 @@ Editor::start_selection_grab (ArdourCanvas::Item* /*item*/, GdkEvent* event)
boost::shared_ptr<Playlist> playlist = clicked_axisview->playlist();
playlist->clear_changes ();
playlist->clear_changes ();
clicked_routeview->playlist()->add_region (region, selection->time[clicked_selection].start);
_session->add_command(new StatefulDiffCommand (playlist));
@ -2625,7 +2624,7 @@ Editor::set_internal_edit (bool yn)
if (yn) {
mouse_select_button.set_image (*(manage (new Image (::get_icon("midi_tool_pencil")))));
mouse_select_button.get_image ()->show ();
ARDOUR_UI::instance()->set_tip (mouse_select_button, _("Draw/Edit MIDI Notes"));
ARDOUR_UI::instance()->set_tip (mouse_select_button, _("Draw/Edit MIDI Notes"));
mouse_mode_toggled (mouse_mode);
/* deselect everything to avoid confusion when e.g. we can't now cut a previously selected
@ -2637,8 +2636,8 @@ Editor::set_internal_edit (bool yn)
mouse_select_button.set_image (*(manage (new Image (::get_icon("tool_range")))));
mouse_select_button.get_image ()->show ();
ARDOUR_UI::instance()->set_tip (mouse_select_button, _("Select/Move Ranges"));
mouse_mode_toggled (mouse_mode); // sets cursor
ARDOUR_UI::instance()->set_tip (mouse_select_button, _("Select/Move Ranges"));
mouse_mode_toggled (mouse_mode); // sets cursor
}
}

View File

@ -160,10 +160,10 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions)
boost::shared_ptr<Playlist> pl = (*a)->region()->playlist();
if (!pl) {
a = tmp;
continue;
}
if (!pl) {
a = tmp;
continue;
}
if (!pl->frozen()) {
/* we haven't seen this playlist before */
@ -174,7 +174,7 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions)
}
if (pl) {
pl->clear_changes ();
pl->clear_changes ();
pl->split_region ((*a)->region(), where);
_session->add_command (new StatefulDiffCommand (pl));
}
@ -328,7 +328,7 @@ Editor::nudge_forward (bool next, bool force_playhead)
distance = next_distance;
}
r->clear_changes ();
r->clear_changes ();
r->set_position (r->position() + distance, this);
_session->add_command (new StatefulDiffCommand (r));
}
@ -409,7 +409,7 @@ Editor::nudge_backward (bool next, bool force_playhead)
distance = next_distance;
}
r->clear_changes ();
r->clear_changes ();
if (r->position() > distance) {
r->set_position (r->position() - distance, this);
@ -1879,9 +1879,9 @@ Editor::add_location_from_selection ()
Location *location = new Location (*_session, start, end, rangename, Location::IsRangeMarker);
_session->begin_reversible_command (_("add marker"));
XMLNode &before = _session->locations()->get_state();
XMLNode &before = _session->locations()->get_state();
_session->locations()->add (location, true);
XMLNode &after = _session->locations()->get_state();
XMLNode &after = _session->locations()->get_state();
_session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
_session->commit_reversible_command ();
}
@ -1899,9 +1899,9 @@ Editor::add_location_mark (framepos_t where)
}
Location *location = new Location (*_session, where, where, markername, Location::IsMark);
_session->begin_reversible_command (_("add marker"));
XMLNode &before = _session->locations()->get_state();
XMLNode &before = _session->locations()->get_state();
_session->locations()->add (location, true);
XMLNode &after = _session->locations()->get_state();
XMLNode &after = _session->locations()->get_state();
_session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
_session->commit_reversible_command ();
}
@ -2092,9 +2092,9 @@ Editor::clear_markers ()
{
if (_session) {
_session->begin_reversible_command (_("clear markers"));
XMLNode &before = _session->locations()->get_state();
XMLNode &before = _session->locations()->get_state();
_session->locations()->clear_markers ();
XMLNode &after = _session->locations()->get_state();
XMLNode &after = _session->locations()->get_state();
_session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
_session->commit_reversible_command ();
}
@ -2105,7 +2105,7 @@ Editor::clear_ranges ()
{
if (_session) {
_session->begin_reversible_command (_("clear ranges"));
XMLNode &before = _session->locations()->get_state();
XMLNode &before = _session->locations()->get_state();
Location * looploc = _session->locations()->auto_loop_location();
Location * punchloc = _session->locations()->auto_punch_location();
@ -2115,7 +2115,7 @@ Editor::clear_ranges ()
if (looploc) _session->locations()->add (looploc);
if (punchloc) _session->locations()->add (punchloc);
XMLNode &after = _session->locations()->get_state();
XMLNode &after = _session->locations()->get_state();
_session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
_session->commit_reversible_command ();
}
@ -2125,9 +2125,9 @@ void
Editor::clear_locations ()
{
_session->begin_reversible_command (_("clear locations"));
XMLNode &before = _session->locations()->get_state();
XMLNode &before = _session->locations()->get_state();
_session->locations()->clear ();
XMLNode &after = _session->locations()->get_state();
XMLNode &after = _session->locations()->get_state();
_session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
_session->commit_reversible_command ();
_session->locations()->clear ();
@ -2196,7 +2196,7 @@ Editor::insert_region_list_drag (boost::shared_ptr<Region> region, int x, int y)
snap_to (where);
begin_reversible_command (_("insert dragged region"));
playlist->clear_changes ();
playlist->clear_changes ();
playlist->add_region (RegionFactory::create (region, true), where, 1.0);
_session->add_command(new StatefulDiffCommand (playlist));
commit_reversible_command ();
@ -2275,7 +2275,7 @@ Editor::insert_region_list_selection (float times)
}
begin_reversible_command (_("insert region"));
playlist->clear_changes ();
playlist->clear_changes ();
playlist->add_region ((RegionFactory::create (region, true)), get_preferred_edit_position(), times);
_session->add_command(new StatefulDiffCommand (playlist));
commit_reversible_command ();
@ -2754,20 +2754,20 @@ Editor::separate_regions_between (const TimeSelection& ts)
rtv->view()->foreach_regionview (sigc::bind (
sigc::ptr_fun (add_if_covered),
&(*t), &new_selection));
if (!in_command) {
begin_reversible_command (_("separate"));
in_command = true;
}
/* pick up changes to existing regions */
/* pick up changes to existing regions */
vector<Command*> cmds;
playlist->rdiff (cmds);
vector<Command*> cmds;
playlist->rdiff (cmds);
_session->add_commands (cmds);
/* pick up changes to the playlist itself (adds/removes)
*/
/* pick up changes to the playlist itself (adds/removes)
*/
_session->add_command(new StatefulDiffCommand (playlist));
}
@ -3012,7 +3012,7 @@ Editor::crop_region_to (framepos_t start, framepos_t end)
the_end = min (end, the_end);
cnt = the_end - the_start + 1;
region->clear_changes ();
region->clear_changes ();
region->trim_to (the_start, cnt, this);
_session->add_command (new StatefulDiffCommand (region));
}
@ -3049,7 +3049,7 @@ Editor::region_fill_track ()
return;
}
pl->clear_changes ();
pl->clear_changes ();
pl->add_region (RegionFactory::create (region, true), region->last_frame(), times);
_session->add_command (new StatefulDiffCommand (pl));
}
@ -3093,7 +3093,7 @@ Editor::region_fill_selection ()
continue;
}
playlist->clear_changes ();
playlist->clear_changes ();
playlist->add_region (RegionFactory::create (region, true), start, times);
_session->add_command (new StatefulDiffCommand (playlist));
}
@ -3125,7 +3125,7 @@ Editor::set_sync_point (framepos_t where, const RegionSelection& rs)
in_command = true;
}
region->clear_changes ();
region->clear_changes ();
region->set_sync_position (where);
_session->add_command(new StatefulDiffCommand (region));
}
@ -3149,7 +3149,7 @@ Editor::remove_region_sync ()
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
(*i)->region()->clear_changes ();
(*i)->region()->clear_changes ();
(*i)->region()->clear_sync_position ();
_session->add_command(new StatefulDiffCommand ((*i)->region()));
}
@ -3268,7 +3268,7 @@ Editor::align_regions_relative (RegionPoint point)
/* move first one specially */
r->clear_changes ();
r->clear_changes ();
r->set_position (pos, this);
_session->add_command(new StatefulDiffCommand (r));
@ -3280,7 +3280,7 @@ Editor::align_regions_relative (RegionPoint point)
boost::shared_ptr<Region> region ((*i)->region());
region->clear_changes ();
region->clear_changes ();
if (dir > 0) {
region->set_position (region->position() + distance, this);
@ -3345,14 +3345,14 @@ Editor::trim_region (bool front)
framepos_t where = get_preferred_edit_position();
RegionSelection rs = get_regions_from_selection_and_edit_point ();
cerr << "trim regions\n";
cerr << "trim regions\n";
if (rs.empty()) {
cerr << " no regions\n";
cerr << " no regions\n";
return;
}
cerr << "where = " << where << endl;
cerr << "where = " << where << endl;
begin_reversible_command (front ? _("trim front") : _("trim back"));
@ -3482,7 +3482,7 @@ Editor::trim_to_region(bool forward)
boost::shared_ptr<Region> region = arv->region();
boost::shared_ptr<Playlist> playlist (region->playlist());
region->clear_changes ();
region->clear_changes ();
if(forward){
@ -3595,7 +3595,7 @@ Editor::bounce_range_selection (bool replace, bool enable_processing)
InterThreadInfo itt;
playlist->clear_changes ();
playlist->clear_changes ();
playlist->clear_owned_changes ();
boost::shared_ptr<Region> r = rtv->track()->bounce_range (start, start+cnt, itt, enable_processing);
@ -3611,7 +3611,7 @@ Editor::bounce_range_selection (bool replace, bool enable_processing)
playlist->rdiff (cmds);
_session->add_commands (cmds);
_session->add_command (new StatefulDiffCommand (playlist));
_session->add_command (new StatefulDiffCommand (playlist));
}
commit_reversible_command ();
@ -3844,7 +3844,7 @@ Editor::remove_clicked_region ()
boost::shared_ptr<Playlist> playlist = clicked_routeview->playlist();
begin_reversible_command (_("remove region"));
playlist->clear_changes ();
playlist->clear_changes ();
playlist->remove_region (clicked_regionview->region());
_session->add_command(new StatefulDiffCommand (playlist));
commit_reversible_command ();
@ -3878,7 +3878,7 @@ Editor::remove_selected_regions ()
regions_to_remove.push_back ((*i)->region());
}
vector<boost::shared_ptr<Playlist> > playlists;
vector<boost::shared_ptr<Playlist> > playlists;
for (list<boost::shared_ptr<Region> >::iterator rl = regions_to_remove.begin(); rl != regions_to_remove.end(); ++rl) {
@ -3900,7 +3900,7 @@ Editor::remove_selected_regions ()
if (i == playlists.end()) {
playlist->clear_changes ();
playlist->clear_changes ();
playlist->freeze ();
playlists.push_back (playlist);
@ -3934,7 +3934,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
framepos_t first_position = max_framepos;
typedef set<boost::shared_ptr<Playlist> > FreezeList;
FreezeList freezelist;
FreezeList freezelist;
/* get ordering correct before we cut/copy */
@ -3958,7 +3958,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
}
if (fl == freezelist.end()) {
pl->clear_changes();
pl->clear_changes();
pl->freeze ();
freezelist.insert (pl);
}
@ -3985,9 +3985,9 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
if (!pl) {
/* region not yet associated with a playlist (e.g. unfinished
capture pass.
*/
++x;
capture pass.
*/
++x;
continue;
}
@ -4046,10 +4046,10 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
/* the pmap is in the same order as the tracks in which selected regions occured */
for (vector<PlaylistMapping>::iterator i = pmap.begin(); i != pmap.end(); ++i) {
if ((*i).pl) {
(*i).pl->thaw();
foo.push_back ((*i).pl);
}
if ((*i).pl) {
(*i).pl->thaw();
foo.push_back ((*i).pl);
}
}
if (!foo.empty()) {
@ -4205,7 +4205,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
sigc::connection c = rtv->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view));
playlist = (*i)->region()->playlist();
playlist->clear_changes ();
playlist->clear_changes ();
playlist->duplicate (r, end_frame + (r->first_frame() - start_frame), times);
_session->add_command(new StatefulDiffCommand (playlist));
@ -4246,7 +4246,7 @@ Editor::duplicate_selection (float times)
if ((playlist = (*i)->playlist()) == 0) {
continue;
}
playlist->clear_changes ();
playlist->clear_changes ();
playlist->duplicate (*ri, selection->time[clicked_selection].end, times);
_session->add_command (new StatefulDiffCommand (playlist));
@ -4292,7 +4292,7 @@ Editor::center_edit_point ()
void
Editor::clear_playlist (boost::shared_ptr<Playlist> playlist)
{
playlist->clear_changes ();
playlist->clear_changes ();
playlist->clear ();
_session->add_command (new StatefulDiffCommand (playlist));
}
@ -4327,17 +4327,17 @@ Editor::nudge_track (bool use_edit, bool forwards)
continue;
}
playlist->clear_changes ();
playlist->clear_owned_changes ();
playlist->clear_changes ();
playlist->clear_owned_changes ();
playlist->nudge_after (start, distance, forwards);
vector<Command*> cmds;
playlist->rdiff (cmds);
vector<Command*> cmds;
playlist->rdiff (cmds);
_session->add_commands (cmds);
_session->add_command (new StatefulDiffCommand (playlist));
_session->add_command (new StatefulDiffCommand (playlist));
}
commit_reversible_command ();
@ -4364,12 +4364,12 @@ Editor::remove_last_capture ()
if (prompter.run () == 1) {
_session->remove_last_capture ();
_regions->redisplay ();
_regions->redisplay ();
}
} else {
_session->remove_last_capture();
_regions->redisplay ();
_regions->redisplay ();
}
}
@ -4465,7 +4465,7 @@ Editor::reset_region_scale_amplitude ()
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*r);
if (!arv)
continue;
arv->region()->clear_changes ();
arv->region()->clear_changes ();
arv->audio_region()->set_scale_amplitude (1.0f);
_session->add_command (new StatefulDiffCommand (arv->region()));
}
@ -4488,9 +4488,9 @@ Editor::adjust_region_gain (bool up)
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*r);
if (!arv) {
continue;
}
}
arv->region()->clear_changes ();
arv->region()->clear_changes ();
double fraction = gain_to_slider_position (arv->audio_region()->scale_amplitude ());
@ -4629,11 +4629,11 @@ Editor::fork_region ()
if (mrv) {
boost::shared_ptr<Playlist> playlist = mrv->region()->playlist();
boost::shared_ptr<MidiRegion> newregion = mrv->midi_region()->clone ();
boost::shared_ptr<MidiRegion> newregion = mrv->midi_region()->clone ();
playlist->clear_changes ();
playlist->replace_region (mrv->region(), newregion, mrv->region()->position());
_session->add_command(new StatefulDiffCommand (playlist));
playlist->clear_changes ();
playlist->replace_region (mrv->region(), newregion, mrv->region()->position());
_session->add_command(new StatefulDiffCommand (playlist));
}
r = tmp;
@ -4647,7 +4647,7 @@ Editor::fork_region ()
void
Editor::quantize_region ()
{
int selected_midi_region_cnt = 0;
int selected_midi_region_cnt = 0;
if (!_session) {
return;
@ -4664,14 +4664,14 @@ Editor::quantize_region ()
++tmp;
MidiRegionView* const mrv = dynamic_cast<MidiRegionView*> (*r);
if (mrv) {
selected_midi_region_cnt++;
}
}
if (mrv) {
selected_midi_region_cnt++;
}
}
if (selected_midi_region_cnt == 0) {
return;
}
if (selected_midi_region_cnt == 0) {
return;
}
QuantizeDialog* qd = new QuantizeDialog (*this);
@ -4828,7 +4828,7 @@ Editor::toggle_gain_envelope_visibility ()
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
if (arv) {
arv->region()->clear_changes ();
arv->region()->clear_changes ();
arv->set_envelope_visible (!arv->envelope_visible());
_session->add_command (new StatefulDiffCommand (arv->region()));
}
@ -4904,7 +4904,7 @@ Editor::toggle_region_lock_style ()
_session->begin_reversible_command (_("region lock style"));
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
(*i)->region()->clear_changes ();
(*i)->region()->clear_changes ();
PositionLockStyle const ns = (*i)->region()->position_lock_style() == AudioTime ? MusicTime : AudioTime;
(*i)->region()->set_position_lock_style (ns);
_session->add_command (new StatefulDiffCommand ((*i)->region()));
@ -5112,7 +5112,7 @@ Editor::set_fade_in_active (bool yn)
boost::shared_ptr<AudioRegion> ar (tmp->audio_region());
ar->clear_changes ();
ar->clear_changes ();
ar->set_fade_in_active (yn);
_session->add_command (new StatefulDiffCommand (ar));
}
@ -5140,7 +5140,7 @@ Editor::set_fade_out_active (bool yn)
boost::shared_ptr<AudioRegion> ar (tmp->audio_region());
ar->clear_changes ();
ar->clear_changes ();
ar->set_fade_out_active (yn);
_session->add_command(new StatefulDiffCommand (ar));
}
@ -5280,12 +5280,12 @@ Editor::set_playhead_cursor ()
void
Editor::split_region ()
{
if (((mouse_mode == MouseRange) ||
(mouse_mode != MouseObject && _join_object_range_state == JOIN_OBJECT_RANGE_RANGE)) &&
!selection->time.empty()) {
separate_regions_between (selection->time);
return;
}
if (((mouse_mode == MouseRange) ||
(mouse_mode != MouseObject && _join_object_range_state == JOIN_OBJECT_RANGE_RANGE)) &&
!selection->time.empty()) {
separate_regions_between (selection->time);
return;
}
RegionSelection rs = get_regions_from_selection_and_edit_point ();
@ -5399,7 +5399,7 @@ Editor::ensure_track_visible(TimeAxisView *track)
double const track_max_y = track->y_position () + track->effective_height ();
if (track_min_y >= current_view_min_y &&
track_max_y <= current_view_max_y) {
track_max_y <= current_view_max_y) {
return;
}
@ -5748,7 +5748,7 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
AnalysisFeatureList::const_iterator x;
pl->clear_changes ();
pl->clear_changes ();
x = positions.begin();
@ -6122,7 +6122,7 @@ Editor::remove_tracks ()
const char* trackstr;
const char* busstr;
vector<boost::shared_ptr<Route> > routes;
bool special_bus = false;
bool special_bus = false;
for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) {
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*x);
@ -6135,28 +6135,28 @@ Editor::remove_tracks ()
}
routes.push_back (rtv->_route);
if (rtv->route()->is_master() || rtv->route()->is_monitor()) {
special_bus = true;
}
}
if (rtv->route()->is_master() || rtv->route()->is_monitor()) {
special_bus = true;
}
}
if (special_bus && !Config->get_allow_special_bus_removal()) {
MessageDialog msg (_("That would be bad news ...."),
false,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);
msg.set_secondary_text (string_compose (_(
"Removing the master or monitor bus is such a bad idea\n\
if (special_bus && !Config->get_allow_special_bus_removal()) {
MessageDialog msg (_("That would be bad news ...."),
false,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);
msg.set_secondary_text (string_compose (_(
"Removing the master or monitor bus is such a bad idea\n\
that %1 is not going to allow it.\n\
\n\
If you really want to do this sort of thing\n\
edit your ardour.rc file to set the\n\
\"allow-special-bus-removal\" option to be \"yes\""), PROGRAM_NAME));
msg.present ();
msg.run ();
return;
}
msg.present ();
msg.run ();
return;
}
if (ntracks + nbusses == 0) {
return;
@ -6188,7 +6188,7 @@ edit your ardour.rc file to set the\n\
}
} else if (nbusses) {
prompt = string_compose (_("Do you really want to remove %1 %2?\n\n"
"This action cannot be undon, and the session file will be overwritten"),
"This action cannot be undon, and the session file will be overwritten"),
nbusses, busstr);
}
@ -6268,7 +6268,7 @@ Editor::insert_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt,
if (pl) {
pl->clear_changes ();
pl->clear_owned_changes ();
pl->clear_owned_changes ();
if (opt == SplitIntersected) {
pl->split (pos);
@ -6276,8 +6276,8 @@ Editor::insert_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt,
pl->shift (pos, frames, (opt == MoveIntersected), ignore_music_glue);
vector<Command*> cmds;
pl->rdiff (cmds);
vector<Command*> cmds;
pl->rdiff (cmds);
_session->add_commands (cmds);
_session->add_command (new StatefulDiffCommand (pl));

View File

@ -59,15 +59,15 @@ using Gtkmm2ext::Keyboard;
EditorRegions::EditorRegions (Editor* e)
: EditorComponent (e)
, old_focus (0)
, name_editable (0)
, old_focus (0)
, name_editable (0)
, _menu (0)
, _show_automatic_regions (true)
, _sort_type ((Editing::RegionListSortType) 0)
, _no_redisplay (false)
, ignore_region_list_selection_change (false)
, ignore_selected_region_change (false)
, expanded (false)
, expanded (false)
{
_display.set_size_request (100, -1);
_display.set_name ("RegionListDisplay");
@ -99,13 +99,13 @@ EditorRegions::EditorRegions (Editor* e)
_display.set_headers_visible (true);
//_display.set_grid_lines (TREE_VIEW_GRID_LINES_BOTH);
/* show path as the row tooltip */
_display.set_tooltip_column (15); /* path */
/* show path as the row tooltip */
_display.set_tooltip_column (15); /* path */
CellRendererText* region_name_cell = dynamic_cast<CellRendererText*>(_display.get_column_cell_renderer (0));
region_name_cell->property_editable() = true;
region_name_cell->signal_edited().connect (sigc::mem_fun (*this, &EditorRegions::name_edit));
region_name_cell->signal_editing_started().connect (sigc::mem_fun (*this, &EditorRegions::name_editing_started));
region_name_cell->signal_editing_started().connect (sigc::mem_fun (*this, &EditorRegions::name_editing_started));
_display.get_selection()->set_select_function (sigc::mem_fun (*this, &EditorRegions::selection_filter));
@ -159,11 +159,11 @@ EditorRegions::EditorRegions (Editor* e)
_change_connection = _display.get_selection()->signal_changed().connect (sigc::mem_fun(*this, &EditorRegions::selection_changed));
_scroller.signal_key_press_event().connect (sigc::mem_fun(*this, &EditorRegions::key_press), false);
_scroller.signal_focus_in_event().connect (sigc::mem_fun (*this, &EditorRegions::focus_in), false);
_scroller.signal_focus_out_event().connect (sigc::mem_fun (*this, &EditorRegions::focus_out));
_scroller.signal_focus_in_event().connect (sigc::mem_fun (*this, &EditorRegions::focus_in), false);
_scroller.signal_focus_out_event().connect (sigc::mem_fun (*this, &EditorRegions::focus_out));
_display.signal_enter_notify_event().connect (sigc::mem_fun (*this, &EditorRegions::enter_notify), false);
_display.signal_leave_notify_event().connect (sigc::mem_fun (*this, &EditorRegions::leave_notify), false);
_display.signal_enter_notify_event().connect (sigc::mem_fun (*this, &EditorRegions::enter_notify), false);
_display.signal_leave_notify_event().connect (sigc::mem_fun (*this, &EditorRegions::leave_notify), false);
// _display.signal_popup_menu().connect (sigc::bind (sigc::mem_fun (*this, &Editor::show__display_context_menu), 1, 0));
@ -176,55 +176,55 @@ EditorRegions::EditorRegions (Editor* e)
bool
EditorRegions::focus_in (GdkEventFocus*)
{
Window* win = dynamic_cast<Window*> (_scroller.get_toplevel ());
Window* win = dynamic_cast<Window*> (_scroller.get_toplevel ());
if (win) {
old_focus = win->get_focus ();
} else {
old_focus = 0;
}
if (win) {
old_focus = win->get_focus ();
} else {
old_focus = 0;
}
name_editable = 0;
name_editable = 0;
/* try to do nothing on focus in (doesn't work, hence selection_count nonsense) */
return true;
/* try to do nothing on focus in (doesn't work, hence selection_count nonsense) */
return true;
}
bool
EditorRegions::focus_out (GdkEventFocus*)
{
if (old_focus) {
old_focus->grab_focus ();
old_focus = 0;
}
if (old_focus) {
old_focus->grab_focus ();
old_focus = 0;
}
name_editable = 0;
name_editable = 0;
return false;
return false;
}
bool
EditorRegions::enter_notify (GdkEventCrossing* ev)
{
/* arm counter so that ::selection_filter() will deny selecting anything for the
next two attempts to change selection status.
*/
_scroller.grab_focus ();
Keyboard::magic_widget_grab_focus ();
return false;
/* arm counter so that ::selection_filter() will deny selecting anything for the
next two attempts to change selection status.
*/
_scroller.grab_focus ();
Keyboard::magic_widget_grab_focus ();
return false;
}
bool
EditorRegions::leave_notify (GdkEventCrossing*)
{
if (old_focus) {
old_focus->grab_focus ();
old_focus = 0;
}
if (old_focus) {
old_focus->grab_focus ();
old_focus = 0;
}
name_editable = 0;
Keyboard::magic_widget_drop_focus ();
return false;
name_editable = 0;
Keyboard::magic_widget_drop_focus ();
return false;
}
void
@ -238,7 +238,7 @@ void
EditorRegions::add_regions (vector<boost::shared_ptr<Region> >& regions)
{
for (vector<boost::shared_ptr<Region> >::iterator x = regions.begin(); x != regions.end(); ++x) {
add_region (*x);
add_region (*x);
}
}
@ -269,7 +269,7 @@ EditorRegions::add_region (boost::shared_ptr<Region> region)
boost::shared_ptr<Region> proxy = parent[_columns.region];
proxy.reset ();
} else {
string s = (*iter)[_columns.name];
string s = (*iter)[_columns.name];
if (s != _("Hidden")) {
parent = *(_model->insert(iter));
parent[_columns.name] = _("Hidden");
@ -343,15 +343,15 @@ EditorRegions::add_region (boost::shared_ptr<Region> region)
row[_columns.property_toggles_visible] = false;
if (missing_source) {
row[_columns.path] = _("(MISSING) ") + region->source()->name();
row[_columns.path] = _("(MISSING) ") + region->source()->name();
} else {
boost::shared_ptr<FileSource> fs = boost::dynamic_pointer_cast<FileSource>(region->source());
if (fs) {
row[_columns.path] = fs->path();
} else {
row[_columns.path] = region->source()->name();
}
boost::shared_ptr<FileSource> fs = boost::dynamic_pointer_cast<FileSource>(region->source());
if (fs) {
row[_columns.path] = fs->path();
} else {
row[_columns.path] = region->source()->name();
}
}
if (region->automatic()) {
@ -387,10 +387,10 @@ EditorRegions::add_region (boost::shared_ptr<Region> region)
}
}
if (found_parent) {
row = *(_model->append ((*i).children()));
break;
}
if (found_parent) {
row = *(_model->append ((*i).children()));
break;
}
}
if (!found_parent) {
@ -408,18 +408,18 @@ EditorRegions::add_region (boost::shared_ptr<Region> region)
void
EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange& what_changed)
{
PropertyChange our_interests;
PropertyChange our_interests;
our_interests.add (ARDOUR::Properties::name);
our_interests.add (ARDOUR::Properties::position);
our_interests.add (ARDOUR::Properties::length);
our_interests.add (ARDOUR::Properties::start);
our_interests.add (ARDOUR::Properties::locked);
our_interests.add (ARDOUR::Properties::position_lock_style);
our_interests.add (ARDOUR::Properties::muted);
our_interests.add (ARDOUR::Properties::opaque);
our_interests.add (ARDOUR::Properties::fade_in);
our_interests.add (ARDOUR::Properties::fade_out);
our_interests.add (ARDOUR::Properties::name);
our_interests.add (ARDOUR::Properties::position);
our_interests.add (ARDOUR::Properties::length);
our_interests.add (ARDOUR::Properties::start);
our_interests.add (ARDOUR::Properties::locked);
our_interests.add (ARDOUR::Properties::position_lock_style);
our_interests.add (ARDOUR::Properties::muted);
our_interests.add (ARDOUR::Properties::opaque);
our_interests.add (ARDOUR::Properties::fade_in);
our_interests.add (ARDOUR::Properties::fade_out);
if (last_row != 0) {
@ -437,7 +437,7 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange
}
}
if (what_changed.contains (our_interests)) {
if (what_changed.contains (our_interests)) {
/* find the region in our model and update its row */
TreeModel::Children rows = _model->children ();
@ -475,43 +475,43 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange
if (found != children.end()) {
boost::shared_ptr<AudioRegion> audioregion = boost::dynamic_pointer_cast<AudioRegion>(r);
uint32_t used = _editor->get_regionview_count_from_region_list (r);
boost::shared_ptr<AudioRegion> audioregion = boost::dynamic_pointer_cast<AudioRegion>(r);
uint32_t used = _editor->get_regionview_count_from_region_list (r);
if (what_changed.contains (ARDOUR::Properties::name)) {
populate_row_name (r, *found);
}
if (what_changed.contains (ARDOUR::Properties::position)) {
populate_row_position (r, *found, used);
populate_row_end (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::length)) {
populate_row_end (r, *found, used);
populate_row_length (r, *found);
}
if (what_changed.contains (ARDOUR::Properties::start)) {
populate_row_length (r, *found);
}
if (what_changed.contains (ARDOUR::Properties::locked)) {
populate_row_locked (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::position_lock_style)) {
populate_row_glued (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::muted)) {
populate_row_muted (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::opaque)) {
populate_row_opaque (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::fade_in)) {
populate_row_fade_in (r, *found, used, audioregion);
}
if (what_changed.contains (ARDOUR::Properties::fade_out)) {
populate_row_fade_out (r, *found, used, audioregion);
}
if (what_changed.contains (ARDOUR::Properties::name)) {
populate_row_name (r, *found);
}
if (what_changed.contains (ARDOUR::Properties::position)) {
populate_row_position (r, *found, used);
populate_row_end (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::length)) {
populate_row_end (r, *found, used);
populate_row_length (r, *found);
}
if (what_changed.contains (ARDOUR::Properties::start)) {
populate_row_length (r, *found);
}
if (what_changed.contains (ARDOUR::Properties::locked)) {
populate_row_locked (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::position_lock_style)) {
populate_row_glued (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::muted)) {
populate_row_muted (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::opaque)) {
populate_row_opaque (r, *found, used);
}
if (what_changed.contains (ARDOUR::Properties::fade_in)) {
populate_row_fade_in (r, *found, used, audioregion);
}
if (what_changed.contains (ARDOUR::Properties::fade_out)) {
populate_row_fade_out (r, *found, used, audioregion);
}
break;
break;
}
++i;
@ -544,9 +544,9 @@ EditorRegions::selection_changed ()
if (iter = _model->get_iter (*i)) {
boost::shared_ptr<Region> region = (*iter)[_columns.region];
// they could have clicked on a row that is just a placeholder, like "Hidden"
// although that is not allowed by our selection filter. check it anyway
// since we need a region ptr.
// they could have clicked on a row that is just a placeholder, like "Hidden"
// although that is not allowed by our selection filter. check it anyway
// since we need a region ptr.
if (region) {
@ -657,10 +657,10 @@ EditorRegions::redisplay ()
tmp_region_list.clear();
const RegionFactory::RegionMap& regions (RegionFactory::regions());
for (RegionFactory::RegionMap::const_iterator i = regions.begin(); i != regions.end(); ++i) {
insert_into_tmp_regionlist (i->second);
}
const RegionFactory::RegionMap& regions (RegionFactory::regions());
for (RegionFactory::RegionMap::const_iterator i = regions.begin(); i != regions.end(); ++i) {
insert_into_tmp_regionlist (i->second);
}
for (list<boost::shared_ptr<Region> >::iterator r = tmp_region_list.begin(); r != tmp_region_list.end(); ++r) {
add_region (*r);
@ -824,21 +824,21 @@ void
EditorRegions::populate_row (boost::shared_ptr<Region> region, TreeModel::Row const &row)
{
boost::shared_ptr<AudioRegion> audioregion = boost::dynamic_pointer_cast<AudioRegion>(region);
uint32_t used = _session->playlists->region_use_count (region);
uint32_t used = _session->playlists->region_use_count (region);
populate_row_position (region, row, used);
populate_row_end (region, row, used);
populate_row_sync (region, row, used);
populate_row_fade_in (region, row, used, audioregion);
populate_row_fade_out (region, row, used, audioregion);
populate_row_locked (region, row, used);
populate_row_glued (region, row, used);
populate_row_muted (region, row, used);
populate_row_opaque (region, row, used);
populate_row_length (region, row);
populate_row_source (region, row);
populate_row_name (region, row);
populate_row_used (region, row, used);
populate_row_position (region, row, used);
populate_row_end (region, row, used);
populate_row_sync (region, row, used);
populate_row_fade_in (region, row, used, audioregion);
populate_row_fade_out (region, row, used, audioregion);
populate_row_locked (region, row, used);
populate_row_glued (region, row, used);
populate_row_muted (region, row, used);
populate_row_opaque (region, row, used);
populate_row_length (region, row);
populate_row_source (region, row);
populate_row_name (region, row);
populate_row_used (region, row, used);
}
#if 0
@ -875,7 +875,7 @@ EditorRegions::populate_row (boost::shared_ptr<Region> region, TreeModel::Row co
void
EditorRegions::populate_row_used (boost::shared_ptr<Region> region, TreeModel::Row const& row, uint32_t used)
{
char buf[8];
char buf[8];
snprintf (buf, sizeof (buf), "%4d" , used);
row[_columns.used] = buf;
}
@ -883,147 +883,147 @@ EditorRegions::populate_row_used (boost::shared_ptr<Region> region, TreeModel::R
void
EditorRegions::populate_row_length (boost::shared_ptr<Region> region, TreeModel::Row const &row)
{
char buf[16];
format_position (region->length(), buf, sizeof (buf));
row[_columns.length] = buf;
char buf[16];
format_position (region->length(), buf, sizeof (buf));
row[_columns.length] = buf;
}
void
EditorRegions::populate_row_end (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used)
{
if (region->whole_file()) {
row[_columns.end] = "";
} else if (used > 1) {
row[_columns.end] = _("Mult.");
} else {
char buf[16];
format_position (region->last_frame(), buf, sizeof (buf));
row[_columns.end] = buf;
}
if (region->whole_file()) {
row[_columns.end] = "";
} else if (used > 1) {
row[_columns.end] = _("Mult.");
} else {
char buf[16];
format_position (region->last_frame(), buf, sizeof (buf));
row[_columns.end] = buf;
}
}
void
EditorRegions::populate_row_position (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used)
{
if (region->whole_file()) {
row[_columns.position] = "";
} else if (used > 1) {
row[_columns.position] = _("Mult.");
} else {
char buf[16];
format_position (region->position(), buf, sizeof (buf));
row[_columns.position] = buf;
}
if (region->whole_file()) {
row[_columns.position] = "";
} else if (used > 1) {
row[_columns.position] = _("Mult.");
} else {
char buf[16];
format_position (region->position(), buf, sizeof (buf));
row[_columns.position] = buf;
}
}
void
EditorRegions::populate_row_sync (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used)
{
if (region->whole_file()) {
row[_columns.sync] = "";
} else if (used > 1) {
row[_columns.sync] = _("Mult."); /* translators: a short phrase for "multiple" as in "many" */
} else {
if (region->whole_file()) {
row[_columns.sync] = "";
} else if (used > 1) {
row[_columns.sync] = _("Mult."); /* translators: a short phrase for "multiple" as in "many" */
} else {
if (region->sync_position() == region->position()) {
row[_columns.sync] = _("Start");
} else if (region->sync_position() == (region->last_frame())) {
row[_columns.sync] = _("End");
} else {
char buf[16];
format_position (region->sync_position(), buf, sizeof (buf));
char buf[16];
format_position (region->sync_position(), buf, sizeof (buf));
row[_columns.sync] = buf;
}
}
}
}
void
EditorRegions::populate_row_fade_in (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used, boost::shared_ptr<AudioRegion> audioregion)
{
if (!audioregion || region->whole_file()) {
row[_columns.fadein] = "";
} else {
if (used > 1) {
row[_columns.fadein] = _("Multiple");
} else {
if (!audioregion || region->whole_file()) {
row[_columns.fadein] = "";
} else {
if (used > 1) {
row[_columns.fadein] = _("Multiple");
} else {
char buf[16];
format_position (audioregion->fade_in()->back()->when, buf, sizeof (buf));
row[_columns.fadein] = buf;
char buf[16];
format_position (audioregion->fade_in()->back()->when, buf, sizeof (buf));
row[_columns.fadein] = buf;
if (audioregion->fade_in_active()) {
row[_columns.fadein] = string_compose("%1%2%3", " ", buf, " ");
} else {
row[_columns.fadein] = string_compose("%1%2%3", "(", buf, ")");
}
}
}
}
}
}
void
EditorRegions::populate_row_fade_out (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used, boost::shared_ptr<AudioRegion> audioregion)
{
if (!audioregion || region->whole_file()) {
row[_columns.fadeout] = "";
} else {
if (used > 1) {
row[_columns.fadeout] = _("Multiple");
} else {
char buf[16];
format_position (audioregion->fade_out()->back()->when, buf, sizeof (buf));
if (!audioregion || region->whole_file()) {
row[_columns.fadeout] = "";
} else {
if (used > 1) {
row[_columns.fadeout] = _("Multiple");
} else {
char buf[16];
format_position (audioregion->fade_out()->back()->when, buf, sizeof (buf));
if (audioregion->fade_out_active()) {
row[_columns.fadeout] = string_compose("%1%2%3", " ", buf, " ");
} else {
row[_columns.fadeout] = string_compose("%1%2%3", "(", buf, ")");
}
}
}
if (audioregion->fade_out_active()) {
row[_columns.fadeout] = string_compose("%1%2%3", " ", buf, " ");
} else {
row[_columns.fadeout] = string_compose("%1%2%3", "(", buf, ")");
}
}
}
}
void
EditorRegions::populate_row_locked (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used)
{
if (region->whole_file()) {
row[_columns.locked] = false;
} else if (used > 1) {
row[_columns.locked] = false;
} else {
if (region->whole_file()) {
row[_columns.locked] = false;
} else if (used > 1) {
row[_columns.locked] = false;
} else {
row[_columns.locked] = region->locked();
}
}
}
void
EditorRegions::populate_row_glued (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used)
{
if (region->whole_file() || used > 1) {
row[_columns.glued] = false;
} else {
if (region->whole_file() || used > 1) {
row[_columns.glued] = false;
} else {
if (region->position_lock_style() == MusicTime) {
row[_columns.glued] = true;
} else {
row[_columns.glued] = false;
}
}
}
}
void
EditorRegions::populate_row_muted (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used)
{
if (region->whole_file() || used > 1) {
row[_columns.muted] = false;
} else {
if (region->whole_file() || used > 1) {
row[_columns.muted] = false;
} else {
row[_columns.muted] = region->muted();
}
}
}
void
EditorRegions::populate_row_opaque (boost::shared_ptr<Region> region, TreeModel::Row const &row, uint32_t used)
{
if (region->whole_file() || used > 1) {
row[_columns.opaque] = false;
} else {
if (region->whole_file() || used > 1) {
row[_columns.opaque] = false;
} else {
row[_columns.opaque] = region->opaque();
}
}
}
void
@ -1111,31 +1111,31 @@ EditorRegions::show_context_menu (int button, int time)
bool
EditorRegions::key_press (GdkEventKey* ev)
{
TreeViewColumn *col;
TreeViewColumn *col;
switch (ev->keyval) {
case GDK_Tab:
case GDK_ISO_Left_Tab:
switch (ev->keyval) {
case GDK_Tab:
case GDK_ISO_Left_Tab:
if (name_editable) {
name_editable->editing_done ();
name_editable = 0;
}
if (name_editable) {
name_editable->editing_done ();
name_editable = 0;
}
col = _display.get_column (0); // select&focus on name column
col = _display.get_column (0); // select&focus on name column
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
treeview_select_previous (_display, _model, col);
} else {
treeview_select_next (_display, _model, col);
}
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
treeview_select_previous (_display, _model, col);
} else {
treeview_select_next (_display, _model, col);
}
return true;
break;
return true;
break;
default:
break;
}
default:
break;
}
return false;
}
@ -1340,10 +1340,10 @@ EditorRegions::selection_filter (const RefPtr<TreeModel>& model, const TreeModel
{
/* not possible to select rows that do not represent regions, like "Hidden" */
if (already_selected) {
/* deselecting anything is OK with us */
return true;
}
if (already_selected) {
/* deselecting anything is OK with us */
return true;
}
TreeModel::iterator iter = model->get_iter (path);
@ -1360,21 +1360,21 @@ EditorRegions::selection_filter (const RefPtr<TreeModel>& model, const TreeModel
void
EditorRegions::name_editing_started (CellEditable* ce, const Glib::ustring&)
{
name_editable = ce;
name_editable = ce;
/* give it a special name */
/* give it a special name */
Gtk::Entry *e = dynamic_cast<Gtk::Entry*> (ce);
Gtk::Entry *e = dynamic_cast<Gtk::Entry*> (ce);
if (e) {
e->set_name (X_("RegionNameEditorEntry"));
}
if (e) {
e->set_name (X_("RegionNameEditorEntry"));
}
}
void
EditorRegions::name_edit (const std::string& path, const std::string& new_text)
{
name_editable = 0;
name_editable = 0;
boost::shared_ptr<Region> region;
TreeIter iter;
@ -1516,7 +1516,7 @@ EditorRegions::get_state () const
void
EditorRegions::set_state (const XMLNode & node)
{
bool changed = false;
bool changed = false;
if (node.name() != X_("RegionList")) {
return;
@ -1525,9 +1525,9 @@ EditorRegions::set_state (const XMLNode & node)
XMLProperty const * p = node.property (X_("sort-type"));
if (p) {
Editing::RegionListSortType const t = static_cast<Editing::RegionListSortType> (string_2_enum (p->value(), _sort_type));
if (_sort_type != t) {
changed = true;
}
if (_sort_type != t) {
changed = true;
}
reset_sort_type (t, true);
RefPtr<RadioAction> ract = sort_type_action (t);
ract->set_active ();
@ -1536,13 +1536,13 @@ EditorRegions::set_state (const XMLNode & node)
p = node.property (X_("sort-ascending"));
if (p) {
bool const yn = string_is_affirmative (p->value ());
SortType old_sort_type;
int old_sort_column;
SortType old_sort_type;
int old_sort_column;
_model->get_sort_column_id (old_sort_column, old_sort_type);
if (old_sort_type != (yn ? SORT_ASCENDING : SORT_DESCENDING)) {
changed = true;
}
_model->get_sort_column_id (old_sort_column, old_sort_type);
if (old_sort_type != (yn ? SORT_ASCENDING : SORT_DESCENDING)) {
changed = true;
}
reset_sort_direction (yn);
RefPtr<Action> act;
if (yn) {
@ -1557,9 +1557,9 @@ EditorRegions::set_state (const XMLNode & node)
p = node.property (X_("show-all"));
if (p) {
bool const yn = string_is_affirmative (p->value ());
if (expanded != yn) {
changed = true;
}
if (expanded != yn) {
changed = true;
}
set_full (yn);
toggle_full_action()->set_active (yn);
}
@ -1567,16 +1567,16 @@ EditorRegions::set_state (const XMLNode & node)
p = node.property (X_("show-automatic-regions"));
if (p) {
bool const yn = string_is_affirmative (p->value ());
if (yn != _show_automatic_regions) {
_show_automatic_regions = yn;
toggle_show_auto_regions_action()->set_active (yn);
if (yn != _show_automatic_regions) {
_show_automatic_regions = yn;
toggle_show_auto_regions_action()->set_active (yn);
changed = true;
}
}
}
}
if (changed) {
redisplay ();
}
if (changed) {
redisplay ();
}
}
RefPtr<RadioAction>

View File

@ -52,9 +52,8 @@ using Gtkmm2ext::Keyboard;
EditorRouteGroups::EditorRouteGroups (Editor* e)
: EditorComponent (e)
, _all_group_active_button (_("No Selection = All Tracks"))
, _in_row_change (false)
, _all_group_active_button (_("No Selection = All Tracks"))
, _in_row_change (false)
{
_model = ListStore::create (_columns);
_display.set_model (_model);
@ -162,13 +161,13 @@ EditorRouteGroups::EditorRouteGroups (Editor* e)
button_box->pack_start (*add_button);
button_box->pack_start (*remove_button);
_all_group_active_button.show ();
_all_group_active_button.show ();
_display_packer.pack_start (_scroller, true, true);
_display_packer.pack_start (_all_group_active_button, false, false);
_display_packer.pack_start (_all_group_active_button, false, false);
_display_packer.pack_start (*button_box, false, false);
_all_group_active_button.signal_toggled().connect (sigc::mem_fun (*this, &EditorRouteGroups::all_group_toggled));
_all_group_active_button.signal_toggled().connect (sigc::mem_fun (*this, &EditorRouteGroups::all_group_toggled));
}
void
@ -207,7 +206,7 @@ EditorRouteGroups::button_press_event (GdkEventButton* ev)
{
TreeModel::Path path;
TreeIter iter;
RouteGroup* group = 0;
RouteGroup* group = 0;
TreeViewColumn* column;
int cellx;
int celly;
@ -381,7 +380,7 @@ EditorRouteGroups::row_change (const Gtk::TreeModel::Path&, const Gtk::TreeModel
void
EditorRouteGroups::add (RouteGroup* group)
{
ENSURE_GUI_THREAD (*this, &EditorRouteGroups::add, group)
ENSURE_GUI_THREAD (*this, &EditorRouteGroups::add, group)
bool focus = false;
TreeModel::Row row = *(_model->append());
@ -437,7 +436,7 @@ EditorRouteGroups::property_changed (RouteGroup* group, const PropertyChange& ch
{
_in_row_change = true;
Gtk::TreeModel::Children children = _model->children();
Gtk::TreeModel::Children children = _model->children();
for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
if (group == (*iter)[_columns.routegroup]) {
@ -492,18 +491,18 @@ EditorRouteGroups::set_session (Session* s)
if (_session) {
RouteGroup& arg (_session->all_route_group());
RouteGroup& arg (_session->all_route_group());
arg.PropertyChanged.connect (property_changed_connection, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::all_group_changed, this, _1), gui_context());
arg.PropertyChanged.connect (property_changed_connection, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::all_group_changed, this, _1), gui_context());
_session->route_group_added.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::add, this, _1), gui_context());
_session->route_group_removed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&EditorRouteGroups::groups_changed, this), gui_context());
}
PBD::PropertyChange pc;
pc.add (Properties::select);
pc.add (Properties::active);
all_group_changed (pc);
PBD::PropertyChange pc;
pc.add (Properties::select);
pc.add (Properties::active);
all_group_changed (pc);
groups_changed ();
}
@ -519,20 +518,19 @@ EditorRouteGroups::run_new_group_dialog ()
void
EditorRouteGroups::all_group_toggled ()
{
if (_session) {
_session->all_route_group().set_select (_all_group_active_button.get_active());
}
if (_session) {
_session->all_route_group().set_select (_all_group_active_button.get_active());
}
}
void
EditorRouteGroups::all_group_changed (const PropertyChange&)
{
if (_session) {
RouteGroup& arg (_session->all_route_group());
_all_group_active_button.set_active (arg.is_active() && arg.is_select());
} else {
_all_group_active_button.set_active (false);
}
if (_session) {
RouteGroup& arg (_session->all_route_group());
_all_group_active_button.set_active (arg.is_active() && arg.is_select());
} else {
_all_group_active_button.set_active (false);
}
}

View File

@ -165,8 +165,8 @@ ArdourStartup::set_load_template( string load_template )
bool
ArdourStartup::use_session_template ()
{
if (!load_template_override.empty())
return true;
if (!load_template_override.empty())
return true;
if (use_template_button.get_active()) {
return template_chooser.get_active_row_number() > 0;
@ -178,10 +178,10 @@ ArdourStartup::use_session_template ()
std::string
ArdourStartup::session_template_name ()
{
if (!load_template_override.empty()) {
string the_path = (ARDOUR::user_template_directory()/ (load_template_override + ".template")).to_string();
return the_path;
}
if (!load_template_override.empty()) {
string the_path = (ARDOUR::user_template_directory()/ (load_template_override + ".template")).to_string();
return the_path;
}
if (ic_existing_session_button.get_active()) {
return string();
@ -204,8 +204,8 @@ ArdourStartup::session_name (bool& should_be_new)
if (ic_new_session_button.get_active()) {
should_be_new = true;
string val = new_name_entry.get_text ();
strip_whitespace_edges (val);
return val;
strip_whitespace_edges (val);
return val;
} else if (_existing_session_chooser_used) {
/* existing session chosen from file chooser */
should_be_new = false;
@ -300,7 +300,7 @@ void
ArdourStartup::default_dir_changed ()
{
Config->set_default_session_parent_dir (default_dir_chooser->get_current_folder());
config_changed ();
config_changed ();
}
void
@ -399,47 +399,47 @@ ArdourStartup::setup_monitor_section_choice_page ()
HBox* hbox = manage (new HBox);
VBox* main_vbox = manage (new VBox);
VBox* vbox;
Label* l = manage (new Label);
Label* l = manage (new Label);
main_vbox->set_spacing (32);
no_monitor_section_button.set_label (_("Use a Master bus directly"));
l->set_alignment (0.0, 1.0);
l->set_markup(_("Connect the Master bus directly to your hardware outputs.\n\
no_monitor_section_button.set_label (_("Use a Master bus directly"));
l->set_alignment (0.0, 1.0);
l->set_markup(_("Connect the Master bus directly to your hardware outputs.\n\
<i>Preferable for simple use</i>."));
vbox = manage (new VBox);
vbox = manage (new VBox);
vbox->set_spacing (6);
vbox->pack_start (no_monitor_section_button, false, true);
vbox->pack_start (*l, false, true);
main_vbox->pack_start (*vbox, false, false);
main_vbox->pack_start (*vbox, false, false);
use_monitor_section_button.set_label (_("Use an additional Monitor bus"));
l = manage (new Label);
l->set_alignment (0.0, 1.0);
l->set_text (_("Use a Monitor bus between Master bus and hardware outputs for \n\
use_monitor_section_button.set_label (_("Use an additional Monitor bus"));
l = manage (new Label);
l->set_alignment (0.0, 1.0);
l->set_text (_("Use a Monitor bus between Master bus and hardware outputs for \n\
greater control in monitoring without affecting the mix."));
vbox = manage (new VBox);
vbox = manage (new VBox);
vbox->set_spacing (6);
vbox->pack_start (use_monitor_section_button, false, true);
vbox->pack_start (*l, false, true);
main_vbox->pack_start (*vbox, false, false);
main_vbox->pack_start (*vbox, false, false);
RadioButton::Group g (use_monitor_section_button.get_group());
no_monitor_section_button.set_group (g);
if (Config->get_use_monitor_bus()) {
use_monitor_section_button.set_active (true);
} else {
no_monitor_section_button.set_active (true);
}
if (Config->get_use_monitor_bus()) {
use_monitor_section_button.set_active (true);
} else {
no_monitor_section_button.set_active (true);
}
use_monitor_section_button.signal_toggled().connect (sigc::mem_fun (*this, &ArdourStartup::config_changed));
no_monitor_section_button.signal_toggled().connect (sigc::mem_fun (*this, &ArdourStartup::config_changed));
use_monitor_section_button.signal_toggled().connect (sigc::mem_fun (*this, &ArdourStartup::config_changed));
no_monitor_section_button.signal_toggled().connect (sigc::mem_fun (*this, &ArdourStartup::config_changed));
monitor_section_label.set_markup(_("<i><small>(You can change this preference at any time, via the Preferences dialog)</small></i>"));
monitor_section_label.set_alignment (0.0, 0.0);
@ -575,7 +575,7 @@ ArdourStartup::on_apply ()
Config->set_monitoring_model (SoftwareMonitoring);
}
Config->set_use_monitor_bus (use_monitor_section_button.get_active());
Config->set_use_monitor_bus (use_monitor_section_button.get_active());
Config->save_state ();
}
@ -621,10 +621,10 @@ ArdourStartup::populate_session_templates ()
static bool
lost_name_entry_focus (GdkEventFocus*)
{
cerr << "lost focus\n";
return false;
cerr << "lost focus\n";
return false;
}
void
ArdourStartup::setup_new_session_page ()
{
@ -678,7 +678,7 @@ ArdourStartup::setup_new_session_page ()
new_folder_chooser.set_title (_("Select folder for session"));
#ifdef GTKOSX
new_folder_chooser.add_shortcut_folder ("/Volumes");
new_folder_chooser.add_shortcut_folder ("/Volumes");
#endif
vbox1->pack_start (*hbox2, false, false);
@ -780,13 +780,13 @@ ArdourStartup::setup_new_session_page ()
set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
new_name_entry.signal_map().connect (sigc::mem_fun (*this, &ArdourStartup::new_name_mapped));
new_name_entry.signal_focus_out_event().connect (sigc::ptr_fun (lost_name_entry_focus));
new_name_entry.signal_focus_out_event().connect (sigc::ptr_fun (lost_name_entry_focus));
}
void
ArdourStartup::new_name_mapped ()
{
cerr << "Grab new name focus\n";
cerr << "Grab new name focus\n";
new_name_entry.grab_focus ();
}
@ -821,7 +821,7 @@ ArdourStartup::redisplay_recent_sessions ()
sort (rs.begin(), rs.end(), cmp);
for (ARDOUR::RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) {
session_directories.push_back ((*i).second);
session_directories.push_back ((*i).second);
}
for (vector<sys::path>::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i)
@ -1252,7 +1252,7 @@ ArdourStartup::limit_outputs_clicked ()
void
ArdourStartup::master_bus_button_clicked ()
{
bool yn = _create_master_bus.get_active();
bool yn = _create_master_bus.get_active();
_master_bus_channel_count.set_sensitive(yn);
}