NO-OP whitespace (updated GH PR #357)

This commit is contained in:
Thomas Brand 2017-07-01 18:42:24 +02:00 committed by Robin Gareus
parent f413b83cb9
commit 63ea7b6516
132 changed files with 2774 additions and 2762 deletions

View file

@ -287,7 +287,7 @@ AddRouteDialog::track_type_chosen ()
true, MESSAGE_INFO, BUTTONS_OK, true); true, MESSAGE_INFO, BUTTONS_OK, true);
msg.set_position (WIN_POS_MOUSE); msg.set_position (WIN_POS_MOUSE);
msg.run (); msg.run ();
} }
channel_combo.set_sensitive (true); channel_combo.set_sensitive (true);
mode_combo.set_sensitive (true); mode_combo.set_sensitive (true);
instrument_combo.set_sensitive (true); instrument_combo.set_sensitive (true);

View file

@ -33,7 +33,7 @@ public:
private: private:
Gtk::RadioButtonGroup _group; Gtk::RadioButtonGroup _group;
std::vector<Gtk::RadioButton*> _radio_buttons; std::vector<Gtk::RadioButton*> _radio_buttons;
bool rb_button_press (GdkEventButton*); bool rb_button_press (GdkEventButton*);
}; };
#endif // __gtk_ardour_ambiguous_file_dialog_h__ #endif // __gtk_ardour_ambiguous_file_dialog_h__

View file

@ -45,12 +45,12 @@ AnalysisWindow::AnalysisWindow()
: source_selection_label (_("Signal source")) : source_selection_label (_("Signal source"))
, source_selection_ranges_rb (_("Selected ranges")) , source_selection_ranges_rb (_("Selected ranges"))
, source_selection_regions_rb (_("Selected regions")) , source_selection_regions_rb (_("Selected regions"))
, show_minmax_button (_("Show frequency power range")) , show_minmax_button (_("Show frequency power range"))
, show_normalized_button (_("Fit dB range")) , show_normalized_button (_("Fit dB range"))
, show_proportional_button (_("Proportional Spectrum, -18dB")) , show_proportional_button (_("Proportional Spectrum, -18dB"))
, fft_graph (16384) , fft_graph (16384)
{ {
set_name(_("FFT analysis window")); set_name (_("FFT analysis window"));
set_title (_("Spectral Analysis")); set_title (_("Spectral Analysis"));
track_list_ready = false; track_list_ready = false;

View file

@ -199,7 +199,7 @@ using namespace Editing;
ARDOUR_UI *ARDOUR_UI::theArdourUI = 0; ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
sigc::signal<void, framepos_t, bool, framepos_t> ARDOUR_UI::Clock; sigc::signal<void, framepos_t, bool, framepos_t> ARDOUR_UI::Clock;
sigc::signal<void> ARDOUR_UI::CloseAllDialogs; sigc::signal<void> ARDOUR_UI::CloseAllDialogs;
static bool static bool
ask_about_configuration_copy (string const & old_dir, string const & new_dir, int version) ask_about_configuration_copy (string const & old_dir, string const & new_dir, int version)
@ -212,7 +212,7 @@ ask_about_configuration_copy (string const & old_dir, string const & new_dir, in
Gtk::MESSAGE_INFO, Gtk::MESSAGE_INFO,
Gtk::BUTTONS_YES_NO, Gtk::BUTTONS_YES_NO,
true /* modal, though it hardly matters since it is the only window */ true /* modal, though it hardly matters since it is the only window */
); );
msg.set_default_response (Gtk::RESPONSE_YES); msg.set_default_response (Gtk::RESPONSE_YES);
msg.show_all (); msg.show_all ();
@ -222,8 +222,8 @@ ask_about_configuration_copy (string const & old_dir, string const & new_dir, in
static void static void
libxml_generic_error_func (void* /* parsing_context*/, libxml_generic_error_func (void* /* parsing_context*/,
const char* msg, const char* msg,
...) ...)
{ {
va_list ap; va_list ap;
char buf[2048]; char buf[2048];
@ -463,7 +463,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
TimeAxisViewItem::set_constant_heights (); TimeAxisViewItem::set_constant_heights ();
/* Set this up so that our window proxies can register actions */ /* Set this up so that our window proxies can register actions */
ActionManager::init (); ActionManager::init ();
@ -529,8 +529,8 @@ ARDOUR_UI::pre_release_dialog ()
ArdourDialog d (_("Pre-Release Warning"), true, false); ArdourDialog d (_("Pre-Release Warning"), true, false);
d.add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK); d.add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
Label* label = manage (new Label); Label* label = manage (new Label);
label->set_markup (string_compose (_("<b>Welcome to this pre-release build of %1 %2</b>\n\n\ label->set_markup (string_compose (_("<b>Welcome to this pre-release build of %1 %2</b>\n\n\
There are still several issues and bugs to be worked on,\n\ There are still several issues and bugs to be worked on,\n\
as well as general workflow improvements, before this can be considered\n\ as well as general workflow improvements, before this can be considered\n\
release software. So, a few guidelines:\n\ release software. So, a few guidelines:\n\
@ -550,11 +550,11 @@ Full information on all the above can be found on the support page at\n\
http://ardour.org/support\n\ http://ardour.org/support\n\
"), PROGRAM_NAME, VERSIONSTRING)); "), PROGRAM_NAME, VERSIONSTRING));
d.get_vbox()->set_border_width (12); d.get_vbox()->set_border_width (12);
d.get_vbox()->pack_start (*label, false, false, 12); d.get_vbox()->pack_start (*label, false, false, 12);
d.get_vbox()->show_all (); d.get_vbox()->show_all ();
d.run (); d.run ();
} }
GlobalPortMatrixWindow* GlobalPortMatrixWindow*
@ -1940,9 +1940,9 @@ ARDOUR_UI::check_audioengine (Gtk::Window& parent)
{ {
if (!AudioEngine::instance()->connected()) { if (!AudioEngine::instance()->connected()) {
MessageDialog msg (parent, string_compose ( MessageDialog msg (parent, string_compose (
_("%1 is not connected to any audio backend.\n" _("%1 is not connected to any audio backend.\n"
"You cannot open or close sessions in this condition"), "You cannot open or close sessions in this condition"),
PROGRAM_NAME)); PROGRAM_NAME));
pop_back_splash (msg); pop_back_splash (msg);
msg.run (); msg.run ();
return false; return false;
@ -2906,7 +2906,7 @@ ARDOUR_UI::process_snapshot_session_prompter (ArdourPrompter& prompter, bool swi
char illegal = Session::session_name_is_legal(snapname); char illegal = Session::session_name_is_legal(snapname);
if (illegal) { if (illegal) {
MessageDialog msg (string_compose (_("To ensure compatibility with various systems\n" MessageDialog msg (string_compose (_("To ensure compatibility with various systems\n"
"snapshot names may not contain a '%1' character"), illegal)); "snapshot names may not contain a '%1' character"), illegal));
msg.run (); msg.run ();
return false; return false;
} }
@ -3006,7 +3006,7 @@ ARDOUR_UI::rename_session ()
if (illegal) { if (illegal) {
MessageDialog msg (string_compose (_("To ensure compatibility with various systems\n" MessageDialog msg (string_compose (_("To ensure compatibility with various systems\n"
"session names may not contain a '%1' character"), illegal)); "session names may not contain a '%1' character"), illegal));
msg.run (); msg.run ();
goto again; goto again;
} }
@ -3449,7 +3449,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
session_path = session_dialog.session_folder (); session_path = session_dialog.session_folder ();
if (nsm) { if (nsm) {
likely_new = true; likely_new = true;
} }
if (!likely_new) { if (!likely_new) {
@ -3486,12 +3486,12 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
if (session_name[0] == G_DIR_SEPARATOR || if (session_name[0] == G_DIR_SEPARATOR ||
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
(session_name.length() > 3 && session_name[1] == ':' && session_name[2] == G_DIR_SEPARATOR) (session_name.length() > 3 && session_name[1] == ':' && session_name[2] == G_DIR_SEPARATOR)
#else #else
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == G_DIR_SEPARATOR) || (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) (session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == G_DIR_SEPARATOR)
#endif #endif
) )
{ {
/* absolute path or cwd-relative path specified for session name: infer session folder /* absolute path or cwd-relative path specified for session name: infer session folder
@ -3509,9 +3509,9 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
if (illegal) { if (illegal) {
MessageDialog msg (session_dialog, MessageDialog msg (session_dialog,
string_compose (_("To ensure compatibility with various systems\n" string_compose (_("To ensure compatibility with various systems\n"
"session names may not contain a '%1' character"), "session names may not contain a '%1' character"),
illegal)); illegal));
msg.run (); msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue; continue;
@ -3548,7 +3548,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
if (illegal) { if (illegal) {
pop_back_splash (session_dialog); pop_back_splash (session_dialog);
MessageDialog msg (session_dialog, string_compose(_("To ensure compatibility with various systems\n" MessageDialog msg (session_dialog, string_compose(_("To ensure compatibility with various systems\n"
"session names may not contain a '%1' character"), illegal)); "session names may not contain a '%1' character"), illegal));
msg.run (); msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue; continue;
@ -3701,8 +3701,8 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
catch (...) { catch (...) {
MessageDialog msg (string_compose( MessageDialog msg (string_compose(
_("Session \"%1 (snapshot %2)\" did not load successfully"), _("Session \"%1 (snapshot %2)\" did not load successfully"),
path, snap_name), path, snap_name),
true, true,
Gtk::MESSAGE_INFO, Gtk::MESSAGE_INFO,
BUTTONS_OK); BUTTONS_OK);
@ -3968,8 +3968,8 @@ ARDOUR_UI::show_splash ()
void void
ARDOUR_UI::hide_splash () ARDOUR_UI::hide_splash ()
{ {
delete splash; delete splash;
splash = 0; splash = 0;
} }
void void
@ -3981,10 +3981,10 @@ ARDOUR_UI::display_cleanup_results (ARDOUR::CleanupReport& rep, const gchar* lis
if (removed == 0) { if (removed == 0) {
MessageDialog msgd (_main_window, MessageDialog msgd (_main_window,
_("No files were ready for clean-up"), _("No files were ready for clean-up"),
true, true,
Gtk::MESSAGE_INFO, Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK); Gtk::BUTTONS_OK);
msgd.set_title (_("Clean-up")); msgd.set_title (_("Clean-up"));
msgd.set_secondary_text (_("If this seems suprising, \n\ msgd.set_secondary_text (_("If this seems suprising, \n\
check for any existing snapshots.\n\ check for any existing snapshots.\n\
@ -3998,12 +3998,12 @@ require some unused files to continue to exist."));
ArdourDialog results (_("Clean-up"), true, false); ArdourDialog results (_("Clean-up"), true, false);
struct CleanupResultsModelColumns : public Gtk::TreeModel::ColumnRecord { struct CleanupResultsModelColumns : public Gtk::TreeModel::ColumnRecord {
CleanupResultsModelColumns() { CleanupResultsModelColumns() {
add (visible_name); add (visible_name);
add (fullpath); add (fullpath);
} }
Gtk::TreeModelColumn<std::string> visible_name; Gtk::TreeModelColumn<std::string> visible_name;
Gtk::TreeModelColumn<std::string> fullpath; Gtk::TreeModelColumn<std::string> fullpath;
}; };
@ -4847,8 +4847,8 @@ ARDOUR_UI::create_xrun_marker (framepos_t where)
void void
ARDOUR_UI::halt_on_xrun_message () ARDOUR_UI::halt_on_xrun_message ()
{ {
cerr << "HALT on xrun\n"; cerr << "HALT on xrun\n";
MessageDialog msg (_main_window, _("Recording was stopped because your system could not keep up.")); MessageDialog msg (_main_window, _("Recording was stopped because your system could not keep up."));
msg.run (); msg.run ();
} }
@ -5103,10 +5103,10 @@ audio may be played at the wrong sample rate.\n"), desired, PROGRAM_NAME, actual
case RESPONSE_ACCEPT: case RESPONSE_ACCEPT:
return 0; return 0;
default: default:
break; break;
} }
return 1; return 1;
} }
void void
@ -5400,11 +5400,11 @@ ARDOUR_UI::session_format_mismatch (std::string xml_path, std::string backup_pat
const char* end_mono = "</tt>"; const char* end_mono = "</tt>";
MessageDialog msg (string_compose (_("%4This is a session from an older version of %3%5\n\n" MessageDialog msg (string_compose (_("%4This is a session from an older version of %3%5\n\n"
"%3 has copied the old session file\n\n%6%1%7\n\nto\n\n%6%2%7\n\n" "%3 has copied the old session file\n\n%6%1%7\n\nto\n\n%6%2%7\n\n"
"From now on, use the backup copy with older versions of %3"), "From now on, use the backup copy with older versions of %3"),
xml_path, backup_path, PROGRAM_NAME, xml_path, backup_path, PROGRAM_NAME,
start_big, end_big, start_big, end_big,
start_mono, end_mono), true); start_mono, end_mono), true);
msg.run (); msg.run ();
} }
@ -5632,7 +5632,7 @@ ARDOUR_UI::audioengine_became_silent ()
void void
ARDOUR_UI::hide_application () ARDOUR_UI::hide_application ()
{ {
Application::instance ()-> hide (); Application::instance ()-> hide ();
} }
void void
@ -5758,7 +5758,7 @@ ARDOUR_UI::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey
bool special_handling_of_unmodified_accelerators = false; bool special_handling_of_unmodified_accelerators = false;
const guint mask = (Keyboard::RelevantModifierKeyMask & ~(Gdk::SHIFT_MASK|Gdk::LOCK_MASK)); const guint mask = (Keyboard::RelevantModifierKeyMask & ~(Gdk::SHIFT_MASK|Gdk::LOCK_MASK));
if (focus) { if (focus) {
/* some widget has keyboard focus */ /* some widget has keyboard focus */
@ -5781,13 +5781,13 @@ ARDOUR_UI::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey
} }
} }
DEBUG_TRACE (DEBUG::Accelerators, string_compose ("Win = %1 [title = %9] focus = %7 (%8) Key event: code = %2 state = %3 special handling ? %4 magic widget focus ? %5 focus widget %6 named %7 mods ? %8\n", DEBUG_TRACE (DEBUG::Accelerators, string_compose ("Win = %1 [title = %9] focus = %7 (%8) Key event: code = %2 state = %3 special handling ? %4 magic widget focus ? %5 focus widget %6 named %7 mods ? %8\n",
win, win,
ev->keyval, ev->keyval,
Gtkmm2ext::show_gdk_event_state (ev->state), Gtkmm2ext::show_gdk_event_state (ev->state),
special_handling_of_unmodified_accelerators, special_handling_of_unmodified_accelerators,
Keyboard::some_magic_widget_has_focus(), Keyboard::some_magic_widget_has_focus(),
focus, focus,
(focus ? gtk_widget_get_name (focus) : "no focus widget"), (focus ? gtk_widget_get_name (focus) : "no focus widget"),
((ev->state & mask) ? "yes" : "no"), ((ev->state & mask) ? "yes" : "no"),
window.get_title())); window.get_title()));
@ -5828,7 +5828,7 @@ ARDOUR_UI::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey
/* no special handling or there are modifiers in effect: accelerate first */ /* no special handling or there are modifiers in effect: accelerate first */
DEBUG_TRACE (DEBUG::Accelerators, "\tactivate, then propagate\n"); DEBUG_TRACE (DEBUG::Accelerators, "\tactivate, then propagate\n");
DEBUG_TRACE (DEBUG::Accelerators, string_compose ("\tevent send-event:%1 time:%2 length:%3 name %7 string:%4 hardware_keycode:%5 group:%6\n", DEBUG_TRACE (DEBUG::Accelerators, string_compose ("\tevent send-event:%1 time:%2 length:%3 name %7 string:%4 hardware_keycode:%5 group:%6\n",
ev->send_event, ev->time, ev->length, ev->string, ev->hardware_keycode, ev->group, gdk_keyval_name (ev->keyval))); ev->send_event, ev->time, ev->length, ev->string, ev->hardware_keycode, ev->group, gdk_keyval_name (ev->keyval)));
@ -5863,12 +5863,12 @@ ARDOUR_UI::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey
return true; return true;
} }
DEBUG_TRACE (DEBUG::Accelerators, "\tnot accelerated, now propagate\n"); DEBUG_TRACE (DEBUG::Accelerators, "\tnot accelerated, now propagate\n");
if (gtk_window_propagate_key_event (win, ev)) { if (gtk_window_propagate_key_event (win, ev)) {
DEBUG_TRACE (DEBUG::Accelerators, "\tpropagate handled\n"); DEBUG_TRACE (DEBUG::Accelerators, "\tpropagate handled\n");
return true; return true;
} }
} else { } else {

View file

@ -462,7 +462,7 @@ private:
void about_signal_response(int response); void about_signal_response(int response);
Gtk::VBox top_packer; Gtk::VBox top_packer;
sigc::connection clock_signal_connection; sigc::connection clock_signal_connection;
void update_clocks (); void update_clocks ();
@ -485,22 +485,22 @@ private:
void update_clock_visibility (); void update_clock_visibility ();
struct TransportControllable : public PBD::Controllable { struct TransportControllable : public PBD::Controllable {
enum ToggleType { enum ToggleType {
Roll = 0, Roll = 0,
Stop, Stop,
RecordEnable, RecordEnable,
GotoStart, GotoStart,
GotoEnd, GotoEnd,
AutoLoop, AutoLoop,
PlaySelection, PlaySelection,
}; };
TransportControllable (std::string name, ARDOUR_UI&, ToggleType); TransportControllable (std::string name, ARDOUR_UI&, ToggleType);
void set_value (double, PBD::Controllable::GroupControlDisposition group_override); void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
double get_value (void) const; double get_value (void) const;
ARDOUR_UI& ui; ARDOUR_UI& ui;
ToggleType type; ToggleType type;
}; };
boost::shared_ptr<TransportControllable> roll_controllable; boost::shared_ptr<TransportControllable> roll_controllable;

View file

@ -219,10 +219,10 @@ ARDOUR_UI::main_window_delete_event (GdkEventAny* ev)
static GtkNotebook* static GtkNotebook*
tab_window_root_drop (GtkNotebook* src, tab_window_root_drop (GtkNotebook* src,
GtkWidget* w, GtkWidget* w,
gint x, gint x,
gint y, gint y,
gpointer user_data) gpointer user_data)
{ {
return ARDOUR_UI::instance()->tab_window_root_drop (src, w, x, y, user_data); return ARDOUR_UI::instance()->tab_window_root_drop (src, w, x, y, user_data);
} }

View file

@ -187,10 +187,10 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act); ActionManager::session_sensitive_actions.push_back (act);
act = global_actions.register_action (main_actions, X_("OpenVideo"), _("Open Video..."), act = global_actions.register_action (main_actions, X_("OpenVideo"), _("Open Video..."),
sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::add_video), (Gtk::Window*) 0)); sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::add_video), (Gtk::Window*) 0));
ActionManager::session_sensitive_actions.push_back (act); ActionManager::session_sensitive_actions.push_back (act);
act = global_actions.register_action (main_actions, X_("CloseVideo"), _("Remove Video"), act = global_actions.register_action (main_actions, X_("CloseVideo"), _("Remove Video"),
sigc::mem_fun (*this, &ARDOUR_UI::remove_video)); sigc::mem_fun (*this, &ARDOUR_UI::remove_video));
act->set_sensitive (false); act->set_sensitive (false);
act = global_actions.register_action (main_actions, X_("ExportVideo"), _("Export to Video File..."), act = global_actions.register_action (main_actions, X_("ExportVideo"), _("Export to Video File..."),
hide_return (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::export_video), false))); hide_return (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::export_video), false)));
@ -730,8 +730,8 @@ ARDOUR_UI::use_menubar_as_top_menubar ()
Gtk::Widget* widget; Gtk::Widget* widget;
Application* app = Application::instance (); Application* app = Application::instance ();
/* the addresses ("/ui/Main...") used below are based on the menu definitions in the menus file /* the addresses ("/ui/Main...") used below are based on the menu definitions in the menus file
*/ */
/* Quit will be taken care of separately */ /* Quit will be taken care of separately */
@ -747,11 +747,11 @@ ARDOUR_UI::use_menubar_as_top_menubar ()
if ((widget = ActionManager::get_widget ("/ui/Main/Session/toggle-about"))) { if ((widget = ActionManager::get_widget ("/ui/Main/Session/toggle-about"))) {
app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget)); app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
} }
if ((widget = ActionManager::get_widget ("/ui/Main/Edit/menu-show-preferences"))) { if ((widget = ActionManager::get_widget ("/ui/Main/Edit/menu-show-preferences"))) {
app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget)); app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
} }
app->set_menu_bar (*menu_bar); app->set_menu_bar (*menu_bar);
} }

View file

@ -106,26 +106,26 @@ ArdourWindow::init ()
set_border_width (10); set_border_width (10);
add_events (Gdk::FOCUS_CHANGE_MASK); add_events (Gdk::FOCUS_CHANGE_MASK);
/* ArdourWindows are not dialogs (they have no "OK" or "Close" button) but /* ArdourWindows are not dialogs (they have no "OK" or "Close" button) but
they should be considered part of the same "window level" as a dialog. This they should be considered part of the same "window level" as a dialog. This
works on X11 in that: works on X11 in that:
(a) there are no window "levels" (a) there are no window "levels"
(b) they will float above normal windows without any particular effort (b) they will float above normal windows without any particular effort
(c) present()-ing them will make a utility float over a dialog or (c) present()-ing them will make a utility float over a dialog or
vice versa. vice versa.
Some X11 Window managers (e.g. KDE) get this wrong, and so we allow the user Some X11 Window managers (e.g. KDE) get this wrong, and so we allow the user
to select what type of window hint is used. to select what type of window hint is used.
GTK+ on OS X uses different levels for DIALOG and UTILITY, and Cocoa has a bug/design GTK+ on OS X uses different levels for DIALOG and UTILITY, and Cocoa has a bug/design
issue that it will not transfer keyboard focus across levels when hiding a window. issue that it will not transfer keyboard focus across levels when hiding a window.
So on OS X, we use DIALOG for all ArdourWindows to ensure that keyboard focus So on OS X, we use DIALOG for all ArdourWindows to ensure that keyboard focus
will return to the main window(s) when this window is hidden. will return to the main window(s) when this window is hidden.
*/ */
#ifdef __APPLE__ #ifdef __APPLE__
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG); set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
#else #else
if (UIConfiguration::instance().get_all_floating_windows_are_dialogs()) { if (UIConfiguration::instance().get_all_floating_windows_are_dialogs()) {
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG); set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);

View file

@ -62,7 +62,7 @@ class AUPluginUI;
@interface NotificationObject : NSObject { @interface NotificationObject : NSObject {
@private @private
AUPluginUI* plugin_ui; AUPluginUI* plugin_ui;
NSWindow* cocoa_parent; NSWindow* cocoa_parent;
NSWindow* top_level_parent; NSWindow* top_level_parent;
} }
@end @end
@ -87,7 +87,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
void activate (); void activate ();
void deactivate (); void deactivate ();
bool non_gtk_gui() const { return true; } bool non_gtk_gui() const { return true; }
void lower_box_realized (); void lower_box_realized ();
bool lower_box_visibility_notify (GdkEventVisibility*); bool lower_box_visibility_notify (GdkEventVisibility*);

View file

@ -327,10 +327,10 @@ AudioClock::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t*
cairo_set_source_rgba (cr, cursor_r, cursor_g, cursor_b, cursor_a); cairo_set_source_rgba (cr, cursor_r, cursor_g, cursor_b, cursor_a);
cairo_rectangle (cr, cairo_rectangle (cr,
min (get_width() - 2.0, min (get_width() - 2.0,
(double) xcenter + cursor.get_x()/PANGO_SCALE + em_width), (double) xcenter + cursor.get_x()/PANGO_SCALE + em_width),
(get_height() - layout_height)/2.0, (get_height() - layout_height)/2.0,
2.0, cursor.get_height()/PANGO_SCALE); 2.0, cursor.get_height()/PANGO_SCALE);
cairo_fill (cr); cairo_fill (cr);
} else { } else {
/* we've entered all possible digits, no cursor */ /* we've entered all possible digits, no cursor */
@ -1722,8 +1722,7 @@ AudioClock::on_motion_notify_event (GdkEventMotion *ev)
if (Keyboard::modifier_state_contains (ev->state, if (Keyboard::modifier_state_contains (ev->state,
Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) { Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) {
pixel_frame_scale_factor = 0.025f; pixel_frame_scale_factor = 0.025f;
} }
@ -1881,7 +1880,7 @@ AudioClock::timecode_validate_edit (const string&)
char ignored[2]; char ignored[2];
if (sscanf (_layout->get_text().c_str(), "%[- _]%" PRId32 ":%" PRId32 ":%" PRId32 "%[:;]%" PRId32, if (sscanf (_layout->get_text().c_str(), "%[- _]%" PRId32 ":%" PRId32 ":%" PRId32 "%[:;]%" PRId32,
ignored, &hours, &TC.minutes, &TC.seconds, ignored, &TC.frames) != 6) { ignored, &hours, &TC.minutes, &TC.seconds, ignored, &TC.frames) != 6) {
return false; return false;
} }
@ -1996,10 +1995,10 @@ AudioClock::frames_from_bbt_string (framepos_t pos, const string& str) const
if (is_duration) { if (is_duration) {
any.bbt.bars++; any.bbt.bars++;
any.bbt.beats++; any.bbt.beats++;
return _session->any_duration_to_frames (pos, any); return _session->any_duration_to_frames (pos, any);
} else { } else {
return _session->convert_to_frames (any); return _session->convert_to_frames (any);
} }
} }

View file

@ -888,7 +888,7 @@ AudioRegionView::redraw_end_xfade ()
void void
AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t width, Points& points, double effective_height, AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t width, Points& points, double effective_height,
double rect_edge, double rect_width) double rect_edge, double rect_width)
{ {
if (points.size() < 2) { if (points.size() < 2) {
return; return;
@ -1578,7 +1578,7 @@ AudioRegionView::set_some_waveform_colors (vector<ArdourCanvas::WaveView*>& wave
} }
} }
for (vector<ArdourCanvas::WaveView*>::iterator w = waves_to_color.begin(); w != waves_to_color.end(); ++w) { for (vector<ArdourCanvas::WaveView*>::iterator w = waves_to_color.begin(); w != waves_to_color.end(); ++w) {
(*w)->set_fill_color (fill); (*w)->set_fill_color (fill);
(*w)->set_outline_color (outline); (*w)->set_outline_color (outline);
(*w)->set_clip_color (clip); (*w)->set_clip_color (clip);
@ -1720,11 +1720,11 @@ AudioRegionView::update_transient(float /*old_pos*/, float new_pos)
float* pos = (float*) (*l).second->get_data ("position"); float* pos = (float*) (*l).second->get_data ("position");
if (rint(new_pos) == rint(*pos)) { if (rint(new_pos) == rint(*pos)) {
framepos_t position = _region->position(); framepos_t position = _region->position();
framepos_t old_frame = (*l).first; framepos_t old_frame = (*l).first;
framepos_t new_frame = trackview.editor().pixel_to_sample (new_pos) + position; framepos_t new_frame = trackview.editor().pixel_to_sample (new_pos) + position;
_region->update_transient (old_frame, new_frame); _region->update_transient (old_frame, new_frame);
break; break;
} }
} }
} }
@ -1742,8 +1742,8 @@ AudioRegionView::remove_transient (float pos)
for (l = feature_lines.begin(); l != feature_lines.end(); ++l) { for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
float *line_pos = (float*) (*l).second->get_data ("position"); float *line_pos = (float*) (*l).second->get_data ("position");
if (rint(pos) == rint(*line_pos)) { if (rint(pos) == rint(*line_pos)) {
_region->remove_transient ((*l).first); _region->remove_transient ((*l).first);
break; break;
} }
} }
} }

View file

@ -86,7 +86,7 @@ class AudioRegionView : public RegionView
void update_envelope_visibility (); void update_envelope_visibility ();
void add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event, bool with_guard_points); void add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event, bool with_guard_points);
void remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event); void remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event);
boost::shared_ptr<AudioRegionGainLine> get_gain_line() const { return gain_line; } boost::shared_ptr<AudioRegionGainLine> get_gain_line() const { return gain_line; }
@ -118,8 +118,8 @@ class AudioRegionView : public RegionView
void drag_start (); void drag_start ();
void drag_end (); void drag_end ();
void redraw_start_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, framecnt_t, ArdourCanvas::Points&, double, double); void redraw_start_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, framecnt_t, ArdourCanvas::Points&, double, double);
void redraw_end_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, framecnt_t, ArdourCanvas::Points&, double, double, double); void redraw_end_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, framecnt_t, ArdourCanvas::Points&, double, double, double);
void redraw_start_xfade (); void redraw_start_xfade ();
void redraw_end_xfade (); void redraw_end_xfade ();
@ -194,7 +194,7 @@ class AudioRegionView : public RegionView
void peaks_ready_handler (uint32_t); void peaks_ready_handler (uint32_t);
void set_colors (); void set_colors ();
void set_waveform_colors (); void set_waveform_colors ();
void reset_width_dependent_items (double pixel_width); void reset_width_dependent_items (double pixel_width);
void set_frame_color (); void set_frame_color ();

View file

@ -111,7 +111,7 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
break; break;
case Destructive: case Destructive:
region_view = new TapeAudioRegionView (_canvas_group, _trackview, region, region_view = new TapeAudioRegionView (_canvas_group, _trackview, region,
_samples_per_pixel, region_color); _samples_per_pixel, region_color);
break; break;
default: default:
fatal << string_compose (_("programming error: %1"), "illegal track mode in ::create_region_view()") << endmsg; fatal << string_compose (_("programming error: %1"), "illegal track mode in ::create_region_view()") << endmsg;
@ -240,8 +240,8 @@ AudioStreamView::setup_rec_box ()
create_rec_box(frame_pos, width); create_rec_box(frame_pos, width);
} else if (rec_active && } else if (rec_active &&
(_trackview.session()->record_status() != Session::Recording || (_trackview.session()->record_status() != Session::Recording ||
!_trackview.track()->rec_enable_control()->get_value())) { !_trackview.track()->rec_enable_control()->get_value())) {
screen_update_connection.disconnect(); screen_update_connection.disconnect();
rec_active = false; rec_active = false;
rec_updating = false; rec_updating = false;

View file

@ -116,7 +116,7 @@ AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
if (_route->panner_shell()) { if (_route->panner_shell()) {
_route->panner_shell()->Changed.connect (*this, invalidator (*this), _route->panner_shell()->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 */ /* map current state of the route */
@ -207,8 +207,8 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
create_trim_automation_child (param, show); create_trim_automation_child (param, show);
} else if (param.type() == PanWidthAutomation || } else if (param.type() == PanWidthAutomation ||
param.type() == PanElevationAutomation || param.type() == PanElevationAutomation ||
param.type() == PanAzimuthAutomation) { param.type() == PanAzimuthAutomation) {
ensure_pan_views (show); ensure_pan_views (show);

View file

@ -165,8 +165,8 @@ public:
protected: protected:
std::string _name; std::string _name;
guint32 _height; guint32 _height;
uint32_t _line_color; uint32_t _line_color;
boost::shared_ptr<ARDOUR::AutomationList> alist; boost::shared_ptr<ARDOUR::AutomationList> alist;
Evoral::TimeConverter<double, ARDOUR::framepos_t>* _time_converter; Evoral::TimeConverter<double, ARDOUR::framepos_t>* _time_converter;
@ -183,8 +183,8 @@ protected:
/** true if we did a push at any point during the current drag */ /** true if we did a push at any point during the current drag */
bool did_push; bool did_push;
ArdourCanvas::Item& _parent_group; ArdourCanvas::Item& _parent_group;
ArdourCanvas::Container* group; ArdourCanvas::Container* group;
ArdourCanvas::PolyLine* line; /* line */ ArdourCanvas::PolyLine* line; /* line */
ArdourCanvas::Points line_points; /* coordinates for canvas line */ ArdourCanvas::Points line_points; /* coordinates for canvas line */
std::vector<ControlPoint*> control_points; /* visible control points */ std::vector<ControlPoint*> control_points; /* visible control points */

View file

@ -51,7 +51,7 @@ using namespace Editing;
AutomationStreamView::AutomationStreamView (AutomationTimeAxisView& tv) AutomationStreamView::AutomationStreamView (AutomationTimeAxisView& tv)
: StreamView (*dynamic_cast<RouteTimeAxisView*>(tv.get_parent()), : StreamView (*dynamic_cast<RouteTimeAxisView*>(tv.get_parent()),
tv.canvas_display()) tv.canvas_display())
, _automation_view(tv) , _automation_view(tv)
, _pending_automation_state (Off) , _pending_automation_state (Off)
{ {

View file

@ -55,25 +55,25 @@ extern void no_app_nap (); // cocoacarbon.mm
static void static void
setup_logging(void) setup_logging(void)
{ {
/* The ASL API has evolved since it was introduced in 10.4. If ASL_LOG_DESCRIPTOR_WRITE is not available, /* The ASL API has evolved since it was introduced in 10.4. If ASL_LOG_DESCRIPTOR_WRITE is not available,
then we're not interested in doing any of this, since its only purpose is to get stderr/stdout to then we're not interested in doing any of this, since its only purpose is to get stderr/stdout to
appear in the Console. appear in the Console.
*/ */
#ifdef ASL_LOG_DESCRIPTOR_WRITE #ifdef ASL_LOG_DESCRIPTOR_WRITE
aslmsg msg; aslmsg msg;
aslclient c = asl_open (PROGRAM_NAME, "com.apple.console", 0); aslclient c = asl_open (PROGRAM_NAME, "com.apple.console", 0);
msg = asl_new(ASL_TYPE_MSG); msg = asl_new(ASL_TYPE_MSG);
asl_set(msg, ASL_KEY_FACILITY, "com.apple.console"); asl_set(msg, ASL_KEY_FACILITY, "com.apple.console");
asl_set(msg, ASL_KEY_LEVEL, ASL_STRING_NOTICE); asl_set(msg, ASL_KEY_LEVEL, ASL_STRING_NOTICE);
asl_set(msg, ASL_KEY_READ_UID, "-1"); asl_set(msg, ASL_KEY_READ_UID, "-1");
int fd = dup(2); int fd = dup(2);
//asl_set_filter(c, ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG)); //asl_set_filter(c, ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG));
asl_add_log_file(c, fd); asl_add_log_file(c, fd);
asl_log(c, NULL, ASL_LEVEL_INFO, string_compose ("Hello world from %1", PROGRAM_NAME).c_str()); asl_log(c, NULL, ASL_LEVEL_INFO, string_compose ("Hello world from %1", PROGRAM_NAME).c_str());
asl_log_descriptor(c, msg, ASL_LEVEL_INFO, 1, ASL_LOG_DESCRIPTOR_WRITE); asl_log_descriptor(c, msg, ASL_LEVEL_INFO, 1, ASL_LOG_DESCRIPTOR_WRITE);
asl_log_descriptor(c, msg, ASL_LEVEL_INFO, 2, ASL_LOG_DESCRIPTOR_WRITE); asl_log_descriptor(c, msg, ASL_LEVEL_INFO, 2, ASL_LOG_DESCRIPTOR_WRITE);
#else #else
#warning This build host has an older ASL API, so no console logging in this build. #warning This build host has an older ASL API, so no console logging in this build.
#endif #endif
@ -94,7 +94,7 @@ fixup_bundle_environment (int argc, char* argv[], string & localedir)
set_language_preference (); set_language_preference ();
setup_logging (); setup_logging ();
char execpath[MAXPATHLEN+1]; char execpath[MAXPATHLEN+1];
uint32_t pathsz = sizeof (execpath); uint32_t pathsz = sizeof (execpath);

View file

@ -92,7 +92,7 @@ gnome_canvas_simpleline_get_type (void)
static void static void
gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class) gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GtkObjectClass *object_class; GtkObjectClass *object_class;
GnomeCanvasItemClass *item_class; GnomeCanvasItemClass *item_class;
@ -200,7 +200,7 @@ gnome_canvas_simpleline_set_property (GObject *object,
GnomeCanvasSimpleLine *simpleline; GnomeCanvasSimpleLine *simpleline;
int update = FALSE; int update = FALSE;
int bounds_changed = FALSE; int bounds_changed = FALSE;
double d; double d;
g_return_if_fail (object != NULL); g_return_if_fail (object != NULL);
g_return_if_fail (GNOME_IS_CANVAS_SIMPLELINE (object)); g_return_if_fail (GNOME_IS_CANVAS_SIMPLELINE (object));
@ -209,42 +209,42 @@ gnome_canvas_simpleline_set_property (GObject *object,
switch (prop_id) { switch (prop_id) {
case PROP_X1: case PROP_X1:
d = g_value_get_double (value); d = g_value_get_double (value);
if (simpleline->x1 != d) { if (simpleline->x1 != d) {
simpleline->x1 = d; simpleline->x1 = d;
bounds_changed = TRUE; bounds_changed = TRUE;
} }
break; break;
case PROP_Y1: case PROP_Y1:
d = g_value_get_double (value); d = g_value_get_double (value);
if (simpleline->y1 != d) { if (simpleline->y1 != d) {
simpleline->y1 = d; simpleline->y1 = d;
bounds_changed = TRUE; bounds_changed = TRUE;
} }
break; break;
case PROP_X2: case PROP_X2:
d = g_value_get_double (value); d = g_value_get_double (value);
if (simpleline->x2 != d) { if (simpleline->x2 != d) {
simpleline->x2 = d; simpleline->x2 = d;
bounds_changed = TRUE; bounds_changed = TRUE;
} }
break; break;
case PROP_Y2: case PROP_Y2:
d = g_value_get_double (value); d = g_value_get_double (value);
if (simpleline->y2 != d) { if (simpleline->y2 != d) {
simpleline->y2 = d; simpleline->y2 = d;
bounds_changed = TRUE; bounds_changed = TRUE;
} }
break; break;
case PROP_COLOR_RGBA: case PROP_COLOR_RGBA:
if (simpleline->color != g_value_get_uint(value)) { if (simpleline->color != g_value_get_uint(value)) {
simpleline->color = g_value_get_uint(value); simpleline->color = g_value_get_uint(value);
UINT_TO_RGBA (simpleline->color, &simpleline->r, &simpleline->g, &simpleline->b, &simpleline->a); UINT_TO_RGBA (simpleline->color, &simpleline->r, &simpleline->g, &simpleline->b, &simpleline->a);
update = TRUE; update = TRUE;
} }
break; break;
default: default:
@ -262,8 +262,8 @@ gnome_canvas_simpleline_get_property (GObject *object,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
g_return_if_fail (object != NULL); g_return_if_fail (object != NULL);
g_return_if_fail (GNOME_IS_CANVAS_SIMPLELINE (object)); g_return_if_fail (GNOME_IS_CANVAS_SIMPLELINE (object));
GnomeCanvasSimpleLine *line = GNOME_CANVAS_SIMPLELINE (object); GnomeCanvasSimpleLine *line = GNOME_CANVAS_SIMPLELINE (object);
@ -293,69 +293,69 @@ static void
gnome_canvas_simpleline_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) gnome_canvas_simpleline_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
{ {
GnomeCanvasSimpleLine *simpleline; GnomeCanvasSimpleLine *simpleline;
double x1, x2, y1, y2; double x1, x2, y1, y2;
simpleline = GNOME_CANVAS_SIMPLELINE (item); simpleline = GNOME_CANVAS_SIMPLELINE (item);
if (parent_class->update) if (parent_class->update)
(* parent_class->update) (item, affine, clip_path, flags); (* parent_class->update) (item, affine, clip_path, flags);
/* redraw old location */ /* redraw old location */
gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2); gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
/* get current bounding box in parent-relative world coordinates */ /* get current bounding box in parent-relative world coordinates */
gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2); gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2);
/* convert parent-relative item coordinates to world coordinates */ /* convert parent-relative item coordinates to world coordinates */
gnome_canvas_item_i2w (item, &x1, &y1); gnome_canvas_item_i2w (item, &x1, &y1);
gnome_canvas_item_i2w (item, &x2, &y2); gnome_canvas_item_i2w (item, &x2, &y2);
/* don't suffer from rounding errors */ /* don't suffer from rounding errors */
x1 = floor (x1); x1 = floor (x1);
y1 = floor (y1); y1 = floor (y1);
x2 = ceil (x2); x2 = ceil (x2);
y2 = ceil (y2); y2 = ceil (y2);
/* force non-zero dimensionality for both axes */ /* force non-zero dimensionality for both axes */
if (x1 == x2) { if (x1 == x2) {
x2 += 1.0; x2 += 1.0;
} }
if (y1 == y2) { if (y1 == y2) {
y2 += 1.0; y2 += 1.0;
} }
/* reset item bounding box (canvas coordinates, so integral. but stored in doubles) */ /* reset item bounding box (canvas coordinates, so integral. but stored in doubles) */
gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x1, y1, &item->x1, &item->y1); gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x1, y1, &item->x1, &item->y1);
gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x2, y2, &item->x2, &item->y2); gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x2, y2, &item->x2, &item->y2);
/* redraw new location */ /* redraw new location */
gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2); gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
/* store actual line coords as canvas coordinates for use in render() */ /* store actual line coords as canvas coordinates for use in render() */
x1 = simpleline->x1; x1 = simpleline->x1;
y1 = simpleline->y1; y1 = simpleline->y1;
x2 = simpleline->x2; x2 = simpleline->x2;
y2 = simpleline->y2; y2 = simpleline->y2;
/* convert to world */ /* convert to world */
gnome_canvas_item_i2w (item, &x1, &y1); gnome_canvas_item_i2w (item, &x1, &y1);
gnome_canvas_item_i2w (item, &x2, &y2); gnome_canvas_item_i2w (item, &x2, &y2);
/* avoid rounding errors */ /* avoid rounding errors */
x1 = (int) floor (item->x1); x1 = (int) floor (item->x1);
y1 = (int) floor (item->y1); y1 = (int) floor (item->y1);
x2 = (int) ceil (item->x2); x2 = (int) ceil (item->x2);
y2 = (int) ceil (item->y2); y2 = (int) ceil (item->y2);
/* convert to canvas coordinates, integral, stored in integers */ /* convert to canvas coordinates, integral, stored in integers */
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x1, y1, &simpleline->cx1, &simpleline->cy1); gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x1, y1, &simpleline->cx1, &simpleline->cy1);
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x2, y2, &simpleline->cx2, &simpleline->cy2); gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x2, y2, &simpleline->cx2, &simpleline->cy2);
} }
static void static void
@ -364,28 +364,28 @@ gnome_canvas_simpleline_render (GnomeCanvasItem *item,
{ {
GnomeCanvasSimpleLine *simpleline; GnomeCanvasSimpleLine *simpleline;
int x1, x2; int x1, x2;
int y1, y2; int y1, y2;
simpleline = GNOME_CANVAS_SIMPLELINE (item); simpleline = GNOME_CANVAS_SIMPLELINE (item);
x1 = simpleline->cx1; x1 = simpleline->cx1;
x2 = simpleline->cx2; x2 = simpleline->cx2;
y1 = simpleline->cy1; y1 = simpleline->cy1;
if (buf->is_bg) { if (buf->is_bg) {
gnome_canvas_buf_ensure_buf (buf); gnome_canvas_buf_ensure_buf (buf);
buf->is_bg = FALSE; buf->is_bg = FALSE;
} }
if (simpleline->x1 != simpleline->x2) { if (simpleline->x1 != simpleline->x2) {
PAINT_HORIZA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a, PAINT_HORIZA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
x1, x2, y1); x1, x2, y1);
} else { } else {
y2 = simpleline->cy2; y2 = simpleline->cy2;
PAINT_VERTA (buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a, PAINT_VERTA (buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
x1, y1, y2); x1, y1, y2);
} }
} }
static void static void
@ -402,10 +402,10 @@ gnome_canvas_simpleline_bounds (GnomeCanvasItem *item, double *x1, double *y1, d
{ {
GnomeCanvasSimpleLine *simpleline = GNOME_CANVAS_SIMPLELINE (item); GnomeCanvasSimpleLine *simpleline = GNOME_CANVAS_SIMPLELINE (item);
*x1 = simpleline->x1; *x1 = simpleline->x1;
*y1 = simpleline->y1; *y1 = simpleline->y1;
*x2 = simpleline->x1; *x2 = simpleline->x1;
*y2 = simpleline->y2; *y2 = simpleline->y2;
} }
static double static double

View file

@ -87,7 +87,7 @@ gnome_canvas_simplerect_get_type (void)
static void static void
gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class) gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GtkObjectClass *object_class; GtkObjectClass *object_class;
GnomeCanvasItemClass *item_class; GnomeCanvasItemClass *item_class;
@ -282,7 +282,7 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x1, y1, &simplerect->bbox_ulx, &simplerect->bbox_uly); gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x1, y1, &simplerect->bbox_ulx, &simplerect->bbox_uly);
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x2, y2, &simplerect->bbox_lrx, &simplerect->bbox_lry); gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x2, y2, &simplerect->bbox_lrx, &simplerect->bbox_lry);
/* now queue redraws for changed areas */ /* now queue redraws for changed areas */
if (item->x1 == old_x1 && item->x2 == old_x2) { if (item->x1 == old_x1 && item->x2 == old_x2) {
@ -376,44 +376,44 @@ gnome_canvas_simplerect_set_property (GObject *object,
switch (prop_id) { switch (prop_id) {
case PROP_X1: case PROP_X1:
if (simplerect->x1 != g_value_get_double (value)) { if (simplerect->x1 != g_value_get_double (value)) {
simplerect->x1 = g_value_get_double (value); simplerect->x1 = g_value_get_double (value);
bounds_changed = TRUE; bounds_changed = TRUE;
} }
break; break;
case PROP_Y1: case PROP_Y1:
if (simplerect->y1 != g_value_get_double (value)) { if (simplerect->y1 != g_value_get_double (value)) {
simplerect->y1 = g_value_get_double (value); simplerect->y1 = g_value_get_double (value);
bounds_changed = TRUE; bounds_changed = TRUE;
} }
break; break;
case PROP_X2: case PROP_X2:
if (simplerect->x2 != g_value_get_double (value)) { if (simplerect->x2 != g_value_get_double (value)) {
simplerect->x2 = g_value_get_double (value); simplerect->x2 = g_value_get_double (value);
bounds_changed = TRUE; bounds_changed = TRUE;
} }
break; break;
case PROP_Y2: case PROP_Y2:
if (simplerect->y2 != g_value_get_double (value)) { if (simplerect->y2 != g_value_get_double (value)) {
simplerect->y2 = g_value_get_double (value); simplerect->y2 = g_value_get_double (value);
bounds_changed = TRUE; bounds_changed = TRUE;
} }
break; break;
case PROP_DRAW: case PROP_DRAW:
if (simplerect->draw != g_value_get_boolean (value)) { if (simplerect->draw != g_value_get_boolean (value)) {
simplerect->draw = g_value_get_boolean (value); simplerect->draw = g_value_get_boolean (value);
update = TRUE; update = TRUE;
} }
break; break;
case PROP_FILL: case PROP_FILL:
if (simplerect->fill != g_value_get_boolean (value)) { if (simplerect->fill != g_value_get_boolean (value)) {
simplerect->fill = g_value_get_boolean (value); simplerect->fill = g_value_get_boolean (value);
update = TRUE; update = TRUE;
} }
break; break;
@ -537,10 +537,10 @@ gnome_canvas_simplerect_update (GnomeCanvasItem *item, double *affine, ArtSVP *c
if (simplerect->full_draw_on_update) { if (simplerect->full_draw_on_update) {
gnome_canvas_request_redraw (item->canvas, gnome_canvas_request_redraw (item->canvas,
simplerect->bbox_ulx, simplerect->bbox_ulx,
simplerect->bbox_uly, simplerect->bbox_uly,
simplerect->bbox_lrx+0.5, simplerect->bbox_lrx+0.5,
simplerect->bbox_lry+0.5); simplerect->bbox_lry+0.5);
simplerect->full_draw_on_update = FALSE; simplerect->full_draw_on_update = FALSE;
} }
@ -622,30 +622,30 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
} }
if (simplerect->outline_a > 0) { if (simplerect->outline_a > 0) {
for (i = 0; i < simplerect->outline_pixels; ++i) { for (i = 0; i < simplerect->outline_pixels; ++i) {
if (simplerect->outline_what & 0x1) { if (simplerect->outline_what & 0x1) {
if (begin == simplerect->bbox_ulx) { if (begin == simplerect->bbox_ulx) {
PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin + i, sy, ey); PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin + i, sy, ey);
} }
} }
if (simplerect->outline_what & 0x2) { if (simplerect->outline_what & 0x2) {
if (end == (simplerect->bbox_lrx - 1)) { if (end == (simplerect->bbox_lrx - 1)) {
PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, end - i, sy, ey + 1); PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, end - i, sy, ey + 1);
} }
} }
if (simplerect->outline_what & 0x4) { if (simplerect->outline_what & 0x4) {
PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i); PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i);
} }
if (simplerect->outline_what & 0x8) { if (simplerect->outline_what & 0x8) {
PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end + 1, ey-i); PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end + 1, ey-i);
} }
} }
} }
} }
#else /* SIMPLERECT_FAST_RENDERER */ #else /* SIMPLERECT_FAST_RENDERER */
@ -701,30 +701,30 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
#endif #endif
} }
if (simplerect->outline_a) { if (simplerect->outline_a) {
for (i = 0; i < (int) simplerect->outline_pixels; ++i) { for (i = 0; i < (int) simplerect->outline_pixels; ++i) {
if (simplerect->outline_what & 0x1) { if (simplerect->outline_what & 0x1) {
if (begin == simplerect->bbox_ulx) { if (begin == simplerect->bbox_ulx) {
PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin + i, sy, ey); PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin + i, sy, ey);
} }
} }
if (simplerect->outline_what & 0x2) { if (simplerect->outline_what & 0x2) {
if (end == (simplerect->bbox_lrx - 1)) { if (end == (simplerect->bbox_lrx - 1)) {
PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, end - i, sy, ey + 1); PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, end - i, sy, ey + 1);
} }
} }
if (simplerect->outline_what & 0x4) { if (simplerect->outline_what & 0x4) {
PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i); PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i);
} }
if (simplerect->outline_what & 0x8) { if (simplerect->outline_what & 0x8) {
PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end + 1, ey-i); PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end + 1, ey-i);
} }
} }
} }
} }
#endif /* SIMPLERECT_FAST_RENDERER */ #endif /* SIMPLERECT_FAST_RENDERER */

View file

