PortList debug methods (to be called from gdb)

This commit is contained in:
Robin Gareus
2021-05-07 01:43:19 +02:00
parent ade679f162
commit 7dc21fdc96
4 changed files with 39 additions and 0 deletions

View File

@@ -229,6 +229,10 @@ protected:
}
virtual BackendPort* port_factory (std::string const& name, ARDOUR::DataType dt, ARDOUR::PortFlags flags) = 0;
#ifndef NDEBUG
void list_ports () const;
#endif
};
} /* namespace ARDOUR */

View File

@@ -121,6 +121,11 @@ public:
uint32_t port_name_size () const;
std::string my_name () const;
#ifndef NDEBUG
void list_cycle_ports () const;
void list_all_ports () const;
#endif
/* Port registration */
boost::shared_ptr<Port> register_input_port (DataType, const std::string& portname, bool async = false, PortFlags extra_flags = PortFlags (0));

View File

@@ -724,3 +724,14 @@ PortEngineSharedImpl::update_system_port_latencies ()
(*it)->update_connected_latency (false);
}
}
#ifndef NDEBUG
void
PortEngineSharedImpl::list_ports () const
{
boost::shared_ptr<PortIndex> p = _ports.reader ();
for (PortIndex::const_iterator i = p->begin (); i != p->end (); ++i) {
std::cout << (*i)->name () << "\n";
}
}
#endif

View File

@@ -1870,3 +1870,22 @@ PortManager::run_input_meters (pframes_t n_samples, samplecnt_t rate)
}
}
}
#ifndef NDEBUG
void
PortManager::list_all_ports () const
{
boost::shared_ptr<Ports> plist = _ports.reader();
for (Ports::iterator p = plist->begin(); p != plist->end(); ++p) {
std::cout << p->first << "\n";
}
}
void
PortManager::list_cycle_ports () const
{
for (Ports::iterator p = _cycle_ports->begin(); p != _cycle_ports->end(); ++p) {
std::cout << p->first << "\n";
}
}
#endif