diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-02-23 15:22:58 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-02-23 15:22:58 +0000 |
commit | 7e531020180affdae2d98ddd93594e7a1e9b4721 (patch) | |
tree | 2329a282a5be65183968e2db2c188d6ec6a843bd | |
parent | 80c6243429ea1996ec0d3be2f42d33d92e5f578f (diff) |
fix up use of plugin input counts when running; SAE menu tweaks; fix up management and display of edit point selection; AU window stuff
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3117 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/about.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/ardour-sae.menus | 15 | ||||
-rw-r--r-- | gtk2_ardour/au_pluginui.mm | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 30 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 26 | ||||
-rw-r--r-- | gtk2_ardour/export_dialog.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/export_dialog.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/option_editor.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/plugin_ui.cc | 15 | ||||
-rw-r--r-- | gtk2_ardour/plugin_ui.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/redirect_box.cc | 11 | ||||
-rw-r--r-- | libs/ardour/audio_unit.cc | 1 | ||||
-rw-r--r-- | libs/ardour/insert.cc | 26 | ||||
-rw-r--r-- | libs/ardour/session.cc | 2 | ||||
-rw-r--r-- | svn_revision.h | 2 |
16 files changed, 103 insertions, 58 deletions
diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about.cc index 8d14f09e3a..b49e08d3cd 100644 --- a/gtk2_ardour/about.cc +++ b/gtk2_ardour/about.cc @@ -155,6 +155,7 @@ static const char* authors[] = { N_("Colin Fletcher"), N_("Roland Stigge"), N_("Audun Halland"), + N_("Armand Klenk"), 0 }; diff --git a/gtk2_ardour/ardour-sae.menus b/gtk2_ardour/ardour-sae.menus index 1d207bc56c..7bf6135925 100644 --- a/gtk2_ardour/ardour-sae.menus +++ b/gtk2_ardour/ardour-sae.menus @@ -54,13 +54,14 @@ <menuitem action='Rewind'/> <menuitem action='TransitionToRoll'/> <menuitem action='TransitionToReverse'/> - <menuitem action='center-playhead'/> - <menuitem action='set-playhead'/> - <menuitem action='playhead-to-edit'/> <menuitem action='nudge-playhead-forward'/> <menuitem action='nudge-playhead-backward'/> <menu action="MovePlayHeadMenu"> + <menuitem action='set-playhead'/> + <menuitem action='playhead-to-edit'/> + <menuitem action='center-playhead'/> + <separator/> <menuitem action='tab-to-transient-forwards'/> <menuitem action='tab-to-transient-backwards'/> <separator/> @@ -107,7 +108,6 @@ <menuitem action='ToggleAutoPlay'/> <menuitem action='ToggleAutoReturn'/> <menuitem action='ToggleClick'/> - <menuitem action='toggle-follow-playhead'/> <separator/> <menu action='LocateToMarker'> </menu> @@ -287,9 +287,9 @@ <menuitem action='zoom-focus-mouse'/> </menu> <menu action="EditPointMenu"> - <menuitem action='edit-point-playhead'/> - <menuitem action='edit-point-mouse'/> - <menuitem action='edit-point-marker'/> + <menuitem action='edit-at-playhead'/> + <menuitem action='edit-at-mouse'/> + <menuitem action='edit-at-selected-marker'/> </menu> <menu action='KeyMouseActions'> <menuitem action='select-next-route'/> @@ -312,6 +312,7 @@ <menuitem action='cycle-snap-mode'/> <menuitem action='cycle-snap-choice'/> </menu> + <menuitem action='toggle-follow-playhead'/> </menu> </menubar> diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm index 4e4a91b516..3f71f126f5 100644 --- a/gtk2_ardour/au_pluginui.mm +++ b/gtk2_ardour/au_pluginui.mm @@ -341,7 +341,6 @@ AUPluginUI::get_nswindow () void AUPluginUI::activate () { - return; if (carbon_window && cocoa_parent) { cerr << "APP activated, activate carbon window " << insert->name() << endl; _activating_from_app = true; @@ -391,7 +390,7 @@ AUPluginUI::carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event) break; case kEventWindowHandleDeactivate: - cerr << "carbon window for " << insert->name() << " deactivated\n"; + cerr << "carbon window for " << insert->name() << " would have been deactivated\n"; // never deactivate the carbon window return noErr; break; diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 1a70f6b754..40030bb201 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -723,8 +723,7 @@ Editor::Editor () set_snap_to (snap_type); snap_mode = SnapOff; set_snap_mode (snap_mode); - _edit_point = EditAtMouse; - set_edit_point_preference (_edit_point); + set_edit_point_preference (EditAtMouse, true); XMLNode* node = ARDOUR_UI::instance()->editor_settings(); set_state (*node); @@ -2157,9 +2156,9 @@ Editor::set_snap_mode (SnapMode mode) instant_save (); } void -Editor::set_edit_point_preference (EditPoint ep) +Editor::set_edit_point_preference (EditPoint ep, bool force) { - bool changed = _edit_point != ep; + bool changed = (_edit_point != ep); _edit_point = ep; string str = edit_point_strings[(int)ep]; @@ -2170,7 +2169,7 @@ Editor::set_edit_point_preference (EditPoint ep) set_canvas_cursor (); - if (!changed) { + if (!force && !changed) { return; } @@ -2194,6 +2193,25 @@ Editor::set_edit_point_preference (EditPoint ep) break; } + const char* action; + + switch (_edit_point) { + case EditAtPlayhead: + action = "edit-at-playhead"; + break; + case EditAtSelectedMarker: + action = "edit-at-marker"; + break; + case EditAtMouse: + action = "edit-at-mouse"; + break; + } + + Glib::RefPtr<Action> act = ActionManager::get_action ("Editor", action); + if (act) { + Glib::RefPtr<RadioAction>::cast_dynamic(act)->set_active (true); + } + instant_save (); } @@ -2267,7 +2285,7 @@ Editor::set_state (const XMLNode& node) } if ((prop = node.property ("edit-point"))) { - set_edit_point_preference ((EditPoint) string_2_enum (prop->value(), _edit_point)); + set_edit_point_preference ((EditPoint) string_2_enum (prop->value(), _edit_point), true); } if ((prop = node.property ("mouse-mode"))) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 762b4900bd..8951bde7ac 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2068,7 +2068,7 @@ public: Gtk::ComboBoxText edit_point_selector; - void set_edit_point_preference (Editing::EditPoint ep); + void set_edit_point_preference (Editing::EditPoint ep, bool force = false); void cycle_edit_point (bool with_marker); void set_edit_point (); void edit_point_selection_done (); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 68a9684887..f12e6a6978 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -267,32 +267,32 @@ Editor::register_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "goto", _("goto"), mem_fun(*this, &Editor::goto_frame)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "center-playhead", _("to Center"), mem_fun(*this, &Editor::center_playhead)); + act = ActionManager::register_action (editor_actions, "center-playhead", _("Center Playhead"), mem_fun(*this, &Editor::center_playhead)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("to Center"), mem_fun(*this, &Editor::center_edit_point)); + act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("Center Active Marker"), mem_fun(*this, &Editor::center_edit_point)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));; + act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead Forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));; ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "scroll-playhead-backward", _("Playhead Backward"), bind (mem_fun(*this, &Editor::scroll_playhead), false)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("to Edit"), bind (mem_fun(*this, &Editor::cursor_align), true)); + act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("Playhead To Active Mark"), bind (mem_fun(*this, &Editor::cursor_align), true)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false)); + act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("Active Mark To Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "trim-front", _("Trim start at edit point"), mem_fun(*this, &Editor::trim_region_front)); + act = ActionManager::register_action (editor_actions, "trim-front", _("Trim Start At Edit Point"), mem_fun(*this, &Editor::trim_region_front)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::region_selection_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "trim-back", _("Trim end at edit point"), mem_fun(*this, &Editor::trim_region_back)); + act = ActionManager::register_action (editor_actions, "trim-back", _("Trim End At Edit Point"), mem_fun(*this, &Editor::trim_region_back)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::region_selection_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start to edit point"), mem_fun(*this, &Editor::trim_region_from_edit_point)); + act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start To Edit Point"), mem_fun(*this, &Editor::trim_region_from_edit_point)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::region_selection_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit point to end"), mem_fun(*this, &Editor::trim_region_to_edit_point)); + act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit Point To End"), mem_fun(*this, &Editor::trim_region_to_edit_point)); ActionManager::session_sensitive_actions.push_back (act); ActionManager::region_selection_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "trim-region-to-loop", _("Trim To Loop"), mem_fun(*this, &Editor::trim_region_to_loop)); @@ -359,9 +359,9 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("Brush at Mouse"), mem_fun(*this, &Editor::kbd_brush)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "set-playhead", _("Set Playhead"), mem_fun(*this, &Editor::set_playhead_cursor)); + act = ActionManager::register_action (editor_actions, "set-playhead", _("Playhead to Mouse"), mem_fun(*this, &Editor::set_playhead_cursor)); ActionManager::session_sensitive_actions.push_back (act); - act = ActionManager::register_action (editor_actions, "set-edit-point", _("Set Edit Point"), mem_fun(*this, &Editor::set_edit_point)); + act = ActionManager::register_action (editor_actions, "set-edit-point", _("Edit Point to Mouse"), mem_fun(*this, &Editor::set_edit_point)); ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)); @@ -561,10 +561,6 @@ Editor::register_actions () ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead))); ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-selected-marker"), _("Marker"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead))); - ActionManager::register_action (editor_actions, "edit-point-marker", _("Marker"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtSelectedMarker)); - ActionManager::register_action (editor_actions, "edit-point-playhead", _("Playhead"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtPlayhead)); - ActionManager::register_action (editor_actions, "edit-point-mouse", _("Mouse"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtMouse)); - ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change edit point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false)); ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change edit point (w/Marker)"), bind (mem_fun (*this, &Editor::cycle_edit_point), true)); diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index 8c22e1b561..84dd7cacc1 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -127,8 +127,8 @@ ExportDialog::ExportDialog(PublicEditor& e) set_title (title.get_string()); set_wmclass (X_("ardour_export"), "Ardour"); set_name ("ExportWindow"); - add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK); - + set_events (get_events()|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK); + spec.running = false; file_entry.set_name ("ExportFileNameEntry"); @@ -142,7 +142,7 @@ ExportDialog::ExportDialog(PublicEditor& e) master_selector.append_column_editable(_("Left"), exp_cols.left); master_selector.append_column_editable(_("Right"), exp_cols.right); master_selector.get_column(0)->set_min_width(100); - + master_selector.get_column(1)->set_min_width(40); master_selector.get_column(1)->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE); master_selector.get_column(2)->set_min_width(40); @@ -388,6 +388,13 @@ ExportDialog::~ExportDialog() { } +bool +ExportDialog::on_event (GdkEvent* ev) +{ + cerr << "ED event type " << ev->type << endl; + return false; +} + void ExportDialog::do_not_allow_track_and_master_selection() { diff --git a/gtk2_ardour/export_dialog.h b/gtk2_ardour/export_dialog.h index 596467d3e1..94420a74ec 100644 --- a/gtk2_ardour/export_dialog.h +++ b/gtk2_ardour/export_dialog.h @@ -47,6 +47,8 @@ class ExportDialog : public ArdourDialog virtual Gtk::FileChooserAction browse_action() const { return Gtk::FILE_CHOOSER_ACTION_SAVE; } + bool on_event (GdkEvent* ev); + protected: ARDOUR::AudioExportSpecification spec; Gtk::Frame file_frame; diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index 656e448461..abdbc88e8e 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -268,10 +268,15 @@ void OptionEditor::setup_misc_options () { Gtk::HBox* hbox; + Label* label; + +#ifndef GTKOSX + /* font scaling does nothing with GDK/Quartz */ + Gtk::Adjustment* dpi_adj = new Gtk::Adjustment ((double)Config->get_font_scale() / 1024, 50, 250, 1, 10); Gtk::HScale * dpi_range = new Gtk::HScale (*dpi_adj); - Label* label = manage (new Label (_("Font Scaling"))); + label = manage (new Label (_("Font Scaling"))); label->set_name ("OptionsLabel"); dpi_range->set_update_policy (Gtk::UPDATE_DISCONTINUOUS); @@ -283,6 +288,7 @@ OptionEditor::setup_misc_options () hbox->pack_start (*label, false, false); hbox->pack_start (*dpi_range, true, true); misc_packer.pack_start (*hbox, false, false); +#endif label = manage (new Label (_("Short crossfade length (msecs)"))); label->set_name ("OptionsLabel"); diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 191c7ebc70..ce81f486d7 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -61,7 +61,8 @@ using namespace Gtkmm2ext; using namespace Gtk; using namespace sigc; -PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, bool scrollable) +PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert> insert, bool scrollable) + : parent (win) { bool have_gui = false; non_gtk_gui = false; @@ -133,6 +134,12 @@ PluginUIWindow::~PluginUIWindow () } void +PluginUIWindow::set_parent (Gtk::Window* win) +{ + parent = win; +} + +void PluginUIWindow::on_map () { Window::on_map (); @@ -145,7 +152,13 @@ PluginUIWindow::on_show () if (_pluginui) { _pluginui->update_presets (); } + Window::on_show (); + + if (parent) { + cerr << "plugin becomes transient for " << parent << endl; + // set_transient_for (*parent); + } } void diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index 244fc6e9cd..b612f4dcdf 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -202,12 +202,13 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox class PluginUIWindow : public Gtk::Window { public: - PluginUIWindow (boost::shared_ptr<ARDOUR::PluginInsert> insert, bool scrollable=false); + PluginUIWindow (Gtk::Window*, boost::shared_ptr<ARDOUR::PluginInsert> insert, bool scrollable=false); ~PluginUIWindow (); PlugUIBase& pluginui() { return *_pluginui; } void resize_preferred(); + void set_parent (Gtk::Window*); bool on_key_press_event (GdkEventKey*); bool on_key_release_event (GdkEventKey*); @@ -216,6 +217,7 @@ class PluginUIWindow : public Gtk::Window void on_map (); private: PlugUIBase* _pluginui; + Gtk::Window* parent; Gtk::VBox vbox; bool non_gtk_gui; void app_activated (bool); diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index 12434662d6..050ffdef55 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -1088,10 +1088,15 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) { PluginUIWindow *plugin_ui; + + /* these are both allowed to be null */ + + Container* toplevel = get_toplevel(); + Window* win = dynamic_cast<Gtk::Window*>(toplevel); if (plugin_insert->get_gui() == 0) { - - plugin_ui = new PluginUIWindow (plugin_insert); + + plugin_ui = new PluginUIWindow (win, plugin_insert); WindowTitle title(Glib::get_application_name()); title += generate_redirect_title (plugin_insert); @@ -1102,9 +1107,9 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) // change window title when route name is changed _route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, boost::weak_ptr<PluginInsert> (plugin_insert))); - } else { plugin_ui = reinterpret_cast<PluginUIWindow *> (plugin_insert->get_gui()); + plugin_ui->set_parent (win); } if (plugin_ui->is_visible()) { diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 695c98ff0a..b846fa5033 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -811,7 +811,6 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip info->n_inputs = -1; info->n_outputs = -1; - plugs.push_back (info); comp = FindNextComponent (comp, &desc); diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc index 8958dc8008..f9c20a35d1 100644 --- a/libs/ardour/insert.cc +++ b/libs/ardour/insert.cc @@ -356,12 +356,11 @@ PluginInsert::silence (nframes_t nframes, nframes_t offset) { int32_t in_index = 0; int32_t out_index = 0; - - uint32_t n; + int32_t n; if (active()) { for (vector<boost::shared_ptr<Plugin> >::iterator i = _plugins.begin(); i != _plugins.end(); ++i) { - n = (*i) -> get_info()->n_inputs; + n = input_streams(); (*i)->connect_and_run (_session.get_silent_buffers (n), n, in_index, out_index, nframes, offset); } } @@ -380,20 +379,17 @@ PluginInsert::run (vector<Sample *>& bufs, uint32_t nbufs, nframes_t nframes, nf } else { - uint32_t in = _plugins[0]->get_info()->n_inputs; - uint32_t out = _plugins[0]->get_info()->n_outputs; + uint32_t in = input_streams (); + uint32_t out = output_streams (); - if (in < 0 || out < 0) { + if (out > in) { - } else { - - if (out > in) { - - /* not active, but something has make up for any channel count increase */ - - for (uint32_t n = out - in; n < out; ++n) { - memcpy (bufs[n], bufs[in - 1], sizeof (Sample) * nframes); - } + /* not active, but something has make up for any channel count increase, + so copy the last buffer to the extras. + */ + + for (uint32_t n = out - in; n < out && n < nbufs; ++n) { + memcpy (bufs[n], bufs[in - 1], sizeof (Sample) * nframes); } } } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index c1afa92684..ac7789e5db 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -848,7 +848,7 @@ Session::when_engine_running () add_connection (c); } - BootMessage (_("Connect ports")); + BootMessage (_("Setup signal flow and plugins")); hookup_io (); diff --git a/svn_revision.h b/svn_revision.h index b9d248c4b0..60a6ecc249 100644 --- a/svn_revision.h +++ b/svn_revision.h @@ -1,4 +1,4 @@ #ifndef __ardour_svn_revision_h__ #define __ardour_svn_revision_h__ -static const char* ardour_svn_revision = "3096"; +static const char* ardour_svn_revision = "3107"; #endif |