@ -129,206 +129,206 @@ static GnomeCanvasItemClass *parent_class;
GType GType
gnome_canvas_waveview_get_type (void) gnome_canvas_waveview_get_type (void)
{ {
static GType waveview_type; static GType waveview_type;
if (!waveview_type) { if (!waveview_type) {
static const GTypeInfo object_info = { static const GTypeInfo object_info = {
sizeof (GnomeCanvasWaveViewClass), sizeof (GnomeCanvasWaveViewClass),
(GBaseInitFunc) NULL, (GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL, (GBaseFinalizeFunc) NULL,
(GClassInitFunc) gnome_canvas_waveview_class_init, (GClassInitFunc) gnome_canvas_waveview_class_init,
(GClassFinalizeFunc) NULL, (GClassFinalizeFunc) NULL,
NULL, /* class_data */ NULL, /* class_data */
sizeof (GnomeCanvasWaveView), sizeof (GnomeCanvasWaveView),
0, /* n_preallocs */ 0, /* n_preallocs */
(GInstanceInitFunc) gnome_canvas_waveview_init, (GInstanceInitFunc) gnome_canvas_waveview_init,
NULL /* value_table */ NULL /* value_table */
}; };
waveview_type = g_type_register_static (GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasWaveView", waveview_type = g_type_register_static (GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasWaveView",
&object_info, 0); &object_info, 0);
} }
return waveview_type; return waveview_type;
} }
static void static void
gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class) gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GtkObjectClass *object_class; GtkObjectClass *object_class;
GnomeCanvasItemClass *item_class; GnomeCanvasItemClass *item_class;
gobject_class = (GObjectClass *) class; gobject_class = (GObjectClass *) class;
object_class = (GtkObjectClass *) class; object_class = (GtkObjectClass *) class;
item_class = (GnomeCanvasItemClass *) class; item_class = (GnomeCanvasItemClass *) class;
parent_class = g_type_class_peek_parent (class); parent_class = g_type_class_peek_parent (class);
gobject_class->set_property = gnome_canvas_waveview_set_property; gobject_class->set_property = gnome_canvas_waveview_set_property;
gobject_class->get_property = gnome_canvas_waveview_get_property; gobject_class->get_property = gnome_canvas_waveview_get_property;
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_DATA_SRC, PROP_DATA_SRC,
g_param_spec_pointer ("data_src", NULL, NULL, g_param_spec_pointer ("data_src", NULL, NULL,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_CHANNEL, PROP_CHANNEL,
g_param_spec_uint ("channel", NULL, NULL, g_param_spec_uint ("channel", NULL, NULL,
0, G_MAXUINT, 0, 0, G_MAXUINT, 0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_LENGTH_FUNCTION, PROP_LENGTH_FUNCTION,
g_param_spec_pointer ("length_function", NULL, NULL, g_param_spec_pointer ("length_function", NULL, NULL,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_SOURCEFILE_LENGTH_FUNCTION, PROP_SOURCEFILE_LENGTH_FUNCTION,
g_param_spec_pointer ("sourcefile_length_function", NULL, NULL, g_param_spec_pointer ("sourcefile_length_function", NULL, NULL,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_PEAK_FUNCTION, PROP_PEAK_FUNCTION,
g_param_spec_pointer ("peak_function", NULL, NULL, g_param_spec_pointer ("peak_function", NULL, NULL,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_GAIN_FUNCTION, PROP_GAIN_FUNCTION,
g_param_spec_pointer ("gain_function", NULL, NULL, g_param_spec_pointer ("gain_function", NULL, NULL,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_GAIN_SRC, PROP_GAIN_SRC,
g_param_spec_pointer ("gain_src", NULL, NULL, g_param_spec_pointer ("gain_src", NULL, NULL,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_CACHE, PROP_CACHE,
g_param_spec_pointer ("cache", NULL, NULL, g_param_spec_pointer ("cache", NULL, NULL,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_CACHE_UPDATER, PROP_CACHE_UPDATER,
g_param_spec_boolean ("cache_updater", NULL, NULL, g_param_spec_boolean ("cache_updater", NULL, NULL,
FALSE, FALSE,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_SAMPLES_PER_UNIT, PROP_SAMPLES_PER_UNIT,
g_param_spec_double ("samples_per_unit", NULL, NULL, g_param_spec_double ("samples_per_unit", NULL, NULL,
0.0, G_MAXDOUBLE, 0.0, 0.0, G_MAXDOUBLE, 0.0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_AMPLITUDE_ABOVE_AXIS, PROP_AMPLITUDE_ABOVE_AXIS,
g_param_spec_double ("amplitude_above_axis", NULL, NULL, g_param_spec_double ("amplitude_above_axis", NULL, NULL,
0.0, G_MAXDOUBLE, 0.0, 0.0, G_MAXDOUBLE, 0.0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_X, PROP_X,
g_param_spec_double ("x", NULL, NULL, g_param_spec_double ("x", NULL, NULL,
0.0, G_MAXDOUBLE, 0.0, 0.0, G_MAXDOUBLE, 0.0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_Y, PROP_Y,
g_param_spec_double ("y", NULL, NULL, g_param_spec_double ("y", NULL, NULL,
0.0, G_MAXDOUBLE, 0.0, 0.0, G_MAXDOUBLE, 0.0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_HEIGHT, PROP_HEIGHT,
g_param_spec_double ("height", NULL, NULL, g_param_spec_double ("height", NULL, NULL,
0.0, G_MAXDOUBLE, 0.0, 0.0, G_MAXDOUBLE, 0.0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_WAVE_COLOR, PROP_WAVE_COLOR,
g_param_spec_uint ("wave_color", NULL, NULL, g_param_spec_uint ("wave_color", NULL, NULL,
0, G_MAXUINT, 0, 0, G_MAXUINT, 0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_CLIP_COLOR, PROP_CLIP_COLOR,
g_param_spec_uint ("clip_color", NULL, NULL, g_param_spec_uint ("clip_color", NULL, NULL,
0, G_MAXUINT, 0, 0, G_MAXUINT, 0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_ZERO_COLOR, PROP_ZERO_COLOR,
g_param_spec_uint ("zero_color", NULL, NULL, g_param_spec_uint ("zero_color", NULL, NULL,
0, G_MAXUINT, 0, 0, G_MAXUINT, 0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_FILL_COLOR, PROP_FILL_COLOR,
g_param_spec_uint ("fill_color", NULL, NULL, g_param_spec_uint ("fill_color", NULL, NULL,
0, G_MAXUINT, 0, 0, G_MAXUINT, 0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_FILLED, PROP_FILLED,
g_param_spec_boolean ("filled", NULL, NULL, g_param_spec_boolean ("filled", NULL, NULL,
FALSE, FALSE,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_RECTIFIED, PROP_RECTIFIED,
g_param_spec_boolean ("rectified", NULL, NULL, g_param_spec_boolean ("rectified", NULL, NULL,
FALSE, FALSE,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_ZERO_LINE, PROP_ZERO_LINE,
g_param_spec_boolean ("zero_line", NULL, NULL, g_param_spec_boolean ("zero_line", NULL, NULL,
FALSE, FALSE,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_LOGSCALED, PROP_LOGSCALED,
g_param_spec_boolean ("logscaled", NULL, NULL, g_param_spec_boolean ("logscaled", NULL, NULL,
FALSE, FALSE,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property g_object_class_install_property
(gobject_class, (gobject_class,
PROP_REGION_START, PROP_REGION_START,
g_param_spec_uint ("region_start", NULL, NULL, g_param_spec_uint ("region_start", NULL, NULL,
0, G_MAXUINT, 0, 0, G_MAXUINT, 0,
(G_PARAM_READABLE | G_PARAM_WRITABLE))); (G_PARAM_READABLE | G_PARAM_WRITABLE)));
object_class->destroy = gnome_canvas_waveview_destroy; object_class->destroy = gnome_canvas_waveview_destroy;
item_class->update = gnome_canvas_waveview_update; item_class->update = gnome_canvas_waveview_update;
item_class->bounds = gnome_canvas_waveview_bounds; item_class->bounds = gnome_canvas_waveview_bounds;
item_class->point = gnome_canvas_waveview_point; item_class->point = gnome_canvas_waveview_point;
item_class->render = gnome_canvas_waveview_render; item_class->render = gnome_canvas_waveview_render;
item_class->draw = gnome_canvas_waveview_draw; item_class->draw = gnome_canvas_waveview_draw;
} }
void void
@ -838,50 +838,50 @@ gnome_canvas_waveview_set_property (GObject *object,
break; break;
case PROP_X: case PROP_X:
if (waveview->x != g_value_get_double (value)) { if (waveview->x != g_value_get_double (value)) {
waveview->x = g_value_get_double (value); waveview->x = g_value_get_double (value);
calc_bounds = TRUE; calc_bounds = TRUE;
} }
break; break;
case PROP_Y: case PROP_Y:
if (waveview->y != g_value_get_double (value)) { if (waveview->y != g_value_get_double (value)) {
waveview->y = g_value_get_double (value); waveview->y = g_value_get_double (value);
calc_bounds = TRUE; calc_bounds = TRUE;
} }
break; break;
case PROP_HEIGHT: case PROP_HEIGHT:
if (waveview->height != fabs (g_value_get_double (value))) { if (waveview->height != fabs (g_value_get_double (value))) {
waveview->height = fabs (g_value_get_double (value)); waveview->height = fabs (g_value_get_double (value));
redraw = TRUE; redraw = TRUE;
} }
break; break;
case PROP_WAVE_COLOR: case PROP_WAVE_COLOR:
if (waveview->wave_color != g_value_get_uint(value)) { if (waveview->wave_color != g_value_get_uint(value)) {
waveview->wave_color = g_value_get_uint(value); waveview->wave_color = g_value_get_uint(value);
redraw = TRUE; redraw = TRUE;
} }
break; break;
case PROP_CLIP_COLOR: case PROP_CLIP_COLOR:
if (waveview->clip_color != g_value_get_uint(value)) { if (waveview->clip_color != g_value_get_uint(value)) {
waveview->clip_color = g_value_get_uint(value); waveview->clip_color = g_value_get_uint(value);
redraw = TRUE; redraw = TRUE;
} }
break; break;
case PROP_ZERO_COLOR: case PROP_ZERO_COLOR:
if (waveview->zero_color != g_value_get_uint(value)) { if (waveview->zero_color != g_value_get_uint(value)) {
waveview->zero_color = g_value_get_uint(value); waveview->zero_color = g_value_get_uint(value);
redraw = TRUE; redraw = TRUE;
} }
break; break;
case PROP_FILL_COLOR: case PROP_FILL_COLOR:
if (waveview->fill_color != g_value_get_uint(value)) { if (waveview->fill_color != g_value_get_uint(value)) {
waveview->fill_color = g_value_get_uint(value); waveview->fill_color = g_value_get_uint(value);
redraw = TRUE; redraw = TRUE;
} }
break; break;
@ -1047,7 +1047,7 @@ gnome_canvas_waveview_get_property (
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
} }
} }
@ -1133,7 +1133,7 @@ gnome_canvas_waveview_gradient_render (GnomeCanvasItem *item,
/* begin: render start x (units) */ /* begin: render start x (units) */
int const begin = MAX (waveview->bbox_ulx, buf->rect.x0); int const begin = MAX (waveview->bbox_ulx, buf->rect.x0);
/* zbegin: start x for zero line (units) */ /* zbegin: start x for zero line (units) */
int const zbegin = (begin == waveview->bbox_ulx) ? (begin + 1) : begin; int const zbegin = (begin == waveview->bbox_ulx) ? (begin + 1) : begin;
/* end: render end x (units) */ /* end: render end x (units) */
@ -1681,7 +1681,7 @@ gnome_canvas_waveview_flat_render (GnomeCanvasItem *item,
/* begin: render start x (units) */ /* begin: render start x (units) */
int const begin = MAX (waveview->bbox_ulx, buf->rect.x0); int const begin = MAX (waveview->bbox_ulx, buf->rect.x0);
/* zbegin: start x for zero line (units) */ /* zbegin: start x for zero line (units) */
int const zbegin = (begin == waveview->bbox_ulx) ? (begin + 1) : begin; int const zbegin = (begin == waveview->bbox_ulx) ? (begin + 1) : begin;
/* end: render end x (units) */ /* end: render end x (units) */

View file

@ -48,17 +48,17 @@ typedef struct _GnomeCanvasWaveViewCache GnomeCanvasWaveViewCache;
struct _GnomeCanvasWaveViewCacheEntry struct _GnomeCanvasWaveViewCacheEntry
{ {
float min; float min;
float max; float max;
}; };
struct _GnomeCanvasWaveViewCache struct _GnomeCanvasWaveViewCache
{ {
GnomeCanvasWaveViewCacheEntry* data; GnomeCanvasWaveViewCacheEntry* data;
guint32 allocated; guint32 allocated;
guint64 data_size; guint64 data_size;
gulong start; gulong start;
gulong end; gulong end;
}; };
GnomeCanvasWaveViewCache* gnome_canvas_waveview_cache_new (void); GnomeCanvasWaveViewCache* gnome_canvas_waveview_cache_new (void);
@ -73,63 +73,63 @@ typedef void (*waveview_peak_function_t)(void*,gulong,gulong,gulong,gpointer,gu
struct _GnomeCanvasWaveView struct _GnomeCanvasWaveView
{ {
GnomeCanvasItem item; GnomeCanvasItem item;
GnomeCanvasWaveViewCache *cache; GnomeCanvasWaveViewCache *cache;
gboolean cache_updater; gboolean cache_updater;
gint screen_width; gint screen_width;
void *data_src; void *data_src;
guint32 channel; guint32 channel;
waveview_peak_function_t peak_function; waveview_peak_function_t peak_function;
waveview_length_function_t length_function; waveview_length_function_t length_function;
waveview_sourcefile_length_function_t sourcefile_length_function; waveview_sourcefile_length_function_t sourcefile_length_function;
waveview_gain_curve_function_t gain_curve_function; waveview_gain_curve_function_t gain_curve_function;
void *gain_src; void *gain_src;
/** x-axis: samples per canvas unit. */ /** x-axis: samples per canvas unit. */
double samples_per_unit; double samples_per_unit;
/** y-axis: amplitude_above_axis. /** y-axis: amplitude_above_axis.
* *
* the default is that an (scaled, normalized -1.0 ... +1.0) amplitude of 1.0 * the default is that an (scaled, normalized -1.0 ... +1.0) amplitude of 1.0
* corresponds to the top of the area assigned to the waveview. * corresponds to the top of the area assigned to the waveview.
* *
* larger values will expand the vertical scale, cutting off the peaks/troughs. * larger values will expand the vertical scale, cutting off the peaks/troughs.
* smaller values will decrease the vertical scale, moving peaks/troughs toward * smaller values will decrease the vertical scale, moving peaks/troughs toward
* the middle of the area assigned to the waveview. * the middle of the area assigned to the waveview.
*/ */
double amplitude_above_axis; double amplitude_above_axis;
double x; double x;
double y; double y;
double height; double height;
double half_height; double half_height;
uint32_t wave_color; uint32_t wave_color;
uint32_t clip_color; uint32_t clip_color;
uint32_t zero_color; uint32_t zero_color;
uint32_t fill_color; uint32_t fill_color;
char filled; char filled;
char rectified; char rectified;
char zero_line; char zero_line;
char logscaled; char logscaled;
/* These are updated by the update() routine /* These are updated by the update() routine
to optimize the render() routine, which may to optimize the render() routine, which may
be called several times after a single update(). be called several times after a single update().
*/ */
int32_t bbox_ulx; int32_t bbox_ulx;
int32_t bbox_uly; int32_t bbox_uly;
int32_t bbox_lrx; int32_t bbox_lrx;
int32_t bbox_lry; int32_t bbox_lry;
unsigned char wave_r, wave_g, wave_b, wave_a; unsigned char wave_r, wave_g, wave_b, wave_a;
unsigned char clip_r, clip_g, clip_b, clip_a; unsigned char clip_r, clip_g, clip_b, clip_a;
unsigned char fill_r, fill_g, fill_b, fill_a; unsigned char fill_r, fill_g, fill_b, fill_a;
uint32_t samples; uint32_t samples;
uint32_t region_start; uint32_t region_start;
int32_t reload_cache_in_render; int32_t reload_cache_in_render;
}; };
struct _GnomeCanvasWaveViewClass { struct _GnomeCanvasWaveViewClass {

View file

@ -20,8 +20,8 @@
#include "clock_group.h" #include "clock_group.h"
ClockGroup::ClockGroup () ClockGroup::ClockGroup ()
: ignore_changes (false) : ignore_changes (false)
, _clock_mode (AudioClock::Frames) , _clock_mode (AudioClock::Frames)
{ {
} }
@ -32,35 +32,35 @@ ClockGroup::~ClockGroup()
void void
ClockGroup::add (AudioClock& clock) ClockGroup::add (AudioClock& clock)
{ {
if (clocks.insert (&clock).second) { if (clocks.insert (&clock).second) {
clock.mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &ClockGroup::one_clock_changed), &clock)); clock.mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &ClockGroup::one_clock_changed), &clock));
clock.set_mode (_clock_mode); clock.set_mode (_clock_mode);
} }
} }
void void
ClockGroup::remove (AudioClock& clock) ClockGroup::remove (AudioClock& clock)
{ {
clocks.erase (&clock); clocks.erase (&clock);
} }
void void
ClockGroup::one_clock_changed (AudioClock* clock) ClockGroup::one_clock_changed (AudioClock* clock)
{ {
if (!ignore_changes) { if (!ignore_changes) {
set_clock_mode (clock->mode()); set_clock_mode (clock->mode());
} }
} }
void void
ClockGroup::set_clock_mode (AudioClock::Mode mode) ClockGroup::set_clock_mode (AudioClock::Mode mode)
{ {
_clock_mode = mode; _clock_mode = mode;
ignore_changes = true; ignore_changes = true;
for (std::set<AudioClock*>::iterator c = clocks.begin(); c != clocks.end(); ++c) { for (std::set<AudioClock*>::iterator c = clocks.begin(); c != clocks.end(); ++c) {
(*c)->set_mode (mode); (*c)->set_mode (mode);
} }
ignore_changes = false; ignore_changes = false;
} }

View file

@ -27,21 +27,21 @@
class ClockGroup : public sigc::trackable { class ClockGroup : public sigc::trackable {
public: public:
ClockGroup (); ClockGroup ();
~ClockGroup (); ~ClockGroup ();
void set_clock_mode (AudioClock::Mode); void set_clock_mode (AudioClock::Mode);
AudioClock::Mode clock_mode() const { return _clock_mode; } AudioClock::Mode clock_mode() const { return _clock_mode; }
void add (AudioClock&); void add (AudioClock&);
void remove (AudioClock&); void remove (AudioClock&);
private: private:
std::set<AudioClock*> clocks; std::set<AudioClock*> clocks;
bool ignore_changes; bool ignore_changes;
AudioClock::Mode _clock_mode; AudioClock::Mode _clock_mode;
void one_clock_changed (AudioClock*); void one_clock_changed (AudioClock*);
}; };
#endif /* __gtk_ardour_clock_group_h__ */ #endif /* __gtk_ardour_clock_group_h__ */

View file

@ -64,18 +64,18 @@ class CrossfadeEditor : public ArdourDialog
Gtk::Button* ok_button; Gtk::Button* ok_button;
struct PresetPoint { struct PresetPoint {
double x; double x;
double y; double y;
PresetPoint (double a, double b) PresetPoint (double a, double b)
: x (a), y (b) {} : x (a), y (b) {}
}; };
struct Preset : public std::list<PresetPoint> { struct Preset : public std::list<PresetPoint> {
const char* name; const char* name;
const char* image_name; const char* image_name;
Preset (const char* n, const char* x) : name (n), image_name (x) {} Preset (const char* n, const char* x) : name (n), image_name (x) {}
}; };
typedef std::list<Preset*> Presets; typedef std::list<Preset*> Presets;
@ -93,36 +93,36 @@ class CrossfadeEditor : public ArdourDialog
Gtk::VBox vpacker; Gtk::VBox vpacker;
struct Point { struct Point {
~Point(); ~Point();
ArdourCanvas::Rectangle* box; ArdourCanvas::Rectangle* box;
ArdourCanvas::PolyLine* curve; ArdourCanvas::PolyLine* curve;
double x; double x;
double y; double y;
static const int32_t size; static const int32_t size;
void move_to (double x, double y, double xfract, double yfract); void move_to (double x, double y, double xfract, double yfract);
}; };
struct PointSorter { struct PointSorter {
bool operator() (const CrossfadeEditor::Point* a, const CrossfadeEditor::Point *b) { bool operator() (const CrossfadeEditor::Point* a, const CrossfadeEditor::Point *b) {
return a->x < b->x; return a->x < b->x;
} }
}; };
ArdourCanvas::Rectangle* toplevel; ArdourCanvas::Rectangle* toplevel;
ArdourCanvas::GtkCanvas* canvas; ArdourCanvas::GtkCanvas* canvas;
struct Half { struct Half {
ArdourCanvas::PolyLine* line; ArdourCanvas::PolyLine* line;
ArdourCanvas::Polygon* shading; ArdourCanvas::Polygon* shading;
std::list<Point*> points; std::list<Point*> points;
ARDOUR::AutomationList normative_curve; /* 0 - 1.0, linear */ ARDOUR::AutomationList normative_curve; /* 0 - 1.0, linear */
ARDOUR::AutomationList gain_curve; /* 0 - 2.0, gain mapping */ ARDOUR::AutomationList gain_curve; /* 0 - 2.0, gain mapping */
std::vector<ArdourCanvas::WaveView*> waves; std::vector<ArdourCanvas::WaveView*> waves;
Half(); Half();
}; };
enum WhichFade { enum WhichFade {

View file

@ -37,12 +37,12 @@ class CrossfadeView : public TimeAxisViewItem
{ {
public: public:
CrossfadeView (ArdourCanvas::Container*, CrossfadeView (ArdourCanvas::Container*,
RouteTimeAxisView&, RouteTimeAxisView&,
boost::shared_ptr<ARDOUR::Crossfade>, boost::shared_ptr<ARDOUR::Crossfade>,
double initial_samples_per_pixel, double initial_samples_per_pixel,
Gdk::Color& basic_color, Gdk::Color& basic_color,
AudioRegionView& leftview, AudioRegionView& leftview,
AudioRegionView& rightview); AudioRegionView& rightview);
~CrossfadeView (); ~CrossfadeView ();

View file

@ -153,7 +153,7 @@ void
EditNoteDialog::done (int r) EditNoteDialog::done (int r)
{ {
if (r != RESPONSE_ACCEPT) { if (r != RESPONSE_ACCEPT) {
return; return;
} }
/* These calls mean that if a value is entered using the keyboard /* These calls mean that if a value is entered using the keyboard

View file

@ -845,16 +845,16 @@ Editor::Editor ()
_show_marker_lines = false; _show_marker_lines = false;
/* Button bindings */ /* Button bindings */
button_bindings = new Bindings ("editor-mouse"); button_bindings = new Bindings ("editor-mouse");
XMLNode* node = button_settings(); XMLNode* node = button_settings();
if (node) { if (node) {
for (XMLNodeList::const_iterator i = node->children().begin(); i != node->children().end(); ++i) { for (XMLNodeList::const_iterator i = node->children().begin(); i != node->children().end(); ++i) {
button_bindings->load_operation (**i); button_bindings->load_operation (**i);
} }
} }
constructed = true; constructed = true;
@ -4716,7 +4716,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
} }
if (entered_marker) { if (entered_marker) {
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use entered marker @ %1\n", entered_marker->position())); DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use entered marker @ %1\n", entered_marker->position()));
return entered_marker->position(); return entered_marker->position();
} }
@ -4737,7 +4737,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
} else { } else {
where = _session->audible_frame(); where = _session->audible_frame();
} }
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use playhead @ %1\n", where)); DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use playhead @ %1\n", where));
break; break;
case EditAtSelectedMarker: case EditAtSelectedMarker:
@ -4750,7 +4750,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
} else { } else {
where = loc->end(); where = loc->end();
} }
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use selected marker @ %1\n", where)); DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use selected marker @ %1\n", where));
break; break;
} }
} }
@ -4765,7 +4765,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
snap_mf.frame = where; snap_mf.frame = where;
snap_to (snap_mf); snap_to (snap_mf);
where = snap_mf.frame; where = snap_mf.frame;
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use mouse @ %1\n", where)); DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use mouse @ %1\n", where));
break; break;
} }

View file

@ -583,13 +583,13 @@ private:
typedef std::pair<TimeAxisView*,XMLNode*> TAVState; typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
struct VisualState { struct VisualState {
VisualState (bool with_tracks); VisualState (bool with_tracks);
~VisualState (); ~VisualState ();
double y_position; double y_position;
framecnt_t samples_per_pixel; framecnt_t samples_per_pixel;
framepos_t leftmost_frame; framepos_t leftmost_frame;
Editing::ZoomFocus zoom_focus; Editing::ZoomFocus zoom_focus;
GUIObjectState* gui_state; GUIObjectState* gui_state;
}; };
std::list<VisualState*> undo_visual_stack; std::list<VisualState*> undo_visual_stack;

View file

@ -732,7 +732,7 @@ Editor::register_actions ()
myactions.register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measure Lines"), sigc::mem_fun (*this, &Editor::toggle_measure_visibility)); myactions.register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measure Lines"), sigc::mem_fun (*this, &Editor::toggle_measure_visibility));
myactions.register_action (editor_actions, X_("toggle-midi-input-active"), _("Toggle MIDI Input Active for Editor-Selected Tracks/Busses"), myactions.register_action (editor_actions, X_("toggle-midi-input-active"), _("Toggle MIDI Input Active for Editor-Selected Tracks/Busses"),
sigc::bind (sigc::mem_fun (*this, &Editor::toggle_midi_input_active), false)); sigc::bind (sigc::mem_fun (*this, &Editor::toggle_midi_input_active), false));
/* MIDI stuff */ /* MIDI stuff */
@ -1694,7 +1694,7 @@ Editor::parameter_changed (std::string p)
_group_tabs->hide (); _group_tabs->hide ();
} }
reset_controls_layout_width (); reset_controls_layout_width ();
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs")); Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
if (act) { if (act) {

View file

@ -629,7 +629,7 @@ Editor::embed_sndfiles (vector<string> paths,
SoundFileInfo finfo; SoundFileInfo finfo;
CursorContext::Handle cursor_ctx = CursorContext::create(*this, _cursors->wait); CursorContext::Handle cursor_ctx = CursorContext::create(*this, _cursors->wait);
gdk_flush (); gdk_flush ();
for (vector<string>::iterator p = paths.begin(); p != paths.end(); ++p) { for (vector<string>::iterator p = paths.begin(); p != paths.end(); ++p) {
@ -913,33 +913,33 @@ Editor::add_sources (vector<string> paths,
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) { if (use_timestamp) {
if (ar) { if (ar) {
/* get timestamp for this region */ /* get timestamp for this region */
const boost::shared_ptr<Source> s (ar->sources().front()); 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<AudioSource> as = boost::dynamic_pointer_cast<AudioSource> (s);
assert (as); assert (as);
if (as->natural_position() != 0) { if (as->natural_position() != 0) {
pos = as->natural_position(); pos = as->natural_position();
} else if (target_tracks == 1) { } else if (target_tracks == 1) {
/* hmm, no timestamp available, put it after the previous region /* hmm, no timestamp available, put it after the previous region
*/ */
if (n == 0) { if (n == 0) {
pos = get_preferred_edit_position (); pos = get_preferred_edit_position ();
} else { } else {
pos += rlen; pos += rlen;
} }
} else { } else {
pos = get_preferred_edit_position (); pos = get_preferred_edit_position ();
} }
} else { } else {
/* should really get first position in MIDI file, but for now, use edit position*/ /* should really get first position in MIDI file, but for now, use edit position*/
pos = get_preferred_edit_position (); pos = get_preferred_edit_position ();
} }
} }
finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track, track_names[n], instrument); finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track, track_names[n], instrument);
@ -1029,7 +1029,7 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region,
} else if (mr) { } else if (mr) {
list<boost::shared_ptr<MidiTrack> > mt ( list<boost::shared_ptr<MidiTrack> > mt (
_session->new_midi_track (ChanCount (DataType::MIDI, 1), _session->new_midi_track (ChanCount (DataType::MIDI, 1),
ChanCount (DataType::MIDI, 1), ChanCount (DataType::MIDI, 1),
Config->get_strict_io () || Profile->get_mixbus (), Config->get_strict_io () || Profile->get_mixbus (),
instrument, (Plugin::PresetRecord*) 0, instrument, (Plugin::PresetRecord*) 0,
(RouteGroup*) 0, (RouteGroup*) 0,

View file

@ -127,7 +127,7 @@ Editor::initialize_canvas ()
* uppermost (last) group with hv_scroll_group as a parent * uppermost (last) group with hv_scroll_group as a parent
*/ */
_drag_motion_group = new ArdourCanvas::Container (hv_scroll_group); _drag_motion_group = new ArdourCanvas::Container (hv_scroll_group);
CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion"); CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion");
/* TIME BAR CANVAS */ /* TIME BAR CANVAS */
@ -317,17 +317,17 @@ Editor::reset_controls_layout_width ()
edit_controls_vbox.size_request (req); edit_controls_vbox.size_request (req);
w = req.width; w = req.width;
if (_group_tabs->is_visible()) { if (_group_tabs->is_visible()) {
_group_tabs->size_request (req); _group_tabs->size_request (req);
w += req.width; w += req.width;
} }
/* the controls layout has no horizontal scrolling, its visible /* the controls layout has no horizontal scrolling, its visible
width is always equal to the total width of its contents. width is always equal to the total width of its contents.
*/ */
controls_layout.property_width() = w; controls_layout.property_width() = w;
controls_layout.property_width_request() = w; controls_layout.property_width_request() = w;
} }
void void
@ -345,11 +345,11 @@ Editor::reset_controls_layout_height (int32_t h)
h += _canvas_drop_zone->height (); h += _canvas_drop_zone->height ();
/* set the height of the scrollable area (i.e. the sum of all contained widgets) /* set the height of the scrollable area (i.e. the sum of all contained widgets)
* for the controls layout. The size request is set elsewhere. * for the controls layout. The size request is set elsewhere.
*/ */
controls_layout.property_height() = h; controls_layout.property_height() = h;
} }
@ -432,11 +432,11 @@ Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, doub
selection->set (tv); selection->set (tv);
do_import (midi_paths, Editing::ImportSerializeFiles, ImportToTrack, do_import (midi_paths, Editing::ImportSerializeFiles, ImportToTrack,
SrcBest, SMFTrackName, SMFTempoIgnore, frame); SrcBest, SMFTrackName, SMFTempoIgnore, frame);
if (UIConfiguration::instance().get_only_copy_imported_files() || copy) { if (UIConfiguration::instance().get_only_copy_imported_files() || copy) {
do_import (audio_paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, do_import (audio_paths, Editing::ImportSerializeFiles, Editing::ImportToTrack,
SrcBest, SMFTrackName, SMFTempoIgnore, frame); SrcBest, SMFTrackName, SMFTempoIgnore, frame);
} else { } else {
do_embed (audio_paths, Editing::ImportSerializeFiles, ImportToTrack, frame); do_embed (audio_paths, Editing::ImportSerializeFiles, ImportToTrack, frame);
} }
@ -520,7 +520,7 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
controls_layout.get_parent()->translate_coordinates (*toplevel, controls_layout.get_parent()->translate_coordinates (*toplevel,
alloc.get_x(), alloc.get_y(), alloc.get_x(), alloc.get_y(),
wx, wy); wx, wy);
scrolling_boundary = ArdourCanvas::Rect (wx, wy, wx + alloc.get_width(), wy + alloc.get_height()); scrolling_boundary = ArdourCanvas::Rect (wx, wy, wx + alloc.get_width(), wy + alloc.get_height());
@ -559,7 +559,7 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
_track_canvas_viewport->get_parent()->translate_coordinates (*toplevel, _track_canvas_viewport->get_parent()->translate_coordinates (*toplevel,
alloc.get_x(), alloc.get_y(), alloc.get_x(), alloc.get_y(),
wx, wy); wx, wy);
scrolling_boundary = ArdourCanvas::Rect (wx, wy, wx + alloc.get_width(), wy + alloc.get_height()); scrolling_boundary = ArdourCanvas::Rect (wx, wy, wx + alloc.get_width(), wy + alloc.get_height());
} }

View file

@ -171,7 +171,7 @@ Editor::track_canvas_button_press_event (GdkEventButton *event)
begin_reversible_selection_op (X_("Clear Selection Click (track canvas)")); begin_reversible_selection_op (X_("Clear Selection Click (track canvas)"));
selection->clear (); selection->clear ();
commit_reversible_selection_op(); commit_reversible_selection_op();
} }
return false; return false;
} }
@ -179,10 +179,10 @@ bool
Editor::track_canvas_button_release_event (GdkEventButton *event) Editor::track_canvas_button_release_event (GdkEventButton *event)
{ {
if (!Keyboard::is_context_menu_event (event)) { if (!Keyboard::is_context_menu_event (event)) {
if (_drags->active ()) { if (_drags->active ()) {
_drags->end_grab ((GdkEvent*) event); _drags->end_grab ((GdkEvent*) event);
} }
} }
return false; return false;
} }
@ -641,9 +641,9 @@ Editor::canvas_fade_out_handle_event (GdkEvent *event, ArdourCanvas::Item* item,
} }
struct DescendingRegionLayerSorter { struct DescendingRegionLayerSorter {
bool operator()(boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) { bool operator()(boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
return a->layer() > b->layer(); return a->layer() > b->layer();
} }
}; };
bool bool
@ -1214,8 +1214,8 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const& context,
if (tv.first == 0 if (tv.first == 0
&& ( && (
boost::dynamic_pointer_cast<AudioRegion> (region) != 0 || boost::dynamic_pointer_cast<AudioRegion> (region) != 0 ||
boost::dynamic_pointer_cast<MidiRegion> (region) != 0 boost::dynamic_pointer_cast<MidiRegion> (region) != 0
) )
) )
{ {
@ -1263,9 +1263,9 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const& context,
void void
Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/, Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/,
int x, int y, int x, int y,
const SelectionData& /*data*/, const SelectionData& /*data*/,
guint /*info*/, guint /*time*/) guint /*info*/, guint /*time*/)
{ {
GdkEvent event; GdkEvent event;
double px; double px;

View file

@ -31,9 +31,9 @@ class Editor;
class EditorCursor { class EditorCursor {
public: public:
EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*)); EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
EditorCursor (Editor&); EditorCursor (Editor&);
~EditorCursor (); ~EditorCursor ();
void set_position (framepos_t); void set_position (framepos_t);

View file

@ -4683,7 +4683,7 @@ MarkerDrag::aborted (bool movement_occurred)
void void
MarkerDrag::update_item (Location*) MarkerDrag::update_item (Location*)
{ {
/* noop */ /* noop */
} }
ControlPointDrag::ControlPointDrag (Editor* e, ArdourCanvas::Item* i) ControlPointDrag::ControlPointDrag (Editor* e, ArdourCanvas::Item* i)
@ -5846,7 +5846,7 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred)
case CreateSkipMarker: case CreateSkipMarker:
case CreateRangeMarker: case CreateRangeMarker:
case CreateCDMarker: case CreateCDMarker:
{ {
XMLNode &before = _editor->session()->locations()->get_state(); XMLNode &before = _editor->session()->locations()->get_state();
if (_operation == CreateSkipMarker) { if (_operation == CreateSkipMarker) {
_editor->begin_reversible_command (_("new skip marker")); _editor->begin_reversible_command (_("new skip marker"));
@ -5873,7 +5873,7 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred)
_editor->session()->add_command(new MementoCommand<Locations>(*(_editor->session()->locations()), &before, &after)); _editor->session()->add_command(new MementoCommand<Locations>(*(_editor->session()->locations()), &before, &after));
_editor->commit_reversible_command (); _editor->commit_reversible_command ();
break; break;
} }
case CreateTransportMarker: case CreateTransportMarker:
// popup menu to pick loop or punch // popup menu to pick loop or punch

View file

@ -88,7 +88,7 @@ public:
bool end_grab (GdkEvent *); bool end_grab (GdkEvent *);
bool have_item (ArdourCanvas::Item *) const; bool have_item (ArdourCanvas::Item *) const;
void mark_double_click (); void mark_double_click ();
/** @return true if an end drag or abort is in progress */ /** @return true if an end drag or abort is in progress */
bool ending () const { bool ending () const {
@ -128,7 +128,7 @@ private:
class Drag class Drag
{ {
public: public:
Drag (Editor *, ArdourCanvas::Item *, bool trackview_only = true); Drag (Editor *, ArdourCanvas::Item *, bool trackview_only = true);
virtual ~Drag () {} virtual ~Drag () {}
void set_manager (DragManager* m) { void set_manager (DragManager* m) {
@ -147,8 +147,8 @@ public:
ARDOUR::MusicFrame adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const; ARDOUR::MusicFrame adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const; ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const;
bool was_double_click() const { return _was_double_click; } bool was_double_click() const { return _was_double_click; }
void set_double_click (bool yn) { _was_double_click = yn; } void set_double_click (bool yn) { _was_double_click = yn; }
/** Called to start a grab of an item. /** Called to start a grab of an item.
* @param e Event that caused the grab to start. * @param e Event that caused the grab to start.
@ -270,7 +270,7 @@ private:
bool _move_threshold_passed; ///< true if the move threshold has been passed, otherwise false bool _move_threshold_passed; ///< true if the move threshold has been passed, otherwise false
bool _starting_point_passed; ///< true if we called move () with first_move flag, otherwise false bool _starting_point_passed; ///< true if we called move () with first_move flag, otherwise false
bool _initially_vertical; ///< true if after move threshold is passed we appear to be moving vertically; undefined before that bool _initially_vertical; ///< true if after move threshold is passed we appear to be moving vertically; undefined before that
bool _was_double_click; ///< true if drag initiated by a double click event bool _was_double_click; ///< true if drag initiated by a double click event
double _grab_x; ///< trackview x of the grab start position double _grab_x; ///< trackview x of the grab start position
double _grab_y; ///< y of the grab start position, possibly adjusted if _trackview_only is true double _grab_y; ///< y of the grab start position, possibly adjusted if _trackview_only is true
double _last_pointer_x; ///< trackview x of the pointer last time a motion occurred double _last_pointer_x; ///< trackview x of the pointer last time a motion occurred
@ -904,7 +904,7 @@ public:
private: private:
void fake_locate (framepos_t); void fake_locate (framepos_t);
EditorCursor& _cursor; EditorCursor& _cursor;
bool _stop; ///< true to stop the transport on starting the drag, otherwise false bool _stop; ///< true to stop the transport on starting the drag, otherwise false
double _grab_zoom; ///< editor frames per unit when our grab started double _grab_zoom; ///< editor frames per unit when our grab started
}; };
@ -949,7 +949,7 @@ public:
class MarkerDrag : public Drag class MarkerDrag : public Drag
{ {
public: public:
MarkerDrag (Editor *, ArdourCanvas::Item *); MarkerDrag (Editor *, ArdourCanvas::Item *);
~MarkerDrag (); ~MarkerDrag ();
void start_grab (GdkEvent *, Gdk::Cursor* c = 0); void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
@ -972,16 +972,16 @@ private:
ArdourMarker* _marker; ///< marker being dragged ArdourMarker* _marker; ///< marker being dragged
bool _selection_changed; bool _selection_changed;
struct CopiedLocationMarkerInfo { struct CopiedLocationMarkerInfo {
ARDOUR::Location* location; ARDOUR::Location* location;
std::vector<ArdourMarker*> markers; std::vector<ArdourMarker*> markers;
bool move_both; bool move_both;
CopiedLocationMarkerInfo (ARDOUR::Location* l, ArdourMarker* m); CopiedLocationMarkerInfo (ARDOUR::Location* l, ArdourMarker* m);
}; };
typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo; typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
CopiedLocationInfo _copied_locations; CopiedLocationInfo _copied_locations;
ArdourCanvas::Points _points; ArdourCanvas::Points _points;
}; };
/** Control point drag */ /** Control point drag */
@ -1004,7 +1004,7 @@ private:
double _fixed_grab_y; double _fixed_grab_y;
double _cumulative_x_drag; double _cumulative_x_drag;
double _cumulative_y_drag; double _cumulative_y_drag;
bool _pushing; bool _pushing;
uint32_t _final_index; uint32_t _final_index;
static double _zero_gain_fraction; static double _zero_gain_fraction;
}; };
@ -1172,8 +1172,8 @@ private:
bool _add; bool _add;
TrackSelection _track_selection_at_start; TrackSelection _track_selection_at_start;
bool _time_selection_at_start; bool _time_selection_at_start;
framepos_t start_at_start; framepos_t start_at_start;
framepos_t end_at_start; framepos_t end_at_start;
}; };
/** Range marker drag */ /** Range marker drag */
@ -1261,7 +1261,7 @@ private:
std::list<ControlPoint*> points; ///< points to drag on the line std::list<ControlPoint*> points; ///< points to drag on the line
std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames
XMLNode* state; ///< the XML state node before the drag XMLNode* state; ///< the XML state node before the drag
double original_fraction; ///< initial y-fraction before the drag double original_fraction; ///< initial y-fraction before the drag
}; };
std::list<Line> _lines; std::list<Line> _lines;

View file

@ -741,7 +741,7 @@ Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent*)
Location* loc = find_location_from_marker (marker, is_start); Location* loc = find_location_from_marker (marker, is_start);
if (_session && loc) { if (_session && loc) {
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::really_remove_marker), loc)); Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::really_remove_marker), loc));
} }
} }
@ -1094,7 +1094,7 @@ Editor::marker_menu_select_using_range ()
bool is_start; bool is_start;
if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) { if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
set_selection_from_range (*l); set_selection_from_range (*l);
} }
} }
@ -1112,7 +1112,7 @@ Editor::marker_menu_select_all_selectables_using_range ()
bool is_start; bool is_start;
if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) { if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, track_views, Selection::Set, false); select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, track_views, Selection::Set, false);
} }
} }
@ -1131,7 +1131,7 @@ Editor::marker_menu_separate_regions_using_location ()
bool is_start; bool is_start;
if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) { if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
separate_regions_using_location (*l); separate_regions_using_location (*l);
} }
} }
@ -1604,11 +1604,13 @@ Editor::rename_marker(ArdourMarker *marker)
loc = find_location_from_marker (marker, is_start); loc = find_location_from_marker (marker, is_start);
if (!loc) if (!loc) {
return;
if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range())
return; return;
}
if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range()) {
return;
}
ArdourPrompter dialog (true); ArdourPrompter dialog (true);
string txt; string txt;
@ -1726,7 +1728,7 @@ Editor::update_punch_range_view ()
} else { } else {
transport_punch_range_rect->hide(); transport_punch_range_rect->hide();
} }
} }
@ -1747,9 +1749,9 @@ Editor::marker_selection_changed ()
} }
struct SortLocationsByPosition { struct SortLocationsByPosition {
bool operator() (Location* a, Location* b) { bool operator() (Location* a, Location* b) {
return a->start() < b->start(); return a->start() < b->start();
} }
}; };
void void

View file

