13
0

Minor cleanups to IO.

git-svn-id: svn://localhost/ardour2/branches/3.0@10322 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-10-27 23:36:42 +00:00
parent e829448207
commit 0a87941c70
4 changed files with 24 additions and 59 deletions

View File

@ -170,12 +170,10 @@ class IO : public SessionObject, public Latent
*/
PBD::Signal1<bool, ChanCount, BoolCombiner> PortCountChanging;
static int disable_connecting (void);
static int enable_connecting (void);
static int disable_ports (void);
static int enable_ports (void);
static int disable_connecting ();
static int enable_connecting ();
static PBD::Signal1<void,ChanCount> PortCountChanged; // emitted when the number of ports changes
static PBD::Signal1<void, ChanCount> PortCountChanged; // emitted when the number of ports changes
static std::string name_from_state (const XMLNode&);
static void set_name_in_state (XMLNode&, const std::string&);
@ -216,9 +214,9 @@ class IO : public SessionObject, public Latent
boost::shared_ptr<Bundle> _bundle; ///< a bundle representing our ports
struct UserBundleInfo {
UserBundleInfo (IO*, boost::shared_ptr<UserBundle> b);
boost::shared_ptr<UserBundle> bundle;
PBD::ScopedConnection changed;
UserBundleInfo (IO*, boost::shared_ptr<UserBundle> b);
boost::shared_ptr<UserBundle> bundle;
PBD::ScopedConnection changed;
};
std::vector<UserBundleInfo*> _bundles_connected; ///< user bundles connected to our ports
@ -229,7 +227,6 @@ class IO : public SessionObject, public Latent
int ensure_ports (ChanCount, bool clear, void *src);
void check_bundles_connected ();
void check_bundles (std::vector<UserBundleInfo*>&, const PortSet&);
void bundle_changed (Bundle::Change);

View File

@ -468,6 +468,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
bool _solo_safe;
DataType _default_type;
FedBy _fed_by;
FedBy _direct_fed_by;
virtual ChanCount input_streams () const;
@ -499,6 +500,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
private:
int _set_state_2X (const XMLNode&, int);
void set_processor_state_2X (XMLNodeList const &, int);
bool sub_feeds (FedBy const &, boost::shared_ptr<Route>, bool* via_send_only = 0);
static uint32_t order_key_cnt;

View File

@ -118,22 +118,15 @@ IO::silence (framecnt_t nframes)
}
}
/** Set _bundles_connected to those bundles that are connected such that every
* port on every bundle channel x is connected to port x in _ports.
*/
void
IO::check_bundles_connected ()
{
check_bundles (_bundles_connected, ports());
}
/** Check the bundles in list to see which are connected to a given PortSet,
* and update list with those that are connected such that every port on every
* bundle channel x is connected to port x in ports.
*/
void
IO::check_bundles (std::vector<UserBundleInfo*>& list, const PortSet& ports)
{
std::vector<UserBundleInfo*> new_list;
for (std::vector<UserBundleInfo*>::iterator i = list.begin(); i != list.end(); ++i) {
for (std::vector<UserBundleInfo*>::iterator i = _bundles_connected.begin(); i != _bundles_connected.end(); ++i) {
uint32_t const N = (*i)->bundle->nchannels().n_total();
@ -147,7 +140,7 @@ IO::check_bundles (std::vector<UserBundleInfo*>& list, const PortSet& ports)
/* Every port on bundle channel j must be connected to our input j */
Bundle::PortList const pl = (*i)->bundle->channel_ports (j);
for (uint32_t k = 0; k < pl.size(); ++k) {
if (ports.port(j)->connected_to (pl[k]) == false) {
if (_ports.port(j)->connected_to (pl[k]) == false) {
ok = false;
break;
}
@ -165,7 +158,7 @@ IO::check_bundles (std::vector<UserBundleInfo*>& list, const PortSet& ports)
}
}
list = new_list;
_bundles_connected = new_list;
}
@ -481,7 +474,7 @@ IO::ensure_io (ChanCount count, bool clear, void* src)
}
XMLNode&
IO::get_state (void)
IO::get_state ()
{
return state (true);
}
@ -1258,7 +1251,7 @@ IO::enable_connecting ()
void
IO::bundle_changed (Bundle::Change /*c*/)
{
//XXX
/* XXX */
// connect_input_ports_to_bundle (_input_bundle, this);
}

View File

@ -2673,7 +2673,7 @@ Route::clear_fed_by ()
}
bool
Route::feeds (boost::shared_ptr<Route> other, bool* via_sends_only)
Route::sub_feeds (Fedby const & fed_by, boost::shared_ptr<Route> other, bool* via_sends_only)
{
const FedBy& fed_by (other->fed_by());
@ -2694,42 +2694,15 @@ Route::feeds (boost::shared_ptr<Route> other, bool* via_sends_only)
}
bool
Route::direct_feeds (boost::shared_ptr<Route> other, bool* only_send)
Route::feeds (boost::shared_ptr<Route> other, bool* via_sends_only)
{
DEBUG_TRACE (DEBUG::Graph, string_compose ("Feeds? %1\n", _name));
return sub_feeds (other->fed_by (), other, via_sends_only);
}
if (_output->connected_to (other->input())) {
DEBUG_TRACE (DEBUG::Graph, string_compose ("\tdirect FEEDS %2\n", other->name()));
if (only_send) {
*only_send = false;
}
return true;
}
for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); ++r) {
boost::shared_ptr<IOProcessor> iop;
if ((iop = boost::dynamic_pointer_cast<IOProcessor>(*r)) != 0) {
if (iop->feeds (other)) {
DEBUG_TRACE (DEBUG::Graph, string_compose ("\tIOP %1 does feed %2\n", iop->name(), other->name()));
if (only_send) {
*only_send = true;
}
return true;
} else {
DEBUG_TRACE (DEBUG::Graph, string_compose ("\tIOP %1 does NOT feed %2\n", iop->name(), other->name()));
}
} else {
DEBUG_TRACE (DEBUG::Graph, string_compose ("\tPROC %1 is not an IOP\n", (*r)->name()));
}
}
DEBUG_TRACE (DEBUG::Graph, string_compose ("\tdoes NOT feed %1\n", other->name()));
return false;
bool
Route::direct_feeds (boost::shared_ptr<Route> other, bool* via_sends_only)
{
return sub_feeds (other->direct_fed_by (), other, via_sends_only);
}
/** Called from the (non-realtime) butler thread when the transport is stopped */