more cleanups for SAE, this time trimming down the region context menu
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 17 Aug 2007 21:13:53 +0000 (21:13 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 17 Aug 2007 21:13:53 +0000 (21:13 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2324 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_region_view.cc
gtk2_ardour/editor.cc

index 93a3daf069a3057257c9488fceefa53fb11c68c0..4f7192e37351b24d5fa6d4173c22cded123422f8 100644 (file)
@@ -29,6 +29,7 @@
 #include <ardour/audioregion.h>
 #include <ardour/audiosource.h>
 #include <ardour/audio_diskstream.h>
+#include <ardour/profile.h>
 #include <pbd/memento_command.h>
 #include <pbd/stacktrace.h>
 
@@ -179,15 +180,17 @@ AudioRegionView::init (Gdk::Color& basic_color, bool wfd)
        foo += ':';
        foo += "gain";
 
-       gain_line = new AudioRegionGainLine (foo, trackview.session(), *this, *group, audio_region()->envelope());
+       if (!Profile->get_sae()) {
+               gain_line = new AudioRegionGainLine (foo, trackview.session(), *this, *group, audio_region()->envelope());
 
-       if (!(_flags & EnvelopeVisible)) {
-               gain_line->hide ();
-       } else {
-               gain_line->show ();
-       }
+               if (!(_flags & EnvelopeVisible)) {
+                       gain_line->hide ();
+               } else {
+                       gain_line->show ();
+               }
 
-       gain_line->reset ();
+               gain_line->reset ();
+       }
 
        set_height (trackview.height);
 
index b161c1498ac174099d0c2f3f05afba9e5e75a94f..bff8bcdb4fd971aecd7d0119f3774ace694ac619 100644 (file)
@@ -54,6 +54,7 @@
 #include <ardour/session_route.h>
 #include <ardour/tempo.h>
 #include <ardour/utils.h>
+#include <ardour/profile.h>
 
 #include <control_protocol/control_protocol.h>
 
@@ -1264,12 +1265,17 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
                }
                
                items.push_back (SeparatorElem());
-               
-               items.push_back (MenuElem (_("Linear"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::Linear)));
-               items.push_back (MenuElem (_("Slowest"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::Fast)));
-               items.push_back (MenuElem (_("Slow"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::LogB)));
-               items.push_back (MenuElem (_("Fast"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::LogA)));
-               items.push_back (MenuElem (_("Fastest"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::Slow)));
+
+               if (Profile->get_sae()) {
+                       items.push_back (MenuElem (_("Linear"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::Linear)));
+                       items.push_back (MenuElem (_("Slowest"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::Fast)));
+               } else {
+                       items.push_back (MenuElem (_("Linear"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::Linear)));
+                       items.push_back (MenuElem (_("Slowest"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::Fast)));
+                       items.push_back (MenuElem (_("Slow"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::LogB)));
+                       items.push_back (MenuElem (_("Fast"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::LogA)));
+                       items.push_back (MenuElem (_("Fastest"), bind (mem_fun (*this, &Editor::set_fade_in_shape), AudioRegion::Slow)));
+               }
                break;
 
        case FadeOutItem:
@@ -1281,13 +1287,17 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
                }
                
                items.push_back (SeparatorElem());
-               
-               items.push_back (MenuElem (_("Linear"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::Linear)));
-               items.push_back (MenuElem (_("Slowest"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::Slow)));
-               items.push_back (MenuElem (_("Slow"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::LogA)));
-               items.push_back (MenuElem (_("Fast"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::LogB)));
-               items.push_back (MenuElem (_("Fastest"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::Fast)));
 
+               if (Profile->get_sae()) {
+                       items.push_back (MenuElem (_("Linear"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::Linear)));
+                       items.push_back (MenuElem (_("Slowest"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::Slow)));
+               } else {
+                       items.push_back (MenuElem (_("Linear"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::Linear)));
+                       items.push_back (MenuElem (_("Slowest"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::Slow)));
+                       items.push_back (MenuElem (_("Slow"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::LogA)));
+                       items.push_back (MenuElem (_("Fast"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::LogB)));
+                       items.push_back (MenuElem (_("Fastest"), bind (mem_fun (*this, &Editor::set_fade_out_shape), AudioRegion::Fast)));
+               }
                break;
 
        default:
@@ -1674,13 +1684,15 @@ Editor::add_region_context_items (AudioStreamView* sv, boost::shared_ptr<Region>
                fooc.block (false);
        }
        
-       items.push_back (CheckMenuElem (_("Opaque")));
-       region_opaque_item = static_cast<CheckMenuItem*>(&items.back());
-       fooc = region_opaque_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_opaque));
-       if (region->opaque()) {
-               fooc.block (true);
-               region_opaque_item->set_active();
-               fooc.block (false);
+       if (!Profile->get_sae()) {
+               items.push_back (CheckMenuElem (_("Opaque")));
+               region_opaque_item = static_cast<CheckMenuItem*>(&items.back());
+               fooc = region_opaque_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_region_opaque));
+               if (region->opaque()) {
+                       fooc.block (true);
+                       region_opaque_item->set_active();
+                       fooc.block (false);
+               }
        }
 
        items.push_back (CheckMenuElem (_("Original position"), mem_fun(*this, &Editor::naturalize)));
@@ -1695,28 +1707,30 @@ Editor::add_region_context_items (AudioStreamView* sv, boost::shared_ptr<Region>
                RegionView* rv = sv->find_view (ar);
                AudioRegionView* arv = dynamic_cast<AudioRegionView*>(rv);
                
-               items.push_back (MenuElem (_("Reset Envelope"), mem_fun(*this, &Editor::reset_region_gain_envelopes)));
-               
-               items.push_back (CheckMenuElem (_("Envelope Visible")));
-               region_envelope_visible_item = static_cast<CheckMenuItem*> (&items.back());
-               fooc = region_envelope_visible_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_gain_envelope_visibility));
-               if (arv->envelope_visible()) {
-                       fooc.block (true);
-                       region_envelope_visible_item->set_active (true);
-                       fooc.block (false);
-               }
-               
-               items.push_back (CheckMenuElem (_("Envelope Active")));
-               region_envelope_active_item = static_cast<CheckMenuItem*> (&items.back());
-               fooc = region_envelope_active_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_gain_envelope_active));
+               if (!Profile->get_sae()) {
+                       items.push_back (MenuElem (_("Reset Envelope"), mem_fun(*this, &Editor::reset_region_gain_envelopes)));
+
+                       items.push_back (CheckMenuElem (_("Envelope Visible")));
+                       region_envelope_visible_item = static_cast<CheckMenuItem*> (&items.back());
+                       fooc = region_envelope_visible_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_gain_envelope_visibility));
+                       if (arv->envelope_visible()) {
+                               fooc.block (true);
+                               region_envelope_visible_item->set_active (true);
+                               fooc.block (false);
+                       }
                
-               if (ar->envelope_active()) {
-                       fooc.block (true);
-                       region_envelope_active_item->set_active (true);
-                       fooc.block (false);
-               }
+                       items.push_back (CheckMenuElem (_("Envelope Active")));
+                       region_envelope_active_item = static_cast<CheckMenuItem*> (&items.back());
+                       fooc = region_envelope_active_item->signal_activate().connect (mem_fun(*this, &Editor::toggle_gain_envelope_active));
+                       
+                       if (ar->envelope_active()) {
+                               fooc.block (true);
+                               region_envelope_active_item->set_active (true);
+                               fooc.block (false);
+                       }
 
-               items.push_back (SeparatorElem());
+                       items.push_back (SeparatorElem());
+               }
 
                if (ar->scale_amplitude() != 1.0f) {
                        items.push_back (MenuElem (_("DeNormalize"), mem_fun(*this, &Editor::denormalize_region)));
@@ -1724,10 +1738,10 @@ Editor::add_region_context_items (AudioStreamView* sv, boost::shared_ptr<Region>
                        items.push_back (MenuElem (_("Normalize"), mem_fun(*this, &Editor::normalize_region)));
                }
        }
+
        items.push_back (MenuElem (_("Reverse"), mem_fun(*this, &Editor::reverse_region)));
        items.push_back (SeparatorElem());
 
-
        /* range related stuff */
 
        items.push_back (MenuElem (_("Add Range Markers"), mem_fun (*this, &Editor::add_location_from_audio_region)));