@ -85,18 +85,18 @@ bool
Editor::mouse_frame (framepos_t& where, bool& in_track_canvas) const Editor::mouse_frame (framepos_t& where, bool& in_track_canvas) const
{ {
/* gdk_window_get_pointer() has X11's XQueryPointer semantics in that it only /* gdk_window_get_pointer() has X11's XQueryPointer semantics in that it only
pays attentions to subwindows. this means that menu windows are ignored, and pays attentions to subwindows. this means that menu windows are ignored, and
if the pointer is in a menu, the return window from the call will be the if the pointer is in a menu, the return window from the call will be the
the regular subwindow *under* the menu. the regular subwindow *under* the menu.
this matters quite a lot if the pointer is moving around in a menu that overlaps this matters quite a lot if the pointer is moving around in a menu that overlaps
the track canvas because we will believe that we are within the track canvas the track canvas because we will believe that we are within the track canvas
when we are not. therefore, we track enter/leave events for the track canvas when we are not. therefore, we track enter/leave events for the track canvas
and allow that to override the result of gdk_window_get_pointer(). and allow that to override the result of gdk_window_get_pointer().
*/ */
if (!within_track_canvas) { if (!within_track_canvas) {
return false; return false;
} }
int x, y; int x, y;
@ -1300,7 +1300,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
break; break;
default: default:
return button_press_dispatch (&event->button); return button_press_dispatch (&event->button);
break; break;
} }
@ -1342,24 +1342,24 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
return true; return true;
} }
bool were_dragging = false; bool were_dragging = false;
if (!Keyboard::is_context_menu_event (&event->button)) { if (!Keyboard::is_context_menu_event (&event->button)) {
/* see if we're finishing a drag */ /* see if we're finishing a drag */
if (_drags->active ()) { if (_drags->active ()) {
bool const r = _drags->end_grab (event); bool const r = _drags->end_grab (event);
if (r) { if (r) {
/* grab dragged, so do nothing else */ /* grab dragged, so do nothing else */
return true; return true;
} }
were_dragging = true; were_dragging = true;
} }
update_region_layering_order_editor (); update_region_layering_order_editor ();
} }
/* edit events get handled here */ /* edit events get handled here */
@ -1661,7 +1661,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
} }
/* do any (de)selection operations that should occur on button release */ /* do any (de)selection operations that should occur on button release */
button_selection (item, event, item_type); button_selection (item, event, item_type);
return true; return true;
@ -1722,7 +1722,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
MeterMarker* m_marker = 0; MeterMarker* m_marker = 0;
TempoMarker* t_marker = 0; TempoMarker* t_marker = 0;
double fraction; double fraction;
bool ret = true; bool ret = true;
/* by the time we reach here, entered_regionview and entered trackview /* by the time we reach here, entered_regionview and entered trackview
* will have already been set as appropriate. Things are done this * will have already been set as appropriate. Things are done this

View file

@ -3139,8 +3139,8 @@ Editor::separate_regions_between (const TimeSelection& ts)
if (!latest_regionviews.empty()) { if (!latest_regionviews.empty()) {
rtv->view()->foreach_regionview (sigc::bind ( rtv->view()->foreach_regionview (sigc::bind (
sigc::ptr_fun (add_if_covered), sigc::ptr_fun (add_if_covered),
&(*t), &new_selection)); &(*t), &new_selection));
if (!in_command) { if (!in_command) {
begin_reversible_command (_("separate")); begin_reversible_command (_("separate"));
@ -3274,10 +3274,10 @@ Editor::separate_under_selected_regions ()
boost::shared_ptr<Playlist> playlist = (*rl)->playlist(); boost::shared_ptr<Playlist> playlist = (*rl)->playlist();
if (!playlist) { if (!playlist) {
// is this check necessary? // is this check necessary?
continue; continue;
} }
vector<PlaylistState>::iterator i; vector<PlaylistState>::iterator i;
@ -3853,26 +3853,26 @@ Editor::trim_to_region(bool forward)
if (forward) { if (forward) {
next_region = playlist->find_next_region (region->first_frame(), Start, 1); next_region = playlist->find_next_region (region->first_frame(), Start, 1);
if (!next_region) { if (!next_region) {
continue; continue;
} }
region->trim_end((framepos_t) ( (next_region->first_frame() - 1) * speed)); region->trim_end((framepos_t) ( (next_region->first_frame() - 1) * speed));
arv->region_changed (PropertyChange (ARDOUR::Properties::length)); arv->region_changed (PropertyChange (ARDOUR::Properties::length));
} }
else { else {
next_region = playlist->find_next_region (region->first_frame(), Start, 0); next_region = playlist->find_next_region (region->first_frame(), Start, 0);
if(!next_region){ if(!next_region){
continue; continue;
} }
region->trim_front((framepos_t) ((next_region->last_frame() + 1) * speed)); region->trim_front((framepos_t) ((next_region->last_frame() + 1) * speed));
arv->region_changed (ARDOUR::bounds_change); arv->region_changed (ARDOUR::bounds_change);
} }
if (!in_command) { if (!in_command) {
@ -3945,8 +3945,8 @@ Editor::freeze_route ()
if (clicked_routeview->track()->has_external_redirects()) { if (clicked_routeview->track()->has_external_redirects()) {
MessageDialog d (string_compose (_("<b>%1</b>\n\nThis track has at least one send/insert/return as part of its signal flow.\n\n" MessageDialog d (string_compose (_("<b>%1</b>\n\nThis track has at least one send/insert/return as part of its signal flow.\n\n"
"Freezing will only process the signal as far as the first send/insert/return."), "Freezing will only process the signal as far as the first send/insert/return."),
clicked_routeview->track()->name()), true, MESSAGE_INFO, BUTTONS_NONE, true); clicked_routeview->track()->name()), true, MESSAGE_INFO, BUTTONS_NONE, true);
d.add_button (_("Freeze anyway"), Gtk::RESPONSE_OK); d.add_button (_("Freeze anyway"), Gtk::RESPONSE_OK);
d.add_button (_("Don't freeze"), Gtk::RESPONSE_CANCEL); d.add_button (_("Don't freeze"), Gtk::RESPONSE_CANCEL);
@ -4463,10 +4463,10 @@ Editor::remove_selected_regions ()
boost::shared_ptr<Playlist> playlist = (*rl)->playlist(); boost::shared_ptr<Playlist> playlist = (*rl)->playlist();
if (!playlist) { if (!playlist) {
// is this check necessary? // is this check necessary?
continue; continue;
} }
/* get_regions_from_selection_and_entered() guarantees that /* get_regions_from_selection_and_entered() guarantees that
the playlists involved are unique, so there is no need the playlists involved are unique, so there is no need
@ -4823,8 +4823,8 @@ Editor::paste_internal (framepos_t position, float times, const int32_t sub_num)
/* Only one line copied, and one automation track selected. Do a /* Only one line copied, and one automation track selected. Do a
"greedy" paste from one automation type to another. */ "greedy" paste from one automation type to another. */
PasteContext ctx(paste_count, times, ItemCounts(), true); PasteContext ctx(paste_count, times, ItemCounts(), true);
ts.front()->paste (position, *cut_buffer, ctx, sub_num); ts.front()->paste (position, *cut_buffer, ctx, sub_num);
} else { } else {
@ -5041,7 +5041,7 @@ Editor::remove_last_capture ()
if (Config->get_verify_remove_last_capture()) { if (Config->get_verify_remove_last_capture()) {
prompt = _("Do you really want to destroy the last capture?" prompt = _("Do you really want to destroy the last capture?"
"\n(This is destructive and cannot be undone)"); "\n(This is destructive and cannot be undone)");
choices.push_back (_("No, do nothing.")); choices.push_back (_("No, do nothing."));
choices.push_back (_("Yes, destroy it.")); choices.push_back (_("Yes, destroy it."));
@ -5296,7 +5296,7 @@ Editor::strip_region_silence ()
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) { for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*> (*i); AudioRegionView* const arv = dynamic_cast<AudioRegionView*> (*i);
if (arv) { if (arv) {
audio_only.push_back (arv); audio_only.push_back (arv);
} }
} }
@ -7658,7 +7658,7 @@ Editor::do_remove_time ()
void void
Editor::remove_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt, Editor::remove_time (framepos_t pos, framecnt_t frames, InsertTimeOption opt,
bool ignore_music_glue, bool markers_too, bool glued_markers_too, bool locked_markers_too, bool tempo_too) bool ignore_music_glue, bool markers_too, bool glued_markers_too, bool locked_markers_too, bool tempo_too)
{ {
if (Config->get_edit_mode() == Lock) { if (Config->get_edit_mode() == Lock) {
error << (_("Cannot insert or delete time when in Lock edit.")) << endmsg; error << (_("Cannot insert or delete time when in Lock edit.")) << endmsg;

View file

@ -65,9 +65,9 @@ using namespace Editing;
using Gtkmm2ext::Keyboard; using Gtkmm2ext::Keyboard;
struct ColumnInfo { struct ColumnInfo {
int index; int index;
const char* label; const char* label;
const char* tooltip; const char* tooltip;
}; };
EditorRegions::EditorRegions (Editor* e) EditorRegions::EditorRegions (Editor* e)
@ -495,8 +495,8 @@ EditorRegions::remove_unused_regions ()
return; return;
} }
prompt = _("Do you really want to remove unused regions?" prompt = _("Do you really want to remove unused regions?"
"\n(This is destructive and cannot be undone)"); "\n(This is destructive and cannot be undone)");
choices.push_back (_("No, do nothing.")); choices.push_back (_("No, do nothing."));
choices.push_back (_("Yes, remove.")); choices.push_back (_("Yes, remove."));
@ -1031,7 +1031,7 @@ EditorRegions::populate_row_name (boost::shared_ptr<Region> region, TreeModel::R
void void
EditorRegions::populate_row_source (boost::shared_ptr<Region> region, TreeModel::Row const &row) EditorRegions::populate_row_source (boost::shared_ptr<Region> region, TreeModel::Row const &row)
{ {
if (boost::dynamic_pointer_cast<SilentFileSource>(region->source())) { if (boost::dynamic_pointer_cast<SilentFileSource>(region->source())) {
row[_columns.path] = _("MISSING ") + Gtkmm2ext::markup_escape_text (region->source()->name()); row[_columns.path] = _("MISSING ") + Gtkmm2ext::markup_escape_text (region->source()->name());
} else { } else {
row[_columns.path] = Gtkmm2ext::markup_escape_text (region->source()->name()); row[_columns.path] = Gtkmm2ext::markup_escape_text (region->source()->name());
@ -1056,10 +1056,10 @@ EditorRegions::set_full (bool f)
{ {
if (f) { if (f) {
_display.expand_all (); _display.expand_all ();
expanded = true; expanded = true;
} else { } else {
_display.collapse_all (); _display.collapse_all ();
expanded = false; expanded = false;
} }
} }
@ -1303,9 +1303,9 @@ EditorRegions::selection_mapover (sigc::slot<void,boost::shared_ptr<Region> > sl
void void
EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context, EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context,
int x, int y, int x, int y,
const SelectionData& data, const SelectionData& data,
guint info, guint time) guint info, guint time)
{ {
vector<string> paths; vector<string> paths;

View file

@ -127,9 +127,9 @@ private:
bool selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn); bool selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
Gtk::Widget* old_focus; Gtk::Widget* old_focus;
Gtk::CellEditable* name_editable; Gtk::CellEditable* name_editable;
void name_editing_started (Gtk::CellEditable*, const Glib::ustring&); void name_editing_started (Gtk::CellEditable*, const Glib::ustring&);
void name_edit (const std::string&, const std::string&); void name_edit (const std::string&, const std::string&);
void locked_changed (std::string const &); void locked_changed (std::string const &);
@ -140,33 +140,33 @@ private:
bool key_press (GdkEventKey *); bool key_press (GdkEventKey *);
bool button_press (GdkEventButton *); bool button_press (GdkEventButton *);
bool focus_in (GdkEventFocus*); bool focus_in (GdkEventFocus*);
bool focus_out (GdkEventFocus*); bool focus_out (GdkEventFocus*);
bool enter_notify (GdkEventCrossing*); bool enter_notify (GdkEventCrossing*);
bool leave_notify (GdkEventCrossing*); bool leave_notify (GdkEventCrossing*);
void show_context_menu (int button, int time); void show_context_menu (int button, int time);
int sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator); int sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
void format_position (ARDOUR::framepos_t pos, char* buf, size_t bufsize, bool onoff = true); void format_position (ARDOUR::framepos_t pos, char* buf, size_t bufsize, bool onoff = true);
void add_region (boost::shared_ptr<ARDOUR::Region>); void add_region (boost::shared_ptr<ARDOUR::Region>);
void populate_row (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, PBD::PropertyChange const &); void populate_row (boost::shared_ptr<ARDOUR::Region>, Gtk::TreeModel::Row const &, PBD::PropertyChange const &);
void populate_row_used (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_used (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_position (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_position (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_end (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_end (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_sync (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_sync (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_fade_in (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr<ARDOUR::AudioRegion>); void populate_row_fade_in (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr<ARDOUR::AudioRegion>);
void populate_row_fade_out (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr<ARDOUR::AudioRegion>); void populate_row_fade_out (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used, boost::shared_ptr<ARDOUR::AudioRegion>);
void populate_row_locked (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_locked (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_muted (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_muted (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_glued (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_glued (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_opaque (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used); void populate_row_opaque (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row, uint32_t used);
void populate_row_length (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row); void populate_row_length (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row);
void populate_row_name (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row); void populate_row_name (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row);
void populate_row_source (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row); void populate_row_source (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row);
void update_row (boost::shared_ptr<ARDOUR::Region>); void update_row (boost::shared_ptr<ARDOUR::Region>);
void update_all_rows (); void update_all_rows ();
@ -215,7 +215,7 @@ private:
PBD::ScopedConnection editor_freeze_connection; PBD::ScopedConnection editor_freeze_connection;
PBD::ScopedConnection editor_thaw_connection; PBD::ScopedConnection editor_thaw_connection;
bool expanded; bool expanded;
}; };
#endif /* __gtk_ardour_editor_regions_h__ */ #endif /* __gtk_ardour_editor_regions_h__ */

View file

@ -58,9 +58,9 @@ using namespace Gtk;
using Gtkmm2ext::Keyboard; using Gtkmm2ext::Keyboard;
struct ColumnInfo { struct ColumnInfo {
int index; int index;
const char* label; const char* label;
const char* tooltip; const char* tooltip;
}; };
EditorRouteGroups::EditorRouteGroups (Editor* e) EditorRouteGroups::EditorRouteGroups (Editor* e)

View file

@ -38,9 +38,9 @@ public:
private: private:
struct Columns : public Gtk::TreeModel::ColumnRecord { struct Columns : public Gtk::TreeModel::ColumnRecord {
Columns () { Columns () {
add (gdkcolor); add (gdkcolor);
add (text); add (text);
add (is_visible); add (is_visible);
@ -54,11 +54,11 @@ private:
add (active_shared); add (active_shared);
add (active_state); add (active_state);
add (routegroup); add (routegroup);
} }
Gtk::TreeModelColumn<Gdk::Color> gdkcolor; Gtk::TreeModelColumn<Gdk::Color> gdkcolor;
Gtk::TreeModelColumn<std::string> text; Gtk::TreeModelColumn<std::string> text;
Gtk::TreeModelColumn<bool> is_visible; Gtk::TreeModelColumn<bool> is_visible;
Gtk::TreeModelColumn<bool> gain; Gtk::TreeModelColumn<bool> gain;
Gtk::TreeModelColumn<bool> gain_relative; Gtk::TreeModelColumn<bool> gain_relative;
Gtk::TreeModelColumn<bool> mute; Gtk::TreeModelColumn<bool> mute;
@ -68,7 +68,7 @@ private:
Gtk::TreeModelColumn<bool> select; Gtk::TreeModelColumn<bool> select;
Gtk::TreeModelColumn<bool> active_shared; Gtk::TreeModelColumn<bool> active_shared;
Gtk::TreeModelColumn<bool> active_state; Gtk::TreeModelColumn<bool> active_state;
Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup; Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
}; };
Columns _columns; Columns _columns;

View file

@ -149,7 +149,7 @@ Editor::initialize_rulers ()
minsec_nmarks = 0; minsec_nmarks = 0;
bbt_ruler = new ArdourCanvas::Ruler (_time_markers_group, *_bbt_metric, bbt_ruler = new ArdourCanvas::Ruler (_time_markers_group, *_bbt_metric,
ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, timebar_height)); ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, timebar_height));
bbt_ruler->set_font_description (font); bbt_ruler->set_font_description (font);
CANVAS_DEBUG_NAME (bbt_ruler, "bbt ruler"); CANVAS_DEBUG_NAME (bbt_ruler, "bbt ruler");
timecode_nmarks = 0; timecode_nmarks = 0;
@ -681,7 +681,7 @@ Editor::update_tempo_based_rulers ()
void void
Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper) Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper)
{ {
using namespace std; using namespace std;
framepos_t spacer; framepos_t spacer;
framepos_t fr; framepos_t fr;
@ -771,22 +771,22 @@ Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper)
timecode_nmarks = 2 + 24; timecode_nmarks = 2 + 24;
} else { } else {
const framecnt_t hours_in_range = range / (60 * 60 * fr); const framecnt_t hours_in_range = range / (60 * 60 * fr);
const int text_width_rough_guess = 120; /* pixels, very very approximate guess at how wide the tick mark text is */ const int text_width_rough_guess = 120; /* pixels, very very approximate guess at how wide the tick mark text is */
/* Normally we do not need to know anything about the width of the canvas /* Normally we do not need to know anything about the width of the canvas
to set the ruler scale, because the caller has already determined to set the ruler scale, because the caller has already determined
the width and set lower + upper arguments to this function to match that. the width and set lower + upper arguments to this function to match that.
But in this case, where the range defined by lower and uppper can vary But in this case, where the range defined by lower and uppper can vary
substantially (basically anything from 24hrs+ to several billion years) substantially (basically anything from 24hrs+ to several billion years)
trying to decide which tick marks to show does require us to know trying to decide which tick marks to show does require us to know
about the available width. about the available width.
*/ */
timecode_nmarks = _track_canvas->width() / text_width_rough_guess; timecode_nmarks = _track_canvas->width() / text_width_rough_guess;
timecode_ruler_scale = timecode_show_many_hours; timecode_ruler_scale = timecode_show_many_hours;
timecode_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / timecode_nmarks)); timecode_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / timecode_nmarks));
} }
} }
@ -946,10 +946,10 @@ Editor::metric_get_timecode (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdou
if ((timecode.hours % timecode_mark_modulo) == 0) { if ((timecode.hours % timecode_mark_modulo) == 0) {
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames); snprintf (buf, sizeof(buf), "%s%02u:%02u:%02u:%02u", timecode.negative ? "-" : "", timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
mark.label = buf; mark.label = buf;
mark.position = pos; mark.position = pos;
marks.push_back (mark); marks.push_back (mark);
++n; ++n;
} }
/* can't use Timecode::increment_hours() here because we may be traversing thousands of hours /* can't use Timecode::increment_hours() here because we may be traversing thousands of hours
* and doing it 1 hour at a time is just stupid (and slow). * and doing it 1 hour at a time is just stupid (and slow).
@ -994,69 +994,69 @@ Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper)
bbt_beat_subdivision = 2; bbt_beat_subdivision = 2;
break; break;
case SnapToBeatDiv3: case SnapToBeatDiv3:
bbt_beat_subdivision = 3; bbt_beat_subdivision = 3;
break; break;
case SnapToBeatDiv4: case SnapToBeatDiv4:
bbt_beat_subdivision = 4; bbt_beat_subdivision = 4;
break; break;
case SnapToBeatDiv5: case SnapToBeatDiv5:
bbt_beat_subdivision = 5; bbt_beat_subdivision = 5;
bbt_accent_modulo = 2; // XXX YIKES bbt_accent_modulo = 2; // XXX YIKES
break; break;
case SnapToBeatDiv6: case SnapToBeatDiv6:
bbt_beat_subdivision = 6; bbt_beat_subdivision = 6;
bbt_accent_modulo = 2; // XXX YIKES bbt_accent_modulo = 2; // XXX YIKES
break; break;
case SnapToBeatDiv7: case SnapToBeatDiv7:
bbt_beat_subdivision = 7; bbt_beat_subdivision = 7;
bbt_accent_modulo = 2; // XXX YIKES bbt_accent_modulo = 2; // XXX YIKES
break; break;
case SnapToBeatDiv8: case SnapToBeatDiv8:
bbt_beat_subdivision = 8; bbt_beat_subdivision = 8;
bbt_accent_modulo = 2; bbt_accent_modulo = 2;
break; break;
case SnapToBeatDiv10: case SnapToBeatDiv10:
bbt_beat_subdivision = 10; bbt_beat_subdivision = 10;
bbt_accent_modulo = 2; // XXX YIKES bbt_accent_modulo = 2; // XXX YIKES
break; break;
case SnapToBeatDiv12: case SnapToBeatDiv12:
bbt_beat_subdivision = 12; bbt_beat_subdivision = 12;
bbt_accent_modulo = 3; bbt_accent_modulo = 3;
break; break;
case SnapToBeatDiv14: case SnapToBeatDiv14:
bbt_beat_subdivision = 14; bbt_beat_subdivision = 14;
bbt_accent_modulo = 3; // XXX YIKES! bbt_accent_modulo = 3; // XXX YIKES!
break; break;
case SnapToBeatDiv16: case SnapToBeatDiv16:
bbt_beat_subdivision = 16; bbt_beat_subdivision = 16;
bbt_accent_modulo = 4; bbt_accent_modulo = 4;
break; break;
case SnapToBeatDiv20: case SnapToBeatDiv20:
bbt_beat_subdivision = 20; bbt_beat_subdivision = 20;
bbt_accent_modulo = 5; bbt_accent_modulo = 5;
break; break;
case SnapToBeatDiv24: case SnapToBeatDiv24:
bbt_beat_subdivision = 24; bbt_beat_subdivision = 24;
bbt_accent_modulo = 6; bbt_accent_modulo = 6;
break; break;
case SnapToBeatDiv28: case SnapToBeatDiv28:
bbt_beat_subdivision = 28; bbt_beat_subdivision = 28;
bbt_accent_modulo = 7; bbt_accent_modulo = 7;
break; break;
case SnapToBeatDiv32: case SnapToBeatDiv32:
bbt_beat_subdivision = 32; bbt_beat_subdivision = 32;
bbt_accent_modulo = 8; bbt_accent_modulo = 8;
break; break;
case SnapToBeatDiv64: case SnapToBeatDiv64:
bbt_beat_subdivision = 64; bbt_beat_subdivision = 64;
bbt_accent_modulo = 8; bbt_accent_modulo = 8;
break; break;
case SnapToBeatDiv128: case SnapToBeatDiv128:
bbt_beat_subdivision = 128; bbt_beat_subdivision = 128;
bbt_accent_modulo = 8; bbt_accent_modulo = 8;
break; break;
default: default:
bbt_beat_subdivision = 4; bbt_beat_subdivision = 4;
break; break;
} }
@ -1072,7 +1072,7 @@ Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper)
/* Only show the bar helper if there aren't many bars on the screen */ /* Only show the bar helper if there aren't many bars on the screen */
if ((bbt_bars < 2) || (beats < 5)) { if ((bbt_bars < 2) || (beats < 5)) {
bbt_bar_helper_on = true; bbt_bar_helper_on = true;
} }
if (beat_density > 8192) { if (beat_density > 8192) {
@ -1196,7 +1196,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
helper_active = true; helper_active = true;
} else { } else {
if ((*i).is_bar()) { if ((*i).is_bar()) {
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar); snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
} else { } else {
@ -1257,10 +1257,10 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
mark.style = ArdourCanvas::Ruler::Mark::Micro; mark.style = ArdourCanvas::Ruler::Mark::Micro;
marks.push_back (mark); marks.push_back (mark);
for (n = 1, i = grid.begin(); n < bbt_nmarks && i != grid.end(); ++i) { for (n = 1, i = grid.begin(); n < bbt_nmarks && i != grid.end(); ++i) {
if ((*i).frame < lower && (bbt_bar_helper_on)) { if ((*i).frame < lower && (bbt_bar_helper_on)) {
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat); snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
edit_last_mark_label (marks, buf); edit_last_mark_label (marks, buf);
helper_active = true; helper_active = true;
} else { } else {
@ -1297,7 +1297,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
i_am_accented = true; i_am_accented = true;
} }
if (i_am_accented && (pos > bbt_position_of_helper)){ if (i_am_accented && (pos > bbt_position_of_helper)){
snprintf (buf, sizeof(buf), "%" PRIu32, tick); snprintf (buf, sizeof(buf), "%" PRIu32, tick);
} else { } else {
buf[0] = '\0'; buf[0] = '\0';
} }
@ -1333,7 +1333,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
mark.style = ArdourCanvas::Ruler::Mark::Micro; mark.style = ArdourCanvas::Ruler::Mark::Micro;
marks.push_back (mark); marks.push_back (mark);
for (n = 1, i = grid.begin(); n < bbt_nmarks && i != grid.end(); ++i) { for (n = 1, i = grid.begin(); n < bbt_nmarks && i != grid.end(); ++i) {
if ((*i).frame < lower && (bbt_bar_helper_on)) { if ((*i).frame < lower && (bbt_bar_helper_on)) {
snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat); snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
@ -1397,18 +1397,18 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
break; break;
case bbt_show_many: case bbt_show_many:
bbt_nmarks = 1; bbt_nmarks = 1;
snprintf (buf, sizeof(buf), "cannot handle %" PRIu32 " bars", bbt_bars ); snprintf (buf, sizeof(buf), "cannot handle %" PRIu32 " bars", bbt_bars );
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
mark.label = buf; mark.label = buf;
mark.position = lower; mark.position = lower;
marks.push_back (mark); marks.push_back (mark);
break; break;
case bbt_show_64: case bbt_show_64:
bbt_nmarks = (gint) (bbt_bars / 64) + 1; bbt_nmarks = (gint) (bbt_bars / 64) + 1;
for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; i++) { for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; i++) {
if ((*i).is_bar()) { if ((*i).is_bar()) {
if ((*i).bar % 64 == 1) { if ((*i).bar % 64 == 1) {
if ((*i).bar % 256 == 1) { if ((*i).bar % 256 == 1) {
@ -1432,19 +1432,19 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
break; break;
case bbt_show_16: case bbt_show_16:
bbt_nmarks = (bbt_bars / 16) + 1; bbt_nmarks = (bbt_bars / 16) + 1;
for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; i++) { for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; i++) {
if ((*i).is_bar()) { if ((*i).is_bar()) {
if ((*i).bar % 16 == 1) { if ((*i).bar % 16 == 1) {
if ((*i).bar % 64 == 1) { if ((*i).bar % 64 == 1) {
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar); snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
} else { } else {
buf[0] = '\0'; buf[0] = '\0';
if ((*i).bar % 64 == 33) { if ((*i).bar % 64 == 33) {
mark.style = ArdourCanvas::Ruler::Mark::Minor; mark.style = ArdourCanvas::Ruler::Mark::Minor;
} else { } else {
mark.style = ArdourCanvas::Ruler::Mark::Micro; mark.style = ArdourCanvas::Ruler::Mark::Micro;
} }
} }
mark.label = buf; mark.label = buf;
@ -1458,36 +1458,36 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
case bbt_show_4: case bbt_show_4:
bbt_nmarks = (bbt_bars / 4) + 1; bbt_nmarks = (bbt_bars / 4) + 1;
for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; ++i) { for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; ++i) {
if ((*i).is_bar()) { if ((*i).is_bar()) {
if ((*i).bar % 4 == 1) { if ((*i).bar % 4 == 1) {
if ((*i).bar % 16 == 1) { if ((*i).bar % 16 == 1) {
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar); snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
} else {
buf[0] = '\0';
if ((*i).bar % 16 == 9) {
mark.style = ArdourCanvas::Ruler::Mark::Minor;
} else { } else {
mark.style = ArdourCanvas::Ruler::Mark::Micro; buf[0] = '\0';
if ((*i).bar % 16 == 9) {
mark.style = ArdourCanvas::Ruler::Mark::Minor;
} else {
mark.style = ArdourCanvas::Ruler::Mark::Micro;
}
} }
mark.label = buf;
mark.position = (*i).frame;
marks.push_back (mark);
++n;
} }
mark.label = buf;
mark.position = (*i).frame;
marks.push_back (mark);
++n;
}
} }
} }
break; break;
case bbt_show_1: case bbt_show_1:
// default: // default:
bbt_nmarks = bbt_bars + 2; bbt_nmarks = bbt_bars + 2;
for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; ++i) { for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; ++i) {
if ((*i).is_bar()) { if ((*i).is_bar()) {
if ((*i).bar % 4 == 1) { if ((*i).bar % 4 == 1) {
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar); snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
} else { } else {
buf[0] = '\0'; buf[0] = '\0';
@ -1590,106 +1590,106 @@ Editor::set_minsec_ruler_scale (framepos_t lower, framepos_t upper)
upper += spacer; upper += spacer;
framecnt_t const range = (upper - lower) * 1000; framecnt_t const range = (upper - lower) * 1000;
if (range <= (fr / 10)) { /* 0-0.1 second */ if (range <= (fr / 10)) { /* 0-0.1 second */
minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */ minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */
minsec_ruler_scale = minsec_show_msecs; minsec_ruler_scale = minsec_show_msecs;
minsec_mark_modulo = 10; minsec_mark_modulo = 10;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= (fr / 2)) { /* 0-0.5 second */ } else if (range <= (fr / 2)) { /* 0-0.5 second */
minsec_mark_interval = fr / 100; /* show 1/100 seconds */ minsec_mark_interval = fr / 100; /* show 1/100 seconds */
minsec_ruler_scale = minsec_show_msecs; minsec_ruler_scale = minsec_show_msecs;
minsec_mark_modulo = 100; minsec_mark_modulo = 100;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= fr) { /* 0-1 second */ } else if (range <= fr) { /* 0-1 second */
minsec_mark_interval = fr / 10; /* show 1/10 seconds */ minsec_mark_interval = fr / 10; /* show 1/10 seconds */
minsec_ruler_scale = minsec_show_msecs; minsec_ruler_scale = minsec_show_msecs;
minsec_mark_modulo = 200; minsec_mark_modulo = 200;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 2 * fr) { /* 1-2 seconds */ } else if (range <= 2 * fr) { /* 1-2 seconds */
minsec_mark_interval = fr / 10; /* show 1/10 seconds */ minsec_mark_interval = fr / 10; /* show 1/10 seconds */
minsec_ruler_scale = minsec_show_msecs; minsec_ruler_scale = minsec_show_msecs;
minsec_mark_modulo = 500; minsec_mark_modulo = 500;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 8 * fr) { /* 2-5 seconds */ } else if (range <= 8 * fr) { /* 2-5 seconds */
minsec_mark_interval = fr / 5; /* show 2 seconds */ minsec_mark_interval = fr / 5; /* show 2 seconds */
minsec_ruler_scale = minsec_show_msecs; minsec_ruler_scale = minsec_show_msecs;
minsec_mark_modulo = 1000; minsec_mark_modulo = 1000;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 16 * fr) { /* 8-16 seconds */ } else if (range <= 16 * fr) { /* 8-16 seconds */
minsec_mark_interval = fr; /* show 1 seconds */ minsec_mark_interval = fr; /* show 1 seconds */
minsec_ruler_scale = minsec_show_seconds; minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 2; minsec_mark_modulo = 2;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 30 * fr) { /* 10-30 seconds */ } else if (range <= 30 * fr) { /* 10-30 seconds */
minsec_mark_interval = fr; /* show 1 seconds */ minsec_mark_interval = fr; /* show 1 seconds */
minsec_ruler_scale = minsec_show_seconds; minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 5;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 60 * fr) { /* 30-60 seconds */
minsec_mark_interval = fr; /* show 1 seconds */
minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 5;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 2 * 60 * fr) { /* 1-2 minutes */
minsec_mark_interval = 5 * fr; /* show 5 seconds */
minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 3;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 4 * 60 * fr) { /* 4 minutes */
minsec_mark_interval = 5 * fr; /* show 10 seconds */
minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 30;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 10 * 60 * fr) { /* 10 minutes */
minsec_mark_interval = 30 * fr; /* show 30 seconds */
minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 120;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 30 * 60 * fr) { /* 10-30 minutes */
minsec_mark_interval = 60 * fr; /* show 1 minute */
minsec_ruler_scale = minsec_show_minutes;
minsec_mark_modulo = 5; minsec_mark_modulo = 5;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 60 * 60 * fr) { /* 30 minutes - 1hr */ } else if (range <= 60 * fr) { /* 30-60 seconds */
minsec_mark_interval = 2 * 60 * fr; /* show 2 minutes */ minsec_mark_interval = fr; /* show 1 seconds */
minsec_ruler_scale = minsec_show_minutes; minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 10; minsec_mark_modulo = 5;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 4 * 60 * 60 * fr) { /* 1 - 4 hrs*/ } else if (range <= 2 * 60 * fr) { /* 1-2 minutes */
minsec_mark_interval = 5 * 60 * fr; /* show 10 minutes */ minsec_mark_interval = 5 * fr; /* show 5 seconds */
minsec_ruler_scale = minsec_show_minutes; minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 30; minsec_mark_modulo = 3;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 8 * 60 * 60 * fr) { /* 4 - 8 hrs*/ } else if (range <= 4 * 60 * fr) { /* 4 minutes */
minsec_mark_interval = 20 * 60 * fr; /* show 20 minutes */ minsec_mark_interval = 5 * fr; /* show 10 seconds */
minsec_ruler_scale = minsec_show_minutes; minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 60; minsec_mark_modulo = 30;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 16 * 60 * 60 * fr) { /* 16-24 hrs*/ } else if (range <= 10 * 60 * fr) { /* 10 minutes */
minsec_mark_interval = 60 * 60 * fr; /* show 60 minutes */ minsec_mark_interval = 30 * fr; /* show 30 seconds */
minsec_ruler_scale = minsec_show_hours; minsec_ruler_scale = minsec_show_seconds;
minsec_mark_modulo = 120;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 30 * 60 * fr) { /* 10-30 minutes */
minsec_mark_interval = 60 * fr; /* show 1 minute */
minsec_ruler_scale = minsec_show_minutes;
minsec_mark_modulo = 5;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 60 * 60 * fr) { /* 30 minutes - 1hr */
minsec_mark_interval = 2 * 60 * fr; /* show 2 minutes */
minsec_ruler_scale = minsec_show_minutes;
minsec_mark_modulo = 10;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 4 * 60 * 60 * fr) { /* 1 - 4 hrs*/
minsec_mark_interval = 5 * 60 * fr; /* show 10 minutes */
minsec_ruler_scale = minsec_show_minutes;
minsec_mark_modulo = 30;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 8 * 60 * 60 * fr) { /* 4 - 8 hrs*/
minsec_mark_interval = 20 * 60 * fr; /* show 20 minutes */
minsec_ruler_scale = minsec_show_minutes;
minsec_mark_modulo = 60;
minsec_nmarks = 2 + (range / minsec_mark_interval);
} else if (range <= 16 * 60 * 60 * fr) { /* 16-24 hrs*/
minsec_mark_interval = 60 * 60 * fr; /* show 60 minutes */
minsec_ruler_scale = minsec_show_hours;
minsec_mark_modulo = 2; minsec_mark_modulo = 2;
minsec_nmarks = 2 + (range / minsec_mark_interval); minsec_nmarks = 2 + (range / minsec_mark_interval);
} else { } else {
const framecnt_t hours_in_range = range / (60 * 60 * fr); const framecnt_t hours_in_range = range / (60 * 60 * fr);
const int text_width_rough_guess = 70; /* pixels, very very approximate guess at how wide the tick mark text is */ const int text_width_rough_guess = 70; /* pixels, very very approximate guess at how wide the tick mark text is */
/* Normally we do not need to know anything about the width of the canvas /* Normally we do not need to know anything about the width of the canvas
to set the ruler scale, because the caller has already determined to set the ruler scale, because the caller has already determined
the width and set lower + upper arguments to this function to match that. the width and set lower + upper arguments to this function to match that.
But in this case, where the range defined by lower and uppper can vary But in this case, where the range defined by lower and uppper can vary
substantially (anything from 24hrs+ to several billion years) substantially (anything from 24hrs+ to several billion years)
trying to decide which tick marks to show does require us to know trying to decide which tick marks to show does require us to know
about the available width. about the available width.
*/ */
minsec_nmarks = _track_canvas->width() / text_width_rough_guess; minsec_nmarks = _track_canvas->width() / text_width_rough_guess;
minsec_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / minsec_nmarks)); minsec_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / minsec_nmarks));
minsec_mark_interval = minsec_mark_modulo * (60 * 60 * fr); minsec_mark_interval = minsec_mark_modulo * (60 * 60 * fr);
minsec_ruler_scale = minsec_show_many_hours; minsec_ruler_scale = minsec_show_many_hours;
} }
} }
void void
@ -1735,77 +1735,77 @@ Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoubl
mark.position = pos/1000.0; mark.position = pos/1000.0;
marks.push_back (mark); marks.push_back (mark);
} }
break; break;
case minsec_show_seconds: case minsec_show_seconds:
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) { for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs); sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
if (secs % minsec_mark_modulo == 0) { if (secs % minsec_mark_modulo == 0) {
if (secs == 0) { if (secs == 0) {
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
} else { } else {
mark.style = ArdourCanvas::Ruler::Mark::Minor; mark.style = ArdourCanvas::Ruler::Mark::Minor;
} }
snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs); snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs);
} else { } else {
buf[0] = '\0'; buf[0] = '\0';
mark.style = ArdourCanvas::Ruler::Mark::Micro; mark.style = ArdourCanvas::Ruler::Mark::Micro;
} }
mark.label = buf; mark.label = buf;
mark.position = pos/1000.0; mark.position = pos/1000.0;
marks.push_back (mark); marks.push_back (mark);
} }
break; break;
case minsec_show_minutes: case minsec_show_minutes:
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) { for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs); sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
if (mins % minsec_mark_modulo == 0) { if (mins % minsec_mark_modulo == 0) {
if (mins == 0) { if (mins == 0) {
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
} else { } else {
mark.style = ArdourCanvas::Ruler::Mark::Minor; mark.style = ArdourCanvas::Ruler::Mark::Minor;
} }
snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs); snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs);
} else { } else {
buf[0] = '\0'; buf[0] = '\0';
mark.style = ArdourCanvas::Ruler::Mark::Micro; mark.style = ArdourCanvas::Ruler::Mark::Micro;
} }
mark.label = buf; mark.label = buf;
mark.position = pos/1000.0; mark.position = pos/1000.0;
marks.push_back (mark); marks.push_back (mark);
} }
break; break;
case minsec_show_hours: case minsec_show_hours:
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) { for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs); sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
if (hrs % minsec_mark_modulo == 0) { if (hrs % minsec_mark_modulo == 0) {
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
snprintf (buf, sizeof(buf), "%02ld:%02ld", hrs, mins); snprintf (buf, sizeof(buf), "%02ld:%02ld", hrs, mins);
} else { } else {
buf[0] = '\0'; buf[0] = '\0';
mark.style = ArdourCanvas::Ruler::Mark::Micro; mark.style = ArdourCanvas::Ruler::Mark::Micro;
} }
mark.label = buf; mark.label = buf;
mark.position = pos/1000.0; mark.position = pos/1000.0;
marks.push_back (mark); marks.push_back (mark);
} }
break; break;
case minsec_show_many_hours: case minsec_show_many_hours:
for (n = 0; n < minsec_nmarks; ) { for (n = 0; n < minsec_nmarks; ) {
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs); sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
if (hrs % minsec_mark_modulo == 0) { if (hrs % minsec_mark_modulo == 0) {
mark.style = ArdourCanvas::Ruler::Mark::Major; mark.style = ArdourCanvas::Ruler::Mark::Major;
snprintf (buf, sizeof(buf), "%02ld:00", hrs); snprintf (buf, sizeof(buf), "%02ld:00", hrs);
mark.label = buf; mark.label = buf;
mark.position = pos/1000.0; mark.position = pos/1000.0;
marks.push_back (mark); marks.push_back (mark);
++n; ++n;
} }
pos += minsec_mark_interval; pos += minsec_mark_interval;
} }
break; break;
} }
} }

