From 50aee542192e98016d44aa3f11f40bbe2e8367f6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 7 Dec 2011 14:23:32 +0000 Subject: remove visible "sound notes" button,add Config parameter to control this (which then saves the state the user selected), add control to the prefs dialog git-svn-id: svn://localhost/ardour2/branches/3.0@10934 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.cc | 19 ------------------- gtk2_ardour/editor.h | 2 -- gtk2_ardour/midi_region_view.cc | 6 +++--- gtk2_ardour/public_editor.h | 4 ---- gtk2_ardour/rc_option_editor.cc | 8 ++++++++ 5 files changed, 11 insertions(+), 28 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index a6d16fa9e9..31d5b495fe 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -642,7 +642,6 @@ Editor::Editor () // load_bindings (); setup_toolbar (); - setup_midi_toolbar (); _snap_type = SnapToBeat; set_snap_to (_snap_type); @@ -2982,27 +2981,9 @@ Editor::setup_tooltips () ARDOUR_UI::instance()->set_tip (snap_type_selector, _("Snap/Grid Units")); ARDOUR_UI::instance()->set_tip (snap_mode_selector, _("Snap/Grid Mode")); ARDOUR_UI::instance()->set_tip (edit_point_selector, _("Edit point")); - ARDOUR_UI::instance()->set_tip (midi_sound_notes, _("Sound Notes")); ARDOUR_UI::instance()->set_tip (edit_mode_selector, _("Edit Mode")); } - -void -Editor::setup_midi_toolbar () -{ - RefPtr act; - - /* Midi sound notes */ - midi_sound_notes.add (*(manage (new Image (::get_icon("midi_sound_notes"))))); - midi_sound_notes.unset_flags (CAN_FOCUS); - midi_sound_notes.set_name (X_("MidiSoundNotesButton")); - - /* Panic */ - - panic_box.pack_start (midi_sound_notes , true, true); - // panic_box.pack_start (midi_panic_button, true, true); -} - int Editor::convert_drop_to_paths ( vector& paths, diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index a87e1d1ce4..c8d4efd4e8 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1607,8 +1607,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* midi toolbar */ Gtk::HBox panic_box; - Gtkmm2ext::StatefulToggleButton midi_sound_notes; - bool sound_notes () const { return midi_sound_notes.get_active(); } void setup_midi_toolbar (); diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 51e96e34b2..b295e55733 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1541,7 +1541,7 @@ MidiRegionView::extend_active_notes() void MidiRegionView::play_midi_note(boost::shared_ptr note) { - if (_no_sound_notes || !trackview.editor().sound_notes()) { + if (_no_sound_notes || !Config->get_sound_midi_notes()) { return; } @@ -1559,7 +1559,7 @@ MidiRegionView::play_midi_note(boost::shared_ptr note) void MidiRegionView::play_midi_chord (vector > notes) { - if (_no_sound_notes || !trackview.editor().sound_notes()) { + if (_no_sound_notes || !Config->get_sound_midi_notes()) { return; } @@ -2341,7 +2341,7 @@ MidiRegionView::move_selection(double dx, double dy, double cumulative_dy) (*i)->move_event(dx, dy); } - if (dy && !_selection.empty() && !_no_sound_notes && trackview.editor().sound_notes()) { + if (dy && !_selection.empty() && !_no_sound_notes && Config->get_sound_midi_notes()) { if (to_play.size() > 1) { diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 4107097236..0d8bbbacef 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -181,10 +181,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual bool internal_editing() const = 0; - /** @return Sound edited notes in MIDI regions while editing - */ - virtual bool sound_notes () const = 0; - /** Possibly start the audition of a region. If @param r is 0, or not an AudioRegion * any current audition is cancelled. If we are currently auditioning @param r, * the audition will be cancelled. Otherwise an audition of @param r will start. diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 83051fc5a7..ec3dd466f4 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1486,6 +1486,14 @@ RCOptionEditor::RCOptionEditor () sigc::mem_fun (*_rc_config, &RCConfiguration::set_never_display_periodic_midi) )); + add_option (_("MIDI"), + new BoolOption ( + "sound-midi-notes", + _("Sound MIDI notes as they are selected"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_sound_midi_notes), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_sound_midi_notes) + )); + /* USER INTERACTION */ add_option (_("User interaction"), new OptionEditorHeading (_("Keyboard"))); -- cgit v1.2.3