DEBUG -- REVERT -- QUICK HACK TO EDIT REGION FX AUTOMATION
This commit is contained in:
parent
85e1dea5c6
commit
58b440f285
|
@ -36,6 +36,7 @@
|
|||
#include "ardour/audioregion.h"
|
||||
#include "ardour/audiosource.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/region_fx_plugin.h"
|
||||
#include "ardour/session.h"
|
||||
|
||||
#include "pbd/memento_command.h"
|
||||
|
@ -1165,6 +1166,19 @@ AudioRegionView::update_envelope_visibility ()
|
|||
if (!gain_line) {
|
||||
return;
|
||||
}
|
||||
static bool done = false;
|
||||
if (_region->nth_plugin (0) && !done) {
|
||||
printf ("USE FIRST CTRL\n");
|
||||
done = true;
|
||||
std::shared_ptr<Evoral::Control> c = _region->nth_plugin (0)->control (Evoral::Parameter (PluginAutomation, 0, 4));
|
||||
std::shared_ptr<AutomationControl> ac = std::dynamic_pointer_cast<AutomationControl> (c);
|
||||
if (ac) {
|
||||
ac->set_automation_state (Play);
|
||||
gain_line.reset (new AudioRegionGainLine ("REGION FX", *this, *group, ac->alist()));
|
||||
gain_line->set_height ((uint32_t) rint (height() - NAME_HIGHLIGHT_SIZE) - 2);
|
||||
gain_line->reset ();
|
||||
}
|
||||
}
|
||||
|
||||
if (trackview.editor().current_mouse_mode() == Editing::MouseDraw || trackview.editor().current_mouse_mode() == Editing::MouseContent ) {
|
||||
gain_line->set_visibility (AutomationLine::VisibleAspects(AutomationLine::ControlPoints|AutomationLine::Line));
|
||||
|
@ -1432,8 +1446,8 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, b
|
|||
region_memento = new MementoCommand<AudioRegion>(*(audio_region().get()), ®ion_before, ®ion_after);
|
||||
}
|
||||
|
||||
if (audio_region()->envelope()->editor_add (timepos_t (fx), y, with_guard_points)) {
|
||||
XMLNode &after = audio_region()->envelope()->get_state();
|
||||
if (gain_line->the_list()->editor_add (timepos_t (fx), y, with_guard_points)) {
|
||||
XMLNode &after = gain_line->the_list()->get_state();
|
||||
std::list<Selectable*> results;
|
||||
|
||||
trackview.editor().begin_reversible_command (_("add gain control point"));
|
||||
|
|
|
@ -48,7 +48,7 @@ AudioRegionGainLine::AudioRegionGainLine (const string & name, AudioRegionView&
|
|||
, rv (r)
|
||||
{
|
||||
// If this isn't true something is horribly wrong, and we'll get catastrophic gain values
|
||||
assert(l->parameter().type() == EnvelopeAutomation);
|
||||
//assert(l->parameter().type() == EnvelopeAutomation);
|
||||
|
||||
r.region()->PropertyChanged.connect (_region_changed_connection, invalidator (*this), boost::bind (&AudioRegionGainLine::region_changed, this, _1), gui_context());
|
||||
|
||||
|
|
Loading…
Reference in New Issue