Bodge around visual glitch where the ranges & markers list would overlap the editor...
[ardour.git] / gtk2_ardour / region_gain_line.cc
index 61f7dde0c706c1b9c323bf101579895f6c14779e..b3dea4f42adf20fc339347f07fb3164164b43430 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2000-2007 Paul Davis 
+    Copyright (C) 2000-2007 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -17,9 +17,9 @@
 
 */
 
-#include <evoral/Curve.hpp>
-#include <ardour/audioregion.h>
-#include <pbd/memento_command.h>
+#include "evoral/Curve.hpp"
+#include "ardour/audioregion.h"
+#include "pbd/memento_command.h"
 
 #include "region_gain_line.h"
 #include "audio_region_view.h"
 #include "time_axis_view.h"
 #include "editor.h"
 
-#include <ardour/session.h>
-
+#include "ardour/session.h"
 
 #include "i18n.h"
 
-
 using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
 AudioRegionGainLine::AudioRegionGainLine (const string & name, Session& s, AudioRegionView& r, ArdourCanvas::Group& parent, boost::shared_ptr<AutomationList> l)
-  : AutomationLine (name, r.get_time_axis_view(), parent, l),
-         session (s),
-         rv (r)
+       : AutomationLine (name, r.get_time_axis_view(), parent, l)
+       , session (s)
+       , rv (r)
 {
        // If this isn't true something is horribly wrong, and we'll get catastrophic gain values
        assert(l->parameter().type() == EnvelopeAutomation);
 
        group->raise_to_top ();
-       set_verbose_cursor_uses_gain_mapping (true);
+       group->property_y() = 2;
+       set_uses_gain_mapping (true);
        terminal_points_can_slide = false;
 }
 
 void
-AudioRegionGainLine::start_drag (ControlPoint* cp, nframes_t x, float fraction) 
+AudioRegionGainLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
 {
        AutomationLine::start_drag (cp, x, fraction);
        if (!rv.audio_region()->envelope_active()) {
                trackview.session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), &rv.audio_region()->get_state(), 0));
                rv.audio_region()->set_envelope_active(false);
-       } 
+       }
 }
 
 // This is an extended copy from AutomationList
@@ -69,7 +68,7 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
 
        model_representation (cp, mr);
 
-       trackview.editor.current_session()->begin_reversible_command (_("remove control point"));
+       trackview.editor().current_session()->begin_reversible_command (_("remove control point"));
        XMLNode &before = alist->get_state();
 
        if (!rv.audio_region()->envelope_active()) {
@@ -77,22 +76,22 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
                rv.audio_region()->set_envelope_active(true);
                XMLNode &region_after = rv.audio_region()->get_state();
                trackview.session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), &region_before, &region_after));
-       } 
-       
+       }
+
        alist->erase (mr.start, mr.end);
 
-       trackview.editor.current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
-       trackview.editor.current_session()->commit_reversible_command ();
-       trackview.editor.current_session()->set_dirty ();
+       trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
+       trackview.editor().current_session()->commit_reversible_command ();
+       trackview.editor().current_session()->set_dirty ();
 }
 
 void
-AudioRegionGainLine::end_drag (ControlPoint* cp) 
+AudioRegionGainLine::end_drag (ControlPoint* cp)
 {
        if (!rv.audio_region()->envelope_active()) {
                rv.audio_region()->set_envelope_active(true);
                trackview.session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), 0, &rv.audio_region()->get_state()));
-       } 
+       }
 
        AutomationLine::end_drag(cp);
 }