mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
NO-OP whitespace (updated GH PR #357)
This commit is contained in:
parent
f413b83cb9
commit
63ea7b6516
132 changed files with 2774 additions and 2762 deletions
|
|
@ -287,7 +287,7 @@ AddRouteDialog::track_type_chosen ()
|
|||
true, MESSAGE_INFO, BUTTONS_OK, true);
|
||||
msg.set_position (WIN_POS_MOUSE);
|
||||
msg.run ();
|
||||
}
|
||||
}
|
||||
channel_combo.set_sensitive (true);
|
||||
mode_combo.set_sensitive (true);
|
||||
instrument_combo.set_sensitive (true);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public:
|
|||
private:
|
||||
Gtk::RadioButtonGroup _group;
|
||||
std::vector<Gtk::RadioButton*> _radio_buttons;
|
||||
bool rb_button_press (GdkEventButton*);
|
||||
bool rb_button_press (GdkEventButton*);
|
||||
};
|
||||
|
||||
#endif // __gtk_ardour_ambiguous_file_dialog_h__
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@ AnalysisWindow::AnalysisWindow()
|
|||
: source_selection_label (_("Signal source"))
|
||||
, source_selection_ranges_rb (_("Selected ranges"))
|
||||
, source_selection_regions_rb (_("Selected regions"))
|
||||
, show_minmax_button (_("Show frequency power range"))
|
||||
, show_normalized_button (_("Fit dB range"))
|
||||
, show_proportional_button (_("Proportional Spectrum, -18dB"))
|
||||
, fft_graph (16384)
|
||||
, show_minmax_button (_("Show frequency power range"))
|
||||
, show_normalized_button (_("Fit dB range"))
|
||||
, show_proportional_button (_("Proportional Spectrum, -18dB"))
|
||||
, fft_graph (16384)
|
||||
{
|
||||
set_name(_("FFT analysis window"));
|
||||
set_name (_("FFT analysis window"));
|
||||
set_title (_("Spectral Analysis"));
|
||||
|
||||
track_list_ready = false;
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ using namespace Editing;
|
|||
ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
|
||||
|
||||
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
|
||||
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::BUTTONS_YES_NO,
|
||||
true /* modal, though it hardly matters since it is the only window */
|
||||
);
|
||||
);
|
||||
|
||||
msg.set_default_response (Gtk::RESPONSE_YES);
|
||||
msg.show_all ();
|
||||
|
|
@ -222,8 +222,8 @@ ask_about_configuration_copy (string const & old_dir, string const & new_dir, in
|
|||
|
||||
static void
|
||||
libxml_generic_error_func (void* /* parsing_context*/,
|
||||
const char* msg,
|
||||
...)
|
||||
const char* msg,
|
||||
...)
|
||||
{
|
||||
va_list ap;
|
||||
char buf[2048];
|
||||
|
|
@ -463,7 +463,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
|
||||
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 ();
|
||||
|
||||
|
|
@ -529,8 +529,8 @@ ARDOUR_UI::pre_release_dialog ()
|
|||
ArdourDialog d (_("Pre-Release Warning"), true, false);
|
||||
d.add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
|
||||
|
||||
Label* label = manage (new Label);
|
||||
label->set_markup (string_compose (_("<b>Welcome to this pre-release build of %1 %2</b>\n\n\
|
||||
Label* label = manage (new Label);
|
||||
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\
|
||||
as well as general workflow improvements, before this can be considered\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\
|
||||
"), PROGRAM_NAME, VERSIONSTRING));
|
||||
|
||||
d.get_vbox()->set_border_width (12);
|
||||
d.get_vbox()->pack_start (*label, false, false, 12);
|
||||
d.get_vbox()->show_all ();
|
||||
d.get_vbox()->set_border_width (12);
|
||||
d.get_vbox()->pack_start (*label, false, false, 12);
|
||||
d.get_vbox()->show_all ();
|
||||
|
||||
d.run ();
|
||||
d.run ();
|
||||
}
|
||||
|
||||
GlobalPortMatrixWindow*
|
||||
|
|
@ -1940,9 +1940,9 @@ ARDOUR_UI::check_audioengine (Gtk::Window& parent)
|
|||
{
|
||||
if (!AudioEngine::instance()->connected()) {
|
||||
MessageDialog msg (parent, string_compose (
|
||||
_("%1 is not connected to any audio backend.\n"
|
||||
"You cannot open or close sessions in this condition"),
|
||||
PROGRAM_NAME));
|
||||
_("%1 is not connected to any audio backend.\n"
|
||||
"You cannot open or close sessions in this condition"),
|
||||
PROGRAM_NAME));
|
||||
pop_back_splash (msg);
|
||||
msg.run ();
|
||||
return false;
|
||||
|
|
@ -2906,7 +2906,7 @@ ARDOUR_UI::process_snapshot_session_prompter (ArdourPrompter& prompter, bool swi
|
|||
char illegal = Session::session_name_is_legal(snapname);
|
||||
if (illegal) {
|
||||
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 ();
|
||||
return false;
|
||||
}
|
||||
|
|
@ -3006,7 +3006,7 @@ ARDOUR_UI::rename_session ()
|
|||
|
||||
if (illegal) {
|
||||
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 ();
|
||||
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 ();
|
||||
|
||||
if (nsm) {
|
||||
likely_new = true;
|
||||
likely_new = true;
|
||||
}
|
||||
|
||||
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 ||
|
||||
#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
|
||||
(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() > 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)
|
||||
#endif
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
/* 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) {
|
||||
MessageDialog msg (session_dialog,
|
||||
string_compose (_("To ensure compatibility with various systems\n"
|
||||
"session names may not contain a '%1' character"),
|
||||
illegal));
|
||||
string_compose (_("To ensure compatibility with various systems\n"
|
||||
"session names may not contain a '%1' character"),
|
||||
illegal));
|
||||
msg.run ();
|
||||
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
|
||||
continue;
|
||||
|
|
@ -3548,7 +3548,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
if (illegal) {
|
||||
pop_back_splash (session_dialog);
|
||||
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 ();
|
||||
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
|
||||
continue;
|
||||
|
|
@ -3701,8 +3701,8 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
|
|||
catch (...) {
|
||||
|
||||
MessageDialog msg (string_compose(
|
||||
_("Session \"%1 (snapshot %2)\" did not load successfully"),
|
||||
path, snap_name),
|
||||
_("Session \"%1 (snapshot %2)\" did not load successfully"),
|
||||
path, snap_name),
|
||||
true,
|
||||
Gtk::MESSAGE_INFO,
|
||||
BUTTONS_OK);
|
||||
|
|
@ -3968,8 +3968,8 @@ ARDOUR_UI::show_splash ()
|
|||
void
|
||||
ARDOUR_UI::hide_splash ()
|
||||
{
|
||||
delete splash;
|
||||
splash = 0;
|
||||
delete splash;
|
||||
splash = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -3981,10 +3981,10 @@ ARDOUR_UI::display_cleanup_results (ARDOUR::CleanupReport& rep, const gchar* lis
|
|||
|
||||
if (removed == 0) {
|
||||
MessageDialog msgd (_main_window,
|
||||
_("No files were ready for clean-up"),
|
||||
true,
|
||||
Gtk::MESSAGE_INFO,
|
||||
Gtk::BUTTONS_OK);
|
||||
_("No files were ready for clean-up"),
|
||||
true,
|
||||
Gtk::MESSAGE_INFO,
|
||||
Gtk::BUTTONS_OK);
|
||||
msgd.set_title (_("Clean-up"));
|
||||
msgd.set_secondary_text (_("If this seems suprising, \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);
|
||||
|
||||
struct CleanupResultsModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
CleanupResultsModelColumns() {
|
||||
add (visible_name);
|
||||
add (fullpath);
|
||||
}
|
||||
Gtk::TreeModelColumn<std::string> visible_name;
|
||||
Gtk::TreeModelColumn<std::string> fullpath;
|
||||
CleanupResultsModelColumns() {
|
||||
add (visible_name);
|
||||
add (fullpath);
|
||||
}
|
||||
Gtk::TreeModelColumn<std::string> visible_name;
|
||||
Gtk::TreeModelColumn<std::string> fullpath;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -4847,8 +4847,8 @@ ARDOUR_UI::create_xrun_marker (framepos_t where)
|
|||
void
|
||||
ARDOUR_UI::halt_on_xrun_message ()
|
||||
{
|
||||
cerr << "HALT on xrun\n";
|
||||
MessageDialog msg (_main_window, _("Recording was stopped because your system could not keep up."));
|
||||
cerr << "HALT on xrun\n";
|
||||
MessageDialog msg (_main_window, _("Recording was stopped because your system could not keep up."));
|
||||
msg.run ();
|
||||
}
|
||||
|
||||
|
|
@ -5103,10 +5103,10 @@ audio may be played at the wrong sample rate.\n"), desired, PROGRAM_NAME, actual
|
|||
case RESPONSE_ACCEPT:
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -5400,11 +5400,11 @@ ARDOUR_UI::session_format_mismatch (std::string xml_path, std::string backup_pat
|
|||
const char* end_mono = "</tt>";
|
||||
|
||||
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"
|
||||
"From now on, use the backup copy with older versions of %3"),
|
||||
xml_path, backup_path, PROGRAM_NAME,
|
||||
start_big, end_big,
|
||||
start_mono, end_mono), true);
|
||||
"%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"),
|
||||
xml_path, backup_path, PROGRAM_NAME,
|
||||
start_big, end_big,
|
||||
start_mono, end_mono), true);
|
||||
|
||||
msg.run ();
|
||||
}
|
||||
|
|
@ -5632,7 +5632,7 @@ ARDOUR_UI::audioengine_became_silent ()
|
|||
void
|
||||
ARDOUR_UI::hide_application ()
|
||||
{
|
||||
Application::instance ()-> hide ();
|
||||
Application::instance ()-> hide ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -5758,7 +5758,7 @@ ARDOUR_UI::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey
|
|||
bool special_handling_of_unmodified_accelerators = false;
|
||||
const guint mask = (Keyboard::RelevantModifierKeyMask & ~(Gdk::SHIFT_MASK|Gdk::LOCK_MASK));
|
||||
|
||||
if (focus) {
|
||||
if (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",
|
||||
win,
|
||||
ev->keyval,
|
||||
Gtkmm2ext::show_gdk_event_state (ev->state),
|
||||
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,
|
||||
ev->keyval,
|
||||
Gtkmm2ext::show_gdk_event_state (ev->state),
|
||||
special_handling_of_unmodified_accelerators,
|
||||
Keyboard::some_magic_widget_has_focus(),
|
||||
focus,
|
||||
focus,
|
||||
(focus ? gtk_widget_get_name (focus) : "no focus widget"),
|
||||
((ev->state & mask) ? "yes" : "no"),
|
||||
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 */
|
||||
|
||||
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",
|
||||
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;
|
||||
}
|
||||
|
||||
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)) {
|
||||
DEBUG_TRACE (DEBUG::Accelerators, "\tpropagate handled\n");
|
||||
return true;
|
||||
}
|
||||
if (gtk_window_propagate_key_event (win, ev)) {
|
||||
DEBUG_TRACE (DEBUG::Accelerators, "\tpropagate handled\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ private:
|
|||
|
||||
void about_signal_response(int response);
|
||||
|
||||
Gtk::VBox top_packer;
|
||||
Gtk::VBox top_packer;
|
||||
|
||||
sigc::connection clock_signal_connection;
|
||||
void update_clocks ();
|
||||
|
|
@ -485,22 +485,22 @@ private:
|
|||
void update_clock_visibility ();
|
||||
|
||||
struct TransportControllable : public PBD::Controllable {
|
||||
enum ToggleType {
|
||||
Roll = 0,
|
||||
Stop,
|
||||
RecordEnable,
|
||||
GotoStart,
|
||||
GotoEnd,
|
||||
AutoLoop,
|
||||
PlaySelection,
|
||||
};
|
||||
enum ToggleType {
|
||||
Roll = 0,
|
||||
Stop,
|
||||
RecordEnable,
|
||||
GotoStart,
|
||||
GotoEnd,
|
||||
AutoLoop,
|
||||
PlaySelection,
|
||||
};
|
||||
|
||||
TransportControllable (std::string name, ARDOUR_UI&, ToggleType);
|
||||
void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
|
||||
double get_value (void) const;
|
||||
TransportControllable (std::string name, ARDOUR_UI&, ToggleType);
|
||||
void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
|
||||
double get_value (void) const;
|
||||
|
||||
ARDOUR_UI& ui;
|
||||
ToggleType type;
|
||||
ARDOUR_UI& ui;
|
||||
ToggleType type;
|
||||
};
|
||||
|
||||
boost::shared_ptr<TransportControllable> roll_controllable;
|
||||
|
|
|
|||
|
|
@ -219,10 +219,10 @@ ARDOUR_UI::main_window_delete_event (GdkEventAny* ev)
|
|||
|
||||
static GtkNotebook*
|
||||
tab_window_root_drop (GtkNotebook* src,
|
||||
GtkWidget* w,
|
||||
gint x,
|
||||
gint y,
|
||||
gpointer user_data)
|
||||
GtkWidget* w,
|
||||
gint x,
|
||||
gint y,
|
||||
gpointer user_data)
|
||||
{
|
||||
return ARDOUR_UI::instance()->tab_window_root_drop (src, w, x, y, user_data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,10 +187,10 @@ ARDOUR_UI::install_actions ()
|
|||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
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);
|
||||
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 = 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)));
|
||||
|
|
@ -730,8 +730,8 @@ ARDOUR_UI::use_menubar_as_top_menubar ()
|
|||
Gtk::Widget* widget;
|
||||
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 */
|
||||
|
||||
|
|
@ -747,11 +747,11 @@ ARDOUR_UI::use_menubar_as_top_menubar ()
|
|||
|
||||
if ((widget = ActionManager::get_widget ("/ui/Main/Session/toggle-about"))) {
|
||||
app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
|
||||
}
|
||||
}
|
||||
|
||||
if ((widget = ActionManager::get_widget ("/ui/Main/Edit/menu-show-preferences"))) {
|
||||
app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
|
||||
}
|
||||
}
|
||||
|
||||
app->set_menu_bar (*menu_bar);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,26 +106,26 @@ ArdourWindow::init ()
|
|||
set_border_width (10);
|
||||
add_events (Gdk::FOCUS_CHANGE_MASK);
|
||||
|
||||
/* 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
|
||||
works on X11 in that:
|
||||
/* 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
|
||||
works on X11 in that:
|
||||
|
||||
(a) there are no window "levels"
|
||||
(b) they will float above normal windows without any particular effort
|
||||
(a) there are no window "levels"
|
||||
(b) they will float above normal windows without any particular effort
|
||||
(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
|
||||
to select what type of window hint is used.
|
||||
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.
|
||||
|
||||
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.
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
|
||||
#else
|
||||
if (UIConfiguration::instance().get_all_floating_windows_are_dialogs()) {
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class AUPluginUI;
|
|||
@interface NotificationObject : NSObject {
|
||||
@private
|
||||
AUPluginUI* plugin_ui;
|
||||
NSWindow* cocoa_parent;
|
||||
NSWindow* cocoa_parent;
|
||||
NSWindow* top_level_parent;
|
||||
}
|
||||
@end
|
||||
|
|
@ -87,7 +87,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
|
|||
void activate ();
|
||||
void deactivate ();
|
||||
|
||||
bool non_gtk_gui() const { return true; }
|
||||
bool non_gtk_gui() const { return true; }
|
||||
|
||||
void lower_box_realized ();
|
||||
bool lower_box_visibility_notify (GdkEventVisibility*);
|
||||
|
|
|
|||
|
|
@ -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_rectangle (cr,
|
||||
min (get_width() - 2.0,
|
||||
(double) xcenter + cursor.get_x()/PANGO_SCALE + em_width),
|
||||
(get_height() - layout_height)/2.0,
|
||||
2.0, cursor.get_height()/PANGO_SCALE);
|
||||
min (get_width() - 2.0,
|
||||
(double) xcenter + cursor.get_x()/PANGO_SCALE + em_width),
|
||||
(get_height() - layout_height)/2.0,
|
||||
2.0, cursor.get_height()/PANGO_SCALE);
|
||||
cairo_fill (cr);
|
||||
} else {
|
||||
/* 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,
|
||||
Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) {
|
||||
|
||||
Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) {
|
||||
pixel_frame_scale_factor = 0.025f;
|
||||
}
|
||||
|
||||
|
|
@ -1881,7 +1880,7 @@ AudioClock::timecode_validate_edit (const string&)
|
|||
char ignored[2];
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -1996,10 +1995,10 @@ AudioClock::frames_from_bbt_string (framepos_t pos, const string& str) const
|
|||
if (is_duration) {
|
||||
any.bbt.bars++;
|
||||
any.bbt.beats++;
|
||||
return _session->any_duration_to_frames (pos, any);
|
||||
return _session->any_duration_to_frames (pos, any);
|
||||
} else {
|
||||
return _session->convert_to_frames (any);
|
||||
}
|
||||
return _session->convert_to_frames (any);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@ AudioRegionView::redraw_end_xfade ()
|
|||
|
||||
void
|
||||
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) {
|
||||
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_outline_color (outline);
|
||||
(*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");
|
||||
|
||||
if (rint(new_pos) == rint(*pos)) {
|
||||
framepos_t position = _region->position();
|
||||
framepos_t old_frame = (*l).first;
|
||||
framepos_t new_frame = trackview.editor().pixel_to_sample (new_pos) + position;
|
||||
_region->update_transient (old_frame, new_frame);
|
||||
break;
|
||||
framepos_t position = _region->position();
|
||||
framepos_t old_frame = (*l).first;
|
||||
framepos_t new_frame = trackview.editor().pixel_to_sample (new_pos) + position;
|
||||
_region->update_transient (old_frame, new_frame);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1742,8 +1742,8 @@ AudioRegionView::remove_transient (float pos)
|
|||
for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
|
||||
float *line_pos = (float*) (*l).second->get_data ("position");
|
||||
if (rint(pos) == rint(*line_pos)) {
|
||||
_region->remove_transient ((*l).first);
|
||||
break;
|
||||
_region->remove_transient ((*l).first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class AudioRegionView : public RegionView
|
|||
|
||||
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);
|
||||
|
||||
boost::shared_ptr<AudioRegionGainLine> get_gain_line() const { return gain_line; }
|
||||
|
|
@ -118,8 +118,8 @@ class AudioRegionView : public RegionView
|
|||
void drag_start ();
|
||||
void drag_end ();
|
||||
|
||||
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_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_start_xfade ();
|
||||
void redraw_end_xfade ();
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ class AudioRegionView : public RegionView
|
|||
void peaks_ready_handler (uint32_t);
|
||||
|
||||
void set_colors ();
|
||||
void set_waveform_colors ();
|
||||
void set_waveform_colors ();
|
||||
void reset_width_dependent_items (double pixel_width);
|
||||
void set_frame_color ();
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
|
|||
break;
|
||||
case Destructive:
|
||||
region_view = new TapeAudioRegionView (_canvas_group, _trackview, region,
|
||||
_samples_per_pixel, region_color);
|
||||
_samples_per_pixel, region_color);
|
||||
break;
|
||||
default:
|
||||
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);
|
||||
|
||||
} else if (rec_active &&
|
||||
(_trackview.session()->record_status() != Session::Recording ||
|
||||
!_trackview.track()->rec_enable_control()->get_value())) {
|
||||
(_trackview.session()->record_status() != Session::Recording ||
|
||||
!_trackview.track()->rec_enable_control()->get_value())) {
|
||||
screen_update_connection.disconnect();
|
||||
rec_active = false;
|
||||
rec_updating = false;
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
|
|||
|
||||
if (_route->panner_shell()) {
|
||||
_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 */
|
||||
|
|
@ -207,8 +207,8 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
|
|||
create_trim_automation_child (param, show);
|
||||
|
||||
} else if (param.type() == PanWidthAutomation ||
|
||||
param.type() == PanElevationAutomation ||
|
||||
param.type() == PanAzimuthAutomation) {
|
||||
param.type() == PanElevationAutomation ||
|
||||
param.type() == PanAzimuthAutomation) {
|
||||
|
||||
ensure_pan_views (show);
|
||||
|
||||
|
|
|
|||
|
|
@ -165,8 +165,8 @@ public:
|
|||
protected:
|
||||
|
||||
std::string _name;
|
||||
guint32 _height;
|
||||
uint32_t _line_color;
|
||||
guint32 _height;
|
||||
uint32_t _line_color;
|
||||
|
||||
boost::shared_ptr<ARDOUR::AutomationList> alist;
|
||||
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 */
|
||||
bool did_push;
|
||||
|
||||
ArdourCanvas::Item& _parent_group;
|
||||
ArdourCanvas::Container* group;
|
||||
ArdourCanvas::Item& _parent_group;
|
||||
ArdourCanvas::Container* group;
|
||||
ArdourCanvas::PolyLine* line; /* line */
|
||||
ArdourCanvas::Points line_points; /* coordinates for canvas line */
|
||||
std::vector<ControlPoint*> control_points; /* visible control points */
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ using namespace Editing;
|
|||
|
||||
AutomationStreamView::AutomationStreamView (AutomationTimeAxisView& tv)
|
||||
: StreamView (*dynamic_cast<RouteTimeAxisView*>(tv.get_parent()),
|
||||
tv.canvas_display())
|
||||
tv.canvas_display())
|
||||
, _automation_view(tv)
|
||||
, _pending_automation_state (Off)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,25 +55,25 @@ extern void no_app_nap (); // cocoacarbon.mm
|
|||
static void
|
||||
setup_logging(void)
|
||||
{
|
||||
/* 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
|
||||
appear in the Console.
|
||||
*/
|
||||
/* 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
|
||||
appear in the Console.
|
||||
*/
|
||||
#ifdef ASL_LOG_DESCRIPTOR_WRITE
|
||||
aslmsg msg;
|
||||
aslclient c = asl_open (PROGRAM_NAME, "com.apple.console", 0);
|
||||
aslmsg msg;
|
||||
aslclient c = asl_open (PROGRAM_NAME, "com.apple.console", 0);
|
||||
|
||||
msg = asl_new(ASL_TYPE_MSG);
|
||||
asl_set(msg, ASL_KEY_FACILITY, "com.apple.console");
|
||||
asl_set(msg, ASL_KEY_LEVEL, ASL_STRING_NOTICE);
|
||||
asl_set(msg, ASL_KEY_READ_UID, "-1");
|
||||
msg = asl_new(ASL_TYPE_MSG);
|
||||
asl_set(msg, ASL_KEY_FACILITY, "com.apple.console");
|
||||
asl_set(msg, ASL_KEY_LEVEL, ASL_STRING_NOTICE);
|
||||
asl_set(msg, ASL_KEY_READ_UID, "-1");
|
||||
|
||||
int fd = dup(2);
|
||||
//asl_set_filter(c, ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG));
|
||||
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_descriptor(c, msg, ASL_LEVEL_INFO, 1, ASL_LOG_DESCRIPTOR_WRITE);
|
||||
asl_log_descriptor(c, msg, ASL_LEVEL_INFO, 2, ASL_LOG_DESCRIPTOR_WRITE);
|
||||
int fd = dup(2);
|
||||
//asl_set_filter(c, ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG));
|
||||
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_descriptor(c, msg, ASL_LEVEL_INFO, 1, ASL_LOG_DESCRIPTOR_WRITE);
|
||||
asl_log_descriptor(c, msg, ASL_LEVEL_INFO, 2, ASL_LOG_DESCRIPTOR_WRITE);
|
||||
#else
|
||||
#warning This build host has an older ASL API, so no console logging in this build.
|
||||
#endif
|
||||
|
|
@ -94,7 +94,7 @@ fixup_bundle_environment (int argc, char* argv[], string & localedir)
|
|||
|
||||
set_language_preference ();
|
||||
|
||||
setup_logging ();
|
||||
setup_logging ();
|
||||
|
||||
char execpath[MAXPATHLEN+1];
|
||||
uint32_t pathsz = sizeof (execpath);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ gnome_canvas_simpleline_get_type (void)
|
|||
static void
|
||||
gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GObjectClass *gobject_class;
|
||||
GtkObjectClass *object_class;
|
||||
GnomeCanvasItemClass *item_class;
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ gnome_canvas_simpleline_set_property (GObject *object,
|
|||
GnomeCanvasSimpleLine *simpleline;
|
||||
int update = FALSE;
|
||||
int bounds_changed = FALSE;
|
||||
double d;
|
||||
double d;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GNOME_IS_CANVAS_SIMPLELINE (object));
|
||||
|
|
@ -209,42 +209,42 @@ gnome_canvas_simpleline_set_property (GObject *object,
|
|||
|
||||
switch (prop_id) {
|
||||
case PROP_X1:
|
||||
d = g_value_get_double (value);
|
||||
if (simpleline->x1 != d) {
|
||||
simpleline->x1 = d;
|
||||
d = g_value_get_double (value);
|
||||
if (simpleline->x1 != d) {
|
||||
simpleline->x1 = d;
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_Y1:
|
||||
d = g_value_get_double (value);
|
||||
if (simpleline->y1 != d) {
|
||||
simpleline->y1 = d;
|
||||
d = g_value_get_double (value);
|
||||
if (simpleline->y1 != d) {
|
||||
simpleline->y1 = d;
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_X2:
|
||||
d = g_value_get_double (value);
|
||||
if (simpleline->x2 != d) {
|
||||
simpleline->x2 = d;
|
||||
d = g_value_get_double (value);
|
||||
if (simpleline->x2 != d) {
|
||||
simpleline->x2 = d;
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_Y2:
|
||||
d = g_value_get_double (value);
|
||||
if (simpleline->y2 != d) {
|
||||
simpleline->y2 = d;
|
||||
d = g_value_get_double (value);
|
||||
if (simpleline->y2 != d) {
|
||||
simpleline->y2 = d;
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_COLOR_RGBA:
|
||||
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);
|
||||
update = TRUE;
|
||||
update = TRUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -262,8 +262,8 @@ gnome_canvas_simpleline_get_property (GObject *object,
|
|||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GNOME_IS_CANVAS_SIMPLELINE (object));
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GNOME_IS_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)
|
||||
{
|
||||
GnomeCanvasSimpleLine *simpleline;
|
||||
double x1, x2, y1, y2;
|
||||
double x1, x2, y1, y2;
|
||||
|
||||
simpleline = GNOME_CANVAS_SIMPLELINE (item);
|
||||
|
||||
if (parent_class->update)
|
||||
(* 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, &x2, &y2);
|
||||
gnome_canvas_item_i2w (item, &x1, &y1);
|
||||
gnome_canvas_item_i2w (item, &x2, &y2);
|
||||
|
||||
/* don't suffer from rounding errors */
|
||||
/* don't suffer from rounding errors */
|
||||
|
||||
x1 = floor (x1);
|
||||
y1 = floor (y1);
|
||||
x2 = ceil (x2);
|
||||
y2 = ceil (y2);
|
||||
x1 = floor (x1);
|
||||
y1 = floor (y1);
|
||||
x2 = ceil (x2);
|
||||
y2 = ceil (y2);
|
||||
|
||||
/* force non-zero dimensionality for both axes */
|
||||
/* force non-zero dimensionality for both axes */
|
||||
|
||||
if (x1 == x2) {
|
||||
x2 += 1.0;
|
||||
}
|
||||
if (x1 == x2) {
|
||||
x2 += 1.0;
|
||||
}
|
||||
|
||||
if (y1 == y2) {
|
||||
y2 += 1.0;
|
||||
}
|
||||
if (y1 == y2) {
|
||||
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), x2, y2, &item->x2, &item->y2);
|
||||
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);
|
||||
|
||||
/* 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;
|
||||
y1 = simpleline->y1;
|
||||
x2 = simpleline->x2;
|
||||
y2 = simpleline->y2;
|
||||
/* convert to world */
|
||||
gnome_canvas_item_i2w (item, &x1, &y1);
|
||||
gnome_canvas_item_i2w (item, &x2, &y2);
|
||||
/* avoid rounding errors */
|
||||
x1 = (int) floor (item->x1);
|
||||
y1 = (int) floor (item->y1);
|
||||
x2 = (int) ceil (item->x2);
|
||||
y2 = (int) ceil (item->y2);
|
||||
/* 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), x2, y2, &simpleline->cx2, &simpleline->cy2);
|
||||
x1 = simpleline->x1;
|
||||
y1 = simpleline->y1;
|
||||
x2 = simpleline->x2;
|
||||
y2 = simpleline->y2;
|
||||
/* convert to world */
|
||||
gnome_canvas_item_i2w (item, &x1, &y1);
|
||||
gnome_canvas_item_i2w (item, &x2, &y2);
|
||||
/* avoid rounding errors */
|
||||
x1 = (int) floor (item->x1);
|
||||
y1 = (int) floor (item->y1);
|
||||
x2 = (int) ceil (item->x2);
|
||||
y2 = (int) ceil (item->y2);
|
||||
/* 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), x2, y2, &simpleline->cx2, &simpleline->cy2);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -364,28 +364,28 @@ gnome_canvas_simpleline_render (GnomeCanvasItem *item,
|
|||
{
|
||||
GnomeCanvasSimpleLine *simpleline;
|
||||
int x1, x2;
|
||||
int y1, y2;
|
||||
int y1, y2;
|
||||
|
||||
simpleline = GNOME_CANVAS_SIMPLELINE (item);
|
||||
|
||||
x1 = simpleline->cx1;
|
||||
x2 = simpleline->cx2;
|
||||
y1 = simpleline->cy1;
|
||||
y1 = simpleline->cy1;
|
||||
|
||||
if (buf->is_bg) {
|
||||
gnome_canvas_buf_ensure_buf (buf);
|
||||
buf->is_bg = FALSE;
|
||||
}
|
||||
|
||||
if (simpleline->x1 != simpleline->x2) {
|
||||
PAINT_HORIZA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
|
||||
x1, x2, y1);
|
||||
} else {
|
||||
y2 = simpleline->cy2;
|
||||
PAINT_VERTA (buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
|
||||
x1, y1, y2);
|
||||
if (simpleline->x1 != simpleline->x2) {
|
||||
PAINT_HORIZA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
|
||||
x1, x2, y1);
|
||||
} else {
|
||||
y2 = simpleline->cy2;
|
||||
PAINT_VERTA (buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
|
||||
x1, y1, y2);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -402,10 +402,10 @@ gnome_canvas_simpleline_bounds (GnomeCanvasItem *item, double *x1, double *y1, d
|
|||
{
|
||||
GnomeCanvasSimpleLine *simpleline = GNOME_CANVAS_SIMPLELINE (item);
|
||||
|
||||
*x1 = simpleline->x1;
|
||||
*y1 = simpleline->y1;
|
||||
*x2 = simpleline->x1;
|
||||
*y2 = simpleline->y2;
|
||||
*x1 = simpleline->x1;
|
||||
*y1 = simpleline->y1;
|
||||
*x2 = simpleline->x1;
|
||||
*y2 = simpleline->y2;
|
||||
}
|
||||
|
||||
static double
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ gnome_canvas_simplerect_get_type (void)
|
|||
static void
|
||||
gnome_canvas_simplerect_class_init (GnomeCanvasSimpleRectClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GObjectClass *gobject_class;
|
||||
GtkObjectClass *object_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), 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) {
|
||||
|
||||
|
|
@ -376,44 +376,44 @@ gnome_canvas_simplerect_set_property (GObject *object,
|
|||
|
||||
switch (prop_id) {
|
||||
case PROP_X1:
|
||||
if (simplerect->x1 != g_value_get_double (value)) {
|
||||
simplerect->x1 = g_value_get_double (value);
|
||||
if (simplerect->x1 != g_value_get_double (value)) {
|
||||
simplerect->x1 = g_value_get_double (value);
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_Y1:
|
||||
if (simplerect->y1 != g_value_get_double (value)) {
|
||||
simplerect->y1 = g_value_get_double (value);
|
||||
if (simplerect->y1 != g_value_get_double (value)) {
|
||||
simplerect->y1 = g_value_get_double (value);
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_X2:
|
||||
if (simplerect->x2 != g_value_get_double (value)) {
|
||||
simplerect->x2 = g_value_get_double (value);
|
||||
if (simplerect->x2 != g_value_get_double (value)) {
|
||||
simplerect->x2 = g_value_get_double (value);
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_Y2:
|
||||
if (simplerect->y2 != g_value_get_double (value)) {
|
||||
simplerect->y2 = g_value_get_double (value);
|
||||
if (simplerect->y2 != g_value_get_double (value)) {
|
||||
simplerect->y2 = g_value_get_double (value);
|
||||
bounds_changed = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_DRAW:
|
||||
if (simplerect->draw != g_value_get_boolean (value)) {
|
||||
simplerect->draw = g_value_get_boolean (value);
|
||||
if (simplerect->draw != g_value_get_boolean (value)) {
|
||||
simplerect->draw = g_value_get_boolean (value);
|
||||
update = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case PROP_FILL:
|
||||
if (simplerect->fill != g_value_get_boolean (value)) {
|
||||
simplerect->fill = g_value_get_boolean (value);
|
||||
if (simplerect->fill != g_value_get_boolean (value)) {
|
||||
simplerect->fill = g_value_get_boolean (value);
|
||||
update = TRUE;
|
||||
}
|
||||
break;
|
||||
|
|
@ -537,10 +537,10 @@ gnome_canvas_simplerect_update (GnomeCanvasItem *item, double *affine, ArtSVP *c
|
|||
|
||||
if (simplerect->full_draw_on_update) {
|
||||
gnome_canvas_request_redraw (item->canvas,
|
||||
simplerect->bbox_ulx,
|
||||
simplerect->bbox_uly,
|
||||
simplerect->bbox_lrx+0.5,
|
||||
simplerect->bbox_lry+0.5);
|
||||
simplerect->bbox_ulx,
|
||||
simplerect->bbox_uly,
|
||||
simplerect->bbox_lrx+0.5,
|
||||
simplerect->bbox_lry+0.5);
|
||||
simplerect->full_draw_on_update = FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -622,30 +622,30 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
|||
|
||||
}
|
||||
|
||||
if (simplerect->outline_a > 0) {
|
||||
for (i = 0; i < simplerect->outline_pixels; ++i) {
|
||||
if (simplerect->outline_a > 0) {
|
||||
for (i = 0; i < simplerect->outline_pixels; ++i) {
|
||||
|
||||
if (simplerect->outline_what & 0x1) {
|
||||
if (begin == simplerect->bbox_ulx) {
|
||||
PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin + i, sy, ey);
|
||||
}
|
||||
}
|
||||
if (simplerect->outline_what & 0x1) {
|
||||
if (begin == simplerect->bbox_ulx) {
|
||||
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 (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);
|
||||
}
|
||||
}
|
||||
if (simplerect->outline_what & 0x2) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if (simplerect->outline_what & 0x4) {
|
||||
PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i);
|
||||
}
|
||||
if (simplerect->outline_what & 0x4) {
|
||||
PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else /* SIMPLERECT_FAST_RENDERER */
|
||||
|
|
@ -701,30 +701,30 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
|
|||
#endif
|
||||
}
|
||||
|
||||
if (simplerect->outline_a) {
|
||||
for (i = 0; i < (int) simplerect->outline_pixels; ++i) {
|
||||
if (simplerect->outline_a) {
|
||||
for (i = 0; i < (int) simplerect->outline_pixels; ++i) {
|
||||
|
||||
if (simplerect->outline_what & 0x1) {
|
||||
if (begin == simplerect->bbox_ulx) {
|
||||
PAINT_VERTA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin + i, sy, ey);
|
||||
}
|
||||
}
|
||||
if (simplerect->outline_what & 0x1) {
|
||||
if (begin == simplerect->bbox_ulx) {
|
||||
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 (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);
|
||||
}
|
||||
}
|
||||
if (simplerect->outline_what & 0x2) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
if (simplerect->outline_what & 0x4) {
|
||||
PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i);
|
||||
}
|
||||
if (simplerect->outline_what & 0x4) {
|
||||
PAINT_HORIZA(buf, simplerect->outline_r, simplerect->outline_g, simplerect->outline_b, simplerect->outline_a, begin, end, sy+i);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* SIMPLERECT_FAST_RENDERER */
|
||||
|
||||
|
|
|
|||
|
|
@ -129,206 +129,206 @@ static GnomeCanvasItemClass *parent_class;
|
|||
GType
|
||||
gnome_canvas_waveview_get_type (void)
|
||||
{
|
||||
static GType waveview_type;
|
||||
static GType waveview_type;
|
||||
|
||||
if (!waveview_type) {
|
||||
static const GTypeInfo object_info = {
|
||||
sizeof (GnomeCanvasWaveViewClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gnome_canvas_waveview_class_init,
|
||||
(GClassFinalizeFunc) NULL,
|
||||
NULL, /* class_data */
|
||||
sizeof (GnomeCanvasWaveView),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnome_canvas_waveview_init,
|
||||
NULL /* value_table */
|
||||
};
|
||||
if (!waveview_type) {
|
||||
static const GTypeInfo object_info = {
|
||||
sizeof (GnomeCanvasWaveViewClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) gnome_canvas_waveview_class_init,
|
||||
(GClassFinalizeFunc) NULL,
|
||||
NULL, /* class_data */
|
||||
sizeof (GnomeCanvasWaveView),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) gnome_canvas_waveview_init,
|
||||
NULL /* value_table */
|
||||
};
|
||||
|
||||
waveview_type = g_type_register_static (GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasWaveView",
|
||||
&object_info, 0);
|
||||
}
|
||||
waveview_type = g_type_register_static (GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasWaveView",
|
||||
&object_info, 0);
|
||||
}
|
||||
|
||||
return waveview_type;
|
||||
return waveview_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GtkObjectClass *object_class;
|
||||
GnomeCanvasItemClass *item_class;
|
||||
GObjectClass *gobject_class;
|
||||
GtkObjectClass *object_class;
|
||||
GnomeCanvasItemClass *item_class;
|
||||
|
||||
gobject_class = (GObjectClass *) class;
|
||||
object_class = (GtkObjectClass *) class;
|
||||
item_class = (GnomeCanvasItemClass *) class;
|
||||
gobject_class = (GObjectClass *) class;
|
||||
object_class = (GtkObjectClass *) 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->get_property = gnome_canvas_waveview_get_property;
|
||||
gobject_class->set_property = gnome_canvas_waveview_set_property;
|
||||
gobject_class->get_property = gnome_canvas_waveview_get_property;
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_DATA_SRC,
|
||||
g_param_spec_pointer ("data_src", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_DATA_SRC,
|
||||
g_param_spec_pointer ("data_src", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CHANNEL,
|
||||
g_param_spec_uint ("channel", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CHANNEL,
|
||||
g_param_spec_uint ("channel", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_LENGTH_FUNCTION,
|
||||
g_param_spec_pointer ("length_function", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_LENGTH_FUNCTION,
|
||||
g_param_spec_pointer ("length_function", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_SOURCEFILE_LENGTH_FUNCTION,
|
||||
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
|
||||
(gobject_class,
|
||||
PROP_PEAK_FUNCTION,
|
||||
g_param_spec_pointer ("peak_function", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_PEAK_FUNCTION,
|
||||
g_param_spec_pointer ("peak_function", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_GAIN_FUNCTION,
|
||||
g_param_spec_pointer ("gain_function", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_GAIN_FUNCTION,
|
||||
g_param_spec_pointer ("gain_function", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_GAIN_SRC,
|
||||
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
|
||||
(gobject_class,
|
||||
PROP_CACHE,
|
||||
g_param_spec_pointer ("cache", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CACHE,
|
||||
g_param_spec_pointer ("cache", NULL, NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CACHE_UPDATER,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CACHE_UPDATER,
|
||||
g_param_spec_boolean ("cache_updater", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_SAMPLES_PER_UNIT,
|
||||
g_param_spec_double ("samples_per_unit", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_SAMPLES_PER_UNIT,
|
||||
g_param_spec_double ("samples_per_unit", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_AMPLITUDE_ABOVE_AXIS,
|
||||
g_param_spec_double ("amplitude_above_axis", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_AMPLITUDE_ABOVE_AXIS,
|
||||
g_param_spec_double ("amplitude_above_axis", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_X,
|
||||
g_param_spec_double ("x", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_X,
|
||||
g_param_spec_double ("x", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_Y,
|
||||
g_param_spec_double ("y", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_Y,
|
||||
g_param_spec_double ("y", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_HEIGHT,
|
||||
g_param_spec_double ("height", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_HEIGHT,
|
||||
g_param_spec_double ("height", NULL, NULL,
|
||||
0.0, G_MAXDOUBLE, 0.0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_WAVE_COLOR,
|
||||
g_param_spec_uint ("wave_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_WAVE_COLOR,
|
||||
g_param_spec_uint ("wave_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CLIP_COLOR,
|
||||
g_param_spec_uint ("clip_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_CLIP_COLOR,
|
||||
g_param_spec_uint ("clip_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_ZERO_COLOR,
|
||||
g_param_spec_uint ("zero_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_ZERO_COLOR,
|
||||
g_param_spec_uint ("zero_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_FILL_COLOR,
|
||||
g_param_spec_uint ("fill_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_FILL_COLOR,
|
||||
g_param_spec_uint ("fill_color", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_FILLED,
|
||||
g_param_spec_boolean ("filled", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_FILLED,
|
||||
g_param_spec_boolean ("filled", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_RECTIFIED,
|
||||
g_param_spec_boolean ("rectified", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_RECTIFIED,
|
||||
g_param_spec_boolean ("rectified", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_ZERO_LINE,
|
||||
g_param_spec_boolean ("zero_line", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_ZERO_LINE,
|
||||
g_param_spec_boolean ("zero_line", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_LOGSCALED,
|
||||
g_param_spec_boolean ("logscaled", NULL, NULL,
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_LOGSCALED,
|
||||
g_param_spec_boolean ("logscaled", NULL, NULL,
|
||||
FALSE,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_REGION_START,
|
||||
g_param_spec_uint ("region_start", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_REGION_START,
|
||||
g_param_spec_uint ("region_start", NULL, NULL,
|
||||
0, G_MAXUINT, 0,
|
||||
(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->bounds = gnome_canvas_waveview_bounds;
|
||||
item_class->point = gnome_canvas_waveview_point;
|
||||
item_class->render = gnome_canvas_waveview_render;
|
||||
item_class->draw = gnome_canvas_waveview_draw;
|
||||
item_class->update = gnome_canvas_waveview_update;
|
||||
item_class->bounds = gnome_canvas_waveview_bounds;
|
||||
item_class->point = gnome_canvas_waveview_point;
|
||||
item_class->render = gnome_canvas_waveview_render;
|
||||
item_class->draw = gnome_canvas_waveview_draw;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -838,50 +838,50 @@ gnome_canvas_waveview_set_property (GObject *object,
|
|||
break;
|
||||
|
||||
case PROP_X:
|
||||
if (waveview->x != g_value_get_double (value)) {
|
||||
waveview->x = g_value_get_double (value);
|
||||
if (waveview->x != g_value_get_double (value)) {
|
||||
waveview->x = g_value_get_double (value);
|
||||
calc_bounds = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_Y:
|
||||
if (waveview->y != g_value_get_double (value)) {
|
||||
waveview->y = g_value_get_double (value);
|
||||
if (waveview->y != g_value_get_double (value)) {
|
||||
waveview->y = g_value_get_double (value);
|
||||
calc_bounds = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_HEIGHT:
|
||||
if (waveview->height != fabs (g_value_get_double (value))) {
|
||||
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));
|
||||
redraw = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_WAVE_COLOR:
|
||||
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;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_CLIP_COLOR:
|
||||
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;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_ZERO_COLOR:
|
||||
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;
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_FILL_COLOR:
|
||||
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;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1047,7 +1047,7 @@ gnome_canvas_waveview_get_property (
|
|||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1133,7 +1133,7 @@ gnome_canvas_waveview_gradient_render (GnomeCanvasItem *item,
|
|||
/* begin: render start x (units) */
|
||||
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;
|
||||
|
||||
/* end: render end x (units) */
|
||||
|
|
@ -1681,7 +1681,7 @@ gnome_canvas_waveview_flat_render (GnomeCanvasItem *item,
|
|||
/* begin: render start x (units) */
|
||||
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;
|
||||
|
||||
/* end: render end x (units) */
|
||||
|
|
|
|||
|
|
@ -48,17 +48,17 @@ typedef struct _GnomeCanvasWaveViewCache GnomeCanvasWaveViewCache;
|
|||
|
||||
struct _GnomeCanvasWaveViewCacheEntry
|
||||
{
|
||||
float min;
|
||||
float max;
|
||||
float min;
|
||||
float max;
|
||||
};
|
||||
|
||||
struct _GnomeCanvasWaveViewCache
|
||||
{
|
||||
GnomeCanvasWaveViewCacheEntry* data;
|
||||
guint32 allocated;
|
||||
guint64 data_size;
|
||||
gulong start;
|
||||
gulong end;
|
||||
GnomeCanvasWaveViewCacheEntry* data;
|
||||
guint32 allocated;
|
||||
guint64 data_size;
|
||||
gulong start;
|
||||
gulong end;
|
||||
};
|
||||
|
||||
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
|
||||
{
|
||||
GnomeCanvasItem item;
|
||||
GnomeCanvasItem item;
|
||||
|
||||
GnomeCanvasWaveViewCache *cache;
|
||||
gboolean cache_updater;
|
||||
gint screen_width;
|
||||
GnomeCanvasWaveViewCache *cache;
|
||||
gboolean cache_updater;
|
||||
gint screen_width;
|
||||
|
||||
void *data_src;
|
||||
guint32 channel;
|
||||
waveview_peak_function_t peak_function;
|
||||
waveview_length_function_t length_function;
|
||||
waveview_sourcefile_length_function_t sourcefile_length_function;
|
||||
waveview_gain_curve_function_t gain_curve_function;
|
||||
void *gain_src;
|
||||
void *data_src;
|
||||
guint32 channel;
|
||||
waveview_peak_function_t peak_function;
|
||||
waveview_length_function_t length_function;
|
||||
waveview_sourcefile_length_function_t sourcefile_length_function;
|
||||
waveview_gain_curve_function_t gain_curve_function;
|
||||
void *gain_src;
|
||||
|
||||
/** x-axis: samples per canvas unit. */
|
||||
double samples_per_unit;
|
||||
/** x-axis: samples per canvas unit. */
|
||||
double samples_per_unit;
|
||||
|
||||
/** y-axis: amplitude_above_axis.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* larger values will expand the vertical scale, cutting off the peaks/troughs.
|
||||
* smaller values will decrease the vertical scale, moving peaks/troughs toward
|
||||
* the middle of the area assigned to the waveview.
|
||||
*/
|
||||
double amplitude_above_axis;
|
||||
/** y-axis: amplitude_above_axis.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* larger values will expand the vertical scale, cutting off the peaks/troughs.
|
||||
* smaller values will decrease the vertical scale, moving peaks/troughs toward
|
||||
* the middle of the area assigned to the waveview.
|
||||
*/
|
||||
double amplitude_above_axis;
|
||||
|
||||
double x;
|
||||
double y;
|
||||
double height;
|
||||
double half_height;
|
||||
uint32_t wave_color;
|
||||
uint32_t clip_color;
|
||||
uint32_t zero_color;
|
||||
uint32_t fill_color;
|
||||
double x;
|
||||
double y;
|
||||
double height;
|
||||
double half_height;
|
||||
uint32_t wave_color;
|
||||
uint32_t clip_color;
|
||||
uint32_t zero_color;
|
||||
uint32_t fill_color;
|
||||
|
||||
char filled;
|
||||
char rectified;
|
||||
char zero_line;
|
||||
char logscaled;
|
||||
char filled;
|
||||
char rectified;
|
||||
char zero_line;
|
||||
char logscaled;
|
||||
|
||||
/* These are updated by the update() routine
|
||||
to optimize the render() routine, which may
|
||||
be called several times after a single update().
|
||||
*/
|
||||
/* These are updated by the update() routine
|
||||
to optimize the render() routine, which may
|
||||
be called several times after a single update().
|
||||
*/
|
||||
|
||||
int32_t bbox_ulx;
|
||||
int32_t bbox_uly;
|
||||
int32_t bbox_lrx;
|
||||
int32_t bbox_lry;
|
||||
unsigned char wave_r, wave_g, wave_b, wave_a;
|
||||
unsigned char clip_r, clip_g, clip_b, clip_a;
|
||||
unsigned char fill_r, fill_g, fill_b, fill_a;
|
||||
uint32_t samples;
|
||||
uint32_t region_start;
|
||||
int32_t reload_cache_in_render;
|
||||
int32_t bbox_ulx;
|
||||
int32_t bbox_uly;
|
||||
int32_t bbox_lrx;
|
||||
int32_t bbox_lry;
|
||||
unsigned char wave_r, wave_g, wave_b, wave_a;
|
||||
unsigned char clip_r, clip_g, clip_b, clip_a;
|
||||
unsigned char fill_r, fill_g, fill_b, fill_a;
|
||||
uint32_t samples;
|
||||
uint32_t region_start;
|
||||
int32_t reload_cache_in_render;
|
||||
};
|
||||
|
||||
struct _GnomeCanvasWaveViewClass {
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
#include "clock_group.h"
|
||||
|
||||
ClockGroup::ClockGroup ()
|
||||
: ignore_changes (false)
|
||||
, _clock_mode (AudioClock::Frames)
|
||||
: ignore_changes (false)
|
||||
, _clock_mode (AudioClock::Frames)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -32,35 +32,35 @@ ClockGroup::~ClockGroup()
|
|||
void
|
||||
ClockGroup::add (AudioClock& clock)
|
||||
{
|
||||
if (clocks.insert (&clock).second) {
|
||||
clock.mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &ClockGroup::one_clock_changed), &clock));
|
||||
clock.set_mode (_clock_mode);
|
||||
}
|
||||
if (clocks.insert (&clock).second) {
|
||||
clock.mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &ClockGroup::one_clock_changed), &clock));
|
||||
clock.set_mode (_clock_mode);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ClockGroup::remove (AudioClock& clock)
|
||||
{
|
||||
clocks.erase (&clock);
|
||||
clocks.erase (&clock);
|
||||
}
|
||||
|
||||
void
|
||||
ClockGroup::one_clock_changed (AudioClock* clock)
|
||||
{
|
||||
if (!ignore_changes) {
|
||||
set_clock_mode (clock->mode());
|
||||
}
|
||||
if (!ignore_changes) {
|
||||
set_clock_mode (clock->mode());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ClockGroup::set_clock_mode (AudioClock::Mode mode)
|
||||
{
|
||||
_clock_mode = mode;
|
||||
_clock_mode = mode;
|
||||
|
||||
ignore_changes = true;
|
||||
for (std::set<AudioClock*>::iterator c = clocks.begin(); c != clocks.end(); ++c) {
|
||||
(*c)->set_mode (mode);
|
||||
}
|
||||
ignore_changes = false;
|
||||
ignore_changes = true;
|
||||
for (std::set<AudioClock*>::iterator c = clocks.begin(); c != clocks.end(); ++c) {
|
||||
(*c)->set_mode (mode);
|
||||
}
|
||||
ignore_changes = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,21 +27,21 @@
|
|||
|
||||
class ClockGroup : public sigc::trackable {
|
||||
public:
|
||||
ClockGroup ();
|
||||
~ClockGroup ();
|
||||
ClockGroup ();
|
||||
~ClockGroup ();
|
||||
|
||||
void set_clock_mode (AudioClock::Mode);
|
||||
AudioClock::Mode clock_mode() const { return _clock_mode; }
|
||||
void set_clock_mode (AudioClock::Mode);
|
||||
AudioClock::Mode clock_mode() const { return _clock_mode; }
|
||||
|
||||
void add (AudioClock&);
|
||||
void remove (AudioClock&);
|
||||
void add (AudioClock&);
|
||||
void remove (AudioClock&);
|
||||
|
||||
private:
|
||||
std::set<AudioClock*> clocks;
|
||||
bool ignore_changes;
|
||||
AudioClock::Mode _clock_mode;
|
||||
std::set<AudioClock*> clocks;
|
||||
bool ignore_changes;
|
||||
AudioClock::Mode _clock_mode;
|
||||
|
||||
void one_clock_changed (AudioClock*);
|
||||
void one_clock_changed (AudioClock*);
|
||||
};
|
||||
|
||||
#endif /* __gtk_ardour_clock_group_h__ */
|
||||
|
|
|
|||
|
|
@ -64,18 +64,18 @@ class CrossfadeEditor : public ArdourDialog
|
|||
Gtk::Button* ok_button;
|
||||
|
||||
struct PresetPoint {
|
||||
double x;
|
||||
double y;
|
||||
double x;
|
||||
double y;
|
||||
|
||||
PresetPoint (double a, double b)
|
||||
: x (a), y (b) {}
|
||||
PresetPoint (double a, double b)
|
||||
: x (a), y (b) {}
|
||||
};
|
||||
|
||||
struct Preset : public std::list<PresetPoint> {
|
||||
const char* name;
|
||||
const char* image_name;
|
||||
const char* 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;
|
||||
|
|
@ -93,36 +93,36 @@ class CrossfadeEditor : public ArdourDialog
|
|||
Gtk::VBox vpacker;
|
||||
|
||||
struct Point {
|
||||
~Point();
|
||||
~Point();
|
||||
|
||||
ArdourCanvas::Rectangle* box;
|
||||
ArdourCanvas::PolyLine* curve;
|
||||
double x;
|
||||
double y;
|
||||
ArdourCanvas::Rectangle* box;
|
||||
ArdourCanvas::PolyLine* curve;
|
||||
double x;
|
||||
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 {
|
||||
bool operator() (const CrossfadeEditor::Point* a, const CrossfadeEditor::Point *b) {
|
||||
return a->x < b->x;
|
||||
}
|
||||
bool operator() (const CrossfadeEditor::Point* a, const CrossfadeEditor::Point *b) {
|
||||
return a->x < b->x;
|
||||
}
|
||||
};
|
||||
|
||||
ArdourCanvas::Rectangle* toplevel;
|
||||
ArdourCanvas::GtkCanvas* canvas;
|
||||
|
||||
struct Half {
|
||||
ArdourCanvas::PolyLine* line;
|
||||
ArdourCanvas::Polygon* shading;
|
||||
std::list<Point*> points;
|
||||
ARDOUR::AutomationList normative_curve; /* 0 - 1.0, linear */
|
||||
ARDOUR::AutomationList gain_curve; /* 0 - 2.0, gain mapping */
|
||||
std::vector<ArdourCanvas::WaveView*> waves;
|
||||
ArdourCanvas::PolyLine* line;
|
||||
ArdourCanvas::Polygon* shading;
|
||||
std::list<Point*> points;
|
||||
ARDOUR::AutomationList normative_curve; /* 0 - 1.0, linear */
|
||||
ARDOUR::AutomationList gain_curve; /* 0 - 2.0, gain mapping */
|
||||
std::vector<ArdourCanvas::WaveView*> waves;
|
||||
|
||||
Half();
|
||||
Half();
|
||||
};
|
||||
|
||||
enum WhichFade {
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@ class CrossfadeView : public TimeAxisViewItem
|
|||
{
|
||||
public:
|
||||
CrossfadeView (ArdourCanvas::Container*,
|
||||
RouteTimeAxisView&,
|
||||
boost::shared_ptr<ARDOUR::Crossfade>,
|
||||
double initial_samples_per_pixel,
|
||||
Gdk::Color& basic_color,
|
||||
AudioRegionView& leftview,
|
||||
AudioRegionView& rightview);
|
||||
RouteTimeAxisView&,
|
||||
boost::shared_ptr<ARDOUR::Crossfade>,
|
||||
double initial_samples_per_pixel,
|
||||
Gdk::Color& basic_color,
|
||||
AudioRegionView& leftview,
|
||||
AudioRegionView& rightview);
|
||||
|
||||
~CrossfadeView ();
|
||||
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ void
|
|||
EditNoteDialog::done (int r)
|
||||
{
|
||||
if (r != RESPONSE_ACCEPT) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
/* These calls mean that if a value is entered using the keyboard
|
||||
|
|
|
|||
|
|
@ -845,16 +845,16 @@ Editor::Editor ()
|
|||
|
||||
_show_marker_lines = false;
|
||||
|
||||
/* Button bindings */
|
||||
/* Button bindings */
|
||||
|
||||
button_bindings = new Bindings ("editor-mouse");
|
||||
|
||||
XMLNode* node = button_settings();
|
||||
if (node) {
|
||||
for (XMLNodeList::const_iterator i = node->children().begin(); i != node->children().end(); ++i) {
|
||||
button_bindings->load_operation (**i);
|
||||
}
|
||||
}
|
||||
if (node) {
|
||||
for (XMLNodeList::const_iterator i = node->children().begin(); i != node->children().end(); ++i) {
|
||||
button_bindings->load_operation (**i);
|
||||
}
|
||||
}
|
||||
|
||||
constructed = true;
|
||||
|
||||
|
|
@ -4716,7 +4716,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
|
|||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
@ -4737,7 +4737,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
|
|||
} else {
|
||||
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;
|
||||
|
||||
case EditAtSelectedMarker:
|
||||
|
|
@ -4750,7 +4750,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
|
|||
} else {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -4765,7 +4765,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
|
|||
snap_mf.frame = where;
|
||||
snap_to (snap_mf);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -583,13 +583,13 @@ private:
|
|||
typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
|
||||
|
||||
struct VisualState {
|
||||
VisualState (bool with_tracks);
|
||||
~VisualState ();
|
||||
double y_position;
|
||||
framecnt_t samples_per_pixel;
|
||||
framepos_t leftmost_frame;
|
||||
Editing::ZoomFocus zoom_focus;
|
||||
GUIObjectState* gui_state;
|
||||
VisualState (bool with_tracks);
|
||||
~VisualState ();
|
||||
double y_position;
|
||||
framecnt_t samples_per_pixel;
|
||||
framepos_t leftmost_frame;
|
||||
Editing::ZoomFocus zoom_focus;
|
||||
GUIObjectState* gui_state;
|
||||
};
|
||||
|
||||
std::list<VisualState*> undo_visual_stack;
|
||||
|
|
|
|||
|
|
@ -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_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 */
|
||||
|
|
@ -1694,7 +1694,7 @@ Editor::parameter_changed (std::string p)
|
|||
_group_tabs->hide ();
|
||||
}
|
||||
|
||||
reset_controls_layout_width ();
|
||||
reset_controls_layout_width ();
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleGroupTabs"));
|
||||
if (act) {
|
||||
|
|
|
|||
|
|
@ -629,7 +629,7 @@ Editor::embed_sndfiles (vector<string> paths,
|
|||
SoundFileInfo finfo;
|
||||
|
||||
CursorContext::Handle cursor_ctx = CursorContext::create(*this, _cursors->wait);
|
||||
gdk_flush ();
|
||||
gdk_flush ();
|
||||
|
||||
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);
|
||||
|
||||
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<AudioSource> as = boost::dynamic_pointer_cast<AudioSource> (s);
|
||||
const boost::shared_ptr<Source> s (ar->sources().front());
|
||||
const boost::shared_ptr<AudioSource> as = boost::dynamic_pointer_cast<AudioSource> (s);
|
||||
|
||||
assert (as);
|
||||
assert (as);
|
||||
|
||||
if (as->natural_position() != 0) {
|
||||
pos = as->natural_position();
|
||||
} else if (target_tracks == 1) {
|
||||
/* hmm, no timestamp available, put it after the previous region
|
||||
*/
|
||||
if (n == 0) {
|
||||
pos = get_preferred_edit_position ();
|
||||
} else {
|
||||
pos += rlen;
|
||||
}
|
||||
} else {
|
||||
pos = get_preferred_edit_position ();
|
||||
}
|
||||
} else {
|
||||
/* should really get first position in MIDI file, but for now, use edit position*/
|
||||
pos = get_preferred_edit_position ();
|
||||
}
|
||||
}
|
||||
if (as->natural_position() != 0) {
|
||||
pos = as->natural_position();
|
||||
} else if (target_tracks == 1) {
|
||||
/* hmm, no timestamp available, put it after the previous region
|
||||
*/
|
||||
if (n == 0) {
|
||||
pos = get_preferred_edit_position ();
|
||||
} else {
|
||||
pos += rlen;
|
||||
}
|
||||
} else {
|
||||
pos = get_preferred_edit_position ();
|
||||
}
|
||||
} else {
|
||||
/* should really get first position in MIDI file, but for now, use edit position*/
|
||||
pos = get_preferred_edit_position ();
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
list<boost::shared_ptr<MidiTrack> > mt (
|
||||
_session->new_midi_track (ChanCount (DataType::MIDI, 1),
|
||||
ChanCount (DataType::MIDI, 1),
|
||||
ChanCount (DataType::MIDI, 1),
|
||||
Config->get_strict_io () || Profile->get_mixbus (),
|
||||
instrument, (Plugin::PresetRecord*) 0,
|
||||
(RouteGroup*) 0,
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ Editor::initialize_canvas ()
|
|||
* uppermost (last) group with hv_scroll_group as a parent
|
||||
*/
|
||||
_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 */
|
||||
|
||||
|
|
@ -317,17 +317,17 @@ Editor::reset_controls_layout_width ()
|
|||
edit_controls_vbox.size_request (req);
|
||||
w = req.width;
|
||||
|
||||
if (_group_tabs->is_visible()) {
|
||||
if (_group_tabs->is_visible()) {
|
||||
_group_tabs->size_request (req);
|
||||
w += req.width;
|
||||
}
|
||||
w += req.width;
|
||||
}
|
||||
|
||||
/* the controls layout has no horizontal scrolling, its visible
|
||||
width is always equal to the total width of its contents.
|
||||
*/
|
||||
/* the controls layout has no horizontal scrolling, its visible
|
||||
width is always equal to the total width of its contents.
|
||||
*/
|
||||
|
||||
controls_layout.property_width() = w;
|
||||
controls_layout.property_width_request() = w;
|
||||
controls_layout.property_width() = w;
|
||||
controls_layout.property_width_request() = w;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -345,11 +345,11 @@ Editor::reset_controls_layout_height (int32_t h)
|
|||
|
||||
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.
|
||||
*/
|
||||
*/
|
||||
|
||||
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);
|
||||
|
||||
do_import (midi_paths, Editing::ImportSerializeFiles, ImportToTrack,
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, frame);
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, frame);
|
||||
|
||||
if (UIConfiguration::instance().get_only_copy_imported_files() || copy) {
|
||||
do_import (audio_paths, Editing::ImportSerializeFiles, Editing::ImportToTrack,
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, frame);
|
||||
SrcBest, SMFTrackName, SMFTempoIgnore, frame);
|
||||
} else {
|
||||
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,
|
||||
alloc.get_x(), alloc.get_y(),
|
||||
wx, wy);
|
||||
wx, wy);
|
||||
|
||||
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,
|
||||
alloc.get_x(), alloc.get_y(),
|
||||
wx, wy);
|
||||
wx, wy);
|
||||
|
||||
scrolling_boundary = ArdourCanvas::Rect (wx, wy, wx + alloc.get_width(), wy + alloc.get_height());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ Editor::track_canvas_button_press_event (GdkEventButton *event)
|
|||
begin_reversible_selection_op (X_("Clear Selection Click (track canvas)"));
|
||||
selection->clear ();
|
||||
commit_reversible_selection_op();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -179,10 +179,10 @@ bool
|
|||
Editor::track_canvas_button_release_event (GdkEventButton *event)
|
||||
{
|
||||
if (!Keyboard::is_context_menu_event (event)) {
|
||||
if (_drags->active ()) {
|
||||
_drags->end_grab ((GdkEvent*) event);
|
||||
}
|
||||
}
|
||||
if (_drags->active ()) {
|
||||
_drags->end_grab ((GdkEvent*) event);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -641,9 +641,9 @@ Editor::canvas_fade_out_handle_event (GdkEvent *event, ArdourCanvas::Item* item,
|
|||
}
|
||||
|
||||
struct DescendingRegionLayerSorter {
|
||||
bool operator()(boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
|
||||
return a->layer() > b->layer();
|
||||
}
|
||||
bool operator()(boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
|
||||
return a->layer() > b->layer();
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
|
|
@ -1214,8 +1214,8 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const& context,
|
|||
|
||||
if (tv.first == 0
|
||||
&& (
|
||||
boost::dynamic_pointer_cast<AudioRegion> (region) != 0 ||
|
||||
boost::dynamic_pointer_cast<MidiRegion> (region) != 0
|
||||
boost::dynamic_pointer_cast<AudioRegion> (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
|
||||
Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/,
|
||||
int x, int y,
|
||||
const SelectionData& /*data*/,
|
||||
guint /*info*/, guint /*time*/)
|
||||
int x, int y,
|
||||
const SelectionData& /*data*/,
|
||||
guint /*info*/, guint /*time*/)
|
||||
{
|
||||
GdkEvent event;
|
||||
double px;
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ class Editor;
|
|||
|
||||
class EditorCursor {
|
||||
public:
|
||||
EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
|
||||
EditorCursor (Editor&);
|
||||
~EditorCursor ();
|
||||
EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
|
||||
EditorCursor (Editor&);
|
||||
~EditorCursor ();
|
||||
|
||||
void set_position (framepos_t);
|
||||
|
||||
|
|
|
|||
|
|
@ -4683,7 +4683,7 @@ MarkerDrag::aborted (bool movement_occurred)
|
|||
void
|
||||
MarkerDrag::update_item (Location*)
|
||||
{
|
||||
/* noop */
|
||||
/* noop */
|
||||
}
|
||||
|
||||
ControlPointDrag::ControlPointDrag (Editor* e, ArdourCanvas::Item* i)
|
||||
|
|
@ -5846,7 +5846,7 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
case CreateSkipMarker:
|
||||
case CreateRangeMarker:
|
||||
case CreateCDMarker:
|
||||
{
|
||||
{
|
||||
XMLNode &before = _editor->session()->locations()->get_state();
|
||||
if (_operation == CreateSkipMarker) {
|
||||
_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->commit_reversible_command ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
case CreateTransportMarker:
|
||||
// popup menu to pick loop or punch
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public:
|
|||
bool end_grab (GdkEvent *);
|
||||
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 */
|
||||
bool ending () const {
|
||||
|
|
@ -128,7 +128,7 @@ private:
|
|||
class Drag
|
||||
{
|
||||
public:
|
||||
Drag (Editor *, ArdourCanvas::Item *, bool trackview_only = true);
|
||||
Drag (Editor *, ArdourCanvas::Item *, bool trackview_only = true);
|
||||
virtual ~Drag () {}
|
||||
|
||||
void set_manager (DragManager* m) {
|
||||
|
|
@ -147,8 +147,8 @@ public:
|
|||
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;
|
||||
|
||||
bool was_double_click() const { return _was_double_click; }
|
||||
void set_double_click (bool yn) { _was_double_click = yn; }
|
||||
bool was_double_click() const { return _was_double_click; }
|
||||
void set_double_click (bool yn) { _was_double_click = yn; }
|
||||
|
||||
/** Called to start a grab of an item.
|
||||
* @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 _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 _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_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
|
||||
|
|
@ -904,7 +904,7 @@ public:
|
|||
private:
|
||||
void fake_locate (framepos_t);
|
||||
|
||||
EditorCursor& _cursor;
|
||||
EditorCursor& _cursor;
|
||||
bool _stop; ///< true to stop the transport on starting the drag, otherwise false
|
||||
double _grab_zoom; ///< editor frames per unit when our grab started
|
||||
};
|
||||
|
|
@ -949,7 +949,7 @@ public:
|
|||
class MarkerDrag : public Drag
|
||||
{
|
||||
public:
|
||||
MarkerDrag (Editor *, ArdourCanvas::Item *);
|
||||
MarkerDrag (Editor *, ArdourCanvas::Item *);
|
||||
~MarkerDrag ();
|
||||
|
||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||
|
|
@ -972,16 +972,16 @@ private:
|
|||
|
||||
ArdourMarker* _marker; ///< marker being dragged
|
||||
bool _selection_changed;
|
||||
struct CopiedLocationMarkerInfo {
|
||||
ARDOUR::Location* location;
|
||||
std::vector<ArdourMarker*> markers;
|
||||
bool move_both;
|
||||
CopiedLocationMarkerInfo (ARDOUR::Location* l, ArdourMarker* m);
|
||||
struct CopiedLocationMarkerInfo {
|
||||
ARDOUR::Location* location;
|
||||
std::vector<ArdourMarker*> markers;
|
||||
bool move_both;
|
||||
CopiedLocationMarkerInfo (ARDOUR::Location* l, ArdourMarker* m);
|
||||
};
|
||||
|
||||
typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
|
||||
CopiedLocationInfo _copied_locations;
|
||||
ArdourCanvas::Points _points;
|
||||
typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
|
||||
CopiedLocationInfo _copied_locations;
|
||||
ArdourCanvas::Points _points;
|
||||
};
|
||||
|
||||
/** Control point drag */
|
||||
|
|
@ -1004,7 +1004,7 @@ private:
|
|||
double _fixed_grab_y;
|
||||
double _cumulative_x_drag;
|
||||
double _cumulative_y_drag;
|
||||
bool _pushing;
|
||||
bool _pushing;
|
||||
uint32_t _final_index;
|
||||
static double _zero_gain_fraction;
|
||||
};
|
||||
|
|
@ -1172,8 +1172,8 @@ private:
|
|||
bool _add;
|
||||
TrackSelection _track_selection_at_start;
|
||||
bool _time_selection_at_start;
|
||||
framepos_t start_at_start;
|
||||
framepos_t end_at_start;
|
||||
framepos_t start_at_start;
|
||||
framepos_t end_at_start;
|
||||
};
|
||||
|
||||
/** Range marker drag */
|
||||
|
|
@ -1261,7 +1261,7 @@ private:
|
|||
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
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -741,7 +741,7 @@ Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent*)
|
|||
Location* loc = find_location_from_marker (marker, is_start);
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
if (!loc)
|
||||
return;
|
||||
|
||||
if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range())
|
||||
if (!loc) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ArdourPrompter dialog (true);
|
||||
string txt;
|
||||
|
|
@ -1726,7 +1728,7 @@ Editor::update_punch_range_view ()
|
|||
|
||||
} else {
|
||||
|
||||
transport_punch_range_rect->hide();
|
||||
transport_punch_range_rect->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1747,9 +1749,9 @@ Editor::marker_selection_changed ()
|
|||
}
|
||||
|
||||
struct SortLocationsByPosition {
|
||||
bool operator() (Location* a, Location* b) {
|
||||
return a->start() < b->start();
|
||||
}
|
||||
bool operator() (Location* a, Location* b) {
|
||||
return a->start() < b->start();
|
||||
}
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -85,18 +85,18 @@ bool
|
|||
Editor::mouse_frame (framepos_t& where, bool& in_track_canvas) const
|
||||
{
|
||||
/* 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
|
||||
if the pointer is in a menu, the return window from the call will be the
|
||||
the regular subwindow *under* the menu.
|
||||
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
|
||||
the regular subwindow *under* the menu.
|
||||
|
||||
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
|
||||
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().
|
||||
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
|
||||
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().
|
||||
*/
|
||||
|
||||
if (!within_track_canvas) {
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
int x, y;
|
||||
|
|
@ -1300,7 +1300,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
|
|||
break;
|
||||
|
||||
default:
|
||||
return button_press_dispatch (&event->button);
|
||||
return button_press_dispatch (&event->button);
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
@ -1342,24 +1342,24 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
return true;
|
||||
}
|
||||
|
||||
bool were_dragging = false;
|
||||
bool were_dragging = false;
|
||||
|
||||
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 ()) {
|
||||
bool const r = _drags->end_grab (event);
|
||||
if (r) {
|
||||
/* grab dragged, so do nothing else */
|
||||
return true;
|
||||
}
|
||||
if (_drags->active ()) {
|
||||
bool const r = _drags->end_grab (event);
|
||||
if (r) {
|
||||
/* grab dragged, so do nothing else */
|
||||
return true;
|
||||
}
|
||||
|
||||
were_dragging = true;
|
||||
}
|
||||
were_dragging = true;
|
||||
}
|
||||
|
||||
update_region_layering_order_editor ();
|
||||
}
|
||||
update_region_layering_order_editor ();
|
||||
}
|
||||
|
||||
/* 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);
|
||||
|
||||
return true;
|
||||
|
|
@ -1722,7 +1722,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
|||
MeterMarker* m_marker = 0;
|
||||
TempoMarker* t_marker = 0;
|
||||
double fraction;
|
||||
bool ret = true;
|
||||
bool ret = true;
|
||||
|
||||
/* by the time we reach here, entered_regionview and entered trackview
|
||||
* will have already been set as appropriate. Things are done this
|
||||
|
|
|
|||
|
|
@ -3139,8 +3139,8 @@ Editor::separate_regions_between (const TimeSelection& ts)
|
|||
if (!latest_regionviews.empty()) {
|
||||
|
||||
rtv->view()->foreach_regionview (sigc::bind (
|
||||
sigc::ptr_fun (add_if_covered),
|
||||
&(*t), &new_selection));
|
||||
sigc::ptr_fun (add_if_covered),
|
||||
&(*t), &new_selection));
|
||||
|
||||
if (!in_command) {
|
||||
begin_reversible_command (_("separate"));
|
||||
|
|
@ -3274,10 +3274,10 @@ Editor::separate_under_selected_regions ()
|
|||
|
||||
boost::shared_ptr<Playlist> playlist = (*rl)->playlist();
|
||||
|
||||
if (!playlist) {
|
||||
if (!playlist) {
|
||||
// is this check necessary?
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
vector<PlaylistState>::iterator i;
|
||||
|
||||
|
|
@ -3853,26 +3853,26 @@ Editor::trim_to_region(bool 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) {
|
||||
continue;
|
||||
}
|
||||
if (!next_region) {
|
||||
continue;
|
||||
}
|
||||
|
||||
region->trim_end((framepos_t) ( (next_region->first_frame() - 1) * speed));
|
||||
arv->region_changed (PropertyChange (ARDOUR::Properties::length));
|
||||
region->trim_end((framepos_t) ( (next_region->first_frame() - 1) * speed));
|
||||
arv->region_changed (PropertyChange (ARDOUR::Properties::length));
|
||||
}
|
||||
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){
|
||||
continue;
|
||||
}
|
||||
if(!next_region){
|
||||
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) {
|
||||
|
|
@ -3945,8 +3945,8 @@ Editor::freeze_route ()
|
|||
|
||||
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"
|
||||
"Freezing will only process the signal as far as the first send/insert/return."),
|
||||
clicked_routeview->track()->name()), true, MESSAGE_INFO, BUTTONS_NONE, true);
|
||||
"Freezing will only process the signal as far as the first send/insert/return."),
|
||||
clicked_routeview->track()->name()), true, MESSAGE_INFO, BUTTONS_NONE, true);
|
||||
|
||||
d.add_button (_("Freeze anyway"), Gtk::RESPONSE_OK);
|
||||
d.add_button (_("Don't freeze"), Gtk::RESPONSE_CANCEL);
|
||||
|
|
@ -4463,10 +4463,10 @@ Editor::remove_selected_regions ()
|
|||
|
||||
boost::shared_ptr<Playlist> playlist = (*rl)->playlist();
|
||||
|
||||
if (!playlist) {
|
||||
if (!playlist) {
|
||||
// is this check necessary?
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* get_regions_from_selection_and_entered() guarantees that
|
||||
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
|
||||
"greedy" paste from one automation type to another. */
|
||||
|
||||
PasteContext ctx(paste_count, times, ItemCounts(), true);
|
||||
ts.front()->paste (position, *cut_buffer, ctx, sub_num);
|
||||
PasteContext ctx(paste_count, times, ItemCounts(), true);
|
||||
ts.front()->paste (position, *cut_buffer, ctx, sub_num);
|
||||
|
||||
} else {
|
||||
|
||||
|
|
@ -5041,7 +5041,7 @@ Editor::remove_last_capture ()
|
|||
|
||||
if (Config->get_verify_remove_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 (_("Yes, destroy it."));
|
||||
|
|
@ -5296,7 +5296,7 @@ Editor::strip_region_silence ()
|
|||
|
||||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*> (*i);
|
||||
if (arv) {
|
||||
if (arv) {
|
||||
audio_only.push_back (arv);
|
||||
}
|
||||
}
|
||||
|
|
@ -7658,7 +7658,7 @@ Editor::do_remove_time ()
|
|||
|
||||
void
|
||||
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) {
|
||||
error << (_("Cannot insert or delete time when in Lock edit.")) << endmsg;
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ using namespace Editing;
|
|||
using Gtkmm2ext::Keyboard;
|
||||
|
||||
struct ColumnInfo {
|
||||
int index;
|
||||
const char* label;
|
||||
const char* tooltip;
|
||||
int index;
|
||||
const char* label;
|
||||
const char* tooltip;
|
||||
};
|
||||
|
||||
EditorRegions::EditorRegions (Editor* e)
|
||||
|
|
@ -495,8 +495,8 @@ EditorRegions::remove_unused_regions ()
|
|||
return;
|
||||
}
|
||||
|
||||
prompt = _("Do you really want to remove unused regions?"
|
||||
"\n(This is destructive and cannot be undone)");
|
||||
prompt = _("Do you really want to remove unused regions?"
|
||||
"\n(This is destructive and cannot be undone)");
|
||||
|
||||
choices.push_back (_("No, do nothing."));
|
||||
choices.push_back (_("Yes, remove."));
|
||||
|
|
@ -1031,7 +1031,7 @@ EditorRegions::populate_row_name (boost::shared_ptr<Region> region, TreeModel::R
|
|||
void
|
||||
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());
|
||||
} else {
|
||||
row[_columns.path] = Gtkmm2ext::markup_escape_text (region->source()->name());
|
||||
|
|
@ -1056,10 +1056,10 @@ EditorRegions::set_full (bool f)
|
|||
{
|
||||
if (f) {
|
||||
_display.expand_all ();
|
||||
expanded = true;
|
||||
expanded = true;
|
||||
} else {
|
||||
_display.collapse_all ();
|
||||
expanded = false;
|
||||
expanded = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1303,9 +1303,9 @@ EditorRegions::selection_mapover (sigc::slot<void,boost::shared_ptr<Region> > sl
|
|||
|
||||
void
|
||||
EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context,
|
||||
int x, int y,
|
||||
const SelectionData& data,
|
||||
guint info, guint time)
|
||||
int x, int y,
|
||||
const SelectionData& data,
|
||||
guint info, guint time)
|
||||
{
|
||||
vector<string> paths;
|
||||
|
||||
|
|
|
|||
|
|
@ -127,9 +127,9 @@ private:
|
|||
|
||||
bool selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
|
||||
|
||||
Gtk::Widget* old_focus;
|
||||
Gtk::CellEditable* name_editable;
|
||||
void name_editing_started (Gtk::CellEditable*, const Glib::ustring&);
|
||||
Gtk::Widget* old_focus;
|
||||
Gtk::CellEditable* name_editable;
|
||||
void name_editing_started (Gtk::CellEditable*, const Glib::ustring&);
|
||||
|
||||
void name_edit (const std::string&, const std::string&);
|
||||
void locked_changed (std::string const &);
|
||||
|
|
@ -140,33 +140,33 @@ private:
|
|||
bool key_press (GdkEventKey *);
|
||||
bool button_press (GdkEventButton *);
|
||||
|
||||
bool focus_in (GdkEventFocus*);
|
||||
bool focus_out (GdkEventFocus*);
|
||||
bool enter_notify (GdkEventCrossing*);
|
||||
bool leave_notify (GdkEventCrossing*);
|
||||
bool focus_in (GdkEventFocus*);
|
||||
bool focus_out (GdkEventFocus*);
|
||||
bool enter_notify (GdkEventCrossing*);
|
||||
bool leave_notify (GdkEventCrossing*);
|
||||
|
||||
void show_context_menu (int button, int time);
|
||||
|
||||
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 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_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_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_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_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_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_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_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_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_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_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_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_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_source (boost::shared_ptr<ARDOUR::Region> region, Gtk::TreeModel::Row const& row);
|
||||
|
||||
void update_row (boost::shared_ptr<ARDOUR::Region>);
|
||||
void update_all_rows ();
|
||||
|
|
@ -215,7 +215,7 @@ private:
|
|||
PBD::ScopedConnection editor_freeze_connection;
|
||||
PBD::ScopedConnection editor_thaw_connection;
|
||||
|
||||
bool expanded;
|
||||
bool expanded;
|
||||
};
|
||||
|
||||
#endif /* __gtk_ardour_editor_regions_h__ */
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ using namespace Gtk;
|
|||
using Gtkmm2ext::Keyboard;
|
||||
|
||||
struct ColumnInfo {
|
||||
int index;
|
||||
const char* label;
|
||||
const char* tooltip;
|
||||
int index;
|
||||
const char* label;
|
||||
const char* tooltip;
|
||||
};
|
||||
|
||||
EditorRouteGroups::EditorRouteGroups (Editor* e)
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
struct Columns : public Gtk::TreeModel::ColumnRecord {
|
||||
struct Columns : public Gtk::TreeModel::ColumnRecord {
|
||||
|
||||
Columns () {
|
||||
Columns () {
|
||||
add (gdkcolor);
|
||||
add (text);
|
||||
add (is_visible);
|
||||
|
|
@ -54,11 +54,11 @@ private:
|
|||
add (active_shared);
|
||||
add (active_state);
|
||||
add (routegroup);
|
||||
}
|
||||
}
|
||||
|
||||
Gtk::TreeModelColumn<Gdk::Color> gdkcolor;
|
||||
Gtk::TreeModelColumn<std::string> text;
|
||||
Gtk::TreeModelColumn<bool> is_visible;
|
||||
Gtk::TreeModelColumn<Gdk::Color> gdkcolor;
|
||||
Gtk::TreeModelColumn<std::string> text;
|
||||
Gtk::TreeModelColumn<bool> is_visible;
|
||||
Gtk::TreeModelColumn<bool> gain;
|
||||
Gtk::TreeModelColumn<bool> gain_relative;
|
||||
Gtk::TreeModelColumn<bool> mute;
|
||||
|
|
@ -68,7 +68,7 @@ private:
|
|||
Gtk::TreeModelColumn<bool> select;
|
||||
Gtk::TreeModelColumn<bool> active_shared;
|
||||
Gtk::TreeModelColumn<bool> active_state;
|
||||
Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
|
||||
Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
|
||||
};
|
||||
|
||||
Columns _columns;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ Editor::initialize_rulers ()
|
|||
minsec_nmarks = 0;
|
||||
|
||||
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);
|
||||
CANVAS_DEBUG_NAME (bbt_ruler, "bbt ruler");
|
||||
timecode_nmarks = 0;
|
||||
|
|
@ -681,7 +681,7 @@ Editor::update_tempo_based_rulers ()
|
|||
void
|
||||
Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper)
|
||||
{
|
||||
using namespace std;
|
||||
using namespace std;
|
||||
|
||||
framepos_t spacer;
|
||||
framepos_t fr;
|
||||
|
|
@ -771,22 +771,22 @@ Editor::set_timecode_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
timecode_nmarks = 2 + 24;
|
||||
} else {
|
||||
|
||||
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 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 */
|
||||
|
||||
/* 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
|
||||
the width and set lower + upper arguments to this function to match that.
|
||||
/* 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
|
||||
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
|
||||
substantially (basically anything from 24hrs+ to several billion years)
|
||||
trying to decide which tick marks to show does require us to know
|
||||
about the available width.
|
||||
*/
|
||||
But in this case, where the range defined by lower and uppper can vary
|
||||
substantially (basically anything from 24hrs+ to several billion years)
|
||||
trying to decide which tick marks to show does require us to know
|
||||
about the available width.
|
||||
*/
|
||||
|
||||
timecode_nmarks = _track_canvas->width() / text_width_rough_guess;
|
||||
timecode_ruler_scale = timecode_show_many_hours;
|
||||
timecode_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / timecode_nmarks));
|
||||
timecode_ruler_scale = timecode_show_many_hours;
|
||||
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) {
|
||||
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);
|
||||
mark.label = buf;
|
||||
mark.position = pos;
|
||||
marks.push_back (mark);
|
||||
++n;
|
||||
mark.label = buf;
|
||||
mark.position = pos;
|
||||
marks.push_back (mark);
|
||||
++n;
|
||||
}
|
||||
/* 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).
|
||||
|
|
@ -994,69 +994,69 @@ Editor::compute_bbt_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
bbt_beat_subdivision = 2;
|
||||
break;
|
||||
case SnapToBeatDiv3:
|
||||
bbt_beat_subdivision = 3;
|
||||
bbt_beat_subdivision = 3;
|
||||
break;
|
||||
case SnapToBeatDiv4:
|
||||
bbt_beat_subdivision = 4;
|
||||
bbt_beat_subdivision = 4;
|
||||
break;
|
||||
case SnapToBeatDiv5:
|
||||
bbt_beat_subdivision = 5;
|
||||
bbt_beat_subdivision = 5;
|
||||
bbt_accent_modulo = 2; // XXX YIKES
|
||||
break;
|
||||
case SnapToBeatDiv6:
|
||||
bbt_beat_subdivision = 6;
|
||||
bbt_beat_subdivision = 6;
|
||||
bbt_accent_modulo = 2; // XXX YIKES
|
||||
break;
|
||||
case SnapToBeatDiv7:
|
||||
bbt_beat_subdivision = 7;
|
||||
bbt_beat_subdivision = 7;
|
||||
bbt_accent_modulo = 2; // XXX YIKES
|
||||
break;
|
||||
case SnapToBeatDiv8:
|
||||
bbt_beat_subdivision = 8;
|
||||
bbt_beat_subdivision = 8;
|
||||
bbt_accent_modulo = 2;
|
||||
break;
|
||||
case SnapToBeatDiv10:
|
||||
bbt_beat_subdivision = 10;
|
||||
bbt_beat_subdivision = 10;
|
||||
bbt_accent_modulo = 2; // XXX YIKES
|
||||
break;
|
||||
case SnapToBeatDiv12:
|
||||
bbt_beat_subdivision = 12;
|
||||
bbt_beat_subdivision = 12;
|
||||
bbt_accent_modulo = 3;
|
||||
break;
|
||||
case SnapToBeatDiv14:
|
||||
bbt_beat_subdivision = 14;
|
||||
bbt_beat_subdivision = 14;
|
||||
bbt_accent_modulo = 3; // XXX YIKES!
|
||||
break;
|
||||
case SnapToBeatDiv16:
|
||||
bbt_beat_subdivision = 16;
|
||||
bbt_beat_subdivision = 16;
|
||||
bbt_accent_modulo = 4;
|
||||
break;
|
||||
case SnapToBeatDiv20:
|
||||
bbt_beat_subdivision = 20;
|
||||
bbt_beat_subdivision = 20;
|
||||
bbt_accent_modulo = 5;
|
||||
break;
|
||||
case SnapToBeatDiv24:
|
||||
bbt_beat_subdivision = 24;
|
||||
bbt_beat_subdivision = 24;
|
||||
bbt_accent_modulo = 6;
|
||||
break;
|
||||
case SnapToBeatDiv28:
|
||||
bbt_beat_subdivision = 28;
|
||||
bbt_beat_subdivision = 28;
|
||||
bbt_accent_modulo = 7;
|
||||
break;
|
||||
case SnapToBeatDiv32:
|
||||
bbt_beat_subdivision = 32;
|
||||
bbt_beat_subdivision = 32;
|
||||
bbt_accent_modulo = 8;
|
||||
break;
|
||||
case SnapToBeatDiv64:
|
||||
bbt_beat_subdivision = 64;
|
||||
bbt_beat_subdivision = 64;
|
||||
bbt_accent_modulo = 8;
|
||||
break;
|
||||
case SnapToBeatDiv128:
|
||||
bbt_beat_subdivision = 128;
|
||||
bbt_beat_subdivision = 128;
|
||||
bbt_accent_modulo = 8;
|
||||
break;
|
||||
default:
|
||||
bbt_beat_subdivision = 4;
|
||||
bbt_beat_subdivision = 4;
|
||||
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 */
|
||||
if ((bbt_bars < 2) || (beats < 5)) {
|
||||
bbt_bar_helper_on = true;
|
||||
bbt_bar_helper_on = true;
|
||||
}
|
||||
|
||||
if (beat_density > 8192) {
|
||||
|
|
@ -1196,7 +1196,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
helper_active = true;
|
||||
} else {
|
||||
|
||||
if ((*i).is_bar()) {
|
||||
if ((*i).is_bar()) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
||||
} else {
|
||||
|
|
@ -1257,10 +1257,10 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
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)) {
|
||||
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);
|
||||
helper_active = true;
|
||||
} else {
|
||||
|
|
@ -1297,7 +1297,7 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
i_am_accented = true;
|
||||
}
|
||||
if (i_am_accented && (pos > bbt_position_of_helper)){
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, tick);
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, tick);
|
||||
} else {
|
||||
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;
|
||||
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)) {
|
||||
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;
|
||||
|
||||
case bbt_show_many:
|
||||
bbt_nmarks = 1;
|
||||
snprintf (buf, sizeof(buf), "cannot handle %" PRIu32 " bars", bbt_bars );
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
mark.label = buf;
|
||||
mark.position = lower;
|
||||
marks.push_back (mark);
|
||||
break;
|
||||
case bbt_show_many:
|
||||
bbt_nmarks = 1;
|
||||
snprintf (buf, sizeof(buf), "cannot handle %" PRIu32 " bars", bbt_bars );
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
mark.label = buf;
|
||||
mark.position = lower;
|
||||
marks.push_back (mark);
|
||||
break;
|
||||
|
||||
case bbt_show_64:
|
||||
bbt_nmarks = (gint) (bbt_bars / 64) + 1;
|
||||
for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; i++) {
|
||||
bbt_nmarks = (gint) (bbt_bars / 64) + 1;
|
||||
for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; i++) {
|
||||
if ((*i).is_bar()) {
|
||||
if ((*i).bar % 64 == 1) {
|
||||
if ((*i).bar % 256 == 1) {
|
||||
|
|
@ -1432,19 +1432,19 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
break;
|
||||
|
||||
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++) {
|
||||
if ((*i).is_bar()) {
|
||||
if ((*i).is_bar()) {
|
||||
if ((*i).bar % 16 == 1) {
|
||||
if ((*i).bar % 64 == 1) {
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
||||
if ((*i).bar % 64 == 1) {
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
} else {
|
||||
buf[0] = '\0';
|
||||
if ((*i).bar % 64 == 33) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
} else {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
}
|
||||
}
|
||||
mark.label = buf;
|
||||
|
|
@ -1458,36 +1458,36 @@ Editor::metric_get_bbt (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdouble l
|
|||
|
||||
case bbt_show_4:
|
||||
bbt_nmarks = (bbt_bars / 4) + 1;
|
||||
for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; ++i) {
|
||||
if ((*i).is_bar()) {
|
||||
if ((*i).bar % 4 == 1) {
|
||||
if ((*i).bar % 16 == 1) {
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
} else {
|
||||
buf[0] = '\0';
|
||||
if ((*i).bar % 16 == 9) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
for (n = 0, i = grid.begin(); i != grid.end() && n < bbt_nmarks; ++i) {
|
||||
if ((*i).is_bar()) {
|
||||
if ((*i).bar % 4 == 1) {
|
||||
if ((*i).bar % 16 == 1) {
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
} 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;
|
||||
|
||||
case bbt_show_1:
|
||||
// default:
|
||||
bbt_nmarks = bbt_bars + 2;
|
||||
bbt_nmarks = bbt_bars + 2;
|
||||
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) {
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
||||
snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
} else {
|
||||
buf[0] = '\0';
|
||||
|
|
@ -1590,106 +1590,106 @@ Editor::set_minsec_ruler_scale (framepos_t lower, framepos_t upper)
|
|||
upper += spacer;
|
||||
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_ruler_scale = minsec_show_msecs;
|
||||
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 */
|
||||
minsec_mark_interval = fr / 100; /* show 1/100 seconds */
|
||||
minsec_ruler_scale = minsec_show_msecs;
|
||||
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 */
|
||||
minsec_mark_interval = fr / 10; /* show 1/10 seconds */
|
||||
minsec_ruler_scale = minsec_show_msecs;
|
||||
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 */
|
||||
minsec_mark_interval = fr / 10; /* show 1/10 seconds */
|
||||
minsec_ruler_scale = minsec_show_msecs;
|
||||
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 */
|
||||
minsec_mark_interval = fr / 5; /* show 2 seconds */
|
||||
minsec_ruler_scale = minsec_show_msecs;
|
||||
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 */
|
||||
minsec_mark_interval = fr; /* show 1 seconds */
|
||||
minsec_ruler_scale = minsec_show_seconds;
|
||||
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 */
|
||||
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 <= 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_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_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_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_nmarks = 2 + (range / minsec_mark_interval);
|
||||
} else {
|
||||
minsec_nmarks = 2 + (range / minsec_mark_interval);
|
||||
} else {
|
||||
|
||||
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 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 */
|
||||
|
||||
/* 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
|
||||
the width and set lower + upper arguments to this function to match that.
|
||||
/* 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
|
||||
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
|
||||
substantially (anything from 24hrs+ to several billion years)
|
||||
trying to decide which tick marks to show does require us to know
|
||||
about the available width.
|
||||
*/
|
||||
But in this case, where the range defined by lower and uppper can vary
|
||||
substantially (anything from 24hrs+ to several billion years)
|
||||
trying to decide which tick marks to show does require us to know
|
||||
about the available width.
|
||||
*/
|
||||
|
||||
minsec_nmarks = _track_canvas->width() / text_width_rough_guess;
|
||||
minsec_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / minsec_nmarks));
|
||||
minsec_mark_interval = minsec_mark_modulo * (60 * 60 * fr);
|
||||
minsec_ruler_scale = minsec_show_many_hours;
|
||||
}
|
||||
minsec_nmarks = _track_canvas->width() / text_width_rough_guess;
|
||||
minsec_mark_modulo = max ((framecnt_t) 1, 1 + (hours_in_range / minsec_nmarks));
|
||||
minsec_mark_interval = minsec_mark_modulo * (60 * 60 * fr);
|
||||
minsec_ruler_scale = minsec_show_many_hours;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1735,77 +1735,77 @@ Editor::metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>& marks, gdoubl
|
|||
mark.position = pos/1000.0;
|
||||
marks.push_back (mark);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case minsec_show_seconds:
|
||||
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (secs % minsec_mark_modulo == 0) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (secs % minsec_mark_modulo == 0) {
|
||||
if (secs == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
} else {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
}
|
||||
snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs);
|
||||
} else {
|
||||
} else {
|
||||
buf[0] = '\0';
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = pos/1000.0;
|
||||
marks.push_back (mark);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case minsec_show_minutes:
|
||||
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (mins % minsec_mark_modulo == 0) {
|
||||
if (mins == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
} else {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
}
|
||||
snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs);
|
||||
} else {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (mins % minsec_mark_modulo == 0) {
|
||||
if (mins == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
} else {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Minor;
|
||||
}
|
||||
snprintf (buf, sizeof(buf), "%02ld:%02ld:%02ld", hrs, mins, secs);
|
||||
} else {
|
||||
buf[0] = '\0';
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = pos/1000.0;
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = pos/1000.0;
|
||||
marks.push_back (mark);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case minsec_show_hours:
|
||||
for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (hrs % minsec_mark_modulo == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
snprintf (buf, sizeof(buf), "%02ld:%02ld", hrs, mins);
|
||||
} else {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (hrs % minsec_mark_modulo == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
snprintf (buf, sizeof(buf), "%02ld:%02ld", hrs, mins);
|
||||
} else {
|
||||
buf[0] = '\0';
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = pos/1000.0;
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Micro;
|
||||
}
|
||||
mark.label = buf;
|
||||
mark.position = pos/1000.0;
|
||||
marks.push_back (mark);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case minsec_show_many_hours:
|
||||
for (n = 0; n < minsec_nmarks; ) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (hrs % minsec_mark_modulo == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
snprintf (buf, sizeof(buf), "%02ld:00", hrs);
|
||||
mark.label = buf;
|
||||
mark.position = pos/1000.0;
|
||||
marks.push_back (mark);
|
||||
++n;
|
||||
}
|
||||
pos += minsec_mark_interval;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case minsec_show_many_hours:
|
||||
for (n = 0; n < minsec_nmarks; ) {
|
||||
sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
|
||||
if (hrs % minsec_mark_modulo == 0) {
|
||||
mark.style = ArdourCanvas::Ruler::Mark::Major;
|
||||
snprintf (buf, sizeof(buf), "%02ld:00", hrs);
|
||||
mark.label = buf;
|
||||
mark.position = pos/1000.0;
|
||||
marks.push_back (mark);
|
||||
++n;
|
||||
}
|
||||
pos += minsec_mark_interval;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ EditorSnapshots::redisplay ()
|
|||
vector<std::string> state_file_paths;
|
||||
|
||||
get_state_files_in_directory (_session->session_directory().root_path(),
|
||||
state_file_paths);
|
||||
state_file_paths);
|
||||
|
||||
if (state_file_paths.empty()) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ EditorSummary::render_background_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_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 ();
|
||||
|
||||
set_editor_y (y.first);
|
||||
set_editor_y (y.first);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@ Editor::mouse_add_new_meter_event (framepos_t frame)
|
|||
const double beat = map.beat_at_bbt (requested);
|
||||
const double al_frame = map.frame_at_beat (beat);
|
||||
begin_reversible_command (_("add meter mark"));
|
||||
XMLNode &before = map.get_state();
|
||||
XMLNode &before = map.get_state();
|
||||
|
||||
if (meter_dialog.get_lock_style() == 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;
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ Editor::time_stretch (RegionSelection& regions, float fraction)
|
|||
stretch.run (*i);
|
||||
|
||||
playlist->replace_region (regions.front()->region(), stretch.results[0],
|
||||
regions.front()->region()->position());
|
||||
regions.front()->region()->position());
|
||||
midi_playlists_affected.insert (playlist);
|
||||
}
|
||||
|
||||
|
|
@ -378,16 +378,16 @@ Editor::timefx_thread (void *arg)
|
|||
|
||||
tsd->editor.do_timefx ();
|
||||
|
||||
/* 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
|
||||
by 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
|
||||
by the GUI ...
|
||||
*/
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
Glib::usleep(2 * G_USEC_PER_SEC);
|
||||
#else
|
||||
struct timespec t = { 2, 0 };
|
||||
nanosleep (&t, 0);
|
||||
struct timespec t = { 2, 0 };
|
||||
nanosleep (&t, 0);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -401,8 +401,8 @@ EngineControl::unblock_changed_signals ()
|
|||
|
||||
EngineControl::SignalBlocker::SignalBlocker (EngineControl& engine_control,
|
||||
const std::string& reason)
|
||||
: ec (engine_control)
|
||||
, m_reason (reason)
|
||||
: ec (engine_control)
|
||||
, m_reason (reason)
|
||||
{
|
||||
DEBUG_ECONTROL (string_compose ("SignalBlocker: %1", m_reason));
|
||||
ec.block_changed_signals ();
|
||||
|
|
|
|||
|
|
@ -40,102 +40,102 @@
|
|||
|
||||
class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
||||
public:
|
||||
EngineControl ();
|
||||
~EngineControl ();
|
||||
EngineControl ();
|
||||
~EngineControl ();
|
||||
|
||||
static bool need_setup ();
|
||||
static bool need_setup ();
|
||||
|
||||
XMLNode& get_state ();
|
||||
bool set_state (const XMLNode&);
|
||||
XMLNode& get_state ();
|
||||
bool set_state (const XMLNode&);
|
||||
|
||||
void set_desired_sample_rate (uint32_t);
|
||||
bool try_autostart ();
|
||||
void set_desired_sample_rate (uint32_t);
|
||||
bool try_autostart ();
|
||||
|
||||
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::HBox basic_hbox;
|
||||
Gtk::VBox basic_vbox;
|
||||
Gtk::Table basic_packer;
|
||||
Gtk::HBox basic_hbox;
|
||||
Gtk::VBox basic_vbox;
|
||||
|
||||
Gtk::ComboBoxText backend_combo;
|
||||
Gtk::ComboBoxText driver_combo;
|
||||
Gtk::ComboBoxText device_combo;
|
||||
Gtk::ComboBoxText input_device_combo;
|
||||
Gtk::ComboBoxText output_device_combo;
|
||||
Gtk::ComboBoxText sample_rate_combo;
|
||||
Gtk::ComboBoxText midi_option_combo;
|
||||
Gtk::ComboBoxText buffer_size_combo;
|
||||
Gtk::Label buffer_size_duration_label;
|
||||
Gtk::ComboBoxText nperiods_combo;
|
||||
Gtk::Adjustment input_latency_adjustment;
|
||||
Gtk::SpinButton input_latency;
|
||||
Gtk::Adjustment output_latency_adjustment;
|
||||
Gtk::SpinButton output_latency;
|
||||
Gtk::Adjustment input_channels_adjustment;
|
||||
Gtk::SpinButton input_channels;
|
||||
Gtk::Adjustment output_channels_adjustment;
|
||||
Gtk::SpinButton output_channels;
|
||||
Gtk::Adjustment ports_adjustment;
|
||||
Gtk::SpinButton ports_spinner;
|
||||
Gtk::ComboBoxText backend_combo;
|
||||
Gtk::ComboBoxText driver_combo;
|
||||
Gtk::ComboBoxText device_combo;
|
||||
Gtk::ComboBoxText input_device_combo;
|
||||
Gtk::ComboBoxText output_device_combo;
|
||||
Gtk::ComboBoxText sample_rate_combo;
|
||||
Gtk::ComboBoxText midi_option_combo;
|
||||
Gtk::ComboBoxText buffer_size_combo;
|
||||
Gtk::Label buffer_size_duration_label;
|
||||
Gtk::ComboBoxText nperiods_combo;
|
||||
Gtk::Adjustment input_latency_adjustment;
|
||||
Gtk::SpinButton input_latency;
|
||||
Gtk::Adjustment output_latency_adjustment;
|
||||
Gtk::SpinButton output_latency;
|
||||
Gtk::Adjustment input_channels_adjustment;
|
||||
Gtk::SpinButton input_channels;
|
||||
Gtk::Adjustment output_channels_adjustment;
|
||||
Gtk::SpinButton output_channels;
|
||||
Gtk::Adjustment ports_adjustment;
|
||||
Gtk::SpinButton ports_spinner;
|
||||
|
||||
Gtk::Label have_control_text;
|
||||
ArdourButton control_app_button;
|
||||
ArdourButton midi_devices_button;
|
||||
ArdourButton start_stop_button;
|
||||
ArdourButton update_devices_button;
|
||||
ArdourButton use_buffered_io_button;
|
||||
Gtk::Label have_control_text;
|
||||
ArdourButton control_app_button;
|
||||
ArdourButton midi_devices_button;
|
||||
ArdourButton start_stop_button;
|
||||
ArdourButton update_devices_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_input_channel_combo;
|
||||
Gtk::Label lm_measure_label;
|
||||
Gtk::Button lm_measure_button;
|
||||
Gtk::Button lm_use_button;
|
||||
Gtk::Button lm_back_button;
|
||||
ArdourButton lm_button_audio;
|
||||
Gtk::Label lm_title;
|
||||
Gtk::Label lm_preamble;
|
||||
Gtk::Label lm_results;
|
||||
Gtk::Table lm_table;
|
||||
Gtk::VBox lm_vbox;
|
||||
bool have_lm_results;
|
||||
bool lm_running;
|
||||
Gtk::ComboBoxText lm_output_channel_combo;
|
||||
Gtk::ComboBoxText lm_input_channel_combo;
|
||||
Gtk::Label lm_measure_label;
|
||||
Gtk::Button lm_measure_button;
|
||||
Gtk::Button lm_use_button;
|
||||
Gtk::Button lm_back_button;
|
||||
ArdourButton lm_button_audio;
|
||||
Gtk::Label lm_title;
|
||||
Gtk::Label lm_preamble;
|
||||
Gtk::Label lm_results;
|
||||
Gtk::Table lm_table;
|
||||
Gtk::VBox lm_vbox;
|
||||
bool have_lm_results;
|
||||
bool lm_running;
|
||||
|
||||
/* MIDI Tab */
|
||||
/* MIDI Tab */
|
||||
|
||||
Gtk::VBox midi_vbox;
|
||||
Gtk::Button midi_back_button;
|
||||
Gtk::Table midi_device_table;
|
||||
Gtk::VBox midi_vbox;
|
||||
Gtk::Button midi_back_button;
|
||||
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_device_changes; // AudioEngine::DeviceListChanged
|
||||
uint32_t _desired_sample_rate;
|
||||
bool started_at_least_once;
|
||||
bool queue_device_changed;
|
||||
uint32_t ignore_changes; // state save/load
|
||||
uint32_t ignore_device_changes; // AudioEngine::DeviceListChanged
|
||||
uint32_t _desired_sample_rate;
|
||||
bool started_at_least_once;
|
||||
bool queue_device_changed;
|
||||
|
||||
void driver_changed ();
|
||||
void backend_changed ();
|
||||
void sample_rate_changed ();
|
||||
void buffer_size_changed ();
|
||||
void nperiods_changed ();
|
||||
void parameter_changed ();
|
||||
void midi_option_changed ();
|
||||
void driver_changed ();
|
||||
void backend_changed ();
|
||||
void sample_rate_changed ();
|
||||
void buffer_size_changed ();
|
||||
void nperiods_changed ();
|
||||
void parameter_changed ();
|
||||
void midi_option_changed ();
|
||||
|
||||
void setup_midi_tab_for_backend ();
|
||||
void setup_midi_tab_for_jack ();
|
||||
void refresh_midi_display (std::string focus = "");
|
||||
void setup_midi_tab_for_backend ();
|
||||
void setup_midi_tab_for_jack ();
|
||||
void refresh_midi_display (std::string focus = "");
|
||||
|
||||
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<uint32_t> get_buffer_sizes_for_all_devices ();
|
||||
|
||||
float get_rate() const;
|
||||
uint32_t get_buffer_size() const;
|
||||
uint32_t get_nperiods() const;
|
||||
uint32_t get_input_channels() const;
|
||||
uint32_t get_output_channels() const;
|
||||
uint32_t get_input_latency() const;
|
||||
uint32_t get_output_latency() const;
|
||||
std::string get_device_name() const;
|
||||
std::string get_input_device_name() const;
|
||||
std::string get_output_device_name() const;
|
||||
std::string get_driver() const;
|
||||
std::string get_backend() const;
|
||||
std::string get_midi_option () const;
|
||||
bool get_use_buffered_io () const;
|
||||
float get_rate() const;
|
||||
uint32_t get_buffer_size() const;
|
||||
uint32_t get_nperiods() const;
|
||||
uint32_t get_input_channels() const;
|
||||
uint32_t get_output_channels() const;
|
||||
uint32_t get_input_latency() const;
|
||||
uint32_t get_output_latency() const;
|
||||
std::string get_device_name() const;
|
||||
std::string get_input_device_name() const;
|
||||
std::string get_output_device_name() const;
|
||||
std::string get_driver() const;
|
||||
std::string get_backend() const;
|
||||
std::string get_midi_option () const;
|
||||
bool get_use_buffered_io () const;
|
||||
|
||||
std::string get_default_device (const std::string&,
|
||||
const std::vector<std::string>&);
|
||||
|
||||
void device_changed ();
|
||||
void input_device_changed ();
|
||||
void output_device_changed ();
|
||||
bool set_driver_popdown_strings ();
|
||||
bool set_device_popdown_strings ();
|
||||
bool set_input_device_popdown_strings ();
|
||||
bool set_output_device_popdown_strings ();
|
||||
void set_samplerate_popdown_strings ();
|
||||
void set_buffersize_popdown_strings ();
|
||||
void set_nperiods_popdown_strings ();
|
||||
void list_devices ();
|
||||
void show_buffer_duration ();
|
||||
void device_changed ();
|
||||
void input_device_changed ();
|
||||
void output_device_changed ();
|
||||
bool set_driver_popdown_strings ();
|
||||
bool set_device_popdown_strings ();
|
||||
bool set_input_device_popdown_strings ();
|
||||
bool set_output_device_popdown_strings ();
|
||||
void set_samplerate_popdown_strings ();
|
||||
void set_buffersize_popdown_strings ();
|
||||
void set_nperiods_popdown_strings ();
|
||||
void list_devices ();
|
||||
void show_buffer_duration ();
|
||||
|
||||
void configure_midi_devices ();
|
||||
void configure_midi_devices ();
|
||||
|
||||
struct MidiDeviceSetting {
|
||||
struct MidiDeviceSetting {
|
||||
std::string name;
|
||||
bool enabled;
|
||||
uint32_t input_latency;
|
||||
uint32_t output_latency;
|
||||
|
||||
MidiDeviceSetting (std::string n, bool en = true, uint32_t inl = 0, uint32_t oul = 0)
|
||||
: name (n)
|
||||
, enabled (en)
|
||||
, input_latency (inl)
|
||||
, output_latency (oul)
|
||||
: name (n)
|
||||
, enabled (en)
|
||||
, input_latency (inl)
|
||||
, output_latency (oul)
|
||||
{}
|
||||
};
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<MidiDeviceSetting> MidiDeviceSettings;
|
||||
bool _can_set_midi_latencies;
|
||||
std::vector<MidiDeviceSettings> _midi_devices;
|
||||
typedef boost::shared_ptr<MidiDeviceSetting> MidiDeviceSettings;
|
||||
bool _can_set_midi_latencies;
|
||||
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) {
|
||||
if ((*p)->name == devicename) {
|
||||
if ((*p)->name == devicename) {
|
||||
return *p;
|
||||
}
|
||||
}
|
||||
}
|
||||
return MidiDeviceSettings();
|
||||
}
|
||||
}
|
||||
|
||||
struct StateStruct {
|
||||
struct StateStruct {
|
||||
std::string backend;
|
||||
std::string driver;
|
||||
std::string device;
|
||||
|
|
@ -238,38 +238,38 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
, use_buffered_io (false)
|
||||
, lru (0) {}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<StateStruct> State;
|
||||
typedef std::list<State> StateList;
|
||||
static bool state_sort_cmp (const State &a, const State &b);
|
||||
typedef boost::shared_ptr<StateStruct> State;
|
||||
typedef std::list<State> StateList;
|
||||
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,
|
||||
const std::string& driver,
|
||||
const std::string& device);
|
||||
State get_matching_state (const std::string& backend,
|
||||
const std::string& driver,
|
||||
const std::string& input_device,
|
||||
const std::string& output_device);
|
||||
State get_saved_state_for_currently_displayed_backend_and_device ();
|
||||
void maybe_display_saved_state ();
|
||||
State save_state ();
|
||||
void store_state (State);
|
||||
bool equivalent_states (const State&, const State&);
|
||||
State get_matching_state (const std::string& backend);
|
||||
State get_matching_state (const std::string& backend,
|
||||
const std::string& driver,
|
||||
const std::string& device);
|
||||
State get_matching_state (const std::string& backend,
|
||||
const std::string& driver,
|
||||
const std::string& input_device,
|
||||
const std::string& output_device);
|
||||
State get_saved_state_for_currently_displayed_backend_and_device ();
|
||||
void maybe_display_saved_state ();
|
||||
State save_state ();
|
||||
void store_state (State);
|
||||
bool equivalent_states (const State&, const State&);
|
||||
|
||||
bool set_current_state (const State& 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_full_control_notebook ();
|
||||
void build_no_control_notebook ();
|
||||
void build_notebook ();
|
||||
void build_full_control_notebook ();
|
||||
void build_no_control_notebook ();
|
||||
|
||||
void connect_changed_signals ();
|
||||
void block_changed_signals ();
|
||||
|
|
@ -303,50 +303,50 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
sigc::connection input_channels_connection;
|
||||
sigc::connection output_channels_connection;
|
||||
|
||||
void on_show ();
|
||||
void on_map ();
|
||||
void control_app_button_clicked ();
|
||||
void start_stop_button_clicked ();
|
||||
void update_devices_button_clicked ();
|
||||
void use_buffered_io_button_clicked ();
|
||||
void use_latency_button_clicked ();
|
||||
void manage_control_app_sensitivity ();
|
||||
int push_state_to_backend (bool start);
|
||||
void post_push ();
|
||||
void update_sensitivity ();
|
||||
void on_show ();
|
||||
void on_map ();
|
||||
void control_app_button_clicked ();
|
||||
void start_stop_button_clicked ();
|
||||
void update_devices_button_clicked ();
|
||||
void use_buffered_io_button_clicked ();
|
||||
void use_latency_button_clicked ();
|
||||
void manage_control_app_sensitivity ();
|
||||
int push_state_to_backend (bool start);
|
||||
void post_push ();
|
||||
void update_sensitivity ();
|
||||
bool start_engine ();
|
||||
bool stop_engine (bool for_latency = false);
|
||||
|
||||
/* latency measurement */
|
||||
void latency_button_clicked ();
|
||||
void latency_back_button_clicked ();
|
||||
bool check_audio_latency_measurement ();
|
||||
bool check_midi_latency_measurement ();
|
||||
sigc::connection latency_timeout;
|
||||
void enable_latency_tab ();
|
||||
void disable_latency_tab ();
|
||||
void start_latency_detection ();
|
||||
void end_latency_detection ();
|
||||
/* latency measurement */
|
||||
void latency_button_clicked ();
|
||||
void latency_back_button_clicked ();
|
||||
bool check_audio_latency_measurement ();
|
||||
bool check_midi_latency_measurement ();
|
||||
sigc::connection latency_timeout;
|
||||
void enable_latency_tab ();
|
||||
void disable_latency_tab ();
|
||||
void start_latency_detection ();
|
||||
void end_latency_detection ();
|
||||
|
||||
void on_switch_page (GtkNotebookPage*, guint page_num);
|
||||
bool on_delete_event (GdkEventAny*);
|
||||
void on_switch_page (GtkNotebookPage*, guint page_num);
|
||||
bool on_delete_event (GdkEventAny*);
|
||||
|
||||
void engine_running ();
|
||||
void engine_stopped ();
|
||||
void device_list_changed ();
|
||||
void engine_running ();
|
||||
void engine_stopped ();
|
||||
void device_list_changed ();
|
||||
|
||||
PBD::ScopedConnection running_connection;
|
||||
PBD::ScopedConnectionList stopped_connection;
|
||||
PBD::ScopedConnection devicelist_connection;
|
||||
PBD::ScopedConnection running_connection;
|
||||
PBD::ScopedConnectionList stopped_connection;
|
||||
PBD::ScopedConnection devicelist_connection;
|
||||
|
||||
void connect_disconnect_click ();
|
||||
void calibrate_audio_latency ();
|
||||
void calibrate_midi_latency (MidiDeviceSettings);
|
||||
void connect_disconnect_click ();
|
||||
void calibrate_audio_latency ();
|
||||
void calibrate_midi_latency (MidiDeviceSettings);
|
||||
|
||||
MidiDeviceSettings _measure_midi;
|
||||
void midi_latency_adjustment_changed(Gtk::Adjustment *, MidiDeviceSettings, bool);
|
||||
void midi_device_enabled_toggled(ArdourButton *, MidiDeviceSettings);
|
||||
sigc::connection lm_back_button_signal;
|
||||
MidiDeviceSettings _measure_midi;
|
||||
void midi_latency_adjustment_changed(Gtk::Adjustment *, MidiDeviceSettings, bool);
|
||||
void midi_device_enabled_toggled(ArdourButton *, MidiDeviceSettings);
|
||||
sigc::connection lm_back_button_signal;
|
||||
};
|
||||
|
||||
#endif /* __gtk2_ardour_engine_dialog_h__ */
|
||||
|
|
|
|||
|
|
@ -168,8 +168,8 @@ setup_gtk_ardour_enums ()
|
|||
REGISTER_ENUM (FadeOutHandleItem);
|
||||
REGISTER_ENUM (NoteItem);
|
||||
REGISTER_ENUM (FeatureLineItem);
|
||||
REGISTER_ENUM (LeftFrameHandle);
|
||||
REGISTER_ENUM (RightFrameHandle);
|
||||
REGISTER_ENUM (LeftFrameHandle);
|
||||
REGISTER_ENUM (RightFrameHandle);
|
||||
REGISTER_ENUM (StartCrossFadeItem);
|
||||
REGISTER_ENUM (EndCrossFadeItem);
|
||||
REGISTER_ENUM (CrossfadeViewItem);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
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),
|
||||
(*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(),
|
||||
|
|
@ -455,15 +455,15 @@ RegionExportChannelSelector::RegionExportChannelSelector (ARDOUR::Session * _ses
|
|||
ProfileManagerPtr manager,
|
||||
ARDOUR::AudioRegion const & region,
|
||||
ARDOUR::AudioTrack & track) :
|
||||
ExportChannelSelector (_session, manager),
|
||||
region (region),
|
||||
track (track),
|
||||
region_chans (region.n_channels()),
|
||||
track_chans (track.n_outputs().n_audio()),
|
||||
ExportChannelSelector (_session, manager),
|
||||
region (region),
|
||||
track (track),
|
||||
region_chans (region.n_channels()),
|
||||
track_chans (track.n_outputs().n_audio()),
|
||||
|
||||
raw_button (type_group),
|
||||
fades_button (type_group),
|
||||
processed_button (type_group)
|
||||
raw_button (type_group),
|
||||
fades_button (type_group),
|
||||
processed_button (type_group)
|
||||
{
|
||||
pack_start (vbox);
|
||||
|
||||
|
|
|
|||
|
|
@ -124,12 +124,12 @@ class ExportDialog : public ArdourDialog, public PBD::ScopedConnectionList
|
|||
|
||||
Gtk::HBox warn_hbox;
|
||||
Gtk::Label warn_label;
|
||||
std::string warn_string;
|
||||
std::string warn_string;
|
||||
|
||||
Gtk::HBox list_files_hbox;
|
||||
Gtk::Label list_files_label;
|
||||
Gtk::Button list_files_button;
|
||||
std::string list_files_string;
|
||||
std::string list_files_string;
|
||||
|
||||
void add_error (std::string const & text);
|
||||
void add_warning (std::string const & text);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
ExportProfileManager::FormatStatePtr format_state,
|
||||
ExportProfileManager::FilenameStatePtr filename_state) :
|
||||
format_state (format_state),
|
||||
filename_state (filename_state),
|
||||
profile_manager (profile_manager),
|
||||
format_state (format_state),
|
||||
filename_state (filename_state),
|
||||
profile_manager (profile_manager),
|
||||
|
||||
format_label (_("Format"), Gtk::ALIGN_LEFT),
|
||||
filename_label (_("Location"), Gtk::ALIGN_LEFT),
|
||||
soundcloud_upload_button (_("Upload to Soundcloud")),
|
||||
analysis_button (_("Analyze Exported Audio")),
|
||||
tab_number (number)
|
||||
format_label (_("Format"), Gtk::ALIGN_LEFT),
|
||||
filename_label (_("Location"), Gtk::ALIGN_LEFT),
|
||||
soundcloud_upload_button (_("Upload to Soundcloud")),
|
||||
analysis_button (_("Analyze Exported Audio")),
|
||||
tab_number (number)
|
||||
{
|
||||
set_border_width (12);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,50 +33,50 @@ static int (*pthread_create_orig)(pthread_t *__restrict,
|
|||
/* Library initialization function */
|
||||
void _init(void)
|
||||
{
|
||||
pthread_create_orig = dlsym(RTLD_NEXT, "pthread_create");
|
||||
fprintf(stderr, "pthreads: using profiling hooks for gprof\n");
|
||||
if(pthread_create_orig == NULL)
|
||||
{
|
||||
char *error = dlerror();
|
||||
if(error == NULL)
|
||||
{
|
||||
error = "pthread_create is NULL";
|
||||
}
|
||||
fprintf(stderr, "%s", error);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
pthread_create_orig = dlsym(RTLD_NEXT, "pthread_create");
|
||||
fprintf(stderr, "pthreads: using profiling hooks for gprof\n");
|
||||
if(pthread_create_orig == NULL)
|
||||
{
|
||||
char *error = dlerror();
|
||||
if(error == NULL)
|
||||
{
|
||||
error = "pthread_create is NULL";
|
||||
}
|
||||
fprintf(stderr, "%s", error);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Our data structure passed to the wrapper */
|
||||
typedef struct wrapper_s
|
||||
{
|
||||
void * (*start_routine)(void *);
|
||||
void * arg;
|
||||
void * (*start_routine)(void *);
|
||||
void * arg;
|
||||
|
||||
pthread_mutex_t lock;
|
||||
pthread_cond_t wait;
|
||||
pthread_mutex_t lock;
|
||||
pthread_cond_t wait;
|
||||
|
||||
struct itimerval itimer;
|
||||
struct itimerval itimer;
|
||||
|
||||
} wrapper_t;
|
||||
|
||||
/* The wrapper function in charge for setting the itimer value */
|
||||
static void * wrapper_routine(void * data)
|
||||
{
|
||||
/* Put user data in thread-local variables */
|
||||
void * (*start_routine)(void *) = ((wrapper_t*)data)->start_routine;
|
||||
void * arg = ((wrapper_t*)data)->arg;
|
||||
/* Put user data in thread-local variables */
|
||||
void * (*start_routine)(void *) = ((wrapper_t*)data)->start_routine;
|
||||
void * arg = ((wrapper_t*)data)->arg;
|
||||
|
||||
/* Set the profile timer value */
|
||||
setitimer(ITIMER_PROF, &((wrapper_t*)data)->itimer, NULL);
|
||||
/* Set the profile timer value */
|
||||
setitimer(ITIMER_PROF, &((wrapper_t*)data)->itimer, NULL);
|
||||
|
||||
/* Tell the calling thread that we don't need its data anymore */
|
||||
pthread_mutex_lock(&((wrapper_t*)data)->lock);
|
||||
pthread_cond_signal(&((wrapper_t*)data)->wait);
|
||||
pthread_mutex_unlock(&((wrapper_t*)data)->lock);
|
||||
/* Tell the calling thread that we don't need its data anymore */
|
||||
pthread_mutex_lock(&((wrapper_t*)data)->lock);
|
||||
pthread_cond_signal(&((wrapper_t*)data)->wait);
|
||||
pthread_mutex_unlock(&((wrapper_t*)data)->lock);
|
||||
|
||||
/* Call the real function */
|
||||
return start_routine(arg);
|
||||
/* Call the real function */
|
||||
return start_routine(arg);
|
||||
}
|
||||
|
||||
/* Our wrapper function for the real pthread_create() */
|
||||
|
|
@ -85,33 +85,33 @@ int pthread_create(pthread_t *__restrict thread,
|
|||
void * (*start_routine)(void *),
|
||||
void *__restrict arg)
|
||||
{
|
||||
wrapper_t wrapper_data;
|
||||
int i_return;
|
||||
wrapper_t wrapper_data;
|
||||
int i_return;
|
||||
|
||||
/* Initialize the wrapper structure */
|
||||
wrapper_data.start_routine = start_routine;
|
||||
wrapper_data.arg = arg;
|
||||
getitimer(ITIMER_PROF, &wrapper_data.itimer);
|
||||
pthread_cond_init(&wrapper_data.wait, NULL);
|
||||
pthread_mutex_init(&wrapper_data.lock, NULL);
|
||||
pthread_mutex_lock(&wrapper_data.lock);
|
||||
/* Initialize the wrapper structure */
|
||||
wrapper_data.start_routine = start_routine;
|
||||
wrapper_data.arg = arg;
|
||||
getitimer(ITIMER_PROF, &wrapper_data.itimer);
|
||||
pthread_cond_init(&wrapper_data.wait, NULL);
|
||||
pthread_mutex_init(&wrapper_data.lock, NULL);
|
||||
pthread_mutex_lock(&wrapper_data.lock);
|
||||
|
||||
/* The real pthread_create call */
|
||||
i_return = pthread_create_orig(thread,
|
||||
/* The real pthread_create call */
|
||||
i_return = pthread_create_orig(thread,
|
||||
attr,
|
||||
&wrapper_routine,
|
||||
&wrapper_data);
|
||||
|
||||
/* If the thread was successfully spawned, wait for the data
|
||||
* to be released */
|
||||
if(i_return == 0)
|
||||
{
|
||||
pthread_cond_wait(&wrapper_data.wait, &wrapper_data.lock);
|
||||
}
|
||||
/* If the thread was successfully spawned, wait for the data
|
||||
* to be released */
|
||||
if(i_return == 0)
|
||||
{
|
||||
pthread_cond_wait(&wrapper_data.wait, &wrapper_data.lock);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&wrapper_data.lock);
|
||||
pthread_mutex_destroy(&wrapper_data.lock);
|
||||
pthread_cond_destroy(&wrapper_data.wait);
|
||||
pthread_mutex_unlock(&wrapper_data.lock);
|
||||
pthread_mutex_destroy(&wrapper_data.lock);
|
||||
pthread_cond_destroy(&wrapper_data.wait);
|
||||
|
||||
return i_return;
|
||||
return i_return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
void set_session (ARDOUR::Session *);
|
||||
|
||||
/** @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);
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ private:
|
|||
void set_activation (ARDOUR::RouteGroup *, bool);
|
||||
void edit_group (ARDOUR::RouteGroup *);
|
||||
void subgroup (ARDOUR::RouteGroup *, bool, ARDOUR::Placement);
|
||||
void un_subgroup (ARDOUR::RouteGroup *);
|
||||
void un_subgroup (ARDOUR::RouteGroup *);
|
||||
void activate_all ();
|
||||
void disable_all ();
|
||||
void remove_group (ARDOUR::RouteGroup *);
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ keyboard_event_handler(GtkWidget *mk, GdkEventKey *event, gpointer ignored)
|
|||
GdkKeymapKey kk;
|
||||
PianoKeyboard *pk = PIANO_KEYBOARD(mk);
|
||||
|
||||
(void) ignored;
|
||||
(void) ignored;
|
||||
|
||||
/* 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 '&'. */
|
||||
|
|
@ -449,7 +449,7 @@ mouse_button_event_handler(PianoKeyboard *pk, GdkEventButton *event, gpointer ig
|
|||
|
||||
int note = get_note_for_xy(pk, x, y);
|
||||
|
||||
(void) ignored;
|
||||
(void) ignored;
|
||||
|
||||
if (event->button != 1)
|
||||
return TRUE;
|
||||
|
|
@ -488,7 +488,7 @@ mouse_motion_event_handler(PianoKeyboard *pk, GdkEventMotion *event, gpointer ig
|
|||
{
|
||||
int note;
|
||||
|
||||
(void) ignored;
|
||||
(void) ignored;
|
||||
|
||||
if ((event->state & GDK_BUTTON1_MASK) == 0)
|
||||
return TRUE;
|
||||
|
|
@ -542,7 +542,7 @@ piano_keyboard_expose(GtkWidget *widget, GdkEventExpose *event)
|
|||
static void
|
||||
piano_keyboard_size_request(GtkWidget* w, GtkRequisition *requisition)
|
||||
{
|
||||
(void) w;
|
||||
(void) w;
|
||||
|
||||
requisition->width = PIANO_KEYBOARD_DEFAULT_WIDTH;
|
||||
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);
|
||||
|
||||
piano_keyboard_signals[REST_SIGNAL] = g_signal_new ("rest",
|
||||
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);
|
||||
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);
|
||||
|
||||
widget_klass = (GtkWidgetClass*) klass;
|
||||
|
||||
|
|
|
|||
|
|
@ -141,15 +141,15 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s)
|
|||
return;
|
||||
}
|
||||
|
||||
if (s) {
|
||||
if (s) {
|
||||
if (!f->connected_to (*j)) {
|
||||
_io->connect (f, *j, 0);
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if (f->connected_to (*j)) {
|
||||
_io->disconnect (f, *j, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class IOSelector : public PortMatrix
|
|||
std::string disassociation_verb () const;
|
||||
std::string channel_noun () const;
|
||||
|
||||
ARDOUR::Session* session() const { return _session; }
|
||||
ARDOUR::Session* session() const { return _session; }
|
||||
|
||||
uint32_t n_io_ports () const;
|
||||
boost::shared_ptr<ARDOUR::IO> const io () { return _io; }
|
||||
|
|
|
|||
|
|
@ -87,19 +87,19 @@ class LevelMeterBase : public ARDOUR::SessionHandlePtr, virtual public sigc::tra
|
|||
Width _width;
|
||||
|
||||
struct MeterInfo {
|
||||
Gtkmm2ext::FastMeter *meter;
|
||||
gint16 width;
|
||||
Gtkmm2ext::FastMeter *meter;
|
||||
gint16 width;
|
||||
int length;
|
||||
bool packed;
|
||||
float max_peak;
|
||||
bool packed;
|
||||
float max_peak;
|
||||
|
||||
MeterInfo() {
|
||||
meter = 0;
|
||||
width = 0;
|
||||
length = 0;
|
||||
packed = false;
|
||||
max_peak = -INFINITY;
|
||||
}
|
||||
MeterInfo() {
|
||||
meter = 0;
|
||||
width = 0;
|
||||
length = 0;
|
||||
packed = false;
|
||||
max_peak = -INFINITY;
|
||||
}
|
||||
};
|
||||
|
||||
guint16 regular_meter_width;
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ Dialog::run (lua_State *L)
|
|||
case Gtk::RESPONSE_ACCEPT:
|
||||
break;
|
||||
default:
|
||||
lua_pushnil (L);
|
||||
lua_pushnil (L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ ArdourMarker::show ()
|
|||
{
|
||||
_shown = true;
|
||||
|
||||
group->show ();
|
||||
group->show ();
|
||||
setup_line ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class ArdourMarker : public sigc::trackable
|
|||
ArdourCanvas::Container* _parent;
|
||||
ArdourCanvas::Container *group;
|
||||
ArdourCanvas::Polygon *mark;
|
||||
ArdourCanvas::Text *_name_item;
|
||||
ArdourCanvas::Text *_name_item;
|
||||
ArdourCanvas::Points *points;
|
||||
ArdourCanvas::Line* _track_canvas_line;
|
||||
ArdourCanvas::Rectangle* _name_background;
|
||||
|
|
@ -142,7 +142,7 @@ private:
|
|||
class TempoMarker : public ArdourMarker
|
||||
{
|
||||
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 ();
|
||||
|
||||
ARDOUR::TempoSection& tempo() const { return _tempo; }
|
||||
|
|
@ -155,7 +155,7 @@ class TempoMarker : public ArdourMarker
|
|||
class MeterMarker : public ArdourMarker
|
||||
{
|
||||
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 ();
|
||||
|
||||
ARDOUR::MeterSection& meter() const { return _meter; }
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ MidiChannelSelector::~MidiChannelSelector()
|
|||
bool
|
||||
MidiChannelSelector::was_clicked (GdkEventButton*)
|
||||
{
|
||||
clicked ();
|
||||
return false;
|
||||
clicked ();
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -360,16 +360,16 @@ MidiChannelSelectorWindow::build ()
|
|||
VBox* vpacker;
|
||||
HBox* capture_controls;
|
||||
HBox* playback_controls;
|
||||
Button* b;
|
||||
Label* l;
|
||||
Button* b;
|
||||
Label* l;
|
||||
|
||||
vpacker = manage (new VBox);
|
||||
vpacker->set_spacing (6);
|
||||
vpacker->set_border_width (12);
|
||||
vpacker = manage (new VBox);
|
||||
vpacker->set_spacing (6);
|
||||
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);
|
||||
vpacker->pack_start (*l, true, true);
|
||||
vpacker->pack_start (*l, true, true);
|
||||
|
||||
vpacker->pack_start (capture_all_button);
|
||||
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);
|
||||
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->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"));
|
||||
capture_controls->pack_start (*b);
|
||||
capture_mask_controls.push_back (b);
|
||||
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"));
|
||||
capture_controls->pack_start (*b);
|
||||
capture_mask_controls.push_back (b);
|
||||
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"));
|
||||
capture_controls->pack_start (*b);
|
||||
capture_mask_controls.push_back (b);
|
||||
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);
|
||||
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);
|
||||
vpacker->pack_start (*l);
|
||||
vpacker->pack_start (*l);
|
||||
|
||||
vpacker->pack_start (playback_all_button);
|
||||
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->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"));
|
||||
playback_controls->pack_start (*b);
|
||||
playback_mask_controls.push_back (b);
|
||||
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"));
|
||||
playback_controls->pack_start (*b);
|
||||
playback_mask_controls.push_back (b);
|
||||
|
|
@ -440,9 +440,9 @@ MidiChannelSelectorWindow::build ()
|
|||
playback_mask_controls.push_back (b);
|
||||
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
|
||||
|
|
|
|||
|
|
@ -42,141 +42,141 @@ namespace ARDOUR {
|
|||
class MidiChannelSelector : public Gtk::Table
|
||||
{
|
||||
public:
|
||||
MidiChannelSelector(int n_rows = 4, int n_columns = 4, int start_row = 0, int start_column = 0);
|
||||
virtual ~MidiChannelSelector() = 0;
|
||||
MidiChannelSelector(int n_rows = 4, int n_columns = 4, int start_row = 0, int start_column = 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_default_channel_color();
|
||||
void set_channel_colors(const uint32_t new_channel_colors[16]);
|
||||
void set_default_channel_color();
|
||||
|
||||
protected:
|
||||
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr) = 0;
|
||||
Gtk::Label _button_labels[4][4];
|
||||
Gtkmm2ext::StatefulToggleButton _buttons[4][4];
|
||||
int _recursion_counter;
|
||||
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr) = 0;
|
||||
Gtk::Label _button_labels[4][4];
|
||||
Gtkmm2ext::StatefulToggleButton _buttons[4][4];
|
||||
int _recursion_counter;
|
||||
|
||||
bool was_clicked (GdkEventButton*);
|
||||
bool was_clicked (GdkEventButton*);
|
||||
};
|
||||
|
||||
class SingleMidiChannelSelector : public MidiChannelSelector
|
||||
{
|
||||
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:
|
||||
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;
|
||||
uint8_t _active_channel;
|
||||
Gtk::ToggleButton* _last_active_button;
|
||||
uint8_t _active_channel;
|
||||
};
|
||||
|
||||
class MidiMultipleChannelSelector : public MidiChannelSelector
|
||||
{
|
||||
public:
|
||||
MidiMultipleChannelSelector(ARDOUR::ChannelMode mode = ARDOUR::FilterChannels,
|
||||
MidiMultipleChannelSelector(ARDOUR::ChannelMode mode = ARDOUR::FilterChannels,
|
||||
uint16_t initial_selection = 0xFFFF);
|
||||
|
||||
virtual ~MidiMultipleChannelSelector();
|
||||
virtual ~MidiMultipleChannelSelector();
|
||||
|
||||
/** The channel mode or selected channel(s) has changed.
|
||||
* First parameter is the new channel mode, second parameter is a bitmask
|
||||
* of the currently selected channels.
|
||||
*/
|
||||
sigc::signal<void, ARDOUR::ChannelMode, uint16_t> mode_changed;
|
||||
/** The channel mode or selected channel(s) has changed.
|
||||
* First parameter is the new channel mode, second parameter is a bitmask
|
||||
* of the currently selected channels.
|
||||
*/
|
||||
sigc::signal<void, ARDOUR::ChannelMode, uint16_t> mode_changed;
|
||||
|
||||
void set_channel_mode(ARDOUR::ChannelMode mode, uint16_t mask);
|
||||
ARDOUR::ChannelMode get_channel_mode () const { return _channel_mode; }
|
||||
void set_channel_mode(ARDOUR::ChannelMode mode, uint16_t mask);
|
||||
ARDOUR::ChannelMode get_channel_mode () const { return _channel_mode; }
|
||||
|
||||
/**
|
||||
* @return each bit in the returned word represents a midi channel, eg.
|
||||
* bit 0 represents channel 0 and bit 15 represents channel 15
|
||||
*
|
||||
*/
|
||||
uint16_t get_selected_channels() const;
|
||||
void set_selected_channels(uint16_t selected_channels);
|
||||
/**
|
||||
* @return each bit in the returned word represents a midi channel, eg.
|
||||
* bit 0 represents channel 0 and bit 15 represents channel 15
|
||||
*
|
||||
*/
|
||||
uint16_t get_selected_channels() const;
|
||||
void set_selected_channels(uint16_t selected_channels);
|
||||
|
||||
protected:
|
||||
ARDOUR::ChannelMode _channel_mode;
|
||||
ARDOUR::NoteMode _note_mode;
|
||||
ARDOUR::ChannelMode _channel_mode;
|
||||
ARDOUR::NoteMode _note_mode;
|
||||
|
||||
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr);
|
||||
void force_channels_button_toggled();
|
||||
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr);
|
||||
void force_channels_button_toggled();
|
||||
|
||||
void select_all(bool on);
|
||||
void invert_selection(void);
|
||||
void select_all(bool on);
|
||||
void invert_selection(void);
|
||||
|
||||
Gtk::Button _select_all;
|
||||
Gtk::Button _select_none;
|
||||
Gtk::Button _invert_selection;
|
||||
Gtk::ToggleButton _force_channel;
|
||||
Gtk::Button _select_all;
|
||||
Gtk::Button _select_none;
|
||||
Gtk::Button _invert_selection;
|
||||
Gtk::ToggleButton _force_channel;
|
||||
};
|
||||
|
||||
class MidiChannelSelectorWindow : public ArdourWindow, public PBD::ScopedConnectionList
|
||||
{
|
||||
public:
|
||||
MidiChannelSelectorWindow (boost::shared_ptr<ARDOUR::MidiTrack>);
|
||||
~MidiChannelSelectorWindow ();
|
||||
MidiChannelSelectorWindow (boost::shared_ptr<ARDOUR::MidiTrack>);
|
||||
~MidiChannelSelectorWindow ();
|
||||
|
||||
void set_channel_colors (const uint32_t new_channel_colors[16]);
|
||||
void set_default_channel_color();
|
||||
void set_channel_colors (const uint32_t new_channel_colors[16]);
|
||||
void set_default_channel_color();
|
||||
|
||||
private:
|
||||
boost::shared_ptr<ARDOUR::MidiTrack> track;
|
||||
std::vector<Gtk::ToggleButton*> playback_buttons;
|
||||
std::vector<Gtk::ToggleButton*> capture_buttons;
|
||||
boost::shared_ptr<ARDOUR::MidiTrack> track;
|
||||
std::vector<Gtk::ToggleButton*> playback_buttons;
|
||||
std::vector<Gtk::ToggleButton*> capture_buttons;
|
||||
|
||||
std::vector<Gtk::Widget*> playback_mask_controls;
|
||||
std::vector<Gtk::Widget*> capture_mask_controls;
|
||||
std::vector<Gtk::Widget*> playback_mask_controls;
|
||||
std::vector<Gtk::Widget*> capture_mask_controls;
|
||||
|
||||
Gtk::HBox capture_mask_box;
|
||||
Gtk::HBox playback_mask_box;
|
||||
Gtk::RadioButtonGroup playback_button_group;
|
||||
Gtk::RadioButton playback_all_button;
|
||||
Gtk::RadioButton playback_filter_button;
|
||||
Gtk::RadioButton playback_force_button;
|
||||
Gtk::RadioButtonGroup capture_button_group;
|
||||
Gtk::RadioButton capture_all_button;
|
||||
Gtk::RadioButton capture_filter_button;
|
||||
Gtk::RadioButton capture_force_button;
|
||||
Gtk::HBox capture_mask_box;
|
||||
Gtk::HBox playback_mask_box;
|
||||
Gtk::RadioButtonGroup playback_button_group;
|
||||
Gtk::RadioButton playback_all_button;
|
||||
Gtk::RadioButton playback_filter_button;
|
||||
Gtk::RadioButton playback_force_button;
|
||||
Gtk::RadioButtonGroup capture_button_group;
|
||||
Gtk::RadioButton capture_all_button;
|
||||
Gtk::RadioButton capture_filter_button;
|
||||
Gtk::RadioButton capture_force_button;
|
||||
|
||||
ARDOUR::ChannelMode last_drawn_capture_mode;
|
||||
ARDOUR::ChannelMode last_drawn_playback_mode;
|
||||
ARDOUR::ChannelMode last_drawn_capture_mode;
|
||||
ARDOUR::ChannelMode last_drawn_playback_mode;
|
||||
|
||||
void build();
|
||||
void set_capture_selected_channels (uint16_t);
|
||||
void set_playback_selected_channels (uint16_t);
|
||||
void build();
|
||||
void set_capture_selected_channels (uint16_t);
|
||||
void set_playback_selected_channels (uint16_t);
|
||||
|
||||
void fill_playback_mask ();
|
||||
void zero_playback_mask ();
|
||||
void invert_playback_mask ();
|
||||
void fill_playback_mask ();
|
||||
void zero_playback_mask ();
|
||||
void invert_playback_mask ();
|
||||
|
||||
void fill_capture_mask ();
|
||||
void zero_capture_mask ();
|
||||
void invert_capture_mask ();
|
||||
void fill_capture_mask ();
|
||||
void zero_capture_mask ();
|
||||
void invert_capture_mask ();
|
||||
|
||||
void playback_mask_changed ();
|
||||
void capture_mask_changed ();
|
||||
void playback_mode_changed ();
|
||||
void capture_mode_changed ();
|
||||
void playback_mask_changed ();
|
||||
void capture_mask_changed ();
|
||||
void playback_mode_changed ();
|
||||
void capture_mode_changed ();
|
||||
|
||||
void playback_channel_clicked (uint16_t);
|
||||
void capture_channel_clicked (uint16_t);
|
||||
void playback_channel_clicked (uint16_t);
|
||||
void capture_channel_clicked (uint16_t);
|
||||
|
||||
void playback_all_clicked();
|
||||
void playback_none_clicked();
|
||||
void playback_invert_clicked();
|
||||
void playback_all_clicked();
|
||||
void playback_none_clicked();
|
||||
void playback_invert_clicked();
|
||||
|
||||
void capture_all_clicked();
|
||||
void capture_none_clicked();
|
||||
void capture_invert_clicked();
|
||||
void capture_all_clicked();
|
||||
void capture_none_clicked();
|
||||
void capture_invert_clicked();
|
||||
|
||||
void capture_mode_toggled (ARDOUR::ChannelMode);
|
||||
void playback_mode_toggled (ARDOUR::ChannelMode);
|
||||
void capture_mode_toggled (ARDOUR::ChannelMode);
|
||||
void playback_mode_toggled (ARDOUR::ChannelMode);
|
||||
};
|
||||
|
||||
#endif /*__ardour_ui_midi_channel_selector_h__*/
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ public:
|
|||
void goto_previous_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_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 nudge_notes (bool forward, bool fine);
|
||||
void channel_edit ();
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ class MidiVelocityDialog : public ArdourDialog
|
|||
uint8_t velocity() const;
|
||||
|
||||
private:
|
||||
Gtk::Adjustment adjustment;
|
||||
Gtk::SpinButton spinner;
|
||||
Gtk::Label label;
|
||||
Gtk::HBox packer;
|
||||
Gtk::Adjustment adjustment;
|
||||
Gtk::SpinButton spinner;
|
||||
Gtk::Label label;
|
||||
Gtk::HBox packer;
|
||||
};
|
||||
|
||||
#endif /* __gtk2_ardour_midi_velocity_dialog_h__ */
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#include "ardour_dialog.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class Session;
|
||||
class Session;
|
||||
}
|
||||
|
||||
class MissingFileDialog : public ArdourDialog
|
||||
|
|
|
|||
|
|
@ -26,15 +26,15 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
|
||||
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.*/
|
||||
set_position (Gtk::WIN_POS_CENTER);
|
||||
|
||||
set_session (s);
|
||||
|
||||
add_button (_("OK"), RESPONSE_OK);
|
||||
set_default_response (RESPONSE_OK);
|
||||
add_button (_("OK"), RESPONSE_OK);
|
||||
set_default_response (RESPONSE_OK);
|
||||
|
||||
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"
|
||||
"(also check the blacklist, Window > Log and Preferences > Plugins)");
|
||||
|
||||
m->set_markup (t.str ());
|
||||
get_vbox()->pack_start (*m, false, false);
|
||||
m->set_markup (t.str ());
|
||||
get_vbox()->pack_start (*m, false, false);
|
||||
|
||||
show_all ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@
|
|||
#include "ardour_dialog.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class Session;
|
||||
class Session;
|
||||
}
|
||||
|
||||
class MissingPluginDialog : public ArdourDialog
|
||||
{
|
||||
public:
|
||||
MissingPluginDialog (ARDOUR::Session *, std::list<std::string> const &);
|
||||
MissingPluginDialog (ARDOUR::Session *, std::list<std::string> const &);
|
||||
};
|
||||
|
||||
#endif /* __gtk_ardour_missing_plugin_dialog_h__ */
|
||||
|
|
|
|||
|
|
@ -1125,11 +1125,11 @@ MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR
|
|||
void
|
||||
MixerStrip::update_diskstream_display ()
|
||||
{
|
||||
if (is_track() && input_selector) {
|
||||
input_selector->hide_all ();
|
||||
}
|
||||
if (is_track() && input_selector) {
|
||||
input_selector->hide_all ();
|
||||
}
|
||||
|
||||
route_color_changed ();
|
||||
route_color_changed ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@ Mixer_UI::Mixer_UI ()
|
|||
, _plugin_selector (0)
|
||||
, _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide)
|
||||
, ignore_reorder (false)
|
||||
, _in_group_rebuild_or_clear (false)
|
||||
, _route_deletion_in_progress (false)
|
||||
, _in_group_rebuild_or_clear (false)
|
||||
, _route_deletion_in_progress (false)
|
||||
, _maximised (false)
|
||||
, _show_mixer_list (true)
|
||||
, myactions (X_("mixer"))
|
||||
|
|
@ -442,7 +442,7 @@ Mixer_UI::remove_master (VCAMasterStrip* vms)
|
|||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
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);
|
||||
break;
|
||||
}
|
||||
|
|
@ -667,7 +667,7 @@ Mixer_UI::remove_strip (MixerStrip* strip)
|
|||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
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);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1132,15 +1132,15 @@ Mixer_UI::hide_strip (MixerStrip* ms)
|
|||
gint
|
||||
Mixer_UI::start_updating ()
|
||||
{
|
||||
fast_screen_update_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &Mixer_UI::fast_update_strips));
|
||||
return 0;
|
||||
fast_screen_update_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &Mixer_UI::fast_update_strips));
|
||||
return 0;
|
||||
}
|
||||
|
||||
gint
|
||||
Mixer_UI::stop_updating ()
|
||||
{
|
||||
fast_screen_update_connection.disconnect();
|
||||
return 0;
|
||||
fast_screen_update_connection.disconnect();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1302,9 +1302,9 @@ Mixer_UI::track_list_delete (const Gtk::TreeModel::Path&)
|
|||
DEBUG_TRACE (DEBUG::OrderKeys, "mixer UI treeview row deleted\n");
|
||||
sync_presentation_info_from_treeview ();
|
||||
|
||||
if (_route_deletion_in_progress) {
|
||||
redisplay_track_list ();
|
||||
}
|
||||
if (_route_deletion_in_progress) {
|
||||
redisplay_track_list ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
|
|||
|
||||
void register_actions ();
|
||||
|
||||
void load_bindings ();
|
||||
Gtkmm2ext::Bindings* bindings;
|
||||
void load_bindings ();
|
||||
Gtkmm2ext::Bindings* bindings;
|
||||
|
||||
protected:
|
||||
void set_axis_targets_for_operation ();
|
||||
|
|
|
|||
|
|
@ -119,15 +119,15 @@ MonitorSelector::set_state (ARDOUR::BundleChannel c[2], bool s)
|
|||
return;
|
||||
}
|
||||
|
||||
if (s) {
|
||||
if (s) {
|
||||
if (!f->connected_to (*j)) {
|
||||
_io->connect (f, *j, 0);
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if (f->connected_to (*j)) {
|
||||
_io->disconnect (f, *j, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -487,12 +487,12 @@ MonoPanner::on_key_press_event (GdkEventKey* ev)
|
|||
void
|
||||
MonoPanner::set_colors ()
|
||||
{
|
||||
colors.fill = UIConfiguration::instance().color_mod ("mono panner fill", "panner fill");
|
||||
colors.outline = UIConfiguration::instance().color ("mono panner outline");
|
||||
colors.text = UIConfiguration::instance().color ("mono panner text");
|
||||
colors.background = UIConfiguration::instance().color ("mono panner bg");
|
||||
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.fill = UIConfiguration::instance().color_mod ("mono panner fill", "panner fill");
|
||||
colors.outline = UIConfiguration::instance().color ("mono panner outline");
|
||||
colors.text = UIConfiguration::instance().color ("mono panner text");
|
||||
colors.background = UIConfiguration::instance().color ("mono panner bg");
|
||||
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");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace ARDOUR {
|
|||
}
|
||||
|
||||
namespace PBD {
|
||||
class Controllable;
|
||||
class Controllable;
|
||||
}
|
||||
|
||||
class MonoPanner : public PannerInterface
|
||||
|
|
@ -42,7 +42,7 @@ class MonoPanner : public PannerInterface
|
|||
MonoPanner (boost::shared_ptr<ARDOUR::PannerShell>);
|
||||
~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> StopGesture;
|
||||
|
|
@ -52,42 +52,42 @@ class MonoPanner : public PannerInterface
|
|||
bool on_button_press_event (GdkEventButton*);
|
||||
bool on_button_release_event (GdkEventButton*);
|
||||
bool on_motion_notify_event (GdkEventMotion*);
|
||||
bool on_scroll_event (GdkEventScroll*);
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
bool on_scroll_event (GdkEventScroll*);
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
|
||||
private:
|
||||
PannerEditor* editor ();
|
||||
boost::shared_ptr<ARDOUR::PannerShell> _panner_shell;
|
||||
|
||||
boost::shared_ptr<PBD::Controllable> position_control;
|
||||
PBD::ScopedConnectionList panvalue_connections;
|
||||
PBD::ScopedConnectionList panshell_connections;
|
||||
int drag_start_x;
|
||||
int last_drag_x;
|
||||
double accumulated_delta;
|
||||
bool detented;
|
||||
boost::shared_ptr<PBD::Controllable> position_control;
|
||||
PBD::ScopedConnectionList panvalue_connections;
|
||||
PBD::ScopedConnectionList panshell_connections;
|
||||
int drag_start_x;
|
||||
int last_drag_x;
|
||||
double accumulated_delta;
|
||||
bool detented;
|
||||
|
||||
BindingProxy position_binder;
|
||||
BindingProxy position_binder;
|
||||
|
||||
void set_tooltip ();
|
||||
void set_tooltip ();
|
||||
|
||||
struct ColorScheme {
|
||||
uint32_t outline;
|
||||
uint32_t fill;
|
||||
uint32_t text;
|
||||
uint32_t background;
|
||||
uint32_t pos_outline;
|
||||
uint32_t pos_fill;
|
||||
};
|
||||
struct ColorScheme {
|
||||
uint32_t outline;
|
||||
uint32_t fill;
|
||||
uint32_t text;
|
||||
uint32_t background;
|
||||
uint32_t pos_outline;
|
||||
uint32_t pos_fill;
|
||||
};
|
||||
|
||||
bool _dragging;
|
||||
|
||||
static Pango::AttrList panner_font_attributes;
|
||||
static bool have_font;
|
||||
|
||||
static ColorScheme colors;
|
||||
static void set_colors ();
|
||||
static bool have_colors;
|
||||
static ColorScheme colors;
|
||||
static void set_colors ();
|
||||
static bool have_colors;
|
||||
void color_handler ();
|
||||
void bypass_handler ();
|
||||
void pannable_handler ();
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ NagScreen::offer_to_donate ()
|
|||
{
|
||||
/* we don't care if it fails */
|
||||
|
||||
PBD::open_uri (Config->get_donate_url());
|
||||
PBD::open_uri (Config->get_donate_url());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -321,6 +321,6 @@ NoteBase::mouse_near_ends () const
|
|||
bool
|
||||
NoteBase::big_enough_to_trim () const
|
||||
{
|
||||
return (x1() - x0()) > 10;
|
||||
return (x1() - x0()) > 10;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ NSM_Client::NSM_Client()
|
|||
int
|
||||
NSM_Client::command_save(char **out_msg)
|
||||
{
|
||||
(void) out_msg;
|
||||
(void) out_msg;
|
||||
|
||||
ARDOUR_UI::instance()->save_state();
|
||||
int r = ERR_OK;
|
||||
ARDOUR_UI::instance()->save_state();
|
||||
int r = ERR_OK;
|
||||
|
||||
return r;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -47,13 +47,13 @@ NSM_Client::command_open(const char* name,
|
|||
const char* client_id,
|
||||
char** /*out_msg*/)
|
||||
{
|
||||
int r = ERR_OK;
|
||||
int r = ERR_OK;
|
||||
|
||||
ARDOUR_COMMAND_LINE::session_name = name;
|
||||
ARDOUR_COMMAND_LINE::backend_client_name = client_id;
|
||||
ARDOUR_COMMAND_LINE::session_name = name;
|
||||
ARDOUR_COMMAND_LINE::backend_client_name = client_id;
|
||||
|
||||
if (ARDOUR_UI::instance()->get_session_parameters(true, false, "")) {
|
||||
return ERR_GENERAL;
|
||||
}
|
||||
return r;
|
||||
if (ARDOUR_UI::instance()->get_session_parameters(true, false, "")) {
|
||||
return ERR_GENERAL;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,17 +23,17 @@
|
|||
|
||||
class NSM_Client:public NSM::Client
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
NSM_Client();
|
||||
~NSM_Client() { }
|
||||
NSM_Client();
|
||||
~NSM_Client() { }
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
int command_open(const char *name,
|
||||
const char *display_name,
|
||||
const char *client_id,
|
||||
char **out_msg);
|
||||
int command_save(char **out_msg);
|
||||
int command_open(const char *name,
|
||||
const char *display_name,
|
||||
const char *client_id,
|
||||
char **out_msg);
|
||||
int command_save(char **out_msg);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -43,262 +43,273 @@ namespace NSM
|
|||
#undef OSC_REPLY
|
||||
#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 ( )
|
||||
{
|
||||
nsm_addr = 0;
|
||||
_nsm_client_id = 0;
|
||||
_nsm_client_path = 0;
|
||||
_session_manager_name = 0;
|
||||
nsm_url = "";
|
||||
nsm_is_active = false;
|
||||
_server = 0;
|
||||
_st = 0;
|
||||
}
|
||||
Client::Client ()
|
||||
{
|
||||
nsm_addr = 0;
|
||||
_nsm_client_id = 0;
|
||||
_nsm_client_path = 0;
|
||||
_session_manager_name = 0;
|
||||
nsm_url = "";
|
||||
nsm_is_active = false;
|
||||
_server = 0;
|
||||
_st = 0;
|
||||
}
|
||||
|
||||
Client::~Client ( )
|
||||
{
|
||||
if ( _st )
|
||||
stop();
|
||||
Client::~Client ()
|
||||
{
|
||||
if (_st) {
|
||||
stop();
|
||||
}
|
||||
|
||||
if ( _st )
|
||||
lo_server_thread_free( _st );
|
||||
else
|
||||
lo_server_free ( _server );
|
||||
}
|
||||
if (_st) {
|
||||
lo_server_thread_free (_st);
|
||||
} else {
|
||||
lo_server_free (_server);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::announce ( const char *application_name, const char *capabilities, const char *process_name )
|
||||
{
|
||||
void
|
||||
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 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!to)
|
||||
{
|
||||
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,
|
||||
capabilities,
|
||||
process_name,
|
||||
1, /* api_major_version */
|
||||
0, /* api_minor_version */
|
||||
pid );
|
||||
pid);
|
||||
|
||||
lo_address_free( to );
|
||||
}
|
||||
lo_address_free (to);
|
||||
}
|
||||
|
||||
void
|
||||
Client::progress ( float p )
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
{
|
||||
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/progress", "f", p );
|
||||
}
|
||||
}
|
||||
void
|
||||
Client::progress (float p)
|
||||
{
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/progress", "f", p);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::is_dirty ( void )
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
{
|
||||
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_dirty", "" );
|
||||
}
|
||||
}
|
||||
void
|
||||
Client::is_dirty (void)
|
||||
{
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_dirty", "");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::is_clean ( void )
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
{
|
||||
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_clean", "" );
|
||||
}
|
||||
}
|
||||
void
|
||||
Client::is_clean (void)
|
||||
{
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/is_clean", "");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::message ( int priority, const char *msg )
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
{
|
||||
lo_send_from( nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/message", "is", priority, msg );
|
||||
}
|
||||
}
|
||||
void
|
||||
Client::message (int priority, const char *msg)
|
||||
{
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_from (nsm_addr, _server, LO_TT_IMMEDIATE, "/nsm/client/message", "is", priority, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Client::broadcast ( lo_message msg )
|
||||
{
|
||||
if ( nsm_is_active )
|
||||
{
|
||||
lo_send_message_from( nsm_addr, _server, "/nsm/server/broadcast", msg );
|
||||
}
|
||||
}
|
||||
void
|
||||
Client::broadcast (lo_message msg)
|
||||
{
|
||||
if (nsm_is_active)
|
||||
{
|
||||
lo_send_message_from (nsm_addr, _server, "/nsm/server/broadcast", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::check ( int timeout )
|
||||
{
|
||||
if ( lo_server_wait( _server, timeout ) )
|
||||
while ( lo_server_recv_noblock( _server, 0 ) ) {}
|
||||
}
|
||||
void
|
||||
Client::check (int timeout)
|
||||
{
|
||||
if (lo_server_wait (_server, timeout)) {
|
||||
while (lo_server_recv_noblock (_server, 0));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Client::start ( )
|
||||
{
|
||||
lo_server_thread_start( _st );
|
||||
}
|
||||
void
|
||||
Client::start ()
|
||||
{
|
||||
lo_server_thread_start (_st);
|
||||
}
|
||||
|
||||
void
|
||||
Client::stop ( )
|
||||
{
|
||||
lo_server_thread_stop( _st );
|
||||
}
|
||||
void
|
||||
Client::stop ()
|
||||
{
|
||||
lo_server_thread_stop (_st);
|
||||
}
|
||||
|
||||
int
|
||||
Client::init ( const char *nsm_url )
|
||||
{
|
||||
this->nsm_url = nsm_url;
|
||||
int
|
||||
Client::init (const char *nsm_url)
|
||||
{
|
||||
this->nsm_url = nsm_url;
|
||||
|
||||
lo_address addr = lo_address_new_from_url( nsm_url );
|
||||
int proto = lo_address_get_protocol( addr );
|
||||
lo_address_free( addr );
|
||||
lo_address addr = lo_address_new_from_url (nsm_url);
|
||||
int proto = lo_address_get_protocol (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 )
|
||||
return -1;
|
||||
if (!_server) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
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, "/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/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, "/error", "sis", &Client::osc_error, 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/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, NULL, NULL, &Client::osc_broadcast, this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Client::init_thread ( const char *nsm_url )
|
||||
{
|
||||
this->nsm_url = nsm_url;
|
||||
int
|
||||
Client::init_thread (const char *nsm_url)
|
||||
{
|
||||
this->nsm_url = nsm_url;
|
||||
|
||||
lo_address addr = lo_address_new_from_url( nsm_url );
|
||||
int proto = lo_address_get_protocol( addr );
|
||||
lo_address_free( addr );
|
||||
lo_address addr = lo_address_new_from_url (nsm_url);
|
||||
int proto = lo_address_get_protocol (addr);
|
||||
lo_address_free (addr);
|
||||
|
||||
_st = lo_server_thread_new_with_proto( NULL, proto, NULL );
|
||||
_server = lo_server_thread_get_server( _st );
|
||||
_st = lo_server_thread_new_with_proto (NULL, proto, NULL);
|
||||
_server = lo_server_thread_get_server (_st);
|
||||
|
||||
if ( ! _server || ! _st )
|
||||
return -1;
|
||||
if (! _server || ! _st) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
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, "/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/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, "/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, "/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/session_is_loaded", "", &Client::osc_session_is_loaded, this);
|
||||
lo_server_thread_add_method (_st, NULL, NULL, &Client::osc_broadcast, this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/************************/
|
||||
/* OSC Message Handlers */
|
||||
/************************/
|
||||
|
||||
int
|
||||
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 );
|
||||
}
|
||||
int
|
||||
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);
|
||||
}
|
||||
|
||||
int
|
||||
Client::osc_save ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
|
||||
{
|
||||
char *out_msg = NULL;
|
||||
int
|
||||
Client::osc_save (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
|
||||
{
|
||||
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 )
|
||||
OSC_REPLY_ERR( r, ( out_msg ? out_msg : "") );
|
||||
else
|
||||
OSC_REPLY( "OK" );
|
||||
if (r) {
|
||||
OSC_REPLY_ERR (r, (out_msg ? out_msg : ""));
|
||||
} else {
|
||||
OSC_REPLY ("OK");
|
||||
}
|
||||
|
||||
if ( out_msg )
|
||||
free( out_msg );
|
||||
if (out_msg) {
|
||||
free (out_msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Client::osc_open ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data )
|
||||
{
|
||||
char *out_msg = NULL;
|
||||
int
|
||||
Client::osc_open (const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
|
||||
{
|
||||
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_path = strdup( &argv[0]->s );
|
||||
nsm->_nsm_client_id = strdup (&argv[2]->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 )
|
||||
OSC_REPLY_ERR( r, ( out_msg ? out_msg : "") );
|
||||
else
|
||||
OSC_REPLY( "OK" );
|
||||
if (r) {
|
||||
OSC_REPLY_ERR (r, (out_msg ? out_msg : ""));
|
||||
} else {
|
||||
OSC_REPLY ("OK");
|
||||
}
|
||||
|
||||
if ( out_msg )
|
||||
free( out_msg );
|
||||
if (out_msg) {
|
||||
free(out_msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
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;
|
||||
int
|
||||
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->command_session_is_loaded();
|
||||
nsm->command_session_is_loaded();
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
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" ) )
|
||||
return -1;
|
||||
int
|
||||
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")) {
|
||||
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
|
||||
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" ) )
|
||||
return -1;
|
||||
int
|
||||
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")) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
NSM::Client *nsm = (NSM::Client*)user_data;
|
||||
NSM::Client *nsm = (NSM::Client*)user_data;
|
||||
|
||||
nsm->nsm_is_active = true;
|
||||
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_is_active = true;
|
||||
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->command_active( nsm->nsm_is_active );
|
||||
nsm->command_active (nsm->nsm_is_active);
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,89 +24,89 @@
|
|||
namespace NSM
|
||||
{
|
||||
|
||||
class Client
|
||||
{
|
||||
class Client
|
||||
{
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
const char *nsm_url;
|
||||
const char *nsm_url;
|
||||
|
||||
lo_server _server;
|
||||
lo_server_thread _st;
|
||||
lo_address nsm_addr;
|
||||
lo_server _server;
|
||||
lo_server_thread _st;
|
||||
lo_address nsm_addr;
|
||||
|
||||
bool nsm_is_active;
|
||||
char *_nsm_client_id;
|
||||
char *_session_manager_name;
|
||||
char *_nsm_client_path;
|
||||
bool nsm_is_active;
|
||||
char *_nsm_client_id;
|
||||
char *_session_manager_name;
|
||||
char *_nsm_client_path;
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
ERR_OK = 0,
|
||||
ERR_GENERAL = -1,
|
||||
ERR_INCOMPATIBLE_API = -2,
|
||||
ERR_BLACKLISTED = -3,
|
||||
ERR_LAUNCH_FAILED = -4,
|
||||
ERR_NO_SUCH_FILE = -5,
|
||||
ERR_NO_SESSION_OPEN = -6,
|
||||
ERR_UNSAVED_CHANGES = -7,
|
||||
ERR_NOT_NOW = -8
|
||||
};
|
||||
enum
|
||||
{
|
||||
ERR_OK = 0,
|
||||
ERR_GENERAL = -1,
|
||||
ERR_INCOMPATIBLE_API = -2,
|
||||
ERR_BLACKLISTED = -3,
|
||||
ERR_LAUNCH_FAILED = -4,
|
||||
ERR_NO_SUCH_FILE = -5,
|
||||
ERR_NO_SESSION_OPEN = -6,
|
||||
ERR_UNSAVED_CHANGES = -7,
|
||||
ERR_NOT_NOW = -8
|
||||
};
|
||||
|
||||
Client ( );
|
||||
virtual ~Client ( );
|
||||
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 *client_id ( void ) { return _nsm_client_id; }
|
||||
const char *client_path ( void ) { return _nsm_client_path; }
|
||||
const char *session_manager_name ( void ) { return _session_manager_name; }
|
||||
const char *client_id ( void ) { return _nsm_client_id; }
|
||||
const char *client_path ( void ) { return _nsm_client_path; }
|
||||
|
||||
/* Client->Server methods */
|
||||
void is_dirty ( void );
|
||||
void is_clean ( void );
|
||||
void progress ( float f );
|
||||
void message( int priority, const char *msg );
|
||||
void announce ( const char *appliction_name, const char *capabilities, const char *process_name );
|
||||
/* Client->Server methods */
|
||||
void is_dirty ( void );
|
||||
void is_clean ( void );
|
||||
void progress ( float f );
|
||||
void message( int priority, const char *msg );
|
||||
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 */
|
||||
int init ( const char *nsm_url );
|
||||
/* init with threading */
|
||||
int init_thread ( const char *nsm_url );
|
||||
/* init without threading */
|
||||
int init ( const char *nsm_url );
|
||||
/* init with threading */
|
||||
int init_thread ( const char *nsm_url );
|
||||
|
||||
/* call this periodically to check for new messages */
|
||||
void check ( int timeout = 0 );
|
||||
/* call this periodically to check for new messages */
|
||||
void check ( int timeout = 0 );
|
||||
|
||||
/* or call these to start and stop a thread (must do your own locking in handler!) */
|
||||
void start ( void );
|
||||
void stop ( void );
|
||||
/* or call these to start and stop a thread (must do your own locking in handler!) */
|
||||
void start ( void );
|
||||
void stop ( void );
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
/* 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_save ( char **out_msg ) = 0;
|
||||
/* 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_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. */
|
||||
virtual int command_broadcast ( const char *, lo_message ) { return -1; }
|
||||
/* 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; }
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
/* 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_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_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_broadcast ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data );
|
||||
/* 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_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_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_broadcast ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data );
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -296,8 +296,8 @@ Panner2d::handle_position_change ()
|
|||
uint32_t n;
|
||||
double w = panner_shell->pannable()->pan_width_control->get_value();
|
||||
|
||||
position.position = AngularVector (panner_shell->pannable()->pan_azimuth_control->get_value() * 360.0,
|
||||
panner_shell->pannable()->pan_elevation_control->get_value() * 90.0);
|
||||
position.position = AngularVector (panner_shell->pannable()->pan_azimuth_control->get_value() * 360.0,
|
||||
panner_shell->pannable()->pan_elevation_control->get_value() * 90.0);
|
||||
|
||||
for (uint32_t i = 0; i < signals.size(); ++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 */
|
||||
|
||||
PBD::AngularVector dp = position.position;
|
||||
if (!have_elevation) dp.ele = 0;
|
||||
dp.azi = 270 - dp.azi;
|
||||
dp.cartesian (c);
|
||||
PBD::AngularVector dp = position.position;
|
||||
if (!have_elevation) dp.ele = 0;
|
||||
dp.azi = 270 - dp.azi;
|
||||
dp.cartesian (c);
|
||||
|
||||
cart_to_gtk (c);
|
||||
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) {
|
||||
for (Targets::const_iterator i = speakers.begin(); i != speakers.end(); ++i) {
|
||||
candidate = *i;
|
||||
PBD::AngularVector sp = candidate->position;
|
||||
sp.azi = 270 -sp.azi;
|
||||
CartesianVector c;
|
||||
sp.cartesian (c);
|
||||
cart_to_gtk (c);
|
||||
PBD::AngularVector sp = candidate->position;
|
||||
sp.azi = 270 -sp.azi;
|
||||
CartesianVector c;
|
||||
sp.cartesian (c);
|
||||
cart_to_gtk (c);
|
||||
|
||||
distance = sqrt ((c.x - x) * (c.x - x) +
|
||||
(c.y - y) * (c.y - y));
|
||||
|
|
@ -523,7 +523,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
|
|||
}
|
||||
|
||||
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) {
|
||||
/* arc to show "diffusion" */
|
||||
|
|
@ -533,7 +533,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
|
|||
|
||||
cairo_save (cr);
|
||||
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_move_to (cr, 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 */
|
||||
|
||||
PBD::AngularVector dp = position.position;
|
||||
if (!have_elevation) dp.ele = 0;
|
||||
dp.azi = 270 - dp.azi;
|
||||
PBD::AngularVector dp = position.position;
|
||||
if (!have_elevation) dp.ele = 0;
|
||||
dp.azi = 270 - dp.azi;
|
||||
dp.cartesian (c);
|
||||
cart_to_gtk (c);
|
||||
|
||||
|
|
@ -588,7 +588,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
|
|||
*/
|
||||
PBD::AngularVector sp = signal->position;
|
||||
if (!have_elevation) sp.ele = 0;
|
||||
sp.azi += 270.0;
|
||||
sp.azi += 270.0;
|
||||
sp.cartesian (c);
|
||||
cart_to_gtk (c);
|
||||
|
||||
|
|
@ -626,8 +626,8 @@ Panner2d::on_expose_event (GdkEventExpose *event)
|
|||
|
||||
if (speaker->visible) {
|
||||
|
||||
PBD::AngularVector sp = speaker->position;
|
||||
sp.azi += 270.0;
|
||||
PBD::AngularVector sp = speaker->position;
|
||||
sp.azi += 270.0;
|
||||
CartesianVector c;
|
||||
sp.cartesian (c);
|
||||
cart_to_gtk (c);
|
||||
|
|
@ -683,29 +683,29 @@ bool
|
|||
Panner2d::on_button_press_event (GdkEventButton *ev)
|
||||
{
|
||||
GdkModifierType state;
|
||||
int x;
|
||||
int y;
|
||||
bool is_signal;
|
||||
int x;
|
||||
int y;
|
||||
bool is_signal;
|
||||
|
||||
if (ev->type == GDK_2BUTTON_PRESS && ev->button == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
did_move = false;
|
||||
did_move = false;
|
||||
|
||||
switch (ev->button) {
|
||||
case 1:
|
||||
case 2:
|
||||
x = ev->x - hoffset;
|
||||
y = ev->y - voffset;
|
||||
x = ev->x - hoffset;
|
||||
y = ev->y - voffset;
|
||||
|
||||
if ((drag_target = find_closest_object (x, y, is_signal)) != 0) {
|
||||
if (!is_signal) {
|
||||
panner_shell->panner()->set_position (drag_target->position.azi/360.0);
|
||||
drag_target = 0;
|
||||
} else {
|
||||
drag_target->set_selected (true);
|
||||
}
|
||||
if (!is_signal) {
|
||||
panner_shell->panner()->set_position (drag_target->position.azi/360.0);
|
||||
drag_target = 0;
|
||||
} else {
|
||||
drag_target->set_selected (true);
|
||||
}
|
||||
}
|
||||
|
||||
state = (GdkModifierType) ev->state;
|
||||
|
|
@ -731,7 +731,7 @@ Panner2d::on_button_release_event (GdkEventButton *ev)
|
|||
x = (int) floor (ev->x);
|
||||
y = (int) floor (ev->y);
|
||||
state = (GdkModifierType) ev->state;
|
||||
ret = handle_motion (x, y, state);
|
||||
ret = handle_motion (x, y, state);
|
||||
drag_target = 0;
|
||||
break;
|
||||
|
||||
|
|
@ -791,7 +791,7 @@ Panner2d::handle_motion (gint evx, gint evy, GdkModifierType state)
|
|||
if (!have_elevation) {
|
||||
clamp_to_circle (cp.x, cp.y);
|
||||
cp.angular (av);
|
||||
av.azi = fmod(270 - av.azi, 360);
|
||||
av.azi = fmod(270 - av.azi, 360);
|
||||
if (drag_target == &position) {
|
||||
double degree_fract = av.azi / 360.0;
|
||||
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;
|
||||
av.azi = r2d * atan2(cp.y, cp.x);
|
||||
av.ele = r2d * asin(cp.z);
|
||||
av.azi = fmod(270 - av.azi, 360);
|
||||
av.azi = fmod(270 - av.azi, 360);
|
||||
|
||||
if (drag_target == &position) {
|
||||
double azi_fract = av.azi / 360.0;
|
||||
|
|
@ -821,18 +821,18 @@ Panner2d::handle_motion (gint evx, gint evy, GdkModifierType state)
|
|||
bool
|
||||
Panner2d::on_scroll_event (GdkEventScroll* ev)
|
||||
{
|
||||
switch (ev->direction) {
|
||||
case GDK_SCROLL_UP:
|
||||
case GDK_SCROLL_RIGHT:
|
||||
panner_shell->panner()->set_position (panner_shell->pannable()->pan_azimuth_control->get_value() - 1.0/360.0);
|
||||
break;
|
||||
switch (ev->direction) {
|
||||
case GDK_SCROLL_UP:
|
||||
case GDK_SCROLL_RIGHT:
|
||||
panner_shell->panner()->set_position (panner_shell->pannable()->pan_azimuth_control->get_value() - 1.0/360.0);
|
||||
break;
|
||||
|
||||
case GDK_SCROLL_DOWN:
|
||||
case GDK_SCROLL_LEFT:
|
||||
panner_shell->panner()->set_position (panner_shell->pannable()->pan_azimuth_control->get_value() + 1.0/360.0);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
case GDK_SCROLL_DOWN:
|
||||
case GDK_SCROLL_LEFT:
|
||||
panner_shell->panner()->set_position (panner_shell->pannable()->pan_azimuth_control->get_value() + 1.0/360.0);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -840,28 +840,28 @@ Panner2d::cart_to_gtk (CartesianVector& c) const
|
|||
{
|
||||
/* cartesian coordinate space:
|
||||
center = 0.0
|
||||
dimension = 2.0 * 2.0
|
||||
increasing y moves up
|
||||
so max values along each axis are -1..+1
|
||||
dimension = 2.0 * 2.0
|
||||
increasing y moves up
|
||||
so max values along each axis are -1..+1
|
||||
|
||||
GTK uses a coordinate space that is:
|
||||
top left = 0.0
|
||||
dimension = (radius*2.0) * (radius*2.0)
|
||||
increasing y moves down
|
||||
dimension = (radius*2.0) * (radius*2.0)
|
||||
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);
|
||||
/* extra subtraction inverts the y-axis to match "increasing y moves down" */
|
||||
c.y = diameter - (diameter * ((c.y + 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" */
|
||||
c.y = diameter - (diameter * ((c.y + 1.0) / 2.0));
|
||||
}
|
||||
|
||||
void
|
||||
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.y = (((diameter - c.y) / diameter) * 2.0) - 1.0;
|
||||
c.y = (((diameter - c.y) / diameter) * 2.0) - 1.0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ PannerInterface::PannerInterface (boost::shared_ptr<Panner> p)
|
|||
, _send_mode (false)
|
||||
, _editor (0)
|
||||
{
|
||||
set_flags (Gtk::CAN_FOCUS);
|
||||
set_flags (Gtk::CAN_FOCUS);
|
||||
|
||||
add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|
|
||||
Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|
|
||||
Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|
|
||||
Gdk::SCROLL_MASK|
|
||||
Gdk::POINTER_MOTION_MASK);
|
||||
add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|
|
||||
Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|
|
||||
Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|
|
||||
Gdk::SCROLL_MASK|
|
||||
Gdk::POINTER_MOTION_MASK);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,10 +60,10 @@ PannerUI::PannerUI (Session* s)
|
|||
pan_astate_menu = 0;
|
||||
pan_astyle_menu = 0;
|
||||
in_pan_update = false;
|
||||
_stereo_panner = 0;
|
||||
_stereo_panner = 0;
|
||||
_mono_panner = 0;
|
||||
_ignore_width_change = false;
|
||||
_ignore_position_change = false;
|
||||
_ignore_width_change = false;
|
||||
_ignore_position_change = false;
|
||||
|
||||
pan_automation_state_button.set_name ("MixerAutomationPlaybackButton");
|
||||
|
||||
|
|
@ -87,8 +87,8 @@ PannerUI::PannerUI (Session* s)
|
|||
void
|
||||
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 ();
|
||||
|
||||
|
|
@ -98,17 +98,17 @@ PannerUI::set_panner (boost::shared_ptr<PannerShell> ps, boost::shared_ptr<Panne
|
|||
delete pan_astate_menu;
|
||||
pan_astate_menu = 0;
|
||||
|
||||
_panshell = ps;
|
||||
_panshell = ps;
|
||||
_panner = p;
|
||||
|
||||
delete twod_panner;
|
||||
twod_panner = 0;
|
||||
|
||||
delete _stereo_panner;
|
||||
_stereo_panner = 0;
|
||||
delete _stereo_panner;
|
||||
_stereo_panner = 0;
|
||||
|
||||
delete _mono_panner;
|
||||
_mono_panner = 0;
|
||||
delete _mono_panner;
|
||||
_mono_panner = 0;
|
||||
|
||||
if (!_panner) {
|
||||
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());
|
||||
|
||||
/* new panner object, force complete reset of panner GUI
|
||||
*/
|
||||
/* new panner object, force complete reset of panner GUI
|
||||
*/
|
||||
|
||||
_current_nouts = 0;
|
||||
_current_nins = 0;
|
||||
_current_nouts = 0;
|
||||
_current_nins = 0;
|
||||
|
||||
setup_pan ();
|
||||
setup_pan ();
|
||||
update_pan_sensitive ();
|
||||
pan_automation_state_changed ();
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ PannerUI::build_astyle_menu ()
|
|||
void
|
||||
PannerUI::on_size_allocate (Allocation& a)
|
||||
{
|
||||
HBox::on_size_allocate (a);
|
||||
HBox::on_size_allocate (a);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -192,8 +192,8 @@ PannerUI::~PannerUI ()
|
|||
delete pan_menu;
|
||||
delete pan_astyle_menu;
|
||||
delete pan_astate_menu;
|
||||
delete _stereo_panner;
|
||||
delete _mono_panner;
|
||||
delete _stereo_panner;
|
||||
delete _mono_panner;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -217,16 +217,16 @@ PannerUI::setup_pan ()
|
|||
return;
|
||||
}
|
||||
|
||||
_current_nins = nins;
|
||||
_current_nouts = nouts;
|
||||
_current_uri = _panshell->panner_gui_uri();
|
||||
_current_nins = nins;
|
||||
_current_nouts = nouts;
|
||||
_current_uri = _panshell->panner_gui_uri();
|
||||
|
||||
container_clear (pan_vbox);
|
||||
container_clear (pan_vbox);
|
||||
|
||||
delete twod_panner;
|
||||
twod_panner = 0;
|
||||
delete _stereo_panner;
|
||||
_stereo_panner = 0;
|
||||
delete twod_panner;
|
||||
twod_panner = 0;
|
||||
delete _stereo_panner;
|
||||
_stereo_panner = 0;
|
||||
delete _mono_panner;
|
||||
_mono_panner = 0;
|
||||
|
||||
|
|
@ -338,21 +338,21 @@ PannerUI::set_send_drawing_mode (bool onoff)
|
|||
void
|
||||
PannerUI::start_touch (boost::weak_ptr<AutomationControl> wac)
|
||||
{
|
||||
boost::shared_ptr<AutomationControl> ac = wac.lock();
|
||||
if (!ac) {
|
||||
return;
|
||||
}
|
||||
ac->start_touch (ac->session().transport_frame());
|
||||
boost::shared_ptr<AutomationControl> ac = wac.lock();
|
||||
if (!ac) {
|
||||
return;
|
||||
}
|
||||
ac->start_touch (ac->session().transport_frame());
|
||||
}
|
||||
|
||||
void
|
||||
PannerUI::stop_touch (boost::weak_ptr<AutomationControl> wac)
|
||||
{
|
||||
boost::shared_ptr<AutomationControl> ac = wac.lock();
|
||||
if (!ac) {
|
||||
return;
|
||||
}
|
||||
ac->stop_touch (false, ac->session().transport_frame());
|
||||
boost::shared_ptr<AutomationControl> ac = wac.lock();
|
||||
if (!ac) {
|
||||
return;
|
||||
}
|
||||
ac->stop_touch (false, ac->session().transport_frame());
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -465,13 +465,13 @@ PannerUI::pan_set_custom_type (std::string uri) {
|
|||
void
|
||||
PannerUI::effective_pan_display ()
|
||||
{
|
||||
if (_stereo_panner) {
|
||||
_stereo_panner->queue_draw ();
|
||||
} else if (_mono_panner) {
|
||||
_mono_panner->queue_draw ();
|
||||
} else if (twod_panner) {
|
||||
twod_panner->queue_draw ();
|
||||
}
|
||||
if (_stereo_panner) {
|
||||
_stereo_panner->queue_draw ();
|
||||
} else if (_mono_panner) {
|
||||
_mono_panner->queue_draw ();
|
||||
} else if (twod_panner) {
|
||||
twod_panner->queue_draw ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -479,11 +479,11 @@ PannerUI::update_pan_sensitive ()
|
|||
{
|
||||
bool const sensitive = !(_panner->pannable()->automation_state() & Play);
|
||||
|
||||
pan_vbox.set_sensitive (sensitive);
|
||||
pan_vbox.set_sensitive (sensitive);
|
||||
|
||||
if (big_window) {
|
||||
big_window->set_sensitive (sensitive);
|
||||
}
|
||||
if (big_window) {
|
||||
big_window->set_sensitive (sensitive);
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
|
|
@ -512,21 +512,21 @@ PannerUI::pan_automation_state_button_event (GdkEventButton *ev)
|
|||
void
|
||||
PannerUI::pan_automation_state_changed ()
|
||||
{
|
||||
boost::shared_ptr<Pannable> pannable (_panner->pannable());
|
||||
boost::shared_ptr<Pannable> pannable (_panner->pannable());
|
||||
|
||||
switch (_width) {
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
bool x = (pannable->automation_state() != ARDOUR::Off);
|
||||
|
||||
if (pan_automation_state_button.get_active() != x) {
|
||||
ignore_toggle = true;
|
||||
ignore_toggle = true;
|
||||
pan_automation_state_button.set_active (x);
|
||||
ignore_toggle = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace ARDOUR {
|
|||
class Panner;
|
||||
class PannerShell;
|
||||
class Delivery;
|
||||
class AutomationControl;
|
||||
class AutomationControl;
|
||||
}
|
||||
|
||||
namespace Gtkmm2ext {
|
||||
|
|
@ -108,15 +108,15 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
|||
Gtk::VBox poswidth_box;
|
||||
Width _width;
|
||||
|
||||
StereoPanner* _stereo_panner;
|
||||
StereoPanner* _stereo_panner;
|
||||
MonoPanner* _mono_panner;
|
||||
|
||||
bool _ignore_width_change;
|
||||
bool _ignore_position_change;
|
||||
void width_adjusted ();
|
||||
void show_width ();
|
||||
void position_adjusted ();
|
||||
void show_position ();
|
||||
bool _ignore_width_change;
|
||||
bool _ignore_position_change;
|
||||
void width_adjusted ();
|
||||
void show_width ();
|
||||
void position_adjusted ();
|
||||
void show_position ();
|
||||
|
||||
Gtk::Menu* pan_astate_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 _astate_string (ARDOUR::AutoState, bool);
|
||||
|
||||
void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
|
||||
void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
|
||||
void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
|
||||
void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
|
||||
|
||||
std::map<std::string,std::string> _panner_list;
|
||||
bool _suspend_menu_callbacks;
|
||||
|
|
|
|||
|
|
@ -77,6 +77,6 @@ private:
|
|||
boost::shared_ptr<MIDI::Name::PatchBank> _current_patch_bank;
|
||||
bool _ignore_signals;
|
||||
|
||||
void instrument_info_changed ();
|
||||
PBD::ScopedConnection _info_changed_connection;
|
||||
void instrument_info_changed ();
|
||||
PBD::ScopedConnection _info_changed_connection;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -758,7 +758,7 @@ PluginEqGui::plot_impulse_amplitude(Gtk::Widget *w, cairo_t *cr)
|
|||
// float width = w->get_width();
|
||||
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);
|
||||
|
||||
for (uint32_t i = 0; i < _impulse_fft->bins()-1; i++) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace ARDOUR {
|
|||
}
|
||||
|
||||
namespace GTKArdour {
|
||||
class FFT;
|
||||
class FFT;
|
||||
}
|
||||
|
||||
class PluginEqGui : public Gtk::Table
|
||||
|
|
@ -113,9 +113,9 @@ private:
|
|||
float _analysis_height;
|
||||
|
||||
// My objects
|
||||
GTKArdour::FFT *_impulse_fft;
|
||||
GTKArdour::FFT *_signal_input_fft;
|
||||
GTKArdour::FFT *_signal_output_fft;
|
||||
GTKArdour::FFT *_impulse_fft;
|
||||
GTKArdour::FFT *_signal_input_fft;
|
||||
GTKArdour::FFT *_signal_output_fft;
|
||||
boost::shared_ptr<ARDOUR::Plugin> _plugin;
|
||||
boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert;
|
||||
|
||||
|
|
|
|||
|
|
@ -620,14 +620,14 @@ PluginSelector::run ()
|
|||
PluginPtr p = load_plugin (pp);
|
||||
if (p) {
|
||||
plugins.push_back (p);
|
||||
} else {
|
||||
MessageDialog msg (string_compose (_("The plugin \"%1\" could not be loaded\n\nSee the Log window for more details (maybe)"), pp->name));
|
||||
msg.run ();
|
||||
}
|
||||
} else {
|
||||
MessageDialog msg (string_compose (_("The plugin \"%1\" could not be loaded\n\nSee the Log window for more details (maybe)"), pp->name));
|
||||
msg.run ();
|
||||
}
|
||||
}
|
||||
if (interested_object && !plugins.empty()) {
|
||||
finish = !interested_object->use_plugins (plugins);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
|
@ -689,57 +689,57 @@ PluginSelector::on_show ()
|
|||
}
|
||||
|
||||
struct PluginMenuCompareByCreator {
|
||||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
|
||||
cmp = cmp_nocase_utf8 (a->creator, b->creator);
|
||||
cmp = cmp_nocase_utf8 (a->creator, b->creator);
|
||||
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp == 0) {
|
||||
/* same creator ... compare names */
|
||||
if (cmp_nocase_utf8 (a->name, b->name) < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp == 0) {
|
||||
/* same creator ... compare names */
|
||||
if (cmp_nocase_utf8 (a->name, b->name) < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
struct PluginMenuCompareByName {
|
||||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
|
||||
cmp = cmp_nocase_utf8 (a->name, b->name);
|
||||
cmp = cmp_nocase_utf8 (a->name, b->name);
|
||||
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp == 0) {
|
||||
/* same name ... compare type */
|
||||
if (a->type < b->type) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp == 0) {
|
||||
/* same name ... compare type */
|
||||
if (a->type < b->type) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
struct PluginMenuCompareByCategory {
|
||||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
|
||||
cmp = cmp_nocase_utf8 (a->category, b->category);
|
||||
cmp = cmp_nocase_utf8 (a->category, b->category);
|
||||
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp == 0) {
|
||||
/* same category ... compare names */
|
||||
if (cmp_nocase_utf8 (a->name, b->name) < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp == 0) {
|
||||
/* same category ... compare names */
|
||||
if (cmp_nocase_utf8 (a->name, b->name) < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/** @return Plugin menu. The caller should not delete it */
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ PluginUIWindow::PluginUIWindow (
|
|||
, was_visible (false)
|
||||
, _keyboard_focused (false)
|
||||
#ifdef AUDIOUNIT_SUPPORT
|
||||
, pre_deactivate_x (-1)
|
||||
, pre_deactivate_y (-1)
|
||||
, pre_deactivate_x (-1)
|
||||
, pre_deactivate_y (-1)
|
||||
#endif
|
||||
|
||||
{
|
||||
|
|
@ -188,9 +188,9 @@ PluginUIWindow::on_show ()
|
|||
|
||||
if (_pluginui) {
|
||||
#if defined (HAVE_AUDIOUNITS) && defined(__APPLE__)
|
||||
if (pre_deactivate_x >= 0) {
|
||||
move (pre_deactivate_x, pre_deactivate_y);
|
||||
}
|
||||
if (pre_deactivate_x >= 0) {
|
||||
move (pre_deactivate_x, pre_deactivate_y);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (_pluginui->on_window_show (_title)) {
|
||||
|
|
@ -203,7 +203,7 @@ void
|
|||
PluginUIWindow::on_hide ()
|
||||
{
|
||||
#if defined (HAVE_AUDIOUNITS) && defined(__APPLE__)
|
||||
get_position (pre_deactivate_x, pre_deactivate_y);
|
||||
get_position (pre_deactivate_x, pre_deactivate_y);
|
||||
#endif
|
||||
|
||||
Window::on_hide ();
|
||||
|
|
@ -342,15 +342,15 @@ PluginUIWindow::app_activated (bool)
|
|||
if (yn) {
|
||||
if (was_visible) {
|
||||
_pluginui->activate ();
|
||||
if (pre_deactivate_x >= 0) {
|
||||
move (pre_deactivate_x, pre_deactivate_y);
|
||||
}
|
||||
if (pre_deactivate_x >= 0) {
|
||||
move (pre_deactivate_x, pre_deactivate_y);
|
||||
}
|
||||
present ();
|
||||
was_visible = true;
|
||||
}
|
||||
} else {
|
||||
was_visible = is_visible();
|
||||
get_position (pre_deactivate_x, pre_deactivate_y);
|
||||
get_position (pre_deactivate_x, pre_deactivate_y);
|
||||
hide ();
|
||||
_pluginui->deactivate ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL
|
|||
ArdourButton automation_manual_all_button;
|
||||
/** a button which sets all controls' automation setting to Play */
|
||||
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;
|
||||
/** a button which sets all controls' automation setting to Touch */
|
||||
ArdourButton automation_touch_all_button;
|
||||
|
|
@ -328,8 +328,8 @@ class PluginUIWindow : public ArdourWindow
|
|||
bool was_visible;
|
||||
bool _keyboard_focused;
|
||||
#ifdef AUDIOUNIT_SUPPORT
|
||||
int pre_deactivate_x;
|
||||
int pre_deactivate_y;
|
||||
int pre_deactivate_x;
|
||||
int pre_deactivate_y;
|
||||
#endif
|
||||
|
||||
void keyboard_focused (bool yn);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
||||
/* we never show the monitor bus inputs */
|
||||
/* we never show the monitor bus inputs */
|
||||
|
||||
if (inputs && (*i)->is_monitor()) {
|
||||
continue;
|
||||
}
|
||||
if (inputs && (*i)->is_monitor()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* keep track of IOs that we have taken bundles from,
|
||||
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_other[DataType::num_types];
|
||||
|
||||
string lpn (PROGRAM_NAME);
|
||||
boost::to_lower (lpn);
|
||||
string lpnc = lpn;
|
||||
lpnc += ':';
|
||||
string lpn (PROGRAM_NAME);
|
||||
boost::to_lower (lpn);
|
||||
string lpnc = lpn;
|
||||
lpnc += ':';
|
||||
|
||||
vector<string> ports;
|
||||
if (type == DataType::NIL) {
|
||||
|
|
@ -529,31 +529,31 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
|
|||
!program->has_port(p) &&
|
||||
!other->has_port(p)) {
|
||||
|
||||
/* special hack: ignore MIDI ports labelled Midi-Through. these
|
||||
are basically useless and mess things up for default
|
||||
connections.
|
||||
*/
|
||||
/* special hack: ignore MIDI ports labelled Midi-Through. these
|
||||
are basically useless and mess things up for default
|
||||
connections.
|
||||
*/
|
||||
|
||||
if (p.find ("Midi-Through") != string::npos || p.find ("Midi Through") != string::npos) {
|
||||
++s;
|
||||
continue;
|
||||
}
|
||||
++s;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* special hack: ignore our monitor inputs (which show up here because
|
||||
we excluded them earlier.
|
||||
*/
|
||||
/* special hack: ignore our monitor inputs (which show up here because
|
||||
we excluded them earlier.
|
||||
*/
|
||||
|
||||
string lp = p;
|
||||
string monitor = _("Monitor");
|
||||
|
||||
boost::to_lower (lp);
|
||||
boost::to_lower (monitor);
|
||||
boost::to_lower (monitor);
|
||||
|
||||
if ((lp.find (monitor) != string::npos) &&
|
||||
(lp.find (lpn) != string::npos)) {
|
||||
++s;
|
||||
continue;
|
||||
}
|
||||
if ((lp.find (monitor) != string::npos) &&
|
||||
(lp.find (lpn) != string::npos)) {
|
||||
++s;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* can't use the audio engine for this as we
|
||||
* are looking at ports not owned by the
|
||||
|
|
|
|||
|
|
@ -35,110 +35,110 @@ using namespace ARDOUR;
|
|||
using namespace Gtk;
|
||||
|
||||
PortInsertUI::PortInsertUI (Gtk::Window* parent, ARDOUR::Session* sess, boost::shared_ptr<ARDOUR::PortInsert> pi)
|
||||
: _pi (pi)
|
||||
, latency_button (_("Measure Latency"))
|
||||
, input_selector (parent, sess, pi->input())
|
||||
, output_selector (parent, sess, pi->output())
|
||||
: _pi (pi)
|
||||
, latency_button (_("Measure Latency"))
|
||||
, input_selector (parent, sess, pi->input())
|
||||
, output_selector (parent, sess, pi->output())
|
||||
{
|
||||
latency_hbox.pack_start (latency_button, false, false);
|
||||
latency_hbox.pack_start (latency_display, false, false);
|
||||
latency_hbox.pack_start (latency_button, false, false);
|
||||
latency_hbox.pack_start (latency_display, false, false);
|
||||
latency_hbox.set_spacing (4);
|
||||
|
||||
output_selector.set_min_height_divisor (2);
|
||||
input_selector.set_min_height_divisor (2);
|
||||
|
||||
notebook.append_page (output_selector, _("Send/Output"));
|
||||
notebook.append_page (input_selector, _("Return/Input"));
|
||||
notebook.append_page (output_selector, _("Send/Output"));
|
||||
notebook.append_page (input_selector, _("Return/Input"));
|
||||
|
||||
notebook.set_current_page (0);
|
||||
notebook.set_current_page (0);
|
||||
|
||||
set_spacing (12);
|
||||
pack_start (notebook, true, true);
|
||||
pack_start (latency_hbox, false, false);
|
||||
set_spacing (12);
|
||||
pack_start (notebook, true, true);
|
||||
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"));
|
||||
}
|
||||
|
||||
void
|
||||
PortInsertUI::update_latency_display ()
|
||||
{
|
||||
framecnt_t const sample_rate = AudioEngine::instance()->sample_rate();
|
||||
if (sample_rate == 0) {
|
||||
latency_display.set_text (_("Disconnected from audio engine"));
|
||||
} else {
|
||||
char buf[64];
|
||||
snprintf (buf, sizeof (buf), "%10.3lf frames %10.3lf ms",
|
||||
(float)_pi->latency(), (float)_pi->latency() * 1000.0f/sample_rate);
|
||||
latency_display.set_text(buf);
|
||||
}
|
||||
framecnt_t const sample_rate = AudioEngine::instance()->sample_rate();
|
||||
if (sample_rate == 0) {
|
||||
latency_display.set_text (_("Disconnected from audio engine"));
|
||||
} else {
|
||||
char buf[64];
|
||||
snprintf (buf, sizeof (buf), "%10.3lf frames %10.3lf ms",
|
||||
(float)_pi->latency(), (float)_pi->latency() * 1000.0f/sample_rate);
|
||||
latency_display.set_text(buf);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
PortInsertUI::check_latency_measurement ()
|
||||
{
|
||||
MTDM* mtdm = _pi->mtdm ();
|
||||
MTDM* mtdm = _pi->mtdm ();
|
||||
|
||||
if (mtdm->resolve () < 0) {
|
||||
latency_display.set_text (_("No signal detected"));
|
||||
return true;
|
||||
}
|
||||
if (mtdm->resolve () < 0) {
|
||||
latency_display.set_text (_("No signal detected"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mtdm->err () > 0.3) {
|
||||
mtdm->invert ();
|
||||
mtdm->resolve ();
|
||||
}
|
||||
if (mtdm->err () > 0.3) {
|
||||
mtdm->invert ();
|
||||
mtdm->resolve ();
|
||||
}
|
||||
|
||||
char buf[128];
|
||||
framecnt_t const sample_rate = AudioEngine::instance()->sample_rate();
|
||||
char buf[128];
|
||||
framecnt_t const sample_rate = AudioEngine::instance()->sample_rate();
|
||||
|
||||
if (sample_rate == 0) {
|
||||
latency_display.set_text (_("Disconnected from audio engine"));
|
||||
_pi->stop_latency_detection ();
|
||||
return false;
|
||||
}
|
||||
if (sample_rate == 0) {
|
||||
latency_display.set_text (_("Disconnected from audio engine"));
|
||||
_pi->stop_latency_detection ();
|
||||
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) {
|
||||
strcat (buf, " ??");
|
||||
solid = false;
|
||||
}
|
||||
if (mtdm->err () > 0.2) {
|
||||
strcat (buf, " ??");
|
||||
solid = false;
|
||||
}
|
||||
|
||||
if (mtdm->inv ()) {
|
||||
strcat (buf, " (Inv)");
|
||||
solid = false;
|
||||
}
|
||||
if (mtdm->inv ()) {
|
||||
strcat (buf, " (Inv)");
|
||||
solid = false;
|
||||
}
|
||||
|
||||
if (solid) {
|
||||
_pi->set_measured_latency (rint (mtdm->del()));
|
||||
latency_button.set_active (false);
|
||||
strcat (buf, " (set)");
|
||||
}
|
||||
if (solid) {
|
||||
_pi->set_measured_latency (rint (mtdm->del()));
|
||||
latency_button.set_active (false);
|
||||
strcat (buf, " (set)");
|
||||
}
|
||||
|
||||
latency_display.set_text (buf);
|
||||
latency_display.set_text (buf);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
PortInsertUI::latency_button_toggled ()
|
||||
{
|
||||
if (latency_button.get_active ()) {
|
||||
if (latency_button.get_active ()) {
|
||||
|
||||
_pi->start_latency_detection ();
|
||||
latency_display.set_text (_("Detecting ..."));
|
||||
latency_timeout = Glib::signal_timeout().connect (mem_fun (*this, &PortInsertUI::check_latency_measurement), 250);
|
||||
_pi->start_latency_detection ();
|
||||
latency_display.set_text (_("Detecting ..."));
|
||||
latency_timeout = Glib::signal_timeout().connect (mem_fun (*this, &PortInsertUI::check_latency_measurement), 250);
|
||||
|
||||
} else {
|
||||
_pi->stop_latency_detection ();
|
||||
latency_timeout.disconnect ();
|
||||
update_latency_display ();
|
||||
}
|
||||
} else {
|
||||
_pi->stop_latency_detection ();
|
||||
latency_timeout.disconnect ();
|
||||
update_latency_display ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -37,19 +37,19 @@ class PortInsertUI : public Gtk::VBox
|
|||
void finished (IOSelector::Result);
|
||||
|
||||
private:
|
||||
boost::shared_ptr<ARDOUR::PortInsert> _pi;
|
||||
boost::shared_ptr<ARDOUR::PortInsert> _pi;
|
||||
|
||||
Gtk::Notebook notebook;
|
||||
Gtk::Notebook notebook;
|
||||
Gtkmm2ext::StatefulToggleButton latency_button;
|
||||
IOSelector input_selector;
|
||||
IOSelector output_selector;
|
||||
Gtk::Label latency_display;
|
||||
Gtk::HBox latency_hbox;
|
||||
sigc::connection latency_timeout;
|
||||
Gtk::Label latency_display;
|
||||
Gtk::HBox latency_hbox;
|
||||
sigc::connection latency_timeout;
|
||||
|
||||
bool check_latency_measurement ();
|
||||
void latency_button_toggled ();
|
||||
void update_latency_display ();
|
||||
bool check_latency_measurement ();
|
||||
void latency_button_toggled ();
|
||||
void update_latency_display ();
|
||||
};
|
||||
|
||||
class PortInsertWindow : public ArdourDialog
|
||||
|
|
|
|||
|
|
@ -483,12 +483,12 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
|
|||
);
|
||||
|
||||
if (bc[dim].bundle->nchannels().n_total() > 1) {
|
||||
for (uint32_t i = 0; i < bc[dim].bundle->nchannels().n_total(); ++i) {
|
||||
if (should_show (bc[dim].bundle->channel_type(i))) {
|
||||
add_remove_option (sub, w, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (uint32_t i = 0; i < bc[dim].bundle->nchannels().n_total(); ++i) {
|
||||
if (should_show (bc[dim].bundle->channel_type(i))) {
|
||||
add_remove_option (sub, w, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ PortMatrixBody::highlight_associated_channels (int dim, ARDOUR::BundleChannel h)
|
|||
PortGroup::BundleList const b = _matrix->visible_ports(1 - dim)->bundles ();
|
||||
|
||||
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))) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -2745,11 +2745,11 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
|
|||
wp->set_state (*ui_xml, 0);
|
||||
}
|
||||
|
||||
void* existing_ui = p->get_ui ();
|
||||
void* existing_ui = p->get_ui ();
|
||||
|
||||
if (existing_ui) {
|
||||
wp->use_window (*(reinterpret_cast<Gtk::Window*>(existing_ui)));
|
||||
}
|
||||
if (existing_ui) {
|
||||
wp->use_window (*(reinterpret_cast<Gtk::Window*>(existing_ui)));
|
||||
}
|
||||
|
||||
p->set_window_proxy (wp);
|
||||
WM::Manager::instance().register_window (wp);
|
||||
|
|
@ -3270,26 +3270,26 @@ ProcessorBox::rename_processor (boost::shared_ptr<Processor> processor)
|
|||
name_prompter.get_result (result);
|
||||
if (result.length()) {
|
||||
|
||||
int tries = 0;
|
||||
string test = result;
|
||||
int tries = 0;
|
||||
string test = result;
|
||||
|
||||
while (tries < 100) {
|
||||
if (_session->io_name_is_legal (test)) {
|
||||
result = test;
|
||||
break;
|
||||
}
|
||||
tries++;
|
||||
while (tries < 100) {
|
||||
if (_session->io_name_is_legal (test)) {
|
||||
result = test;
|
||||
break;
|
||||
}
|
||||
tries++;
|
||||
|
||||
test = string_compose ("%1-%2", result, tries);
|
||||
}
|
||||
test = string_compose ("%1-%2", result, tries);
|
||||
}
|
||||
|
||||
if (tries < 100) {
|
||||
processor->set_name (result);
|
||||
} else {
|
||||
/* unlikely! */
|
||||
ARDOUR_UI::instance()->popup_error
|
||||
(string_compose (_("At least 100 IO objects exist with a name like %1 - name not changed"), result));
|
||||
}
|
||||
if (tries < 100) {
|
||||
processor->set_name (result);
|
||||
} else {
|
||||
/* unlikely! */
|
||||
ARDOUR_UI::instance()->popup_error
|
||||
(string_compose (_("At least 100 IO objects exist with a name like %1 - name not changed"), result));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -3362,10 +3362,10 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr
|
|||
|
||||
IOProcessor::prepare_for_reset (n, s->name());
|
||||
|
||||
if (s->set_state (n, Stateful::loading_state_version)) {
|
||||
delete s;
|
||||
return;
|
||||
}
|
||||
if (s->set_state (n, Stateful::loading_state_version)) {
|
||||
delete s;
|
||||
return;
|
||||
}
|
||||
|
||||
p.reset (s);
|
||||
|
||||
|
|
@ -3378,24 +3378,24 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr
|
|||
|
||||
IOProcessor::prepare_for_reset (n, s->name());
|
||||
|
||||
if (s->set_state (n, Stateful::loading_state_version)) {
|
||||
delete s;
|
||||
return;
|
||||
}
|
||||
if (s->set_state (n, Stateful::loading_state_version)) {
|
||||
delete s;
|
||||
return;
|
||||
}
|
||||
|
||||
p.reset (s);
|
||||
|
||||
} else if (type->value() == "return") {
|
||||
|
||||
XMLNode n (**niter);
|
||||
Return* r = new Return (*_session);
|
||||
Return* r = new Return (*_session);
|
||||
|
||||
IOProcessor::prepare_for_reset (n, r->name());
|
||||
|
||||
if (r->set_state (n, Stateful::loading_state_version)) {
|
||||
delete r;
|
||||
return;
|
||||
}
|
||||
if (r->set_state (n, Stateful::loading_state_version)) {
|
||||
delete r;
|
||||
return;
|
||||
}
|
||||
|
||||
p.reset (r);
|
||||
|
||||
|
|
|
|||
|
|
@ -435,16 +435,16 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
|
|||
|
||||
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;
|
||||
|
||||
/* a WindowProxy object can use this */
|
||||
Gtk::Window* get_editor_window (boost::shared_ptr<ARDOUR::Processor>, bool);
|
||||
Gtk::Window* get_generic_editor_window (boost::shared_ptr<ARDOUR::Processor>);
|
||||
/* a WindowProxy object can use this */
|
||||
Gtk::Window* get_editor_window (boost::shared_ptr<ARDOUR::Processor>, bool);
|
||||
Gtk::Window* get_generic_editor_window (boost::shared_ptr<ARDOUR::Processor>);
|
||||
|
||||
void manage_pins (boost::shared_ptr<ARDOUR::Processor>);
|
||||
void edit_processor (boost::shared_ptr<ARDOUR::Processor>);
|
||||
void generic_edit_processor (boost::shared_ptr<ARDOUR::Processor>);
|
||||
void manage_pins (boost::shared_ptr<ARDOUR::Processor>);
|
||||
void edit_processor (boost::shared_ptr<ARDOUR::Processor>);
|
||||
void generic_edit_processor (boost::shared_ptr<ARDOUR::Processor>);
|
||||
|
||||
void update_gui_object_state (ProcessorEntry *);
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
|
|||
|
||||
void route_going_away ();
|
||||
|
||||
bool is_editor_mixer_strip() const;
|
||||
bool is_editor_mixer_strip() const;
|
||||
|
||||
Gtkmm2ext::DnDVBox<ProcessorEntry> processor_display;
|
||||
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 &);
|
||||
|
||||
Width _width;
|
||||
bool _redisplay_pending;
|
||||
bool _redisplay_pending;
|
||||
|
||||
Gtk::Menu *processor_menu;
|
||||
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&);
|
||||
std::string generate_processor_title (boost::shared_ptr<ARDOUR::PluginInsert> pi);
|
||||
|
||||
//typedef std::list<ProcessorWindowProxy*> ProcessorWindowProxies;
|
||||
//ProcessorWindowProxies _processor_window_info;
|
||||
//typedef std::list<ProcessorWindowProxy*> ProcessorWindowProxies;
|
||||
//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 maybe_add_processor_to_ui_list (boost::weak_ptr<ARDOUR::Processor>);
|
||||
|
|
|
|||
|
|
@ -46,30 +46,30 @@ using namespace ARDOUR_UI_UTILS;
|
|||
|
||||
RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> r)
|
||||
: ArdourDialog (_("Region"))
|
||||
, _table (9, 2)
|
||||
, _table_row (0)
|
||||
, _region (r)
|
||||
, name_label (_("Name:"))
|
||||
, audition_button (_("Audition"))
|
||||
, _clock_group (new ClockGroup)
|
||||
, position_clock (X_("regionposition"), true, "", true, false)
|
||||
, end_clock (X_("regionend"), true, "", true, false)
|
||||
, length_clock (X_("regionlength"), true, "", true, false, true)
|
||||
, sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, "", true, false)
|
||||
, sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, "", true, false)
|
||||
/* XXX cannot file start yet */
|
||||
, start_clock (X_("regionstart"), true, "", false, false)
|
||||
, _sources (1)
|
||||
, _table (9, 2)
|
||||
, _table_row (0)
|
||||
, _region (r)
|
||||
, name_label (_("Name:"))
|
||||
, audition_button (_("Audition"))
|
||||
, _clock_group (new ClockGroup)
|
||||
, position_clock (X_("regionposition"), true, "", true, false)
|
||||
, end_clock (X_("regionend"), true, "", true, false)
|
||||
, length_clock (X_("regionlength"), true, "", true, false, true)
|
||||
, sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, "", true, false)
|
||||
, sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, "", true, false)
|
||||
/* XXX cannot file start yet */
|
||||
, start_clock (X_("regionstart"), true, "", false, false)
|
||||
, _sources (1)
|
||||
{
|
||||
set_session (s);
|
||||
|
||||
_clock_group->set_clock_mode (ARDOUR_UI::instance()->secondary_clock->mode());
|
||||
_clock_group->add (position_clock);
|
||||
_clock_group->add (end_clock);
|
||||
_clock_group->add (length_clock);
|
||||
_clock_group->add (sync_offset_relative_clock);
|
||||
_clock_group->add (sync_offset_absolute_clock);
|
||||
_clock_group->add (start_clock);
|
||||
_clock_group->set_clock_mode (ARDOUR_UI::instance()->secondary_clock->mode());
|
||||
_clock_group->add (position_clock);
|
||||
_clock_group->add (end_clock);
|
||||
_clock_group->add (length_clock);
|
||||
_clock_group->add (sync_offset_relative_clock);
|
||||
_clock_group->add (sync_offset_absolute_clock);
|
||||
_clock_group->add (start_clock);
|
||||
|
||||
position_clock.set_session (_session);
|
||||
end_clock.set_session (_session);
|
||||
|
|
@ -198,7 +198,7 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> r)
|
|||
|
||||
RegionEditor::~RegionEditor ()
|
||||
{
|
||||
delete _clock_group;
|
||||
delete _clock_group;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -299,7 +299,7 @@ RegionEditor::end_clock_changed ()
|
|||
PublicEditor::instance().begin_reversible_command (_("change region end position"));
|
||||
in_command = true;
|
||||
|
||||
_region->clear_changes ();
|
||||
_region->clear_changes ();
|
||||
_region->trim_end (end_clock.current_time());
|
||||
_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"));
|
||||
|
||||
_region->clear_changes ();
|
||||
_region->clear_changes ();
|
||||
_region->set_sync_position (sync_offset_absolute_clock.current_time());
|
||||
_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"));
|
||||
|
||||
_region->clear_changes ();
|
||||
_region->clear_changes ();
|
||||
_region->set_sync_position (sync_offset_relative_clock.current_time() + _region->position ());
|
||||
_session->add_command (new StatefulDiffCommand (_region));
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class RegionEditor : public ArdourDialog
|
|||
Gtk::Label sync_absolute_label;
|
||||
Gtk::Label start_label;
|
||||
|
||||
ClockGroup* _clock_group;
|
||||
ClockGroup* _clock_group;
|
||||
|
||||
AudioClock position_clock;
|
||||
AudioClock end_clock;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue