diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-07 14:23:32 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-07 14:23:32 +0000 |
commit | 50aee542192e98016d44aa3f11f40bbe2e8367f6 (patch) | |
tree | 8a9d4c1d9c3d097b11ad61063f9c0d7de6efbe1d /gtk2_ardour | |
parent | 20aeb5af0abd50dc01db503d65897c7dfebf6467 (diff) |
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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 19 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/rc_option_editor.cc | 8 |
5 files changed, 11 insertions, 28 deletions
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<Action> 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<string>& 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<NoteType> 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<NoteType> note) void MidiRegionView::play_midi_chord (vector<boost::shared_ptr<NoteType> > 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"))); |