ControlProtocol doesn't actually need any record of an event loop and doesn't need to connect to any signals itself
git-svn-id: svn://localhost/ardour2/branches/3.0@12063 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -50,34 +50,17 @@ PBD::Signal1<void,uint32_t> ControlProtocol::SetRouteSelection;
|
||||
PBD::Signal1<void,uint32_t> ControlProtocol::RemoveRouteFromSelection;
|
||||
PBD::Signal0<void> ControlProtocol::ClearRouteSelection;
|
||||
|
||||
ControlProtocol::ControlProtocol (Session& s, string str, EventLoop* evloop)
|
||||
: BasicUI (s),
|
||||
_name (str)
|
||||
ControlProtocol::ControlProtocol (Session& s, string str)
|
||||
: BasicUI (s)
|
||||
, _name (str)
|
||||
, _active (false)
|
||||
{
|
||||
if (evloop) {
|
||||
_own_event_loop = false;
|
||||
_event_loop = evloop;
|
||||
} else {
|
||||
_own_event_loop = true;
|
||||
fatal << "programming error: cannot create control protocols without an existing event loop (yet)" << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
_active = false;
|
||||
|
||||
session->RouteAdded.connect (*this, MISSING_INVALIDATOR, boost::protect (boost::bind (&ControlProtocol::add_strip, this, _1)), _event_loop);
|
||||
}
|
||||
|
||||
ControlProtocol::~ControlProtocol ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::add_strip (ARDOUR::RouteList&)
|
||||
{
|
||||
route_list_changed();
|
||||
}
|
||||
|
||||
void
|
||||
ControlProtocol::next_track (uint32_t initial_id)
|
||||
{
|
||||
|
||||
@@ -39,9 +39,9 @@ class Route;
|
||||
class Session;
|
||||
class Bundle;
|
||||
|
||||
class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, public PBD::ScopedConnectionList, public BasicUI {
|
||||
class ControlProtocol : public PBD::Stateful, public PBD::ScopedConnectionList, public BasicUI {
|
||||
public:
|
||||
ControlProtocol (Session&, std::string name, PBD::EventLoop* event_loop);
|
||||
ControlProtocol (Session&, std::string name);
|
||||
virtual ~ControlProtocol();
|
||||
|
||||
std::string name() const { return _name; }
|
||||
@@ -52,8 +52,6 @@ class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, pu
|
||||
virtual int set_feedback (bool /*yn*/) { return 0; }
|
||||
virtual bool get_feedback () const { return false; }
|
||||
|
||||
virtual void route_list_changed () {}
|
||||
|
||||
virtual void midi_connectivity_established () {}
|
||||
|
||||
PBD::Signal0<void> ActiveChanged;
|
||||
@@ -132,14 +130,10 @@ class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, pu
|
||||
virtual void tear_down_gui() { }
|
||||
|
||||
protected:
|
||||
PBD::EventLoop* _event_loop;
|
||||
bool _own_event_loop;
|
||||
std::vector<boost::shared_ptr<ARDOUR::Route> > route_table;
|
||||
std::string _name;
|
||||
bool _active;
|
||||
|
||||
void add_strip (std::list<boost::shared_ptr<ARDOUR::Route> >&);
|
||||
|
||||
void next_track (uint32_t initial_id);
|
||||
void prev_track (uint32_t initial_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user