View file

@ -191,7 +191,7 @@ EditorSnapshots::redisplay ()
vector<std::string> state_file_paths; vector<std::string> state_file_paths;
get_state_files_in_directory (_session->session_directory().root_path(), get_state_files_in_directory (_session->session_directory().root_path(),
state_file_paths); state_file_paths);
if (state_file_paths.empty()) { if (state_file_paths.empty()) {
return; return;

View file

@ -124,7 +124,7 @@ EditorSummary::render_background_image ()
cairo_t* cr = cairo_create (_image); cairo_t* cr = cairo_create (_image);
/* background (really just the dividing lines between tracks */ /* background (really just the dividing lines between tracks */
cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_source_rgb (cr, 0, 0, 0);
cairo_rectangle (cr, 0, 0, get_width(), get_height()); cairo_rectangle (cr, 0, 0, get_width(), get_height());
@ -989,7 +989,7 @@ EditorSummary::set_editor_y (pair<double, double> const y)
_editor->_routes->resume_redisplay (); _editor->_routes->resume_redisplay ();
set_editor_y (y.first); set_editor_y (y.first);
} }
void void

View file

@ -455,7 +455,7 @@ Editor::mouse_add_new_meter_event (framepos_t frame)
const double beat = map.beat_at_bbt (requested); const double beat = map.beat_at_bbt (requested);
const double al_frame = map.frame_at_beat (beat); const double al_frame = map.frame_at_beat (beat);
begin_reversible_command (_("add meter mark")); begin_reversible_command (_("add meter mark"));
XMLNode &before = map.get_state(); XMLNode &before = map.get_state();
if (meter_dialog.get_lock_style() == MusicTime) { if (meter_dialog.get_lock_style() == MusicTime) {
map.add_meter (Meter (bpb, note_type), beat, requested, 0, MusicTime); map.add_meter (Meter (bpb, note_type), beat, requested, 0, MusicTime);
@ -514,7 +514,7 @@ Editor::edit_meter_section (MeterSection* section)
const PositionLockStyle pls = (meter_dialog.get_lock_style() == AudioTime) ? AudioTime : MusicTime; const PositionLockStyle pls = (meter_dialog.get_lock_style() == AudioTime) ? AudioTime : MusicTime;
begin_reversible_command (_("replace meter mark")); begin_reversible_command (_("replace meter mark"));
XMLNode &before = _session->tempo_map().get_state(); XMLNode &before = _session->tempo_map().get_state();
_session->tempo_map().replace_meter (*section, meter, when, frame, pls); _session->tempo_map().replace_meter (*section, meter, when, frame, pls);

View file

@ -105,7 +105,7 @@ Editor::time_stretch (RegionSelection& regions, float fraction)
stretch.run (*i); stretch.run (*i);
playlist->replace_region (regions.front()->region(), stretch.results[0], playlist->replace_region (regions.front()->region(), stretch.results[0],
regions.front()->region()->position()); regions.front()->region()->position());
midi_playlists_affected.insert (playlist); midi_playlists_affected.insert (playlist);
} }
@ -378,16 +378,16 @@ Editor::timefx_thread (void *arg)
tsd->editor.do_timefx (); tsd->editor.do_timefx ();
/* GACK! HACK! sleep for a bit so that our request buffer for the GUI /* GACK! HACK! sleep for a bit so that our request buffer for the GUI
event loop doesn't die before any changes we made are processed event loop doesn't die before any changes we made are processed
by the GUI ... by the GUI ...
*/ */
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
Glib::usleep(2 * G_USEC_PER_SEC); Glib::usleep(2 * G_USEC_PER_SEC);
#else #else
struct timespec t = { 2, 0 }; struct timespec t = { 2, 0 };
nanosleep (&t, 0); nanosleep (&t, 0);
#endif #endif
return 0; return 0;
} }

View file

@ -401,8 +401,8 @@ EngineControl::unblock_changed_signals ()
EngineControl::SignalBlocker::SignalBlocker (EngineControl& engine_control, EngineControl::SignalBlocker::SignalBlocker (EngineControl& engine_control,
const std::string& reason) const std::string& reason)
: ec (engine_control) : ec (engine_control)
, m_reason (reason) , m_reason (reason)
{ {
DEBUG_ECONTROL (string_compose ("SignalBlocker: %1", m_reason)); DEBUG_ECONTROL (string_compose ("SignalBlocker: %1", m_reason));
ec.block_changed_signals (); ec.block_changed_signals ();

View file

@ -40,102 +40,102 @@
class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList { class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
public: public:
EngineControl (); EngineControl ();
~EngineControl (); ~EngineControl ();
static bool need_setup (); static bool need_setup ();
XMLNode& get_state (); XMLNode& get_state ();
bool set_state (const XMLNode&); bool set_state (const XMLNode&);
void set_desired_sample_rate (uint32_t); void set_desired_sample_rate (uint32_t);
bool try_autostart (); bool try_autostart ();
private: private:
Gtk::Notebook notebook; Gtk::Notebook notebook;
Gtk::Label engine_status; Gtk::Label engine_status;
/* core fields used by all backends */ /* core fields used by all backends */
Gtk::Table basic_packer; Gtk::Table basic_packer;
Gtk::HBox basic_hbox; Gtk::HBox basic_hbox;
Gtk::VBox basic_vbox; Gtk::VBox basic_vbox;
Gtk::ComboBoxText backend_combo; Gtk::ComboBoxText backend_combo;
Gtk::ComboBoxText driver_combo; Gtk::ComboBoxText driver_combo;
Gtk::ComboBoxText device_combo; Gtk::ComboBoxText device_combo;
Gtk::ComboBoxText input_device_combo; Gtk::ComboBoxText input_device_combo;
Gtk::ComboBoxText output_device_combo; Gtk::ComboBoxText output_device_combo;
Gtk::ComboBoxText sample_rate_combo; Gtk::ComboBoxText sample_rate_combo;
Gtk::ComboBoxText midi_option_combo; Gtk::ComboBoxText midi_option_combo;
Gtk::ComboBoxText buffer_size_combo; Gtk::ComboBoxText buffer_size_combo;
Gtk::Label buffer_size_duration_label; Gtk::Label buffer_size_duration_label;
Gtk::ComboBoxText nperiods_combo; Gtk::ComboBoxText nperiods_combo;
Gtk::Adjustment input_latency_adjustment; Gtk::Adjustment input_latency_adjustment;
Gtk::SpinButton input_latency; Gtk::SpinButton input_latency;
Gtk::Adjustment output_latency_adjustment; Gtk::Adjustment output_latency_adjustment;
Gtk::SpinButton output_latency; Gtk::SpinButton output_latency;
Gtk::Adjustment input_channels_adjustment; Gtk::Adjustment input_channels_adjustment;
Gtk::SpinButton input_channels; Gtk::SpinButton input_channels;
Gtk::Adjustment output_channels_adjustment; Gtk::Adjustment output_channels_adjustment;
Gtk::SpinButton output_channels; Gtk::SpinButton output_channels;
Gtk::Adjustment ports_adjustment; Gtk::Adjustment ports_adjustment;
Gtk::SpinButton ports_spinner; Gtk::SpinButton ports_spinner;
Gtk::Label have_control_text; Gtk::Label have_control_text;
ArdourButton control_app_button; ArdourButton control_app_button;
ArdourButton midi_devices_button; ArdourButton midi_devices_button;
ArdourButton start_stop_button; ArdourButton start_stop_button;
ArdourButton update_devices_button; ArdourButton update_devices_button;
ArdourButton use_buffered_io_button; ArdourButton use_buffered_io_button;
Gtk::Button connect_disconnect_button; Gtk::Button connect_disconnect_button;
/* latency measurement */ /* latency measurement */
Gtk::ComboBoxText lm_output_channel_combo; Gtk::ComboBoxText lm_output_channel_combo;
Gtk::ComboBoxText lm_input_channel_combo; Gtk::ComboBoxText lm_input_channel_combo;
Gtk::Label lm_measure_label; Gtk::Label lm_measure_label;
Gtk::Button lm_measure_button; Gtk::Button lm_measure_button;
Gtk::Button lm_use_button; Gtk::Button lm_use_button;
Gtk::Button lm_back_button; Gtk::Button lm_back_button;
ArdourButton lm_button_audio; ArdourButton lm_button_audio;
Gtk::Label lm_title; Gtk::Label lm_title;
Gtk::Label lm_preamble; Gtk::Label lm_preamble;
Gtk::Label lm_results; Gtk::Label lm_results;
Gtk::Table lm_table; Gtk::Table lm_table;
Gtk::VBox lm_vbox; Gtk::VBox lm_vbox;
bool have_lm_results; bool have_lm_results;
bool lm_running; bool lm_running;
/* MIDI Tab */ /* MIDI Tab */
Gtk::VBox midi_vbox; Gtk::VBox midi_vbox;
Gtk::Button midi_back_button; Gtk::Button midi_back_button;
Gtk::Table midi_device_table; Gtk::Table midi_device_table;
/* MIDI ... JACK */ /* MIDI ... JACK */
Gtk::CheckButton aj_button; Gtk::CheckButton aj_button;
uint32_t ignore_changes; // state save/load uint32_t ignore_changes; // state save/load
uint32_t ignore_device_changes; // AudioEngine::DeviceListChanged uint32_t ignore_device_changes; // AudioEngine::DeviceListChanged
uint32_t _desired_sample_rate; uint32_t _desired_sample_rate;
bool started_at_least_once; bool started_at_least_once;
bool queue_device_changed; bool queue_device_changed;
void driver_changed (); void driver_changed ();
void backend_changed (); void backend_changed ();
void sample_rate_changed (); void sample_rate_changed ();
void buffer_size_changed (); void buffer_size_changed ();
void nperiods_changed (); void nperiods_changed ();
void parameter_changed (); void parameter_changed ();
void midi_option_changed (); void midi_option_changed ();
void setup_midi_tab_for_backend (); void setup_midi_tab_for_backend ();
void setup_midi_tab_for_jack (); void setup_midi_tab_for_jack ();
void refresh_midi_display (std::string focus = ""); void refresh_midi_display (std::string focus = "");
void update_midi_options (); void update_midi_options ();
@ -148,67 +148,67 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
std::vector<float> get_sample_rates_for_all_devices (); std::vector<float> get_sample_rates_for_all_devices ();
std::vector<uint32_t> get_buffer_sizes_for_all_devices (); std::vector<uint32_t> get_buffer_sizes_for_all_devices ();
float get_rate() const; float get_rate() const;
uint32_t get_buffer_size() const; uint32_t get_buffer_size() const;
uint32_t get_nperiods() const; uint32_t get_nperiods() const;
uint32_t get_input_channels() const; uint32_t get_input_channels() const;
uint32_t get_output_channels() const; uint32_t get_output_channels() const;
uint32_t get_input_latency() const; uint32_t get_input_latency() const;
uint32_t get_output_latency() const; uint32_t get_output_latency() const;
std::string get_device_name() const; std::string get_device_name() const;
std::string get_input_device_name() const; std::string get_input_device_name() const;
std::string get_output_device_name() const; std::string get_output_device_name() const;
std::string get_driver() const; std::string get_driver() const;
std::string get_backend() const; std::string get_backend() const;
std::string get_midi_option () const; std::string get_midi_option () const;
bool get_use_buffered_io () const; bool get_use_buffered_io () const;
std::string get_default_device (const std::string&, std::string get_default_device (const std::string&,
const std::vector<std::string>&); const std::vector<std::string>&);
void device_changed (); void device_changed ();
void input_device_changed (); void input_device_changed ();
void output_device_changed (); void output_device_changed ();
bool set_driver_popdown_strings (); bool set_driver_popdown_strings ();
bool set_device_popdown_strings (); bool set_device_popdown_strings ();
bool set_input_device_popdown_strings (); bool set_input_device_popdown_strings ();
bool set_output_device_popdown_strings (); bool set_output_device_popdown_strings ();
void set_samplerate_popdown_strings (); void set_samplerate_popdown_strings ();
void set_buffersize_popdown_strings (); void set_buffersize_popdown_strings ();
void set_nperiods_popdown_strings (); void set_nperiods_popdown_strings ();
void list_devices (); void list_devices ();
void show_buffer_duration (); void show_buffer_duration ();
void configure_midi_devices (); void configure_midi_devices ();
struct MidiDeviceSetting { struct MidiDeviceSetting {
std::string name; std::string name;
bool enabled; bool enabled;
uint32_t input_latency; uint32_t input_latency;
uint32_t output_latency; uint32_t output_latency;
MidiDeviceSetting (std::string n, bool en = true, uint32_t inl = 0, uint32_t oul = 0) MidiDeviceSetting (std::string n, bool en = true, uint32_t inl = 0, uint32_t oul = 0)
: name (n) : name (n)
, enabled (en) , enabled (en)
, input_latency (inl) , input_latency (inl)
, output_latency (oul) , output_latency (oul)
{} {}
}; };
typedef boost::shared_ptr<MidiDeviceSetting> MidiDeviceSettings; typedef boost::shared_ptr<MidiDeviceSetting> MidiDeviceSettings;
bool _can_set_midi_latencies; bool _can_set_midi_latencies;
std::vector<MidiDeviceSettings> _midi_devices; std::vector<MidiDeviceSettings> _midi_devices;
MidiDeviceSettings find_midi_device(std::string devicename) const { MidiDeviceSettings find_midi_device(std::string devicename) const {
for (std::vector<MidiDeviceSettings>::const_iterator p = _midi_devices.begin(); p != _midi_devices.end(); ++p) { for (std::vector<MidiDeviceSettings>::const_iterator p = _midi_devices.begin(); p != _midi_devices.end(); ++p) {
if ((*p)->name == devicename) { if ((*p)->name == devicename) {
return *p; return *p;
} }
} }
return MidiDeviceSettings(); return MidiDeviceSettings();
} }
struct StateStruct { struct StateStruct {
std::string backend; std::string backend;
std::string driver; std::string driver;
std::string device; std::string device;
@ -238,38 +238,38 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
, use_buffered_io (false) , use_buffered_io (false)
, lru (0) {} , lru (0) {}
}; };
typedef boost::shared_ptr<StateStruct> State; typedef boost::shared_ptr<StateStruct> State;
typedef std::list<State> StateList; typedef std::list<State> StateList;
static bool state_sort_cmp (const State &a, const State &b); static bool state_sort_cmp (const State &a, const State &b);
StateList states; StateList states;
State get_matching_state (const std::string& backend); State get_matching_state (const std::string& backend);
State get_matching_state (const std::string& backend, State get_matching_state (const std::string& backend,
const std::string& driver, const std::string& driver,
const std::string& device); const std::string& device);
State get_matching_state (const std::string& backend, State get_matching_state (const std::string& backend,
const std::string& driver, const std::string& driver,
const std::string& input_device, const std::string& input_device,
const std::string& output_device); const std::string& output_device);
State get_saved_state_for_currently_displayed_backend_and_device (); State get_saved_state_for_currently_displayed_backend_and_device ();
void maybe_display_saved_state (); void maybe_display_saved_state ();
State save_state (); State save_state ();
void store_state (State); void store_state (State);
bool equivalent_states (const State&, const State&); bool equivalent_states (const State&, const State&);
bool set_current_state (const State& state); bool set_current_state (const State& state);
void set_default_state (); void set_default_state ();
bool _have_control; bool _have_control;
static bool print_channel_count (Gtk::SpinButton*); static bool print_channel_count (Gtk::SpinButton*);
void build_notebook (); void build_notebook ();
void build_full_control_notebook (); void build_full_control_notebook ();
void build_no_control_notebook (); void build_no_control_notebook ();
void connect_changed_signals (); void connect_changed_signals ();
void block_changed_signals (); void block_changed_signals ();
@ -303,50 +303,50 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
sigc::connection input_channels_connection; sigc::connection input_channels_connection;
sigc::connection output_channels_connection; sigc::connection output_channels_connection;
void on_show (); void on_show ();
void on_map (); void on_map ();
void control_app_button_clicked (); void control_app_button_clicked ();
void start_stop_button_clicked (); void start_stop_button_clicked ();
void update_devices_button_clicked (); void update_devices_button_clicked ();
void use_buffered_io_button_clicked (); void use_buffered_io_button_clicked ();
void use_latency_button_clicked (); void use_latency_button_clicked ();
void manage_control_app_sensitivity (); void manage_control_app_sensitivity ();
int push_state_to_backend (bool start); int push_state_to_backend (bool start);
void post_push (); void post_push ();
void update_sensitivity (); void update_sensitivity ();
bool start_engine (); bool start_engine ();
bool stop_engine (bool for_latency = false); bool stop_engine (bool for_latency = false);
/* latency measurement */ /* latency measurement */
void latency_button_clicked (); void latency_button_clicked ();
void latency_back_button_clicked (); void latency_back_button_clicked ();
bool check_audio_latency_measurement (); bool check_audio_latency_measurement ();
bool check_midi_latency_measurement (); bool check_midi_latency_measurement ();
sigc::connection latency_timeout; sigc::connection latency_timeout;
void enable_latency_tab (); void enable_latency_tab ();
void disable_latency_tab (); void disable_latency_tab ();
void start_latency_detection (); void start_latency_detection ();
void end_latency_detection (); void end_latency_detection ();
void on_switch_page (GtkNotebookPage*, guint page_num); void on_switch_page (GtkNotebookPage*, guint page_num);
bool on_delete_event (GdkEventAny*); bool on_delete_event (GdkEventAny*);
void engine_running (); void engine_running ();
void engine_stopped (); void engine_stopped ();
void device_list_changed (); void device_list_changed ();
PBD::ScopedConnection running_connection; PBD::ScopedConnection running_connection;
PBD::ScopedConnectionList stopped_connection; PBD::ScopedConnectionList stopped_connection;
PBD::ScopedConnection devicelist_connection; PBD::ScopedConnection devicelist_connection;
void connect_disconnect_click (); void connect_disconnect_click ();
void calibrate_audio_latency (); void calibrate_audio_latency ();
void calibrate_midi_latency (MidiDeviceSettings); void calibrate_midi_latency (MidiDeviceSettings);
MidiDeviceSettings _measure_midi; MidiDeviceSettings _measure_midi;
void midi_latency_adjustment_changed(Gtk::Adjustment *, MidiDeviceSettings, bool); void midi_latency_adjustment_changed(Gtk::Adjustment *, MidiDeviceSettings, bool);
void midi_device_enabled_toggled(ArdourButton *, MidiDeviceSettings); void midi_device_enabled_toggled(ArdourButton *, MidiDeviceSettings);
sigc::connection lm_back_button_signal; sigc::connection lm_back_button_signal;
}; };
#endif /* __gtk2_ardour_engine_dialog_h__ */ #endif /* __gtk2_ardour_engine_dialog_h__ */

View file

@ -168,8 +168,8 @@ setup_gtk_ardour_enums ()
REGISTER_ENUM (FadeOutHandleItem); REGISTER_ENUM (FadeOutHandleItem);
REGISTER_ENUM (NoteItem); REGISTER_ENUM (NoteItem);
REGISTER_ENUM (FeatureLineItem); REGISTER_ENUM (FeatureLineItem);
REGISTER_ENUM (LeftFrameHandle); REGISTER_ENUM (LeftFrameHandle);
REGISTER_ENUM (RightFrameHandle); REGISTER_ENUM (RightFrameHandle);
REGISTER_ENUM (StartCrossFadeItem); REGISTER_ENUM (StartCrossFadeItem);
REGISTER_ENUM (EndCrossFadeItem); REGISTER_ENUM (EndCrossFadeItem);
REGISTER_ENUM (CrossfadeViewItem); REGISTER_ENUM (CrossfadeViewItem);

View file

@ -238,7 +238,7 @@ PortExportChannelSelector::ChannelTreeView::set_config (ChannelConfigPtr c)
for (Gtk::ListStore::Children::const_iterator p_it = port_list->children().begin(); p_it != port_list->children().end(); ++p_it) { for (Gtk::ListStore::Children::const_iterator p_it = port_list->children().begin(); p_it != port_list->children().end(); ++p_it) {
route_ports.insert ((*p_it)->get_value (route_cols.port_cols.port)); route_ports.insert ((*p_it)->get_value (route_cols.port_cols.port));
port_labels.insert (make_pair ((*p_it)->get_value (route_cols.port_cols.port), port_labels.insert (make_pair ((*p_it)->get_value (route_cols.port_cols.port),
(*p_it)->get_value (route_cols.port_cols.label))); (*p_it)->get_value (route_cols.port_cols.label)));
} }
std::set_intersection (pec->get_ports().begin(), pec->get_ports().end(), std::set_intersection (pec->get_ports().begin(), pec->get_ports().end(),
@ -455,15 +455,15 @@ RegionExportChannelSelector::RegionExportChannelSelector (ARDOUR::Session * _ses
ProfileManagerPtr manager, ProfileManagerPtr manager,
ARDOUR::AudioRegion const & region, ARDOUR::AudioRegion const & region,
ARDOUR::AudioTrack & track) : ARDOUR::AudioTrack & track) :
ExportChannelSelector (_session, manager), ExportChannelSelector (_session, manager),
region (region), region (region),
track (track), track (track),
region_chans (region.n_channels()), region_chans (region.n_channels()),
track_chans (track.n_outputs().n_audio()), track_chans (track.n_outputs().n_audio()),
raw_button (type_group), raw_button (type_group),
fades_button (type_group), fades_button (type_group),
processed_button (type_group) processed_button (type_group)
{ {
pack_start (vbox); pack_start (vbox);

View file

@ -124,12 +124,12 @@ class ExportDialog : public ArdourDialog, public PBD::ScopedConnectionList
Gtk::HBox warn_hbox; Gtk::HBox warn_hbox;
Gtk::Label warn_label; Gtk::Label warn_label;
std::string warn_string; std::string warn_string;
Gtk::HBox list_files_hbox; Gtk::HBox list_files_hbox;
Gtk::Label list_files_label; Gtk::Label list_files_label;
Gtk::Button list_files_button; Gtk::Button list_files_button;
std::string list_files_string; std::string list_files_string;
void add_error (std::string const & text); void add_error (std::string const & text);
void add_warning (std::string const & text); void add_warning (std::string const & text);

View file

@ -198,15 +198,15 @@ ExportFileNotebook::handle_page_change (GtkNotebookPage*, uint32_t page)
ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager, ExportFileNotebook * parent, uint32_t number, ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager, ExportFileNotebook * parent, uint32_t number,
ExportProfileManager::FormatStatePtr format_state, ExportProfileManager::FormatStatePtr format_state,
ExportProfileManager::FilenameStatePtr filename_state) : ExportProfileManager::FilenameStatePtr filename_state) :
format_state (format_state), format_state (format_state),
filename_state (filename_state), filename_state (filename_state),
profile_manager (profile_manager), profile_manager (profile_manager),
format_label (_("Format"), Gtk::ALIGN_LEFT), format_label (_("Format"), Gtk::ALIGN_LEFT),
filename_label (_("Location"), Gtk::ALIGN_LEFT), filename_label (_("Location"), Gtk::ALIGN_LEFT),
soundcloud_upload_button (_("Upload to Soundcloud")), soundcloud_upload_button (_("Upload to Soundcloud")),
analysis_button (_("Analyze Exported Audio")), analysis_button (_("Analyze Exported Audio")),
tab_number (number) tab_number (number)
{ {
set_border_width (12); set_border_width (12);

View file

@ -33,50 +33,50 @@ static int (*pthread_create_orig)(pthread_t *__restrict,
/* Library initialization function */ /* Library initialization function */
void _init(void) void _init(void)
{ {
pthread_create_orig = dlsym(RTLD_NEXT, "pthread_create"); pthread_create_orig = dlsym(RTLD_NEXT, "pthread_create");
fprintf(stderr, "pthreads: using profiling hooks for gprof\n"); fprintf(stderr, "pthreads: using profiling hooks for gprof\n");
if(pthread_create_orig == NULL) if(pthread_create_orig == NULL)
{ {
char *error = dlerror(); char *error = dlerror();
if(error == NULL) if(error == NULL)
{ {
error = "pthread_create is NULL"; error = "pthread_create is NULL";
} }
fprintf(stderr, "%s", error); fprintf(stderr, "%s", error);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
/* Our data structure passed to the wrapper */ /* Our data structure passed to the wrapper */
typedef struct wrapper_s typedef struct wrapper_s
{ {
void * (*start_routine)(void *); void * (*start_routine)(void *);
void * arg; void * arg;
pthread_mutex_t lock; pthread_mutex_t lock;
pthread_cond_t wait; pthread_cond_t wait;
struct itimerval itimer; struct itimerval itimer;
} wrapper_t; } wrapper_t;
/* The wrapper function in charge for setting the itimer value */ /* The wrapper function in charge for setting the itimer value */
static void * wrapper_routine(void * data) static void * wrapper_routine(void * data)
{ {
/* Put user data in thread-local variables */ /* Put user data in thread-local variables */
void * (*start_routine)(void *) = ((wrapper_t*)data)->start_routine; void * (*start_routine)(void *) = ((wrapper_t*)data)->start_routine;
void * arg = ((wrapper_t*)data)->arg; void * arg = ((wrapper_t*)data)->arg;
/* Set the profile timer value */ /* Set the profile timer value */
setitimer(ITIMER_PROF, &((wrapper_t*)data)->itimer, NULL); setitimer(ITIMER_PROF, &((wrapper_t*)data)->itimer, NULL);
/* Tell the calling thread that we don't need its data anymore */ /* Tell the calling thread that we don't need its data anymore */
pthread_mutex_lock(&((wrapper_t*)data)->lock); pthread_mutex_lock(&((wrapper_t*)data)->lock);
pthread_cond_signal(&((wrapper_t*)data)->wait); pthread_cond_signal(&((wrapper_t*)data)->wait);
pthread_mutex_unlock(&((wrapper_t*)data)->lock); pthread_mutex_unlock(&((wrapper_t*)data)->lock);
/* Call the real function */ /* Call the real function */
return start_routine(arg); return start_routine(arg);
} }
/* Our wrapper function for the real pthread_create() */ /* Our wrapper function for the real pthread_create() */
@ -85,33 +85,33 @@ int pthread_create(pthread_t *__restrict thread,
void * (*start_routine)(void *), void * (*start_routine)(void *),
void *__restrict arg) void *__restrict arg)
{ {
wrapper_t wrapper_data; wrapper_t wrapper_data;
int i_return; int i_return;
/* Initialize the wrapper structure */ /* Initialize the wrapper structure */
wrapper_data.start_routine = start_routine; wrapper_data.start_routine = start_routine;
wrapper_data.arg = arg; wrapper_data.arg = arg;
getitimer(ITIMER_PROF, &wrapper_data.itimer); getitimer(ITIMER_PROF, &wrapper_data.itimer);
pthread_cond_init(&wrapper_data.wait, NULL); pthread_cond_init(&wrapper_data.wait, NULL);
pthread_mutex_init(&wrapper_data.lock, NULL); pthread_mutex_init(&wrapper_data.lock, NULL);
pthread_mutex_lock(&wrapper_data.lock); pthread_mutex_lock(&wrapper_data.lock);
/* The real pthread_create call */ /* The real pthread_create call */
i_return = pthread_create_orig(thread, i_return = pthread_create_orig(thread,
attr, attr,
&wrapper_routine, &wrapper_routine,
&wrapper_data); &wrapper_data);
/* If the thread was successfully spawned, wait for the data /* If the thread was successfully spawned, wait for the data
* to be released */ * to be released */
if(i_return == 0) if(i_return == 0)
{ {
pthread_cond_wait(&wrapper_data.wait, &wrapper_data.lock); pthread_cond_wait(&wrapper_data.wait, &wrapper_data.lock);
} }
pthread_mutex_unlock(&wrapper_data.lock); pthread_mutex_unlock(&wrapper_data.lock);
pthread_mutex_destroy(&wrapper_data.lock); pthread_mutex_destroy(&wrapper_data.lock);
pthread_cond_destroy(&wrapper_data.wait); pthread_cond_destroy(&wrapper_data.wait);
return i_return; return i_return;
} }

View file

@ -48,7 +48,7 @@ public:
void set_session (ARDOUR::Session *); void set_session (ARDOUR::Session *);
/** @param g Route group, or 0. /** @param g Route group, or 0.
* @return Menu to be popped up on right-click over the given route group. * @return Menu to be popped up on right-click over the given route group.
*/ */
Gtk::Menu* get_menu (ARDOUR::RouteGroup* g, bool tabArea = false); Gtk::Menu* get_menu (ARDOUR::RouteGroup* g, bool tabArea = false);
@ -110,7 +110,7 @@ private:
void set_activation (ARDOUR::RouteGroup *, bool); void set_activation (ARDOUR::RouteGroup *, bool);
void edit_group (ARDOUR::RouteGroup *); void edit_group (ARDOUR::RouteGroup *);
void subgroup (ARDOUR::RouteGroup *, bool, ARDOUR::Placement); void subgroup (ARDOUR::RouteGroup *, bool, ARDOUR::Placement);
void un_subgroup (ARDOUR::RouteGroup *); void un_subgroup (ARDOUR::RouteGroup *);
void activate_all (); void activate_all ();
void disable_all (); void disable_all ();
void remove_group (ARDOUR::RouteGroup *); void remove_group (ARDOUR::RouteGroup *);

View file

@ -367,7 +367,7 @@ keyboard_event_handler(GtkWidget *mk, GdkEventKey *event, gpointer ignored)
GdkKeymapKey kk; GdkKeymapKey kk;
PianoKeyboard *pk = PIANO_KEYBOARD(mk); PianoKeyboard *pk = PIANO_KEYBOARD(mk);
(void) ignored; (void) ignored;
/* We're not using event->keyval, because we need keyval with level set to 0. /* We're not using event->keyval, because we need keyval with level set to 0.
E.g. if user holds Shift and presses '7', we want to get a '7', not '&'. */ E.g. if user holds Shift and presses '7', we want to get a '7', not '&'. */
@ -449,7 +449,7 @@ mouse_button_event_handler(PianoKeyboard *pk, GdkEventButton *event, gpointer ig
int note = get_note_for_xy(pk, x, y); int note = get_note_for_xy(pk, x, y);
(void) ignored; (void) ignored;
if (event->button != 1) if (event->button != 1)
return TRUE; return TRUE;
@ -488,7 +488,7 @@ mouse_motion_event_handler(PianoKeyboard *pk, GdkEventMotion *event, gpointer ig
{ {
int note; int note;
(void) ignored; (void) ignored;
if ((event->state & GDK_BUTTON1_MASK) == 0) if ((event->state & GDK_BUTTON1_MASK) == 0)
return TRUE; return TRUE;
@ -542,7 +542,7 @@ piano_keyboard_expose(GtkWidget *widget, GdkEventExpose *event)
static void static void
piano_keyboard_size_request(GtkWidget* w, GtkRequisition *requisition) piano_keyboard_size_request(GtkWidget* w, GtkRequisition *requisition)
{ {
(void) w; (void) w;
requisition->width = PIANO_KEYBOARD_DEFAULT_WIDTH; requisition->width = PIANO_KEYBOARD_DEFAULT_WIDTH;
requisition->height = PIANO_KEYBOARD_DEFAULT_HEIGHT; requisition->height = PIANO_KEYBOARD_DEFAULT_HEIGHT;
@ -625,8 +625,8 @@ piano_keyboard_class_init(PianoKeyboardClass *klass)
0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
piano_keyboard_signals[REST_SIGNAL] = g_signal_new ("rest", piano_keyboard_signals[REST_SIGNAL] = g_signal_new ("rest",
G_TYPE_FROM_CLASS (klass), (GSignalFlags)(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION), G_TYPE_FROM_CLASS (klass), (GSignalFlags)(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION),
0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
widget_klass = (GtkWidgetClass*) klass; widget_klass = (GtkWidgetClass*) klass;

View file

@ -141,15 +141,15 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s)
return; return;
} }
if (s) { if (s) {
if (!f->connected_to (*j)) { if (!f->connected_to (*j)) {
_io->connect (f, *j, 0); _io->connect (f, *j, 0);
} }
} else { } else {
if (f->connected_to (*j)) { if (f->connected_to (*j)) {
_io->disconnect (f, *j, 0); _io->disconnect (f, *j, 0);
} }
} }
} }
} }
} }

View file

@ -34,7 +34,7 @@ class IOSelector : public PortMatrix
std::string disassociation_verb () const; std::string disassociation_verb () const;
std::string channel_noun () const; std::string channel_noun () const;
ARDOUR::Session* session() const { return _session; } ARDOUR::Session* session() const { return _session; }
uint32_t n_io_ports () const; uint32_t n_io_ports () const;
boost::shared_ptr<ARDOUR::IO> const io () { return _io; } boost::shared_ptr<ARDOUR::IO> const io () { return _io; }

View file

@ -87,19 +87,19 @@ class LevelMeterBase : public ARDOUR::SessionHandlePtr, virtual public sigc::tra
Width _width; Width _width;
struct MeterInfo { struct MeterInfo {
Gtkmm2ext::FastMeter *meter; Gtkmm2ext::FastMeter *meter;
gint16 width; gint16 width;
int length; int length;
bool packed; bool packed;
float max_peak; float max_peak;
MeterInfo() { MeterInfo() {
meter = 0; meter = 0;
width = 0; width = 0;
length = 0; length = 0;
packed = false; packed = false;
max_peak = -INFINITY; max_peak = -INFINITY;
} }
}; };
guint16 regular_meter_width; guint16 regular_meter_width;

View file

@ -642,7 +642,7 @@ Dialog::run (lua_State *L)
case Gtk::RESPONSE_ACCEPT: case Gtk::RESPONSE_ACCEPT:
break; break;
default: default:
lua_pushnil (L); lua_pushnil (L);
return 1; return 1;
} }

View file

@ -479,7 +479,7 @@ ArdourMarker::show ()
{ {
_shown = true; _shown = true;
group->show (); group->show ();
setup_line (); setup_line ();
} }

View file

@ -108,7 +108,7 @@ class ArdourMarker : public sigc::trackable
ArdourCanvas::Container* _parent; ArdourCanvas::Container* _parent;
ArdourCanvas::Container *group; ArdourCanvas::Container *group;
ArdourCanvas::Polygon *mark; ArdourCanvas::Polygon *mark;
ArdourCanvas::Text *_name_item; ArdourCanvas::Text *_name_item;
ArdourCanvas::Points *points; ArdourCanvas::Points *points;
ArdourCanvas::Line* _track_canvas_line; ArdourCanvas::Line* _track_canvas_line;
ArdourCanvas::Rectangle* _name_background; ArdourCanvas::Rectangle* _name_background;
@ -142,7 +142,7 @@ private:
class TempoMarker : public ArdourMarker class TempoMarker : public ArdourMarker
{ {
public: public:
TempoMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&); TempoMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, ARDOUR::TempoSection&);
~TempoMarker (); ~TempoMarker ();
ARDOUR::TempoSection& tempo() const { return _tempo; } ARDOUR::TempoSection& tempo() const { return _tempo; }
@ -155,7 +155,7 @@ class TempoMarker : public ArdourMarker
class MeterMarker : public ArdourMarker class MeterMarker : public ArdourMarker
{ {
public: public:
MeterMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&); MeterMarker (PublicEditor& editor, ArdourCanvas::Container &, guint32 rgba, const std::string& text, ARDOUR::MeterSection&);
~MeterMarker (); ~MeterMarker ();
ARDOUR::MeterSection& meter() const { return _meter; } ARDOUR::MeterSection& meter() const { return _meter; }

View file

@ -85,8 +85,8 @@ MidiChannelSelector::~MidiChannelSelector()
bool bool
MidiChannelSelector::was_clicked (GdkEventButton*) MidiChannelSelector::was_clicked (GdkEventButton*)
{ {
clicked (); clicked ();
return false; return false;
} }
void void
@ -360,16 +360,16 @@ MidiChannelSelectorWindow::build ()
VBox* vpacker; VBox* vpacker;
HBox* capture_controls; HBox* capture_controls;
HBox* playback_controls; HBox* playback_controls;
Button* b; Button* b;
Label* l; Label* l;
vpacker = manage (new VBox); vpacker = manage (new VBox);
vpacker->set_spacing (6); vpacker->set_spacing (6);
vpacker->set_border_width (12); vpacker->set_border_width (12);
l = manage (new Label (string_compose ("<span size=\"large\" weight=\"bold\">%1</span>", _("Inbound")))); l = manage (new Label (string_compose ("<span size=\"large\" weight=\"bold\">%1</span>", _("Inbound"))));
l->set_use_markup (true); l->set_use_markup (true);
vpacker->pack_start (*l, true, true); vpacker->pack_start (*l, true, true);
vpacker->pack_start (capture_all_button); vpacker->pack_start (capture_all_button);
capture_all_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::capture_mode_toggled), AllChannels)); capture_all_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::capture_mode_toggled), AllChannels));
@ -380,35 +380,35 @@ MidiChannelSelectorWindow::build ()
vpacker->pack_start (capture_force_button); vpacker->pack_start (capture_force_button);
capture_force_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::capture_mode_toggled), ForceChannel)); capture_force_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::capture_mode_toggled), ForceChannel));
vpacker->pack_start (capture_mask_box); vpacker->pack_start (capture_mask_box);
capture_controls = manage (new HBox); capture_controls = manage (new HBox);
capture_controls->set_spacing (6); capture_controls->set_spacing (6);
b = manage (new Button (_("All"))); b = manage (new Button (_("All")));
Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to enable recording all channels")); Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to enable recording all channels"));
capture_controls->pack_start (*b); capture_controls->pack_start (*b);
capture_mask_controls.push_back (b); capture_mask_controls.push_back (b);
b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::fill_capture_mask)); b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::fill_capture_mask));
b = manage (new Button (_("None"))); b = manage (new Button (_("None")));
Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to disable recording all channels")); Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to disable recording all channels"));
capture_controls->pack_start (*b); capture_controls->pack_start (*b);
capture_mask_controls.push_back (b); capture_mask_controls.push_back (b);
b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::zero_capture_mask)); b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::zero_capture_mask));
b = manage (new Button (_("Invert"))); b = manage (new Button (_("Invert")));
Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to invert currently selected recording channels")); Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to invert currently selected recording channels"));
capture_controls->pack_start (*b); capture_controls->pack_start (*b);
capture_mask_controls.push_back (b); capture_mask_controls.push_back (b);
b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::invert_capture_mask)); b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::invert_capture_mask));
vpacker->pack_start (*capture_controls); vpacker->pack_start (*capture_controls);
Gtk::HSeparator *hseparator2 = manage(new Gtk::HSeparator); Gtk::HSeparator *hseparator2 = manage(new Gtk::HSeparator);
vpacker->pack_start (*hseparator2, false, false, 6); vpacker->pack_start (*hseparator2, false, false, 6);
l = manage (new Label (string_compose ("<span size=\"large\" weight=\"bold\">%1</span>", _("Playback")))); l = manage (new Label (string_compose ("<span size=\"large\" weight=\"bold\">%1</span>", _("Playback"))));
l->set_use_markup (true); l->set_use_markup (true);
vpacker->pack_start (*l); vpacker->pack_start (*l);
vpacker->pack_start (playback_all_button); vpacker->pack_start (playback_all_button);
playback_all_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::playback_mode_toggled), AllChannels)); playback_all_button.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MidiChannelSelectorWindow::playback_mode_toggled), AllChannels));
@ -424,12 +424,12 @@ MidiChannelSelectorWindow::build ()
playback_controls = manage (new HBox); playback_controls = manage (new HBox);
playback_controls->set_spacing (6); playback_controls->set_spacing (6);
b = manage (new Button (_("All"))); b = manage (new Button (_("All")));
Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to enable playback of all channels")); Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to enable playback of all channels"));
playback_controls->pack_start (*b); playback_controls->pack_start (*b);
playback_mask_controls.push_back (b); playback_mask_controls.push_back (b);
b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::fill_playback_mask)); b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::fill_playback_mask));
b = manage (new Button (_("None"))); b = manage (new Button (_("None")));
Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to disable playback of all channels")); Gtkmm2ext::UI::instance()->set_tip (*b, _("Click to disable playback of all channels"));
playback_controls->pack_start (*b); playback_controls->pack_start (*b);
playback_mask_controls.push_back (b); playback_mask_controls.push_back (b);
@ -440,9 +440,9 @@ MidiChannelSelectorWindow::build ()
playback_mask_controls.push_back (b); playback_mask_controls.push_back (b);
b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::invert_playback_mask)); b->signal_clicked().connect (sigc::mem_fun (*this, &MidiChannelSelectorWindow::invert_playback_mask));
vpacker->pack_start (*playback_controls); vpacker->pack_start (*playback_controls);
add (*vpacker); add (*vpacker);
} }
void void

