Remove redundant view <-> model value mapping stuff from AudioRegionGainLine.
git-svn-id: svn://localhost/ardour2/trunk@2296 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6dc8ec0104
commit
e0eb5fd335
@ -43,25 +43,14 @@ AudioRegionGainLine::AudioRegionGainLine (const string & name, Session& s, Audio
|
||||
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);
|
||||
terminal_points_can_slide = false;
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionGainLine::view_to_model_y (double& y)
|
||||
{
|
||||
y = slider_position_to_gain (y);
|
||||
y = max (0.0, y);
|
||||
y = min (2.0, y);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionGainLine::model_to_view_y (double& y)
|
||||
{
|
||||
y = gain_to_slider_position (y);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionGainLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
||||
{
|
||||
@ -102,7 +91,7 @@ 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()));
|
||||
trackview.session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), 0, &rv.audio_region()->get_state()));
|
||||
}
|
||||
|
||||
AutomationLine::end_drag(cp);
|
||||
|
@ -37,15 +37,11 @@ class AudioRegionGainLine : public AutomationLine
|
||||
public:
|
||||
AudioRegionGainLine (const string & name, ARDOUR::Session&, AudioRegionView&, ArdourCanvas::Group& parent, boost::shared_ptr<ARDOUR::AutomationList>);
|
||||
|
||||
void view_to_model_y (double&);
|
||||
void model_to_view_y (double&);
|
||||
|
||||
void start_drag (ControlPoint*, nframes_t x, float fraction);
|
||||
void end_drag (ControlPoint*);
|
||||
|
||||
void remove_point (ControlPoint&);
|
||||
|
||||
|
||||
private:
|
||||
ARDOUR::Session& session;
|
||||
AudioRegionView& rv;
|
||||
|
Loading…
Reference in New Issue
Block a user