Add method to check if Session is empty
Empty means that it contains some tracks or user-addedd busses or VCA (not counting master, monitor, surround busses). This is motivated by A&H control-surface.
This commit is contained in:
@@ -359,6 +359,7 @@ public:
|
||||
uint32_t ntracks () const;
|
||||
uint32_t naudiotracks () const;
|
||||
uint32_t nbusses () const;
|
||||
bool empty () const;
|
||||
|
||||
bool plot_process_graph (std::string const& file_name) const;
|
||||
|
||||
|
||||
@@ -3146,6 +3146,7 @@ LuaBindings::common (lua_State* L)
|
||||
.addFunction ("name", &Session::name)
|
||||
.addFunction ("path", &Session::path)
|
||||
.addFunction ("uuid", &Session::uuid)
|
||||
.addFunction ("empty", &Session::empty)
|
||||
.addFunction ("record_status", &Session::record_status)
|
||||
.addFunction ("maybe_enable_record", &Session::maybe_enable_record)
|
||||
.addFunction ("disable_record", &Session::disable_record)
|
||||
|
||||
@@ -6736,6 +6736,20 @@ Session::nstripables (bool with_monitor) const
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool
|
||||
Session::empty() const
|
||||
{
|
||||
StripableList sl;
|
||||
get_stripables (sl);
|
||||
for (auto const& s: sl) {
|
||||
if (s->is_singleton ()) {
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
Session::plot_process_graph (std::string const& file_name) const {
|
||||
return _graph_chain ? _graph_chain->plot (file_name) : false;
|
||||
|
||||
Reference in New Issue
Block a user