View file

@ -42,141 +42,141 @@ namespace ARDOUR {
class MidiChannelSelector : public Gtk::Table class MidiChannelSelector : public Gtk::Table
{ {
public: public:
MidiChannelSelector(int n_rows = 4, int n_columns = 4, int start_row = 0, int start_column = 0); MidiChannelSelector(int n_rows = 4, int n_columns = 4, int start_row = 0, int start_column = 0);
virtual ~MidiChannelSelector() = 0; virtual ~MidiChannelSelector() = 0;
sigc::signal<void> clicked; sigc::signal<void> clicked;
void set_channel_colors(const uint32_t new_channel_colors[16]); void set_channel_colors(const uint32_t new_channel_colors[16]);
void set_default_channel_color(); void set_default_channel_color();
protected: protected:
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr) = 0; virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr) = 0;
Gtk::Label _button_labels[4][4]; Gtk::Label _button_labels[4][4];
Gtkmm2ext::StatefulToggleButton _buttons[4][4]; Gtkmm2ext::StatefulToggleButton _buttons[4][4];
int _recursion_counter; int _recursion_counter;
bool was_clicked (GdkEventButton*); bool was_clicked (GdkEventButton*);
}; };
class SingleMidiChannelSelector : public MidiChannelSelector class SingleMidiChannelSelector : public MidiChannelSelector
{ {
public: public:
SingleMidiChannelSelector(uint8_t active_channel = 0); SingleMidiChannelSelector(uint8_t active_channel = 0);
uint8_t get_active_channel() const { return _active_channel; } uint8_t get_active_channel() const { return _active_channel; }
sigc::signal<void, uint8_t> channel_selected; sigc::signal<void, uint8_t> channel_selected;
protected: protected:
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr); virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr);
Gtk::ToggleButton* _last_active_button; Gtk::ToggleButton* _last_active_button;
uint8_t _active_channel; uint8_t _active_channel;
}; };
class MidiMultipleChannelSelector : public MidiChannelSelector class MidiMultipleChannelSelector : public MidiChannelSelector
{ {
public: public:
MidiMultipleChannelSelector(ARDOUR::ChannelMode mode = ARDOUR::FilterChannels, MidiMultipleChannelSelector(ARDOUR::ChannelMode mode = ARDOUR::FilterChannels,
uint16_t initial_selection = 0xFFFF); uint16_t initial_selection = 0xFFFF);
virtual ~MidiMultipleChannelSelector(); virtual ~MidiMultipleChannelSelector();
/** The channel mode or selected channel(s) has changed. /** The channel mode or selected channel(s) has changed.
* First parameter is the new channel mode, second parameter is a bitmask * First parameter is the new channel mode, second parameter is a bitmask
* of the currently selected channels. * of the currently selected channels.
*/ */
sigc::signal<void, ARDOUR::ChannelMode, uint16_t> mode_changed; sigc::signal<void, ARDOUR::ChannelMode, uint16_t> mode_changed;
void set_channel_mode(ARDOUR::ChannelMode mode, uint16_t mask); void set_channel_mode(ARDOUR::ChannelMode mode, uint16_t mask);
ARDOUR::ChannelMode get_channel_mode () const { return _channel_mode; } ARDOUR::ChannelMode get_channel_mode () const { return _channel_mode; }
/** /**
* @return each bit in the returned word represents a midi channel, eg. * @return each bit in the returned word represents a midi channel, eg.
* bit 0 represents channel 0 and bit 15 represents channel 15 * bit 0 represents channel 0 and bit 15 represents channel 15
* *
*/ */
uint16_t get_selected_channels() const; uint16_t get_selected_channels() const;
void set_selected_channels(uint16_t selected_channels); void set_selected_channels(uint16_t selected_channels);
protected: protected:
ARDOUR::ChannelMode _channel_mode; ARDOUR::ChannelMode _channel_mode;
ARDOUR::NoteMode _note_mode; ARDOUR::NoteMode _note_mode;
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr); virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr);
void force_channels_button_toggled(); void force_channels_button_toggled();
void select_all(bool on); void select_all(bool on);
void invert_selection(void); void invert_selection(void);
Gtk::Button _select_all; Gtk::Button _select_all;
Gtk::Button _select_none; Gtk::Button _select_none;
Gtk::Button _invert_selection; Gtk::Button _invert_selection;
Gtk::ToggleButton _force_channel; Gtk::ToggleButton _force_channel;
}; };
class MidiChannelSelectorWindow : public ArdourWindow, public PBD::ScopedConnectionList class MidiChannelSelectorWindow : public ArdourWindow, public PBD::ScopedConnectionList
{ {
public: public:
MidiChannelSelectorWindow (boost::shared_ptr<ARDOUR::MidiTrack>); MidiChannelSelectorWindow (boost::shared_ptr<ARDOUR::MidiTrack>);
~MidiChannelSelectorWindow (); ~MidiChannelSelectorWindow ();
void set_channel_colors (const uint32_t new_channel_colors[16]); void set_channel_colors (const uint32_t new_channel_colors[16]);
void set_default_channel_color(); void set_default_channel_color();
private: private:
boost::shared_ptr<ARDOUR::MidiTrack> track; boost::shared_ptr<ARDOUR::MidiTrack> track;
std::vector<Gtk::ToggleButton*> playback_buttons; std::vector<Gtk::ToggleButton*> playback_buttons;
std::vector<Gtk::ToggleButton*> capture_buttons; std::vector<Gtk::ToggleButton*> capture_buttons;
std::vector<Gtk::Widget*> playback_mask_controls; std::vector<Gtk::Widget*> playback_mask_controls;
std::vector<Gtk::Widget*> capture_mask_controls; std::vector<Gtk::Widget*> capture_mask_controls;
Gtk::HBox capture_mask_box; Gtk::HBox capture_mask_box;
Gtk::HBox playback_mask_box; Gtk::HBox playback_mask_box;
Gtk::RadioButtonGroup playback_button_group; Gtk::RadioButtonGroup playback_button_group;
Gtk::RadioButton playback_all_button; Gtk::RadioButton playback_all_button;
Gtk::RadioButton playback_filter_button; Gtk::RadioButton playback_filter_button;
Gtk::RadioButton playback_force_button; Gtk::RadioButton playback_force_button;
Gtk::RadioButtonGroup capture_button_group; Gtk::RadioButtonGroup capture_button_group;
Gtk::RadioButton capture_all_button; Gtk::RadioButton capture_all_button;
Gtk::RadioButton capture_filter_button; Gtk::RadioButton capture_filter_button;
Gtk::RadioButton capture_force_button; Gtk::RadioButton capture_force_button;
ARDOUR::ChannelMode last_drawn_capture_mode; ARDOUR::ChannelMode last_drawn_capture_mode;
ARDOUR::ChannelMode last_drawn_playback_mode; ARDOUR::ChannelMode last_drawn_playback_mode;
void build(); void build();
void set_capture_selected_channels (uint16_t); void set_capture_selected_channels (uint16_t);
void set_playback_selected_channels (uint16_t); void set_playback_selected_channels (uint16_t);
void fill_playback_mask (); void fill_playback_mask ();
void zero_playback_mask (); void zero_playback_mask ();
void invert_playback_mask (); void invert_playback_mask ();
void fill_capture_mask (); void fill_capture_mask ();
void zero_capture_mask (); void zero_capture_mask ();
void invert_capture_mask (); void invert_capture_mask ();
void playback_mask_changed (); void playback_mask_changed ();
void capture_mask_changed (); void capture_mask_changed ();
void playback_mode_changed (); void playback_mode_changed ();
void capture_mode_changed (); void capture_mode_changed ();
void playback_channel_clicked (uint16_t); void playback_channel_clicked (uint16_t);
void capture_channel_clicked (uint16_t); void capture_channel_clicked (uint16_t);
void playback_all_clicked(); void playback_all_clicked();
void playback_none_clicked(); void playback_none_clicked();
void playback_invert_clicked(); void playback_invert_clicked();
void capture_all_clicked(); void capture_all_clicked();
void capture_none_clicked(); void capture_none_clicked();
void capture_invert_clicked(); void capture_invert_clicked();
void capture_mode_toggled (ARDOUR::ChannelMode); void capture_mode_toggled (ARDOUR::ChannelMode);
void playback_mode_toggled (ARDOUR::ChannelMode); void playback_mode_toggled (ARDOUR::ChannelMode);
}; };
#endif /*__ardour_ui_midi_channel_selector_h__*/ #endif /*__ardour_ui_midi_channel_selector_h__*/

View file

@ -303,7 +303,7 @@ public:
void goto_previous_note (bool add_to_selection); void goto_previous_note (bool add_to_selection);
void goto_next_note (bool add_to_selection); void goto_next_note (bool add_to_selection);
void change_note_lengths (bool, bool, Evoral::Beats beats, bool start, bool end); void change_note_lengths (bool, bool, Evoral::Beats beats, bool start, bool end);
void change_velocities (bool up, bool fine, bool allow_smush, bool all_together); void change_velocities (bool up, bool fine, bool allow_smush, bool all_together);
void transpose (bool up, bool fine, bool allow_smush); void transpose (bool up, bool fine, bool allow_smush);
void nudge_notes (bool forward, bool fine); void nudge_notes (bool forward, bool fine);
void channel_edit (); void channel_edit ();

View file

@ -34,10 +34,10 @@ class MidiVelocityDialog : public ArdourDialog
uint8_t velocity() const; uint8_t velocity() const;
private: private:
Gtk::Adjustment adjustment; Gtk::Adjustment adjustment;
Gtk::SpinButton spinner; Gtk::SpinButton spinner;
Gtk::Label label; Gtk::Label label;
Gtk::HBox packer; Gtk::HBox packer;
}; };
#endif /* __gtk2_ardour_midi_velocity_dialog_h__ */ #endif /* __gtk2_ardour_midi_velocity_dialog_h__ */

View file

@ -30,7 +30,7 @@
#include "ardour_dialog.h" #include "ardour_dialog.h"
namespace ARDOUR { namespace ARDOUR {
class Session; class Session;
} }
class MissingFileDialog : public ArdourDialog class MissingFileDialog : public ArdourDialog

View file

@ -26,15 +26,15 @@ using namespace ARDOUR;
using namespace PBD; using namespace PBD;
MissingPluginDialog::MissingPluginDialog (Session * s, list<string> const & plugins) MissingPluginDialog::MissingPluginDialog (Session * s, list<string> const & plugins)
: ArdourDialog (_("Missing Plugins"), true, false) : ArdourDialog (_("Missing Plugins"), true, false)
{ {
/* This dialog is always shown programatically. Center the window.*/ /* This dialog is always shown programatically. Center the window.*/
set_position (Gtk::WIN_POS_CENTER); set_position (Gtk::WIN_POS_CENTER);
set_session (s); set_session (s);
add_button (_("OK"), RESPONSE_OK); add_button (_("OK"), RESPONSE_OK);
set_default_response (RESPONSE_OK); set_default_response (RESPONSE_OK);
Label* m = manage (new Label); Label* m = manage (new Label);
@ -49,8 +49,8 @@ MissingPluginDialog::MissingPluginDialog (Session * s, list<string> const & plug
"It is recommended that you install the missing plugins and re-load the session.\n" "It is recommended that you install the missing plugins and re-load the session.\n"
"(also check the blacklist, Window > Log and Preferences > Plugins)"); "(also check the blacklist, Window > Log and Preferences > Plugins)");
m->set_markup (t.str ()); m->set_markup (t.str ());
get_vbox()->pack_start (*m, false, false); get_vbox()->pack_start (*m, false, false);
show_all (); show_all ();
} }

View file

@ -24,13 +24,13 @@
#include "ardour_dialog.h" #include "ardour_dialog.h"
namespace ARDOUR { namespace ARDOUR {
class Session; class Session;
} }
class MissingPluginDialog : public ArdourDialog class MissingPluginDialog : public ArdourDialog
{ {
public: public:
MissingPluginDialog (ARDOUR::Session *, std::list<std::string> const &); MissingPluginDialog (ARDOUR::Session *, std::list<std::string> const &);
}; };
#endif /* __gtk_ardour_missing_plugin_dialog_h__ */ #endif /* __gtk_ardour_missing_plugin_dialog_h__ */

View file

@ -1125,11 +1125,11 @@ MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR
void void
MixerStrip::update_diskstream_display () MixerStrip::update_diskstream_display ()
{ {
if (is_track() && input_selector) { if (is_track() && input_selector) {
input_selector->hide_all (); input_selector->hide_all ();
} }
route_color_changed (); route_color_changed ();
} }
void void

View file

@ -106,8 +106,8 @@ Mixer_UI::Mixer_UI ()
, _plugin_selector (0) , _plugin_selector (0)
, _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide) , _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide)
, ignore_reorder (false) , ignore_reorder (false)
, _in_group_rebuild_or_clear (false) , _in_group_rebuild_or_clear (false)
, _route_deletion_in_progress (false) , _route_deletion_in_progress (false)
, _maximised (false) , _maximised (false)
, _show_mixer_list (true) , _show_mixer_list (true)
, myactions (X_("mixer")) , myactions (X_("mixer"))
@ -442,7 +442,7 @@ Mixer_UI::remove_master (VCAMasterStrip* vms)
for (ri = rows.begin(); ri != rows.end(); ++ri) { for (ri = rows.begin(); ri != rows.end(); ++ri) {
if ((*ri)[stripable_columns.strip] == vms) { if ((*ri)[stripable_columns.strip] == vms) {
PBD::Unwinder<bool> uw (_route_deletion_in_progress, true); PBD::Unwinder<bool> uw (_route_deletion_in_progress, true);
track_model->erase (ri); track_model->erase (ri);
break; break;
} }
@ -667,7 +667,7 @@ Mixer_UI::remove_strip (MixerStrip* strip)
for (ri = rows.begin(); ri != rows.end(); ++ri) { for (ri = rows.begin(); ri != rows.end(); ++ri) {
if ((*ri)[stripable_columns.strip] == strip) { if ((*ri)[stripable_columns.strip] == strip) {
PBD::Unwinder<bool> uw (_route_deletion_in_progress, true); PBD::Unwinder<bool> uw (_route_deletion_in_progress, true);
track_model->erase (ri); track_model->erase (ri);
break; break;
} }
@ -1132,15 +1132,15 @@ Mixer_UI::hide_strip (MixerStrip* ms)
gint gint
Mixer_UI::start_updating () Mixer_UI::start_updating ()
{ {
fast_screen_update_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &Mixer_UI::fast_update_strips)); fast_screen_update_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &Mixer_UI::fast_update_strips));
return 0; return 0;
} }
gint gint
Mixer_UI::stop_updating () Mixer_UI::stop_updating ()
{ {
fast_screen_update_connection.disconnect(); fast_screen_update_connection.disconnect();
return 0; return 0;
} }
void void
@ -1302,9 +1302,9 @@ Mixer_UI::track_list_delete (const Gtk::TreeModel::Path&)
DEBUG_TRACE (DEBUG::OrderKeys, "mixer UI treeview row deleted\n"); DEBUG_TRACE (DEBUG::OrderKeys, "mixer UI treeview row deleted\n");
sync_presentation_info_from_treeview (); sync_presentation_info_from_treeview ();
if (_route_deletion_in_progress) { if (_route_deletion_in_progress) {
redisplay_track_list (); redisplay_track_list ();
} }
} }
void void

View file

@ -124,8 +124,8 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
void register_actions (); void register_actions ();
void load_bindings (); void load_bindings ();
Gtkmm2ext::Bindings* bindings; Gtkmm2ext::Bindings* bindings;
protected: protected:
void set_axis_targets_for_operation (); void set_axis_targets_for_operation ();

View file

@ -119,15 +119,15 @@ MonitorSelector::set_state (ARDOUR::BundleChannel c[2], bool s)
return; return;
} }
if (s) { if (s) {
if (!f->connected_to (*j)) { if (!f->connected_to (*j)) {
_io->connect (f, *j, 0); _io->connect (f, *j, 0);
} }
} else { } else {
if (f->connected_to (*j)) { if (f->connected_to (*j)) {
_io->disconnect (f, *j, 0); _io->disconnect (f, *j, 0);
} }
} }
} }
} }
} }

View file

@ -487,12 +487,12 @@ MonoPanner::on_key_press_event (GdkEventKey* ev)
void void
MonoPanner::set_colors () MonoPanner::set_colors ()
{ {
colors.fill = UIConfiguration::instance().color_mod ("mono panner fill", "panner fill"); colors.fill = UIConfiguration::instance().color_mod ("mono panner fill", "panner fill");
colors.outline = UIConfiguration::instance().color ("mono panner outline"); colors.outline = UIConfiguration::instance().color ("mono panner outline");
colors.text = UIConfiguration::instance().color ("mono panner text"); colors.text = UIConfiguration::instance().color ("mono panner text");
colors.background = UIConfiguration::instance().color ("mono panner bg"); colors.background = UIConfiguration::instance().color ("mono panner bg");
colors.pos_outline = UIConfiguration::instance().color ("mono panner position outline"); colors.pos_outline = UIConfiguration::instance().color ("mono panner position outline");
colors.pos_fill = UIConfiguration::instance().color_mod ("mono panner position fill", "mono panner position fill"); colors.pos_fill = UIConfiguration::instance().color_mod ("mono panner position fill", "mono panner position fill");
} }
void void

View file

@ -33,7 +33,7 @@ namespace ARDOUR {
} }
namespace PBD { namespace PBD {
class Controllable; class Controllable;
} }
class MonoPanner : public PannerInterface class MonoPanner : public PannerInterface
@ -42,7 +42,7 @@ class MonoPanner : public PannerInterface
MonoPanner (boost::shared_ptr<ARDOUR::PannerShell>); MonoPanner (boost::shared_ptr<ARDOUR::PannerShell>);
~MonoPanner (); ~MonoPanner ();
boost::shared_ptr<PBD::Controllable> get_controllable() const { return position_control; } boost::shared_ptr<PBD::Controllable> get_controllable() const { return position_control; }
sigc::signal<void> StartGesture; sigc::signal<void> StartGesture;
sigc::signal<void> StopGesture; sigc::signal<void> StopGesture;
@ -52,42 +52,42 @@ class MonoPanner : public PannerInterface
bool on_button_press_event (GdkEventButton*); bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*); bool on_button_release_event (GdkEventButton*);
bool on_motion_notify_event (GdkEventMotion*); bool on_motion_notify_event (GdkEventMotion*);
bool on_scroll_event (GdkEventScroll*); bool on_scroll_event (GdkEventScroll*);
bool on_key_press_event (GdkEventKey*); bool on_key_press_event (GdkEventKey*);
private: private:
PannerEditor* editor (); PannerEditor* editor ();
boost::shared_ptr<ARDOUR::PannerShell> _panner_shell; boost::shared_ptr<ARDOUR::PannerShell> _panner_shell;
boost::shared_ptr<PBD::Controllable> position_control; boost::shared_ptr<PBD::Controllable> position_control;
PBD::ScopedConnectionList panvalue_connections; PBD::ScopedConnectionList panvalue_connections;
PBD::ScopedConnectionList panshell_connections; PBD::ScopedConnectionList panshell_connections;
int drag_start_x; int drag_start_x;
int last_drag_x; int last_drag_x;
double accumulated_delta; double accumulated_delta;
bool detented; bool detented;
BindingProxy position_binder; BindingProxy position_binder;
void set_tooltip (); void set_tooltip ();
struct ColorScheme { struct ColorScheme {
uint32_t outline; uint32_t outline;
uint32_t fill; uint32_t fill;
uint32_t text; uint32_t text;
uint32_t background; uint32_t background;
uint32_t pos_outline; uint32_t pos_outline;
uint32_t pos_fill; uint32_t pos_fill;
}; };
bool _dragging; bool _dragging;
static Pango::AttrList panner_font_attributes; static Pango::AttrList panner_font_attributes;
static bool have_font; static bool have_font;
static ColorScheme colors; static ColorScheme colors;
static void set_colors (); static void set_colors ();
static bool have_colors; static bool have_colors;
void color_handler (); void color_handler ();
void bypass_handler (); void bypass_handler ();
void pannable_handler (); void pannable_handler ();

View file

@ -195,7 +195,7 @@ NagScreen::offer_to_donate ()
{ {
/* we don't care if it fails */ /* we don't care if it fails */
PBD::open_uri (Config->get_donate_url()); PBD::open_uri (Config->get_donate_url());
} }
void void

View file

@ -321,6 +321,6 @@ NoteBase::mouse_near_ends () const
bool bool
NoteBase::big_enough_to_trim () const NoteBase::big_enough_to_trim () const
{ {
return (x1() - x0()) > 10; return (x1() - x0()) > 10;
} }

View file

@ -33,12 +33,12 @@ NSM_Client::NSM_Client()
int int
NSM_Client::command_save(char **out_msg) NSM_Client::command_save(char **out_msg)
{ {
(void) out_msg; (void) out_msg;
ARDOUR_UI::instance()->save_state(); ARDOUR_UI::instance()->save_state();
int r = ERR_OK; int r = ERR_OK;
return r; return r;
} }
int int
@ -47,13 +47,13 @@ NSM_Client::command_open(const char* name,
const char* client_id, const char* client_id,
char** /*out_msg*/) char** /*out_msg*/)
{ {
int r = ERR_OK; int r = ERR_OK;
ARDOUR_COMMAND_LINE::session_name = name; ARDOUR_COMMAND_LINE::session_name = name;
ARDOUR_COMMAND_LINE::backend_client_name = client_id; ARDOUR_COMMAND_LINE::backend_client_name = client_id;
if (ARDOUR_UI::instance()->get_session_parameters(true, false, "")) { if (ARDOUR_UI::instance()->get_session_parameters(true, false, "")) {
return ERR_GENERAL; return ERR_GENERAL;
} }
return r; return r;
} }

View file

