From ba62f8f4540c40e2185a790757f00749f7146d92 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 3 Nov 2006 23:47:56 +0000 Subject: remove fade nonsense from region popup editor git-svn-id: svn://localhost/ardour2/trunk@1069 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_region_editor.cc | 243 +------------------------------------ gtk2_ardour/audio_region_editor.h | 37 ------ 2 files changed, 1 insertion(+), 279 deletions(-) diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc index b6bb4589a9..77b73027d1 100644 --- a/gtk2_ardour/audio_region_editor.cc +++ b/gtk2_ardour/audio_region_editor.cc @@ -57,13 +57,7 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr length_clock ("AudioRegionEditorClock", true, true), sync_offset_clock ("AudioRegionEditorClock", true, true), envelope_loop_table (1, 3), - envelope_label (_("ENVELOPE")), - fade_in_table (4, 3), - fade_in_length_adjustment (5.0, 0.0, 10000, 0.05, 1), - fade_in_length_spinner (fade_in_length_adjustment, 10), - fade_out_table (4, 3), - fade_out_length_adjustment (5.0, 0.0, 10000, 0.05, 1), - fade_out_length_spinner (fade_out_length_adjustment, 10) + envelope_label (_("ENVELOPE")) { start_clock.set_session (&_session); @@ -99,17 +93,12 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr lock_button.set_name ("AudioRegionEditorToggleButton"); envelope_active_button.set_name ("AudioRegionEditorToggleButton"); envelope_view_button.set_name ("AudioRegionEditorToggleButton"); - fade_in_active_button.set_name ("AudioRegionEditorToggleButton"); - fade_out_active_button.set_name ("AudioRegionEditorToggleButton"); - audition_button.set_name ("AudioRegionEditorToggleButton"); ARDOUR_UI::instance()->tooltips().set_tip (mute_button, _("mute this region")); ARDOUR_UI::instance()->tooltips().set_tip (opaque_button, _("regions underneath this one cannot be heard")); ARDOUR_UI::instance()->tooltips().set_tip (lock_button, _("prevent any changes to this region")); ARDOUR_UI::instance()->tooltips().set_tip (envelope_active_button, _("use the gain envelope during playback")); ARDOUR_UI::instance()->tooltips().set_tip (envelope_view_button, _("show the gain envelope")); - ARDOUR_UI::instance()->tooltips().set_tip (fade_in_active_button, _("use fade in curve during playback")); - ARDOUR_UI::instance()->tooltips().set_tip (fade_out_active_button, _("use fade out curve during playback")); ARDOUR_UI::instance()->tooltips().set_tip (audition_button, _("audition this region")); mute_button.unset_flags (Gtk::CAN_FOCUS); @@ -117,8 +106,6 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr lock_button.unset_flags (Gtk::CAN_FOCUS); envelope_active_button.unset_flags (Gtk::CAN_FOCUS); envelope_view_button.unset_flags (Gtk::CAN_FOCUS); - fade_in_active_button.unset_flags (Gtk::CAN_FOCUS); - fade_out_active_button.unset_flags (Gtk::CAN_FOCUS); audition_button.unset_flags (Gtk::CAN_FOCUS); mute_button.set_events (mute_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); @@ -126,8 +113,6 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr lock_button.set_events (lock_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); envelope_active_button.set_events (envelope_active_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); envelope_view_button.set_events (envelope_view_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); - fade_in_active_button.set_events (fade_in_active_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); - fade_out_active_button.set_events (fade_out_active_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); audition_button.set_events (audition_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK)); top_row_button_hbox.set_border_width (5); @@ -178,79 +163,10 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr envelope_loop_table.attach (envelope_active_button, 0, 1, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL); envelope_loop_table.attach (envelope_view_button, 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL); - /* fade in */ - - fade_in_table.set_border_width (5); - fade_in_table.set_homogeneous (false); - - fade_in_label.set_name ("AudioRegionEditorLabel"); - fade_in_active_button_label.set_name ("AudioRegionEditorSmallLabel"); - fade_in_length_label.set_name ("AudioRegionEditorSmallLabel"); - - fade_in_label.set_text (_("FADE IN")); - fade_in_active_button_label.set_text (_("active")); - fade_in_length_label.set_text (_("msecs")); - - fade_in_active_button.add (fade_in_active_button_label); - - fade_in_length_spinner.set_name("GenericSpinner"); - - fade_in_length_spinner.set_digits (3); - - // fade_in_length_spinner.signal_activate().connect (mem_fun(*this, &AudioRegionEditor::activation)); - - Gtkmm2ext::set_size_request_to_display_given_text (fade_in_length_spinner, "500g", 20, -1); - - fade_in_label_align.add (fade_in_label); - fade_in_label_align.set (0.5); - - - fade_in_table.attach (fade_in_label_align, 0, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL); - - fade_in_table.attach (fade_in_length_label, 0, 1, 1, 2, Gtk::EXPAND, Gtk::FILL); - fade_in_table.attach (fade_in_length_spinner, 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL); - - fade_in_table.attach (fade_in_active_button, 0, 2, 3, 5, Gtk::FILL|Gtk::EXPAND, Gtk::FILL); - - /* fade out */ - - fade_out_table.set_border_width (5); - fade_out_table.set_homogeneous (false); - - fade_out_label.set_name ("AudioRegionEditorLabel"); - fade_out_active_button_label.set_name ("AudioRegionEditorSmallLabel"); - fade_out_length_label.set_name ("AudioRegionEditorSmallLabel"); - - fade_out_label.set_text (_("FADE OUT")); - fade_out_active_button_label.set_text (_("active")); - fade_out_length_label.set_text (_("msecs")); - - fade_out_active_button.add (fade_out_active_button_label); - - fade_out_length_spinner.set_name("GenericSpinner"); - - fade_out_length_spinner.set_digits (3); - - fade_out_length_spinner.signal_activate().connect (mem_fun(*this, &AudioRegionEditor::activation)); - - Gtkmm2ext::set_size_request_to_display_given_text (fade_out_length_spinner, "500g", 20, -1); - - fade_out_label_align.add (fade_out_label); - fade_out_label_align.set (0.5); - - fade_out_table.attach (fade_out_label_align, 0, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL); - - fade_out_table.attach (fade_out_length_label, 0, 1, 1, 2, Gtk::EXPAND, Gtk::FILL); - fade_out_table.attach (fade_out_length_spinner, 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL); - - fade_out_table.attach (fade_out_active_button, 0, 2, 3, 5, Gtk::FILL|Gtk::EXPAND, Gtk::FILL); - lower_hbox.pack_start (time_table, true, true); lower_hbox.pack_start (sep1, false, false); lower_hbox.pack_start (envelope_loop_table, true, true); lower_hbox.pack_start (sep2, false, false); - lower_hbox.pack_start (fade_in_table, true, true); - lower_hbox.pack_start (fade_out_table, true, true); get_vbox()->pack_start (top_row_hbox, true, true); get_vbox()->pack_start (sep3, false, false); @@ -274,8 +190,6 @@ AudioRegionEditor::AudioRegionEditor (Session& s, boost::shared_ptr opacity_changed (); lock_changed (); layer_changed (); - fade_in_changed (); - fade_out_changed (); XMLNode *node = _region->extra_xml ("GUI"); XMLProperty *prop = 0; @@ -330,30 +244,6 @@ AudioRegionEditor::region_changed (Change what_changed) if (what_changed & AudioRegion::EnvelopeActiveChanged) { envelope_active_changed (); } - if (what_changed & AudioRegion::FadeInChanged) { - fade_in_changed (); - } - if (what_changed & AudioRegion::FadeOutChanged) { - fade_out_changed (); - } - if (what_changed & AudioRegion::FadeInActiveChanged) { - fade_in_active_changed (); - } - if (what_changed & AudioRegion::FadeOutActiveChanged) { - fade_out_active_changed (); - } -} - -void -AudioRegionEditor::fade_in_realized () -{ - fade_in_changed (); -} - -void -AudioRegionEditor::fade_out_realized () -{ - fade_out_changed (); } gint @@ -389,30 +279,6 @@ AudioRegionEditor::breleased (GdkEventButton* ev, Gtk::SpinButton* but, void (Au return FALSE; } -void -AudioRegionEditor::start_editing_fade_in () -{ - _region->freeze (); -} - -void -AudioRegionEditor::stop_editing_fade_in () -{ - _region->thaw (_("fade in edit")); -} - -void -AudioRegionEditor::start_editing_fade_out () -{ - _region->freeze (); -} - -void -AudioRegionEditor::stop_editing_fade_out () -{ - _region->thaw (_("fade out edit")); -} - void AudioRegionEditor::connect_editor_events () { @@ -422,22 +288,6 @@ AudioRegionEditor::connect_editor_events () end_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::end_clock_changed)); length_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::length_clock_changed)); - fade_in_length_spinner.signal_button_press_event().connect (bind (mem_fun(*this, &AudioRegionEditor::bpressed), &fade_in_length_spinner, - &AudioRegionEditor::start_editing_fade_in)); - fade_in_length_spinner.signal_button_release_event().connect (bind (mem_fun (*this, &AudioRegionEditor::breleased), &fade_in_length_spinner, - &AudioRegionEditor::stop_editing_fade_in)); - - fade_out_length_spinner.signal_button_press_event().connect (bind (mem_fun(*this, &AudioRegionEditor::bpressed), &fade_out_length_spinner, - &AudioRegionEditor::start_editing_fade_out)); - fade_out_length_spinner.signal_button_release_event().connect (bind (mem_fun (*this, &AudioRegionEditor::breleased), &fade_out_length_spinner, - &AudioRegionEditor::stop_editing_fade_out)); - - fade_in_length_adjustment.signal_value_changed().connect (mem_fun(*this, &AudioRegionEditor::fade_in_length_adjustment_changed)); - fade_out_length_adjustment.signal_value_changed().connect (mem_fun(*this, &AudioRegionEditor::fade_out_length_adjustment_changed)); - - fade_in_active_button.signal_toggled().connect (mem_fun(*this, &AudioRegionEditor::fade_in_active_toggled)); - fade_out_active_button.signal_toggled().connect (mem_fun(*this, &AudioRegionEditor::fade_out_active_toggled)); - envelope_active_button.signal_button_press_event().connect (mem_fun(*this, &AudioRegionEditor::envelope_active_button_press)); envelope_active_button.signal_button_release_event().connect (mem_fun(*this, &AudioRegionEditor::envelope_active_button_release)); audition_button.signal_toggled().connect (mem_fun(*this, &AudioRegionEditor::audition_button_toggled)); @@ -628,97 +478,6 @@ AudioRegionEditor::name_entry_changed () } } -void -AudioRegionEditor::fade_in_changed () -{ - float msecs = fade_in_length_adjustment.get_value(); - nframes_t sr = _session.frame_rate(); - nframes_t adj_frames = (nframes_t) floor (msecs * (sr/1000.0f)); - nframes_t frames; - bool x; - - if (adj_frames != (frames = (nframes_t) _region->fade_in().back()->when)) { - fade_in_length_adjustment.set_value ((frames * 1000.0f) / sr); - } - - if ((x = _region->fade_in_active()) != fade_in_active_button.get_active()) { - fade_in_active_button.set_active (x); - } -} - -void -AudioRegionEditor::fade_out_changed () -{ - float msecs = fade_out_length_adjustment.get_value(); - nframes_t sr = _session.frame_rate(); - nframes_t adj_frames = (nframes_t) floor (msecs * (sr/1000.0f)); - nframes_t frames; - bool x; - if (adj_frames != (frames = (nframes_t) _region->fade_out().back()->when)) { - fade_out_length_adjustment.set_value ((frames * 1000.0f) / sr); - } - - if ((x = _region->fade_out_active()) != fade_out_active_button.get_active()) { - fade_out_active_button.set_active (x); - } -} - -void -AudioRegionEditor::fade_in_length_adjustment_changed () -{ - nframes_t fade_length = (nframes_t) floor (fade_in_length_adjustment.get_value() * _session.frame_rate() * 0.001); - fade_length = max (fade_length, (nframes_t) 64); - fade_length = min (fade_length, _region->length()); - - _region->set_fade_in_length (fade_length); - /* region is frozen, no worries */ - fade_in_changed(); -} - -void -AudioRegionEditor::fade_out_length_adjustment_changed () -{ - nframes_t fade_length = (nframes_t) floor (fade_out_length_adjustment.get_value() * _session.frame_rate() * 0.001); - fade_length = max (fade_length, (nframes_t) 64); - fade_length = min (fade_length, _region->length()); - - _region->set_fade_out_length (fade_length); - /* region is frozen, no worries */ - fade_out_changed(); -} - -void -AudioRegionEditor::fade_in_active_toggled () -{ - _region->set_fade_in_active (fade_in_active_button.get_active()); -} - -void -AudioRegionEditor::fade_out_active_toggled () -{ - _region->set_fade_out_active (fade_out_active_button.get_active()); -} - -void -AudioRegionEditor::fade_out_active_changed () -{ - bool x; - - if ((x = _region->fade_out_active()) != fade_out_active_button.get_active()) { - fade_out_active_button.set_active (x); - } -} - -void -AudioRegionEditor::fade_in_active_changed () -{ - bool x; - - if ((x = _region->fade_in_active()) != fade_in_active_button.get_active()) { - fade_in_active_button.set_active (x); - } -} - void AudioRegionEditor::audition_state_changed (bool yn) { diff --git a/gtk2_ardour/audio_region_editor.h b/gtk2_ardour/audio_region_editor.h index dbbc40f9ba..a0c61e404d 100644 --- a/gtk2_ardour/audio_region_editor.h +++ b/gtk2_ardour/audio_region_editor.h @@ -107,26 +107,6 @@ class AudioRegionEditor : public RegionEditor Gtk::Label loop_label; Gtk::Label envelope_label; - Gtk::Table fade_in_table; - Gtk::Label fade_in_label; - Gtk::Alignment fade_in_label_align; - Gtk::Label fade_in_active_button_label; - Gtk::ToggleButton fade_in_active_button; - Gtk::Label fade_in_length_label; - - Gtk::Adjustment fade_in_length_adjustment; - Gtk::SpinButton fade_in_length_spinner; - - Gtk::Table fade_out_table; - Gtk::Label fade_out_label; - Gtk::Alignment fade_out_label_align; - Gtk::Label fade_out_active_button_label; - Gtk::ToggleButton fade_out_active_button; - Gtk::Label fade_out_length_label; - - Gtk::Adjustment fade_out_length_adjustment; - Gtk::SpinButton fade_out_length_spinner; - Gtk::HSeparator sep3; Gtk::VSeparator sep1; Gtk::VSeparator sep2; @@ -140,10 +120,6 @@ class AudioRegionEditor : public RegionEditor void lock_changed (); void layer_changed (); - void fade_in_length_adjustment_changed (); - void fade_out_length_adjustment_changed (); - void fade_in_changed (); - void fade_out_changed (); void audition_state_changed (bool); void activation (); @@ -164,19 +140,6 @@ class AudioRegionEditor : public RegionEditor void raise_button_clicked (); void lower_button_clicked (); - void fade_in_active_toggled (); - void fade_out_active_toggled (); - void fade_in_active_changed (); - void fade_out_active_changed (); - - void fade_in_realized (); - void fade_out_realized (); - - void start_editing_fade_in (); - void start_editing_fade_out (); - void stop_editing_fade_in (); - void stop_editing_fade_out (); - gint bpressed (GdkEventButton* ev, Gtk::SpinButton* but, void (AudioRegionEditor::*pmf)()); gint breleased (GdkEventButton* ev, Gtk::SpinButton* but, void (AudioRegionEditor::*pmf)()); -- cgit v1.2.3