Automatically show automation-lane when touching a control
This commit is contained in:
parent
7e74f9eb1e
commit
bd8c26a059
@ -105,6 +105,8 @@ using namespace Editing;
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using std::list;
|
using std::list;
|
||||||
|
|
||||||
|
sigc::signal<void> RouteTimeAxisView::signal_ctrl_touched;
|
||||||
|
|
||||||
RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCanvas::Canvas& canvas)
|
RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCanvas::Canvas& canvas)
|
||||||
: RouteUI(sess)
|
: RouteUI(sess)
|
||||||
, StripableTimeAxisView(ed, sess, canvas)
|
, StripableTimeAxisView(ed, sess, canvas)
|
||||||
@ -130,6 +132,10 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCan
|
|||||||
sess->config.ParameterChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::parameter_changed, this, _1), gui_context());
|
sess->config.ParameterChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::parameter_changed, this, _1), gui_context());
|
||||||
UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::parameter_changed));
|
UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::parameter_changed));
|
||||||
|
|
||||||
|
Controllable::ControlTouched.connect (
|
||||||
|
ctrl_touched_connection, invalidator (*this), boost::bind (&RouteTimeAxisView::show_touched_automation, this, _1), gui_context ()
|
||||||
|
);
|
||||||
|
|
||||||
parameter_changed ("editor-stereo-only-meters");
|
parameter_changed ("editor-stereo-only-meters");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,8 +387,20 @@ RouteTimeAxisView::setup_processor_menu_and_curves ()
|
|||||||
{
|
{
|
||||||
_subplugin_menu_map.clear ();
|
_subplugin_menu_map.clear ();
|
||||||
subplugin_menu.items().clear ();
|
subplugin_menu.items().clear ();
|
||||||
|
ctrl_node_map.clear ();
|
||||||
_route->foreach_processor (sigc::mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu));
|
_route->foreach_processor (sigc::mem_fun (*this, &RouteTimeAxisView::add_processor_to_subplugin_menu));
|
||||||
_route->foreach_processor (sigc::mem_fun (*this, &RouteTimeAxisView::add_existing_processor_automation_curves));
|
_route->foreach_processor (sigc::mem_fun (*this, &RouteTimeAxisView::add_existing_processor_automation_curves));
|
||||||
|
|
||||||
|
/* update controllable LUT */
|
||||||
|
for (list<ProcessorAutomationInfo*>::iterator i = processor_automation.begin(); i != processor_automation.end(); ++i) {
|
||||||
|
if (!(*i)->valid) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (vector<ProcessorAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
|
||||||
|
boost::shared_ptr<PBD::Controllable> c = boost::dynamic_pointer_cast <PBD::Controllable>((*i)->processor->control((*ii)->what));
|
||||||
|
ctrl_node_map[c] = *ii;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -1562,6 +1580,57 @@ RouteTimeAxisView::show_existing_automation (bool apply_to_selection)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RouteTimeAxisView::maybe_hide_automation (boost::weak_ptr<PBD::Controllable> wctrl)
|
||||||
|
{
|
||||||
|
ctrl_autohide_connection.disconnect ();
|
||||||
|
boost::shared_ptr<AutomationControl> ac = boost::dynamic_pointer_cast<AutomationControl> (wctrl.lock ());
|
||||||
|
if (!ac) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ProcessorAutomationNode* pan = find_processor_automation_node (ac);
|
||||||
|
if (pan) {
|
||||||
|
pan->menu_item->set_active (false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RouteTimeAxisView::show_touched_automation (boost::weak_ptr<PBD::Controllable> wctrl)
|
||||||
|
{
|
||||||
|
boost::shared_ptr<AutomationControl> ac = boost::dynamic_pointer_cast<AutomationControl> (wctrl.lock ());
|
||||||
|
if (!ac) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (!_editor.show_touched_automation_lane ()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ProcessorAutomationNode* pan = find_processor_automation_node (ac);
|
||||||
|
if (!pan) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* hide any lanes */
|
||||||
|
signal_ctrl_touched ();
|
||||||
|
|
||||||
|
if (!pan->menu_item->get_active ()) {
|
||||||
|
pan->menu_item->set_active (true);
|
||||||
|
ctrl_autohide_connection = signal_ctrl_touched.connect (sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::maybe_hide_automation), wctrl));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* now scroll to the ctrl */
|
||||||
|
for (Children::iterator j = children.begin(); j != children.end(); ++j) {
|
||||||
|
boost::shared_ptr<AutomationTimeAxisView> atv = boost::dynamic_pointer_cast<AutomationTimeAxisView> (*j);
|
||||||
|
if (atv && atv->control () == ac) {
|
||||||
|
_editor.ensure_time_axis_view_is_visible (*atv, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::hide_all_automation (bool apply_to_selection)
|
RouteTimeAxisView::hide_all_automation (bool apply_to_selection)
|
||||||
{
|
{
|
||||||
@ -1639,6 +1708,17 @@ RouteTimeAxisView::find_processor_automation_node (boost::shared_ptr<Processor>
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RouteTimeAxisView::ProcessorAutomationNode*
|
||||||
|
RouteTimeAxisView::find_processor_automation_node (boost::shared_ptr<AutomationControl> ac)
|
||||||
|
{
|
||||||
|
std::map<boost::shared_ptr<PBD::Controllable>, ProcessorAutomationNode*>::const_iterator i;
|
||||||
|
i = ctrl_node_map.find (ac);
|
||||||
|
if (i != ctrl_node_map.end ()) {
|
||||||
|
return i->second;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/** Add an AutomationTimeAxisView to display automation for a processor's parameter */
|
/** Add an AutomationTimeAxisView to display automation for a processor's parameter */
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr<Processor> processor, Evoral::Parameter what)
|
RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr<Processor> processor, Evoral::Parameter what)
|
||||||
|
@ -194,6 +194,9 @@ protected:
|
|||||||
ProcessorAutomationNode*
|
ProcessorAutomationNode*
|
||||||
find_processor_automation_node (boost::shared_ptr<ARDOUR::Processor> i, Evoral::Parameter);
|
find_processor_automation_node (boost::shared_ptr<ARDOUR::Processor> i, Evoral::Parameter);
|
||||||
|
|
||||||
|
ProcessorAutomationNode*
|
||||||
|
find_processor_automation_node (boost::shared_ptr<ARDOUR::AutomationControl>);
|
||||||
|
|
||||||
boost::shared_ptr<AutomationLine>
|
boost::shared_ptr<AutomationLine>
|
||||||
find_processor_automation_curve (boost::shared_ptr<ARDOUR::Processor> i, Evoral::Parameter);
|
find_processor_automation_curve (boost::shared_ptr<ARDOUR::Processor> i, Evoral::Parameter);
|
||||||
|
|
||||||
@ -261,6 +264,8 @@ protected:
|
|||||||
*/
|
*/
|
||||||
std::list<ProcessorAutomationInfo*> processor_automation;
|
std::list<ProcessorAutomationInfo*> processor_automation;
|
||||||
|
|
||||||
|
std::map<boost::shared_ptr<PBD::Controllable>, ProcessorAutomationNode*> ctrl_node_map;
|
||||||
|
|
||||||
typedef std::vector<boost::shared_ptr<AutomationLine> > ProcessorAutomationCurves;
|
typedef std::vector<boost::shared_ptr<AutomationLine> > ProcessorAutomationCurves;
|
||||||
ProcessorAutomationCurves processor_automation_curves;
|
ProcessorAutomationCurves processor_automation_curves;
|
||||||
/** parameter -> menu item map for the plugin automation menu */
|
/** parameter -> menu item map for the plugin automation menu */
|
||||||
@ -299,10 +304,17 @@ private:
|
|||||||
void update_playlist_tip ();
|
void update_playlist_tip ();
|
||||||
void parameter_changed (std::string const & p);
|
void parameter_changed (std::string const & p);
|
||||||
void update_track_number_visibility();
|
void update_track_number_visibility();
|
||||||
|
void show_touched_automation (boost::weak_ptr<PBD::Controllable>);
|
||||||
|
void maybe_hide_automation (boost::weak_ptr<PBD::Controllable>);
|
||||||
|
|
||||||
void drop_instrument_ref ();
|
void drop_instrument_ref ();
|
||||||
void reread_midnam ();
|
void reread_midnam ();
|
||||||
PBD::ScopedConnectionList midnam_connection;
|
PBD::ScopedConnectionList midnam_connection;
|
||||||
|
|
||||||
|
static sigc::signal<void> signal_ctrl_touched;
|
||||||
|
|
||||||
|
PBD::ScopedConnection ctrl_touched_connection;
|
||||||
|
sigc::connection ctrl_autohide_connection;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_route_time_axis_h__ */
|
#endif /* __ardour_route_time_axis_h__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user