@ -23,17 +23,17 @@
class NSM_Client:public NSM::Client class NSM_Client:public NSM::Client
{ {
public: public:
NSM_Client(); NSM_Client();
~NSM_Client() { } ~NSM_Client() { }
protected: protected:
int command_open(const char *name, int command_open(const char *name,
const char *display_name, const char *display_name,
const char *client_id, const char *client_id,
char **out_msg); char **out_msg);
int command_save(char **out_msg); int command_save(char **out_msg);
}; };

View file

@ -43,262 +43,273 @@ namespace NSM
#undef OSC_REPLY #undef OSC_REPLY
#undef OSC_REPLY_ERR #undef OSC_REPLY_ERR
#define OSC_REPLY( value ) lo_send_from( ((NSM::Client*)user_data)->nsm_addr, ((NSM::Client*)user_data)->_server, LO_TT_IMMEDIATE, "/reply", "ss", path, value ) #define OSC_REPLY(value) lo_send_from( ((NSM::Client*)user_data)->nsm_addr, ((NSM::Client*)user_data)->_server, LO_TT_IMMEDIATE, "/reply", "ss", path, value)
#define OSC_REPLY_ERR( errcode, value ) lo_send_from( ((NSM::Client*)user_data)->nsm_addr, ((NSM::Client*)user_data)->_server, LO_TT_IMMEDIATE, "/error", "sis", path, errcode, value ) #define OSC_REPLY_ERR(errcode, value) lo_send_from( ((NSM::Client*)user_data)->nsm_addr, ((NSM::Client*)user_data)->_server, LO_TT_IMMEDIATE, "/error", "sis", path, errcode, value)
Client::Client ( ) Client::Client ()
{ {
nsm_addr = 0; nsm_addr = 0;
_nsm_client_id = 0; _nsm_client_id = 0;
_nsm_client_path = 0; _nsm_client_path = 0;
_session_manager_name = 0; _session_manager_name = 0;
nsm_url = ""; nsm_url = "";
nsm_is_active = false; nsm_is_active = false;
_server = 0; _server = 0;
_st = 0; _st = 0;
} }
Client::~Client ( ) Client::~Client ()
{ {
if ( _st ) if (_st) {
stop(); stop();
}
if ( _st ) if (_st) {
lo_server_thread_free( _st ); lo_server_thread_free (_st);
else } else {
lo_server_free ( _server ); lo_server_free (_server);
} }
}
void void
Client::announce ( const char *application_name, const char *capabilities, const char *process_name ) Client::announce (const char *application_name, const char *capabilities, const char *process_name)
{ {
lo_address to = lo_address_new_from_url( nsm_url ); lo_address to = lo_address_new_from_url (nsm_url);
if ( ! to ) if (!to)
{ {
return; return;
} }
int pid = (int)getpid(); int pid = (int)getpid();
lo_send_from( to, _server, LO_TT_IMMEDIATE, "/nsm/server/announce", "sssiii", lo_send_from (to, _server, LO_TT_IMMEDIATE, "/nsm/server/announce", "sssiii",
application_name, application_name,
capabilities, capabilities,
process_name, process_name,
1, /* api_major_version */ 1, /* api_major_version */
0, /* api_minor_version */ 0, /* api_minor_version */
pid ); pid);
lo_address_free( to ); lo_address_free (to);
} }
void void
Client::progress ( float p ) Client::progress (float p)
{ {
if ( nsm_is_active ) if (nsm_is_active)
{ {
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/progress", "f", p ); lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/progress", "f", p);
} }
} }
void void
Client::is_dirty ( void ) Client::is_dirty (void)
{ {
if ( nsm_is_active ) if (nsm_is_active)
{ {
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_dirty", "" ); lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_dirty", "");
} }
} }
void void
Client::is_clean ( void ) Client::is_clean (void)
{ {
if ( nsm_is_active ) if (nsm_is_active)
{ {
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_clean", "" ); lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_clean", "");
} }
} }
void void
Client::message ( int priority, const char *msg ) Client::message (int priority, const char *msg)
{ {
if ( nsm_is_active ) if (nsm_is_active)
{ {
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/message", "is", priority, msg ); lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/message", "is", priority, msg);
} }
} }
void void
Client::broadcast ( lo_message msg ) Client::broadcast (lo_message msg)
{ {
if ( nsm_is_active ) if (nsm_is_active)
{ {
lo_send_message_from( nsm_addr, _server, "/nsm/server/broadcast", msg ); lo_send_message_from (nsm_addr, _server, "/nsm/server/broadcast", msg);
} }
} }
void void
Client::check ( int timeout ) Client::check (int timeout)
{ {
if ( lo_server_wait( _server, timeout ) ) if (lo_server_wait (_server, timeout)) {
while ( lo_server_recv_noblock( _server, 0 ) ) {} while (lo_server_recv_noblock (_server, 0));
} }
}
void void
Client::start ( ) Client::start ()
{ {
lo_server_thread_start( _st ); lo_server_thread_start (_st);
} }
void void
Client::stop ( ) Client::stop ()
{ {
lo_server_thread_stop( _st ); lo_server_thread_stop (_st);
} }
int int
Client::init ( const char *nsm_url ) Client::init (const char *nsm_url)
{ {
this->nsm_url = nsm_url; this->nsm_url = nsm_url;
lo_address addr = lo_address_new_from_url( nsm_url ); lo_address addr = lo_address_new_from_url (nsm_url);
int proto = lo_address_get_protocol( addr ); int proto = lo_address_get_protocol (addr);
lo_address_free( addr ); lo_address_free (addr);
_server = lo_server_new_with_proto( NULL, proto, NULL ); _server = lo_server_new_with_proto (NULL, proto, NULL);
if ( ! _server ) if (!_server) {
return -1; return -1;
}
lo_server_add_method( _server, "/error", "sis", &Client::osc_error, this ); lo_server_add_method (_server, "/error", "sis", &Client::osc_error, this);
lo_server_add_method( _server, "/reply", "ssss", &Client::osc_announce_reply, this ); lo_server_add_method (_server, "/reply", "ssss", &Client::osc_announce_reply, this);
lo_server_add_method( _server, "/nsm/client/open", "sss", &Client::osc_open, this ); lo_server_add_method (_server, "/nsm/client/open", "sss", &Client::osc_open, this);
lo_server_add_method( _server, "/nsm/client/save", "", &Client::osc_save, this ); lo_server_add_method (_server, "/nsm/client/save", "", &Client::osc_save, this);
lo_server_add_method( _server, "/nsm/client/session_is_loaded", "", &Client::osc_session_is_loaded, this ); lo_server_add_method (_server, "/nsm/client/session_is_loaded", "", &Client::osc_session_is_loaded, this);
lo_server_add_method( _server, NULL, NULL, &Client::osc_broadcast, this ); lo_server_add_method (_server, NULL, NULL, &Client::osc_broadcast, this);
return 0; return 0;
} }
int int
Client::init_thread ( const char *nsm_url ) Client::init_thread (const char *nsm_url)
{ {
this->nsm_url = nsm_url; this->nsm_url = nsm_url;
lo_address addr = lo_address_new_from_url( nsm_url ); lo_address addr = lo_address_new_from_url (nsm_url);
int proto = lo_address_get_protocol( addr ); int proto = lo_address_get_protocol (addr);
lo_address_free( addr ); lo_address_free (addr);
_st = lo_server_thread_new_with_proto( NULL, proto, NULL ); _st = lo_server_thread_new_with_proto (NULL, proto, NULL);
_server = lo_server_thread_get_server( _st ); _server = lo_server_thread_get_server (_st);
if ( ! _server || ! _st ) if (! _server || ! _st) {
return -1; return -1;
}
lo_server_thread_add_method( _st, "/error", "sis", &Client::osc_error, this ); lo_server_thread_add_method (_st, "/error", "sis", &Client::osc_error, this);
lo_server_thread_add_method( _st, "/reply", "ssss", &Client::osc_announce_reply, this ); lo_server_thread_add_method (_st, "/reply", "ssss", &Client::osc_announce_reply, this);
lo_server_thread_add_method( _st, "/nsm/client/open", "sss", &Client::osc_open, this ); lo_server_thread_add_method (_st, "/nsm/client/open", "sss", &Client::osc_open, this);
lo_server_thread_add_method( _st, "/nsm/client/save", "", &Client::osc_save, this ); lo_server_thread_add_method (_st, "/nsm/client/save", "", &Client::osc_save, this);
lo_server_thread_add_method( _st, "/nsm/client/session_is_loaded", "", &Client::osc_session_is_loaded, this ); lo_server_thread_add_method (_st, "/nsm/client/session_is_loaded", "", &Client::osc_session_is_loaded, this);
lo_server_thread_add_method( _st, NULL, NULL, &Client::osc_broadcast, this ); lo_server_thread_add_method (_st, NULL, NULL, &Client::osc_broadcast, this);
return 0; return 0;
} }
/************************/ /************************/
/* OSC Message Handlers */ /* OSC Message Handlers */
/************************/ /************************/
int int
Client::osc_broadcast ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) Client::osc_broadcast (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
{ {
return ((NSM::Client*)user_data)->command_broadcast( path, msg ); return ((NSM::Client*)user_data)->command_broadcast (path, msg);
} }
int int
Client::osc_save ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) Client::osc_save (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
{ {
char *out_msg = NULL; char *out_msg = NULL;
int r = ((NSM::Client*)user_data)->command_save(&out_msg); int r = ((NSM::Client*)user_data)->command_save(&out_msg);
if ( r ) if (r) {
OSC_REPLY_ERR( r, ( out_msg ? out_msg : "") ); OSC_REPLY_ERR (r, (out_msg ? out_msg : ""));
else } else {
OSC_REPLY( "OK" ); OSC_REPLY ("OK");
}
if ( out_msg ) if (out_msg) {
free( out_msg ); free (out_msg);
}
return 0; return 0;
} }
int int
Client::osc_open ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) Client::osc_open (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
{ {
char *out_msg = NULL; char *out_msg = NULL;
NSM::Client *nsm = (NSM::Client*)user_data; NSM::Client *nsm = (NSM::Client*)user_data;
nsm->_nsm_client_id = strdup( &argv[2]->s ); nsm->_nsm_client_id = strdup (&argv[2]->s);
nsm->_nsm_client_path = strdup( &argv[0]->s ); nsm->_nsm_client_path = strdup (&argv[0]->s);
int r = ((NSM::Client*)user_data)->command_open( &argv[0]->s, &argv[1]->s, &argv[2]->s, &out_msg); int r = ((NSM::Client*)user_data)->command_open (&argv[0]->s, &argv[1]->s, &argv[2]->s, &out_msg);
if ( r ) if (r) {
OSC_REPLY_ERR( r, ( out_msg ? out_msg : "") ); OSC_REPLY_ERR (r, (out_msg ? out_msg : ""));
else } else {
OSC_REPLY( "OK" ); OSC_REPLY ("OK");
}
if ( out_msg ) if (out_msg) {
free( out_msg ); free(out_msg);
}
return 0; return 0;
} }
int int
Client::osc_session_is_loaded ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) Client::osc_session_is_loaded (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
{ {
NSM::Client *nsm = (NSM::Client*)user_data; NSM::Client *nsm = (NSM::Client*)user_data;
nsm->command_session_is_loaded(); nsm->command_session_is_loaded();
return 0; return 0;
} }
int int
Client::osc_error ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) Client::osc_error (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
{ {
if ( strcmp( &argv[0]->s, "/nsm/server/announce" ) ) if (strcmp (&argv[0]->s, "/nsm/server/announce")) {
return -1; return -1;
}
NSM::Client *nsm = (NSM::Client*)user_data; NSM::Client *nsm = (NSM::Client*)user_data;
nsm->nsm_is_active = false; nsm->nsm_is_active = false;
nsm->command_active( nsm->nsm_is_active ); nsm->command_active (nsm->nsm_is_active);
return 0; return 0;
} }
int int
Client::osc_announce_reply ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) Client::osc_announce_reply (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
{ {
if ( strcmp( &argv[0]->s, "/nsm/server/announce" ) ) if (strcmp (&argv[0]->s, "/nsm/server/announce")) {
return -1; return -1;
}
NSM::Client *nsm = (NSM::Client*)user_data; NSM::Client *nsm = (NSM::Client*)user_data;
nsm->nsm_is_active = true; nsm->nsm_is_active = true;
nsm->_session_manager_name = strdup( &argv[2]->s ); nsm->_session_manager_name = strdup (&argv[2]->s);
nsm->nsm_addr = lo_address_new_from_url( lo_address_get_url( lo_message_get_source( msg ) )); nsm->nsm_addr = lo_address_new_from_url (lo_address_get_url (lo_message_get_source (msg)));
nsm->command_active( nsm->nsm_is_active ); nsm->command_active (nsm->nsm_is_active);
return 0; return 0;
} }
}; };

View file

@ -24,89 +24,89 @@
namespace NSM namespace NSM
{ {
class Client class Client
{ {
private: private:
const char *nsm_url; const char *nsm_url;
lo_server _server; lo_server _server;
lo_server_thread _st; lo_server_thread _st;
lo_address nsm_addr; lo_address nsm_addr;
bool nsm_is_active; bool nsm_is_active;
char *_nsm_client_id; char *_nsm_client_id;
char *_session_manager_name; char *_session_manager_name;
char *_nsm_client_path; char *_nsm_client_path;
public: public:
enum enum
{ {
ERR_OK = 0, ERR_OK = 0,
ERR_GENERAL = -1, ERR_GENERAL = -1,
ERR_INCOMPATIBLE_API = -2, ERR_INCOMPATIBLE_API = -2,
ERR_BLACKLISTED = -3, ERR_BLACKLISTED = -3,
ERR_LAUNCH_FAILED = -4, ERR_LAUNCH_FAILED = -4,
ERR_NO_SUCH_FILE = -5, ERR_NO_SUCH_FILE = -5,
ERR_NO_SESSION_OPEN = -6, ERR_NO_SESSION_OPEN = -6,
ERR_UNSAVED_CHANGES = -7, ERR_UNSAVED_CHANGES = -7,
ERR_NOT_NOW = -8 ERR_NOT_NOW = -8
}; };
Client ( ); Client ( );
virtual ~Client ( ); virtual ~Client ( );
bool is_active ( void ) { return nsm_is_active; } bool is_active ( void ) { return nsm_is_active; }
const char *session_manager_name ( void ) { return _session_manager_name; } const char *session_manager_name ( void ) { return _session_manager_name; }
const char *client_id ( void ) { return _nsm_client_id; } const char *client_id ( void ) { return _nsm_client_id; }
const char *client_path ( void ) { return _nsm_client_path; } const char *client_path ( void ) { return _nsm_client_path; }
/* Client->Server methods */ /* Client->Server methods */
void is_dirty ( void ); void is_dirty ( void );
void is_clean ( void ); void is_clean ( void );
void progress ( float f ); void progress ( float f );
void message( int priority, const char *msg ); void message( int priority, const char *msg );
void announce ( const char *appliction_name, const char *capabilities, const char *process_name ); void announce ( const char *appliction_name, const char *capabilities, const char *process_name );
void broadcast ( lo_message msg ); void broadcast ( lo_message msg );
/* init without threading */ /* init without threading */
int init ( const char *nsm_url ); int init ( const char *nsm_url );
/* init with threading */ /* init with threading */
int init_thread ( const char *nsm_url ); int init_thread ( const char *nsm_url );
/* call this periodically to check for new messages */ /* call this periodically to check for new messages */
void check ( int timeout = 0 ); void check ( int timeout = 0 );
/* or call these to start and stop a thread (must do your own locking in handler!) */ /* or call these to start and stop a thread (must do your own locking in handler!) */
void start ( void ); void start ( void );
void stop ( void ); void stop ( void );
protected: protected:
/* Server->Client methods */ /* Server->Client methods */
virtual int command_open ( const char *name, const char *display_name, const char *client_id, char **out_msg ) = 0; virtual int command_open ( const char *name, const char *display_name, const char *client_id, char **out_msg ) = 0;
virtual int command_save ( char **out_msg ) = 0; virtual int command_save ( char **out_msg ) = 0;
virtual void command_active ( bool ) { } virtual void command_active ( bool ) { }
virtual void command_session_is_loaded ( void ) { } virtual void command_session_is_loaded ( void ) { }
/* invoked when an unrecognized message is received. Should return 0 if you handled it, -1 otherwise. */ /* invoked when an unrecognized message is received. Should return 0 if you handled it, -1 otherwise. */
virtual int command_broadcast ( const char *, lo_message ) { return -1; } virtual int command_broadcast ( const char *, lo_message ) { return -1; }
private: private:
/* osc handlers */ /* osc handlers */
static int osc_open ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ); static int osc_open ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data );
static int osc_save ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ); static int osc_save ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data );
static int osc_announce_reply ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ); static int osc_announce_reply ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data );
static int osc_error ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ); static int osc_error ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data );
static int osc_session_is_loaded ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ); static int osc_session_is_loaded ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data );
static int osc_broadcast ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ); static int osc_broadcast ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data );
}; };
}; };

View file

