[Ardour-Dev] Problems using control surface with Ardour
stuartallen1972 at gmail.com
Tue Jul 14 22:35:10 PDT 2009
As some of you may know I've been working on trying to solve the problem of
the transport control bindings being lost when Ardour reloads and I think I
am getting close to having a solution. As far as I can tell, the problem
with the transport control bindings being lost when Ardour is restarted is
caused by the controls not being added to the Session object (no call to
Session->add_controllable(blah)). I tried just adding these calls in
load_session() (ardour_ui.cc) after the Session is instantiated, but it
turns out that in the process of the Session object being instantiated (in
the function "second_stage_init"), a reference to the Session is passed to
the ControlProtocolManager (ControlProtocolManager::instance().set_session
(*this);) This call also triggers all the initialisation functions specified
in the ControlProtocolDescriptors so the "[WARNING]: Generic MIDI control:
controllable 6 not found in session (ignored)" messages appear before the
"new Session" line in load_session() returns. In order to get this working
commented out the line "ControlProtocolManager::instance().set_session
(*this);" in second_stage_init() and added this code to load_session() in
/* now the session been created, add the transport controls */
This seems to now work - the warnings have disappears and the bindings work
after re-load, but I don't know enough about Ardour yet to know if moving
the call to ControlProtocolManager.set_session() is a very bad thing to do.
To keep closer to the original order of events, the controls would have to
be added from within the code that creates the Session object, but I wasn't
sure of the best was to pass these objects to that code.
Of course the other issue is that these controls probably weren't written to
the session in the first place as they are independent of any session
(unless you wish to bind them differently on a song-by-song basis).
Any advice would be greatly appreciated,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ardour-Dev