@ -296,8 +296,8 @@ Panner2d::handle_position_change ()
uint32_t n; uint32_t n;
double w = panner_shell->pannable()->pan_width_control->get_value(); double w = panner_shell->pannable()->pan_width_control->get_value();
position.position = AngularVector (panner_shell->pannable()->pan_azimuth_control->get_value() * 360.0, position.position = AngularVector (panner_shell->pannable()->pan_azimuth_control->get_value() * 360.0,
panner_shell->pannable()->pan_elevation_control->get_value() * 90.0); panner_shell->pannable()->pan_elevation_control->get_value() * 90.0);
for (uint32_t i = 0; i < signals.size(); ++i) { for (uint32_t i = 0; i < signals.size(); ++i) {
signals[i]->position = panner_shell->panner()->signal_position (i); signals[i]->position = panner_shell->panner()->signal_position (i);
@ -341,10 +341,10 @@ Panner2d::find_closest_object (gdouble x, gdouble y, bool& is_signal)
/* start with the position itself */ /* start with the position itself */
PBD::AngularVector dp = position.position; PBD::AngularVector dp = position.position;
if (!have_elevation) dp.ele = 0; if (!have_elevation) dp.ele = 0;
dp.azi = 270 - dp.azi; dp.azi = 270 - dp.azi;
dp.cartesian (c); dp.cartesian (c);
cart_to_gtk (c); cart_to_gtk (c);
best_distance = sqrt ((c.x - x) * (c.x - x) + best_distance = sqrt ((c.x - x) * (c.x - x) +
@ -387,11 +387,11 @@ Panner2d::find_closest_object (gdouble x, gdouble y, bool& is_signal)
if (!closest) { if (!closest) {
for (Targets::const_iterator i = speakers.begin(); i != speakers.end(); ++i) { for (Targets::const_iterator i = speakers.begin(); i != speakers.end(); ++i) {
candidate = *i; candidate = *i;
PBD::AngularVector sp = candidate->position; PBD::AngularVector sp = candidate->position;
sp.azi = 270 -sp.azi; sp.azi = 270 -sp.azi;
CartesianVector c; CartesianVector c;
sp.cartesian (c); sp.cartesian (c);
cart_to_gtk (c); cart_to_gtk (c);
distance = sqrt ((c.x - x) * (c.x - x) + distance = sqrt ((c.x - x) * (c.x - x) +
(c.y - y) * (c.y - y)); (c.y - y) * (c.y - y));
@ -523,7 +523,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
} }
if (!panner_shell->bypassed()) { if (!panner_shell->bypassed()) {
/* convention top == front ^= azimuth == .5 (same as stereo/mono panners) */ /* convention top == front ^= azimuth == .5 (same as stereo/mono panners) */
if (signals.size() > 1) { if (signals.size() > 1) {
/* arc to show "diffusion" */ /* arc to show "diffusion" */
@ -533,7 +533,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
cairo_save (cr); cairo_save (cr);
cairo_translate (cr, radius, radius); cairo_translate (cr, radius, radius);
cairo_rotate (cr, M_PI / 2.0); cairo_rotate (cr, M_PI / 2.0);
cairo_rotate (cr, position_angle - (width_angle/2.0)); cairo_rotate (cr, position_angle - (width_angle/2.0));
cairo_move_to (cr, 0, 0); cairo_move_to (cr, 0, 0);
cairo_arc_negative (cr, 0, 0, radius, width_angle, 0.0); cairo_arc_negative (cr, 0, 0, radius, width_angle, 0.0);
@ -562,9 +562,9 @@ Panner2d::on_expose_event (GdkEventExpose *event)
/* draw position */ /* draw position */
PBD::AngularVector dp = position.position; PBD::AngularVector dp = position.position;
if (!have_elevation) dp.ele = 0; if (!have_elevation) dp.ele = 0;
dp.azi = 270 - dp.azi; dp.azi = 270 - dp.azi;
dp.cartesian (c); dp.cartesian (c);
cart_to_gtk (c); cart_to_gtk (c);
@ -588,7 +588,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
*/ */
PBD::AngularVector sp = signal->position; PBD::AngularVector sp = signal->position;
if (!have_elevation) sp.ele = 0; if (!have_elevation) sp.ele = 0;
sp.azi += 270.0; sp.azi += 270.0;
sp.cartesian (c); sp.cartesian (c);
cart_to_gtk (c); cart_to_gtk (c);
@ -626,8 +626,8 @@ Panner2d::on_expose_event (GdkEventExpose *event)
if (speaker->visible) { if (speaker->visible) {
PBD::AngularVector sp = speaker->position; PBD::AngularVector sp = speaker->position;
sp.azi += 270.0; sp.azi += 270.0;
CartesianVector c; CartesianVector c;
sp.cartesian (c); sp.cartesian (c);
cart_to_gtk (c); cart_to_gtk (c);
@ -683,29 +683,29 @@ bool
Panner2d::on_button_press_event (GdkEventButton *ev) Panner2d::on_button_press_event (GdkEventButton *ev)
{ {
GdkModifierType state; GdkModifierType state;
int x; int x;
int y; int y;
bool is_signal; bool is_signal;
if (ev->type == GDK_2BUTTON_PRESS && ev->button == 1) { if (ev->type == GDK_2BUTTON_PRESS && ev->button == 1) {
return false; return false;
} }
did_move = false; did_move = false;
switch (ev->button) { switch (ev->button) {
case 1: case 1:
case 2: case 2:
x = ev->x - hoffset; x = ev->x - hoffset;
y = ev->y - voffset; y = ev->y - voffset;
if ((drag_target = find_closest_object (x, y, is_signal)) != 0) { if ((drag_target = find_closest_object (x, y, is_signal)) != 0) {
if (!is_signal) { if (!is_signal) {
panner_shell->panner()->set_position (drag_target->position.azi/360.0); panner_shell->panner()->set_position (drag_target->position.azi/360.0);
drag_target = 0; drag_target = 0;
} else { } else {
drag_target->set_selected (true); drag_target->set_selected (true);
} }
} }
state = (GdkModifierType) ev->state; state = (GdkModifierType) ev->state;
@ -731,7 +731,7 @@ Panner2d::on_button_release_event (GdkEventButton *ev)
x = (int) floor (ev->x); x = (int) floor (ev->x);
y = (int) floor (ev->y); y = (int) floor (ev->y);
state = (GdkModifierType) ev->state; state = (GdkModifierType) ev->state;
ret = handle_motion (x, y, state); ret = handle_motion (x, y, state);
drag_target = 0; drag_target = 0;
break; break;
@ -791,7 +791,7 @@ Panner2d::handle_motion (gint evx, gint evy, GdkModifierType state)
if (!have_elevation) { if (!have_elevation) {
clamp_to_circle (cp.x, cp.y); clamp_to_circle (cp.x, cp.y);
cp.angular (av); cp.angular (av);
av.azi = fmod(270 - av.azi, 360); av.azi = fmod(270 - av.azi, 360);
if (drag_target == &position) { if (drag_target == &position) {
double degree_fract = av.azi / 360.0; double degree_fract = av.azi / 360.0;
panner_shell->panner()->set_position (degree_fract); panner_shell->panner()->set_position (degree_fract);
@ -803,7 +803,7 @@ Panner2d::handle_motion (gint evx, gint evy, GdkModifierType state)
double r2d = 180.0 / M_PI; double r2d = 180.0 / M_PI;
av.azi = r2d * atan2(cp.y, cp.x); av.azi = r2d * atan2(cp.y, cp.x);
av.ele = r2d * asin(cp.z); av.ele = r2d * asin(cp.z);
av.azi = fmod(270 - av.azi, 360); av.azi = fmod(270 - av.azi, 360);
if (drag_target == &position) { if (drag_target == &position) {
double azi_fract = av.azi / 360.0; double azi_fract = av.azi / 360.0;
@ -821,18 +821,18 @@ Panner2d::handle_motion (gint evx, gint evy, GdkModifierType state)
bool bool
Panner2d::on_scroll_event (GdkEventScroll* ev) Panner2d::on_scroll_event (GdkEventScroll* ev)
{ {
switch (ev->direction) { switch (ev->direction) {
case GDK_SCROLL_UP: case GDK_SCROLL_UP:
case GDK_SCROLL_RIGHT: case GDK_SCROLL_RIGHT:
panner_shell->panner()->set_position (panner_shell->pannable()->pan_azimuth_control->get_value() - 1.0/360.0); panner_shell->panner()->set_position (panner_shell->pannable()->pan_azimuth_control->get_value() - 1.0/360.0);
break; break;
case GDK_SCROLL_DOWN: case GDK_SCROLL_DOWN:
case GDK_SCROLL_LEFT: case GDK_SCROLL_LEFT:
panner_shell->panner()->set_position (panner_shell->pannable()->pan_azimuth_control->get_value() + 1.0/360.0); panner_shell->panner()->set_position (panner_shell->pannable()->pan_azimuth_control->get_value() + 1.0/360.0);
break; break;
} }
return true; return true;
} }
void void
@ -840,28 +840,28 @@ Panner2d::cart_to_gtk (CartesianVector& c) const
{ {
/* cartesian coordinate space: /* cartesian coordinate space:
center = 0.0 center = 0.0
dimension = 2.0 * 2.0 dimension = 2.0 * 2.0
increasing y moves up increasing y moves up
so max values along each axis are -1..+1 so max values along each axis are -1..+1
GTK uses a coordinate space that is: GTK uses a coordinate space that is:
top left = 0.0 top left = 0.0
dimension = (radius*2.0) * (radius*2.0) dimension = (radius*2.0) * (radius*2.0)
increasing y moves down increasing y moves down
*/ */
const double diameter = radius*2.0; const double diameter = radius*2.0;
c.x = diameter * ((c.x + 1.0) / 2.0); c.x = diameter * ((c.x + 1.0) / 2.0);
/* extra subtraction inverts the y-axis to match "increasing y moves down" */ /* extra subtraction inverts the y-axis to match "increasing y moves down" */
c.y = diameter - (diameter * ((c.y + 1.0) / 2.0)); c.y = diameter - (diameter * ((c.y + 1.0) / 2.0));
} }
void void
Panner2d::gtk_to_cart (CartesianVector& c) const Panner2d::gtk_to_cart (CartesianVector& c) const
{ {
const double diameter = radius*2.0; const double diameter = radius*2.0;
c.x = ((c.x / diameter) * 2.0) - 1.0; c.x = ((c.x / diameter) * 2.0) - 1.0;
c.y = (((diameter - c.y) / diameter) * 2.0) - 1.0; c.y = (((diameter - c.y) / diameter) * 2.0) - 1.0;
} }
void void

View file

@ -36,13 +36,13 @@ PannerInterface::PannerInterface (boost::shared_ptr<Panner> p)
, _send_mode (false) , _send_mode (false)
, _editor (0) , _editor (0)
{ {
set_flags (Gtk::CAN_FOCUS); set_flags (Gtk::CAN_FOCUS);
add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK| add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|
Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK| Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|
Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK| Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|
Gdk::SCROLL_MASK| Gdk::SCROLL_MASK|
Gdk::POINTER_MOTION_MASK); Gdk::POINTER_MOTION_MASK);
} }

View file

@ -60,10 +60,10 @@ PannerUI::PannerUI (Session* s)
pan_astate_menu = 0; pan_astate_menu = 0;
pan_astyle_menu = 0; pan_astyle_menu = 0;
in_pan_update = false; in_pan_update = false;
_stereo_panner = 0; _stereo_panner = 0;
_mono_panner = 0; _mono_panner = 0;
_ignore_width_change = false; _ignore_width_change = false;
_ignore_position_change = false; _ignore_position_change = false;
pan_automation_state_button.set_name ("MixerAutomationPlaybackButton"); pan_automation_state_button.set_name ("MixerAutomationPlaybackButton");
@ -87,8 +87,8 @@ PannerUI::PannerUI (Session* s)
void void
PannerUI::set_panner (boost::shared_ptr<PannerShell> ps, boost::shared_ptr<Panner> p) PannerUI::set_panner (boost::shared_ptr<PannerShell> ps, boost::shared_ptr<Panner> p)
{ {
/* note that the panshell might not change here (i.e. ps == _panshell) /* note that the panshell might not change here (i.e. ps == _panshell)
*/ */
connections.drop_connections (); connections.drop_connections ();
@ -98,17 +98,17 @@ PannerUI::set_panner (boost::shared_ptr<PannerShell> ps, boost::shared_ptr<Panne
delete pan_astate_menu; delete pan_astate_menu;
pan_astate_menu = 0; pan_astate_menu = 0;
_panshell = ps; _panshell = ps;
_panner = p; _panner = p;
delete twod_panner; delete twod_panner;
twod_panner = 0; twod_panner = 0;
delete _stereo_panner; delete _stereo_panner;
_stereo_panner = 0; _stereo_panner = 0;
delete _mono_panner; delete _mono_panner;
_mono_panner = 0; _mono_panner = 0;
if (!_panner) { if (!_panner) {
return; return;
@ -116,13 +116,13 @@ PannerUI::set_panner (boost::shared_ptr<PannerShell> ps, boost::shared_ptr<Panne
_panshell->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::panshell_changed, this), gui_context()); _panshell->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::panshell_changed, this), gui_context());
/* new panner object, force complete reset of panner GUI /* new panner object, force complete reset of panner GUI
*/ */
_current_nouts = 0; _current_nouts = 0;
_current_nins = 0; _current_nins = 0;
setup_pan (); setup_pan ();
update_pan_sensitive (); update_pan_sensitive ();
pan_automation_state_changed (); pan_automation_state_changed ();
} }
@ -176,7 +176,7 @@ PannerUI::build_astyle_menu ()
void void
PannerUI::on_size_allocate (Allocation& a) PannerUI::on_size_allocate (Allocation& a)
{ {
HBox::on_size_allocate (a); HBox::on_size_allocate (a);
} }
void void
@ -192,8 +192,8 @@ PannerUI::~PannerUI ()
delete pan_menu; delete pan_menu;
delete pan_astyle_menu; delete pan_astyle_menu;
delete pan_astate_menu; delete pan_astate_menu;
delete _stereo_panner; delete _stereo_panner;
delete _mono_panner; delete _mono_panner;
} }
void void
@ -217,16 +217,16 @@ PannerUI::setup_pan ()
return; return;
} }
_current_nins = nins; _current_nins = nins;
_current_nouts = nouts; _current_nouts = nouts;
_current_uri = _panshell->panner_gui_uri(); _current_uri = _panshell->panner_gui_uri();
container_clear (pan_vbox); container_clear (pan_vbox);
delete twod_panner; delete twod_panner;
twod_panner = 0; twod_panner = 0;
delete _stereo_panner; delete _stereo_panner;
_stereo_panner = 0; _stereo_panner = 0;
delete _mono_panner; delete _mono_panner;
_mono_panner = 0; _mono_panner = 0;
@ -338,21 +338,21 @@ PannerUI::set_send_drawing_mode (bool onoff)
void void
PannerUI::start_touch (boost::weak_ptr<AutomationControl> wac) PannerUI::start_touch (boost::weak_ptr<AutomationControl> wac)
{ {
boost::shared_ptr<AutomationControl> ac = wac.lock(); boost::shared_ptr<AutomationControl> ac = wac.lock();
if (!ac) { if (!ac) {
return; return;
} }
ac->start_touch (ac->session().transport_frame()); ac->start_touch (ac->session().transport_frame());
} }
void void
PannerUI::stop_touch (boost::weak_ptr<AutomationControl> wac) PannerUI::stop_touch (boost::weak_ptr<AutomationControl> wac)
{ {
boost::shared_ptr<AutomationControl> ac = wac.lock(); boost::shared_ptr<AutomationControl> ac = wac.lock();
if (!ac) { if (!ac) {
return; return;
} }
ac->stop_touch (false, ac->session().transport_frame()); ac->stop_touch (false, ac->session().transport_frame());
} }
bool bool
@ -465,13 +465,13 @@ PannerUI::pan_set_custom_type (std::string uri) {
void void
PannerUI::effective_pan_display () PannerUI::effective_pan_display ()
{ {
if (_stereo_panner) { if (_stereo_panner) {
_stereo_panner->queue_draw (); _stereo_panner->queue_draw ();
} else if (_mono_panner) { } else if (_mono_panner) {
_mono_panner->queue_draw (); _mono_panner->queue_draw ();
} else if (twod_panner) { } else if (twod_panner) {
twod_panner->queue_draw (); twod_panner->queue_draw ();
} }
} }
void void
@ -479,11 +479,11 @@ PannerUI::update_pan_sensitive ()
{ {
bool const sensitive = !(_panner->pannable()->automation_state() & Play); bool const sensitive = !(_panner->pannable()->automation_state() & Play);
pan_vbox.set_sensitive (sensitive); pan_vbox.set_sensitive (sensitive);
if (big_window) { if (big_window) {
big_window->set_sensitive (sensitive); big_window->set_sensitive (sensitive);
} }
} }
gint gint
@ -512,21 +512,21 @@ PannerUI::pan_automation_state_button_event (GdkEventButton *ev)
void void
PannerUI::pan_automation_state_changed () PannerUI::pan_automation_state_changed ()
{ {
boost::shared_ptr<Pannable> pannable (_panner->pannable()); boost::shared_ptr<Pannable> pannable (_panner->pannable());
switch (_width) { switch (_width) {
case Wide: case Wide:
pan_automation_state_button.set_label (astate_string(pannable->automation_state())); pan_automation_state_button.set_label (astate_string(pannable->automation_state()));
break; break;
case Narrow: case Narrow:
pan_automation_state_button.set_label (short_astate_string(pannable->automation_state())); pan_automation_state_button.set_label (short_astate_string(pannable->automation_state()));
break; break;
} }
bool x = (pannable->automation_state() != ARDOUR::Off); bool x = (pannable->automation_state() != ARDOUR::Off);
if (pan_automation_state_button.get_active() != x) { if (pan_automation_state_button.get_active() != x) {
ignore_toggle = true; ignore_toggle = true;
pan_automation_state_button.set_active (x); pan_automation_state_button.set_active (x);
ignore_toggle = false; ignore_toggle = false;
} }

View file

@ -46,7 +46,7 @@ namespace ARDOUR {
class Panner; class Panner;
class PannerShell; class PannerShell;
class Delivery; class Delivery;
class AutomationControl; class AutomationControl;
} }
namespace Gtkmm2ext { namespace Gtkmm2ext {
@ -108,15 +108,15 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
Gtk::VBox poswidth_box; Gtk::VBox poswidth_box;
Width _width; Width _width;
StereoPanner* _stereo_panner; StereoPanner* _stereo_panner;
MonoPanner* _mono_panner; MonoPanner* _mono_panner;
bool _ignore_width_change; bool _ignore_width_change;
bool _ignore_position_change; bool _ignore_position_change;
void width_adjusted (); void width_adjusted ();
void show_width (); void show_width ();
void position_adjusted (); void position_adjusted ();
void show_position (); void show_position ();
Gtk::Menu* pan_astate_menu; Gtk::Menu* pan_astate_menu;
Gtk::Menu* pan_astyle_menu; Gtk::Menu* pan_astyle_menu;
@ -153,8 +153,8 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
std::string short_astate_string (ARDOUR::AutoState); std::string short_astate_string (ARDOUR::AutoState);
std::string _astate_string (ARDOUR::AutoState, bool); std::string _astate_string (ARDOUR::AutoState, bool);
void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>); void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>); void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
std::map<std::string,std::string> _panner_list; std::map<std::string,std::string> _panner_list;
bool _suspend_menu_callbacks; bool _suspend_menu_callbacks;

View file

@ -77,6 +77,6 @@ private:
boost::shared_ptr<MIDI::Name::PatchBank> _current_patch_bank; boost::shared_ptr<MIDI::Name::PatchBank> _current_patch_bank;
bool _ignore_signals; bool _ignore_signals;
void instrument_info_changed (); void instrument_info_changed ();
PBD::ScopedConnection _info_changed_connection; PBD::ScopedConnection _info_changed_connection;
}; };

View file

@ -758,7 +758,7 @@ PluginEqGui::plot_impulse_amplitude(Gtk::Widget *w, cairo_t *cr)
// float width = w->get_width(); // float width = w->get_width();
float height = w->get_height(); float height = w->get_height();
cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
cairo_set_line_width (cr, 2.5); cairo_set_line_width (cr, 2.5);
for (uint32_t i = 0; i < _impulse_fft->bins()-1; i++) { for (uint32_t i = 0; i < _impulse_fft->bins()-1; i++) {

View file

@ -36,7 +36,7 @@ namespace ARDOUR {
} }
namespace GTKArdour { namespace GTKArdour {
class FFT; class FFT;
} }
class PluginEqGui : public Gtk::Table class PluginEqGui : public Gtk::Table
@ -113,9 +113,9 @@ private:
float _analysis_height; float _analysis_height;
// My objects // My objects
GTKArdour::FFT *_impulse_fft; GTKArdour::FFT *_impulse_fft;
GTKArdour::FFT *_signal_input_fft; GTKArdour::FFT *_signal_input_fft;
GTKArdour::FFT *_signal_output_fft; GTKArdour::FFT *_signal_output_fft;
boost::shared_ptr<ARDOUR::Plugin> _plugin; boost::shared_ptr<ARDOUR::Plugin> _plugin;
boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert; boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert;

View file

@ -620,14 +620,14 @@ PluginSelector::run ()
PluginPtr p = load_plugin (pp); PluginPtr p = load_plugin (pp);
if (p) { if (p) {
plugins.push_back (p); plugins.push_back (p);
} else { } else {
MessageDialog msg (string_compose (_("The plugin \"%1\" could not be loaded\n\nSee the Log window for more details (maybe)"), pp->name)); MessageDialog msg (string_compose (_("The plugin \"%1\" could not be loaded\n\nSee the Log window for more details (maybe)"), pp->name));
msg.run (); msg.run ();
} }
} }
if (interested_object && !plugins.empty()) { if (interested_object && !plugins.empty()) {
finish = !interested_object->use_plugins (plugins); finish = !interested_object->use_plugins (plugins);
} }
break; break;
@ -689,57 +689,57 @@ PluginSelector::on_show ()
} }
struct PluginMenuCompareByCreator { struct PluginMenuCompareByCreator {
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const { bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp; int cmp;
cmp = cmp_nocase_utf8 (a->creator, b->creator); cmp = cmp_nocase_utf8 (a->creator, b->creator);
if (cmp < 0) { if (cmp < 0) {
return true; return true;
} else if (cmp == 0) { } else if (cmp == 0) {
/* same creator ... compare names */ /* same creator ... compare names */
if (cmp_nocase_utf8 (a->name, b->name) < 0) { if (cmp_nocase_utf8 (a->name, b->name) < 0) {
return true; return true;
} }
} }
return false; return false;
} }
}; };
struct PluginMenuCompareByName { struct PluginMenuCompareByName {
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const { bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp; int cmp;
cmp = cmp_nocase_utf8 (a->name, b->name); cmp = cmp_nocase_utf8 (a->name, b->name);
if (cmp < 0) { if (cmp < 0) {
return true; return true;
} else if (cmp == 0) { } else if (cmp == 0) {
/* same name ... compare type */ /* same name ... compare type */
if (a->type < b->type) { if (a->type < b->type) {
return true; return true;
} }
} }
return false; return false;
} }
}; };
struct PluginMenuCompareByCategory { struct PluginMenuCompareByCategory {
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const { bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp; int cmp;
cmp = cmp_nocase_utf8 (a->category, b->category); cmp = cmp_nocase_utf8 (a->category, b->category);
if (cmp < 0) { if (cmp < 0) {
return true; return true;
} else if (cmp == 0) { } else if (cmp == 0) {
/* same category ... compare names */ /* same category ... compare names */
if (cmp_nocase_utf8 (a->name, b->name) < 0) { if (cmp_nocase_utf8 (a->name, b->name) < 0) {
return true; return true;
} }
} }
return false; return false;
} }
}; };
/** @return Plugin menu. The caller should not delete it */ /** @return Plugin menu. The caller should not delete it */

View file

@ -92,8 +92,8 @@ PluginUIWindow::PluginUIWindow (
, was_visible (false) , was_visible (false)
, _keyboard_focused (false) , _keyboard_focused (false)
#ifdef AUDIOUNIT_SUPPORT #ifdef AUDIOUNIT_SUPPORT
, pre_deactivate_x (-1) , pre_deactivate_x (-1)
, pre_deactivate_y (-1) , pre_deactivate_y (-1)
#endif #endif
{ {
@ -188,9 +188,9 @@ PluginUIWindow::on_show ()
if (_pluginui) { if (_pluginui) {
#if defined (HAVE_AUDIOUNITS) && defined(__APPLE__) #if defined (HAVE_AUDIOUNITS) && defined(__APPLE__)
if (pre_deactivate_x >= 0) { if (pre_deactivate_x >= 0) {
move (pre_deactivate_x, pre_deactivate_y); move (pre_deactivate_x, pre_deactivate_y);
} }
#endif #endif
if (_pluginui->on_window_show (_title)) { if (_pluginui->on_window_show (_title)) {
@ -203,7 +203,7 @@ void
PluginUIWindow::on_hide () PluginUIWindow::on_hide ()
{ {
#if defined (HAVE_AUDIOUNITS) && defined(__APPLE__) #if defined (HAVE_AUDIOUNITS) && defined(__APPLE__)
get_position (pre_deactivate_x, pre_deactivate_y); get_position (pre_deactivate_x, pre_deactivate_y);
#endif #endif
Window::on_hide (); Window::on_hide ();
@ -342,15 +342,15 @@ PluginUIWindow::app_activated (bool)
if (yn) { if (yn) {
if (was_visible) { if (was_visible) {
_pluginui->activate (); _pluginui->activate ();
if (pre_deactivate_x >= 0) { if (pre_deactivate_x >= 0) {
move (pre_deactivate_x, pre_deactivate_y); move (pre_deactivate_x, pre_deactivate_y);
} }
present (); present ();
was_visible = true; was_visible = true;
} }
} else { } else {
was_visible = is_visible(); was_visible = is_visible();
get_position (pre_deactivate_x, pre_deactivate_y); get_position (pre_deactivate_x, pre_deactivate_y);
hide (); hide ();
_pluginui->deactivate (); _pluginui->deactivate ();
} }

View file

@ -144,7 +144,7 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL
ArdourButton automation_manual_all_button; ArdourButton automation_manual_all_button;
/** a button which sets all controls' automation setting to Play */ /** a button which sets all controls' automation setting to Play */
ArdourButton automation_play_all_button; ArdourButton automation_play_all_button;
/** a button which sets all controls' automation setting to Write */ /** a button which sets all controls' automation setting to Write */
ArdourButton automation_write_all_button; ArdourButton automation_write_all_button;
/** a button which sets all controls' automation setting to Touch */ /** a button which sets all controls' automation setting to Touch */
ArdourButton automation_touch_all_button; ArdourButton automation_touch_all_button;
@ -328,8 +328,8 @@ class PluginUIWindow : public ArdourWindow
bool was_visible; bool was_visible;
bool _keyboard_focused; bool _keyboard_focused;
#ifdef AUDIOUNIT_SUPPORT #ifdef AUDIOUNIT_SUPPORT
int pre_deactivate_x; int pre_deactivate_x;
int pre_deactivate_y; int pre_deactivate_y;
#endif #endif
void keyboard_focused (bool yn); void keyboard_focused (bool yn);

View file

@ -351,11 +351,11 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
for (RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) { for (RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) {
/* we never show the monitor bus inputs */ /* we never show the monitor bus inputs */
if (inputs && (*i)->is_monitor()) { if (inputs && (*i)->is_monitor()) {
continue; continue;
} }
/* keep track of IOs that we have taken bundles from, /* keep track of IOs that we have taken bundles from,
so that we can avoid taking the same IO from both so that we can avoid taking the same IO from both
@ -500,10 +500,10 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
std::vector<std::string> extra_program[DataType::num_types]; std::vector<std::string> extra_program[DataType::num_types];
std::vector<std::string> extra_other[DataType::num_types]; std::vector<std::string> extra_other[DataType::num_types];
string lpn (PROGRAM_NAME); string lpn (PROGRAM_NAME);
boost::to_lower (lpn); boost::to_lower (lpn);
string lpnc = lpn; string lpnc = lpn;
lpnc += ':'; lpnc += ':';
vector<string> ports; vector<string> ports;
if (type == DataType::NIL) { if (type == DataType::NIL) {
@ -529,31 +529,31 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
!program->has_port(p) && !program->has_port(p) &&
!other->has_port(p)) { !other->has_port(p)) {
/* special hack: ignore MIDI ports labelled Midi-Through. these /* special hack: ignore MIDI ports labelled Midi-Through. these
are basically useless and mess things up for default are basically useless and mess things up for default
connections. connections.
*/ */
if (p.find ("Midi-Through") != string::npos || p.find ("Midi Through") != string::npos) { if (p.find ("Midi-Through") != string::npos || p.find ("Midi Through") != string::npos) {
++s; ++s;
continue; continue;
} }
/* special hack: ignore our monitor inputs (which show up here because /* special hack: ignore our monitor inputs (which show up here because
we excluded them earlier. we excluded them earlier.
*/ */
string lp = p; string lp = p;
string monitor = _("Monitor"); string monitor = _("Monitor");
boost::to_lower (lp); boost::to_lower (lp);
boost::to_lower (monitor); boost::to_lower (monitor);
if ((lp.find (monitor) != string::npos) && if ((lp.find (monitor) != string::npos) &&
(lp.find (lpn) != string::npos)) { (lp.find (lpn) != string::npos)) {
++s; ++s;
continue; continue;
} }
/* can't use the audio engine for this as we /* can't use the audio engine for this as we
* are looking at ports not owned by the * are looking at ports not owned by the

View file

@ -35,110 +35,110 @@ using namespace ARDOUR;
using namespace Gtk; using namespace Gtk;
PortInsertUI::PortInsertUI (Gtk::Window* parent, ARDOUR::Session* sess, boost::shared_ptr<ARDOUR::PortInsert> pi) PortInsertUI::PortInsertUI (Gtk::Window* parent, ARDOUR::Session* sess, boost::shared_ptr<ARDOUR::PortInsert> pi)
: _pi (pi) : _pi (pi)
, latency_button (_("Measure Latency")) , latency_button (_("Measure Latency"))
, input_selector (parent, sess, pi->input()) , input_selector (parent, sess, pi->input())
, output_selector (parent, sess, pi->output()) , output_selector (parent, sess, pi->output())
{ {
latency_hbox.pack_start (latency_button, false, false); latency_hbox.pack_start (latency_button, false, false);
latency_hbox.pack_start (latency_display, false, false); latency_hbox.pack_start (latency_display, false, false);
latency_hbox.set_spacing (4); latency_hbox.set_spacing (4);
output_selector.set_min_height_divisor (2); output_selector.set_min_height_divisor (2);
input_selector.set_min_height_divisor (2); input_selector.set_min_height_divisor (2);
notebook.append_page (output_selector, _("Send/Output")); notebook.append_page (output_selector, _("Send/Output"));
notebook.append_page (input_selector, _("Return/Input")); notebook.append_page (input_selector, _("Return/Input"));
notebook.set_current_page (0); notebook.set_current_page (0);
set_spacing (12); set_spacing (12);
pack_start (notebook, true, true); pack_start (notebook, true, true);
pack_start (latency_hbox, false, false); pack_start (latency_hbox, false, false);
update_latency_display (); update_latency_display ();
latency_button.signal_toggled().connect (mem_fun (*this, &PortInsertUI::latency_button_toggled)); latency_button.signal_toggled().connect (mem_fun (*this, &PortInsertUI::latency_button_toggled));
latency_button.set_name (X_("MeasureLatencyButton")); latency_button.set_name (X_("MeasureLatencyButton"));
} }
void void
PortInsertUI::update_latency_display () PortInsertUI::update_latency_display ()
{ {
framecnt_t const sample_rate = AudioEngine::instance()->sample_rate(); framecnt_t const sample_rate = AudioEngine::instance()->sample_rate();
if (sample_rate == 0) { if (sample_rate == 0) {
latency_display.set_text (_("Disconnected from audio engine")); latency_display.set_text (_("Disconnected from audio engine"));
} else { } else {
char buf[64]; char buf[64];
snprintf (buf, sizeof (buf), "%10.3lf frames %10.3lf ms", snprintf (buf, sizeof (buf), "%10.3lf frames %10.3lf ms",
(float)_pi->latency(), (float)_pi->latency() * 1000.0f/sample_rate); (float)_pi->latency(), (float)_pi->latency() * 1000.0f/sample_rate);
latency_display.set_text(buf); latency_display.set_text(buf);
} }
} }
bool bool
PortInsertUI::check_latency_measurement () PortInsertUI::check_latency_measurement ()
{ {
MTDM* mtdm = _pi->mtdm (); MTDM* mtdm = _pi->mtdm ();
if (mtdm->resolve () < 0) { if (mtdm->resolve () < 0) {
latency_display.set_text (_("No signal detected")); latency_display.set_text (_("No signal detected"));
return true; return true;
} }
if (mtdm->err () > 0.3) { if (mtdm->err () > 0.3) {
mtdm->invert (); mtdm->invert ();
mtdm->resolve (); mtdm->resolve ();
} }
char buf[128]; char buf[128];
framecnt_t const sample_rate = AudioEngine::instance()->sample_rate(); framecnt_t const sample_rate = AudioEngine::instance()->sample_rate();
if (sample_rate == 0) { if (sample_rate == 0) {
latency_display.set_text (_("Disconnected from audio engine")); latency_display.set_text (_("Disconnected from audio engine"));
_pi->stop_latency_detection (); _pi->stop_latency_detection ();
return false; return false;
} }
snprintf (buf, sizeof (buf), "%10.3lf frames %10.3lf ms", mtdm->del (), mtdm->del () * 1000.0f/sample_rate); snprintf (buf, sizeof (buf), "%10.3lf frames %10.3lf ms", mtdm->del (), mtdm->del () * 1000.0f/sample_rate);
bool solid = true; bool solid = true;
if (mtdm->err () > 0.2) { if (mtdm->err () > 0.2) {
strcat (buf, " ??"); strcat (buf, " ??");
solid = false; solid = false;
} }
if (mtdm->inv ()) { if (mtdm->inv ()) {
strcat (buf, " (Inv)"); strcat (buf, " (Inv)");
solid = false; solid = false;
} }
if (solid) { if (solid) {
_pi->set_measured_latency (rint (mtdm->del())); _pi->set_measured_latency (rint (mtdm->del()));
latency_button.set_active (false); latency_button.set_active (false);
strcat (buf, " (set)"); strcat (buf, " (set)");
} }
latency_display.set_text (buf); latency_display.set_text (buf);
return true; return true;
} }
void void
PortInsertUI::latency_button_toggled () PortInsertUI::latency_button_toggled ()
{ {
if (latency_button.get_active ()) { if (latency_button.get_active ()) {
_pi->start_latency_detection (); _pi->start_latency_detection ();
latency_display.set_text (_("Detecting ...")); latency_display.set_text (_("Detecting ..."));
latency_timeout = Glib::signal_timeout().connect (mem_fun (*this, &PortInsertUI::check_latency_measurement), 250); latency_timeout = Glib::signal_timeout().connect (mem_fun (*this, &PortInsertUI::check_latency_measurement), 250);
} else { } else {
_pi->stop_latency_detection (); _pi->stop_latency_detection ();
latency_timeout.disconnect (); latency_timeout.disconnect ();
update_latency_display (); update_latency_display ();
} }
} }
void void

View file

@ -37,19 +37,19 @@ class PortInsertUI : public Gtk::VBox
void finished (IOSelector::Result); void finished (IOSelector::Result);
private: private:
boost::shared_ptr<ARDOUR::PortInsert> _pi; boost::shared_ptr<ARDOUR::PortInsert> _pi;
Gtk::Notebook notebook; Gtk::Notebook notebook;
Gtkmm2ext::StatefulToggleButton latency_button; Gtkmm2ext::StatefulToggleButton latency_button;
IOSelector input_selector; IOSelector input_selector;
IOSelector output_selector; IOSelector output_selector;
Gtk::Label latency_display; Gtk::Label latency_display;
Gtk::HBox latency_hbox; Gtk::HBox latency_hbox;
sigc::connection latency_timeout; sigc::connection latency_timeout;
bool check_latency_measurement (); bool check_latency_measurement ();
void latency_button_toggled (); void latency_button_toggled ();
void update_latency_display (); void update_latency_display ();
}; };
class PortInsertWindow : public ArdourDialog class PortInsertWindow : public ArdourDialog

View file

@ -483,12 +483,12 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
); );
if (bc[dim].bundle->nchannels().n_total() > 1) { if (bc[dim].bundle->nchannels().n_total() > 1) {
for (uint32_t i = 0; i < bc[dim].bundle->nchannels().n_total(); ++i) { for (uint32_t i = 0; i < bc[dim].bundle->nchannels().n_total(); ++i) {
if (should_show (bc[dim].bundle->channel_type(i))) { if (should_show (bc[dim].bundle->channel_type(i))) {
add_remove_option (sub, w, i); add_remove_option (sub, w, i);
} }
} }
} }
} }
} }

View file

@ -471,7 +471,7 @@ PortMatrixBody::highlight_associated_channels (int dim, ARDOUR::BundleChannel h)
PortGroup::BundleList const b = _matrix->visible_ports(1 - dim)->bundles (); PortGroup::BundleList const b = _matrix->visible_ports(1 - dim)->bundles ();
for (PortGroup::BundleList::const_iterator i = b.begin(); i != b.end(); ++i) { for (PortGroup::BundleList::const_iterator i = b.begin(); i != b.end(); ++i) {
for (uint32_t j = 0; j < (*i)->bundle->nchannels().n_total(); ++j) { for (uint32_t j = 0; j < (*i)->bundle->nchannels().n_total(); ++j) {
if (!_matrix->should_show ((*i)->bundle->channel_type(j))) { if (!_matrix->should_show ((*i)->bundle->channel_type(j))) {
continue; continue;

View file

@ -2745,11 +2745,11 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
wp->set_state (*ui_xml, 0); wp->set_state (*ui_xml, 0);
} }
void* existing_ui = p->get_ui (); void* existing_ui = p->get_ui ();
if (existing_ui) { if (existing_ui) {
wp->use_window (*(reinterpret_cast<Gtk::Window*>(existing_ui))); wp->use_window (*(reinterpret_cast<Gtk::Window*>(existing_ui)));
} }
p->set_window_proxy (wp); p->set_window_proxy (wp);
WM::Manager::instance().register_window (wp); WM::Manager::instance().register_window (wp);
@ -3270,26 +3270,26 @@ ProcessorBox::rename_processor (boost::shared_ptr<Processor> processor)
name_prompter.get_result (result); name_prompter.get_result (result);
if (result.length()) { if (result.length()) {
int tries = 0; int tries = 0;
string test = result; string test = result;
while (tries < 100) { while (tries < 100) {
if (_session->io_name_is_legal (test)) { if (_session->io_name_is_legal (test)) {
result = test; result = test;
break; break;
} }
tries++; tries++;
test = string_compose ("%1-%2", result, tries); test = string_compose ("%1-%2", result, tries);
} }
if (tries < 100) { if (tries < 100) {
processor->set_name (result); processor->set_name (result);
} else { } else {
/* unlikely! */ /* unlikely! */
ARDOUR_UI::instance()->popup_error ARDOUR_UI::instance()->popup_error
(string_compose (_("At least 100 IO objects exist with a name like %1 - name not changed"), result)); (string_compose (_("At least 100 IO objects exist with a name like %1 - name not changed"), result));
} }
} }
break; break;
} }
@ -3362,10 +3362,10 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr
IOProcessor::prepare_for_reset (n, s->name()); IOProcessor::prepare_for_reset (n, s->name());
if (s->set_state (n, Stateful::loading_state_version)) { if (s->set_state (n, Stateful::loading_state_version)) {
delete s; delete s;
return; return;
} }
p.reset (s); p.reset (s);
@ -3378,24 +3378,24 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr
IOProcessor::prepare_for_reset (n, s->name()); IOProcessor::prepare_for_reset (n, s->name());
if (s->set_state (n, Stateful::loading_state_version)) { if (s->set_state (n, Stateful::loading_state_version)) {
delete s; delete s;
return; return;
} }
p.reset (s); p.reset (s);
} else if (type->value() == "return") { } else if (type->value() == "return") {
XMLNode n (**niter); XMLNode n (**niter);
Return* r = new Return (*_session); Return* r = new Return (*_session);
IOProcessor::prepare_for_reset (n, r->name()); IOProcessor::prepare_for_reset (n, r->name());
if (r->set_state (n, Stateful::loading_state_version)) { if (r->set_state (n, Stateful::loading_state_version)) {
delete r; delete r;
return; return;
} }
p.reset (r); p.reset (r);

View file

@ -435,16 +435,16 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
bool edit_aux_send(boost::shared_ptr<ARDOUR::Processor>); bool edit_aux_send(boost::shared_ptr<ARDOUR::Processor>);
/* Everything except a WindowProxy object should use this to get the window */ /* Everything except a WindowProxy object should use this to get the window */
Gtk::Window* get_processor_ui (boost::shared_ptr<ARDOUR::Processor>) const; Gtk::Window* get_processor_ui (boost::shared_ptr<ARDOUR::Processor>) const;
/* a WindowProxy object can use this */ /* a WindowProxy object can use this */
Gtk::Window* get_editor_window (boost::shared_ptr<ARDOUR::Processor>, bool); Gtk::Window* get_editor_window (boost::shared_ptr<ARDOUR::Processor>, bool);
Gtk::Window* get_generic_editor_window (boost::shared_ptr<ARDOUR::Processor>); Gtk::Window* get_generic_editor_window (boost::shared_ptr<ARDOUR::Processor>);
void manage_pins (boost::shared_ptr<ARDOUR::Processor>); void manage_pins (boost::shared_ptr<ARDOUR::Processor>);
void edit_processor (boost::shared_ptr<ARDOUR::Processor>); void edit_processor (boost::shared_ptr<ARDOUR::Processor>);
void generic_edit_processor (boost::shared_ptr<ARDOUR::Processor>); void generic_edit_processor (boost::shared_ptr<ARDOUR::Processor>);
void update_gui_object_state (ProcessorEntry *); void update_gui_object_state (ProcessorEntry *);
@ -497,7 +497,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void route_going_away (); void route_going_away ();
bool is_editor_mixer_strip() const; bool is_editor_mixer_strip() const;
Gtkmm2ext::DnDVBox<ProcessorEntry> processor_display; Gtkmm2ext::DnDVBox<ProcessorEntry> processor_display;
Gtk::ScrolledWindow processor_scroller; Gtk::ScrolledWindow processor_scroller;
@ -511,7 +511,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void object_drop (Gtkmm2ext::DnDVBox<ProcessorEntry> *, ProcessorEntry *, Glib::RefPtr<Gdk::DragContext> const &); void object_drop (Gtkmm2ext::DnDVBox<ProcessorEntry> *, ProcessorEntry *, Glib::RefPtr<Gdk::DragContext> const &);
Width _width; Width _width;
bool _redisplay_pending; bool _redisplay_pending;
Gtk::Menu *processor_menu; Gtk::Menu *processor_menu;
gint processor_menu_map_handler (GdkEventAny *ev); gint processor_menu_map_handler (GdkEventAny *ev);
@ -609,10 +609,10 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void route_property_changed (const PBD::PropertyChange&); void route_property_changed (const PBD::PropertyChange&);
std::string generate_processor_title (boost::shared_ptr<ARDOUR::PluginInsert> pi); std::string generate_processor_title (boost::shared_ptr<ARDOUR::PluginInsert> pi);
//typedef std::list<ProcessorWindowProxy*> ProcessorWindowProxies; //typedef std::list<ProcessorWindowProxy*> ProcessorWindowProxies;
//ProcessorWindowProxies _processor_window_info; //ProcessorWindowProxies _processor_window_info;
ProcessorWindowProxy* find_window_proxy (boost::shared_ptr<ARDOUR::Processor>) const; ProcessorWindowProxy* find_window_proxy (boost::shared_ptr<ARDOUR::Processor>) const;
void set_processor_ui (boost::shared_ptr<ARDOUR::Processor>, Gtk::Window *); void set_processor_ui (boost::shared_ptr<ARDOUR::Processor>, Gtk::Window *);
void maybe_add_processor_to_ui_list (boost::weak_ptr<ARDOUR::Processor>); void maybe_add_processor_to_ui_list (boost::weak_ptr<ARDOUR::Processor>);

View file

@ -46,30 +46,30 @@ using namespace ARDOUR_UI_UTILS;
RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> r) RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> r)
: ArdourDialog (_("Region")) : ArdourDialog (_("Region"))
, _table (9, 2) , _table (9, 2)
, _table_row (0) , _table_row (0)
, _region (r) , _region (r)
, name_label (_("Name:")) , name_label (_("Name:"))
, audition_button (_("Audition")) , audition_button (_("Audition"))
, _clock_group (new ClockGroup) , _clock_group (new ClockGroup)
, position_clock (X_("regionposition"), true, "", true, false) , position_clock (X_("regionposition"), true, "", true, false)
, end_clock (X_("regionend"), true, "", true, false) , end_clock (X_("regionend"), true, "", true, false)
, length_clock (X_("regionlength"), true, "", true, false, true) , length_clock (X_("regionlength"), true, "", true, false, true)
, sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, "", true, false) , sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, "", true, false)
, sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, "", true, false) , sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, "", true, false)
/* XXX cannot file start yet */ /* XXX cannot file start yet */
, start_clock (X_("regionstart"), true, "", false, false) , start_clock (X_("regionstart"), true, "", false, false)
, _sources (1) , _sources (1)
{ {
set_session (s); set_session (s);
_clock_group->set_clock_mode (ARDOUR_UI::instance()->secondary_clock->mode()); _clock_group->set_clock_mode (ARDOUR_UI::instance()->secondary_clock->mode());
_clock_group->add (position_clock); _clock_group->add (position_clock);
_clock_group->add (end_clock); _clock_group->add (end_clock);
_clock_group->add (length_clock); _clock_group->add (length_clock);
_clock_group->add (sync_offset_relative_clock); _clock_group->add (sync_offset_relative_clock);
_clock_group->add (sync_offset_absolute_clock); _clock_group->add (sync_offset_absolute_clock);
_clock_group->add (start_clock); _clock_group->add (start_clock);
position_clock.set_session (_session); position_clock.set_session (_session);
end_clock.set_session (_session); end_clock.set_session (_session);
@ -198,7 +198,7 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> r)
RegionEditor::~RegionEditor () RegionEditor::~RegionEditor ()
{ {
delete _clock_group; delete _clock_group;
} }
void void
@ -299,7 +299,7 @@ RegionEditor::end_clock_changed ()
PublicEditor::instance().begin_reversible_command (_("change region end position")); PublicEditor::instance().begin_reversible_command (_("change region end position"));
in_command = true; in_command = true;
_region->clear_changes (); _region->clear_changes ();
_region->trim_end (end_clock.current_time()); _region->trim_end (end_clock.current_time());
_session->add_command(new StatefulDiffCommand (_region)); _session->add_command(new StatefulDiffCommand (_region));
} }
@ -415,7 +415,7 @@ RegionEditor::sync_offset_absolute_clock_changed ()
{ {
PublicEditor::instance().begin_reversible_command (_("change region sync point")); PublicEditor::instance().begin_reversible_command (_("change region sync point"));
_region->clear_changes (); _region->clear_changes ();
_region->set_sync_position (sync_offset_absolute_clock.current_time()); _region->set_sync_position (sync_offset_absolute_clock.current_time());
_session->add_command (new StatefulDiffCommand (_region)); _session->add_command (new StatefulDiffCommand (_region));
@ -427,7 +427,7 @@ RegionEditor::sync_offset_relative_clock_changed ()
{ {
PublicEditor::instance().begin_reversible_command (_("change region sync point")); PublicEditor::instance().begin_reversible_command (_("change region sync point"));
_region->clear_changes (); _region->clear_changes ();
_region->set_sync_position (sync_offset_relative_clock.current_time() + _region->position ()); _region->set_sync_position (sync_offset_relative_clock.current_time() + _region->position ());
_session->add_command (new StatefulDiffCommand (_region)); _session->add_command (new StatefulDiffCommand (_region));

View file

@ -77,7 +77,7 @@ class RegionEditor : public ArdourDialog
Gtk::Label sync_absolute_label; Gtk::Label sync_absolute_label;
Gtk::Label start_label; Gtk::Label start_label;
ClockGroup* _clock_group; ClockGroup* _clock_group;
AudioClock position_clock; AudioClock position_clock;
AudioClock end_clock; AudioClock end_clock;

Some files were not shown because too many files have changed in this diff Show more