Add Lua bindings to manage Groups
This commit is contained in:
parent
d64646a2ca
commit
7f9befae2d
|
@ -617,7 +617,9 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
|
|||
bool _reconfigure_on_delete;
|
||||
};
|
||||
|
||||
RouteGroup* new_route_group (const std::string&);
|
||||
void add_route_group (RouteGroup *);
|
||||
void remove_route_group (RouteGroup* rg) { if (rg) remove_route_group (*rg); }
|
||||
void remove_route_group (RouteGroup&);
|
||||
void reorder_route_groups (std::list<RouteGroup*>);
|
||||
|
||||
|
|
|
@ -825,7 +825,38 @@ LuaBindings::common (lua_State* L)
|
|||
.endClass ()
|
||||
|
||||
.beginClass <RouteGroup> ("RouteGroup")
|
||||
// stub RouteGroup* is needed for new_audio_track()
|
||||
.addFunction ("is_active", &RouteGroup::is_active)
|
||||
.addFunction ("is_relative", &RouteGroup::is_relative)
|
||||
.addFunction ("is_hidden", &RouteGroup::is_hidden)
|
||||
.addFunction ("is_gain", &RouteGroup::is_gain)
|
||||
.addFunction ("is_mute", &RouteGroup::is_mute)
|
||||
.addFunction ("is_solo", &RouteGroup::is_solo)
|
||||
.addFunction ("is_recenable", &RouteGroup::is_recenable)
|
||||
.addFunction ("is_select", &RouteGroup::is_select)
|
||||
.addFunction ("is_route_active", &RouteGroup::is_route_active)
|
||||
.addFunction ("is_color", &RouteGroup::is_color)
|
||||
.addFunction ("is_monitoring", &RouteGroup::is_monitoring)
|
||||
.addFunction ("group_master_number", &RouteGroup::group_master_number)
|
||||
.addFunction ("empty", &RouteGroup::empty)
|
||||
.addFunction ("size", &RouteGroup::size)
|
||||
.addFunction ("set_active", &RouteGroup::set_active)
|
||||
.addFunction ("set_relative", &RouteGroup::set_relative)
|
||||
.addFunction ("set_hidden", &RouteGroup::set_hidden)
|
||||
.addFunction ("set_gain", &RouteGroup::set_gain)
|
||||
.addFunction ("set_mute", &RouteGroup::set_mute)
|
||||
.addFunction ("set_solo", &RouteGroup::set_solo)
|
||||
.addFunction ("set_recenable", &RouteGroup::set_recenable)
|
||||
.addFunction ("set_select", &RouteGroup::set_select)
|
||||
.addFunction ("set_route_active", &RouteGroup::set_route_active)
|
||||
.addFunction ("set_color", &RouteGroup::set_color)
|
||||
.addFunction ("set_monitoring", &RouteGroup::set_monitoring)
|
||||
.addFunction ("add", &RouteGroup::add)
|
||||
.addFunction ("remove", &RouteGroup::remove)
|
||||
.addFunction ("clear", &RouteGroup::clear)
|
||||
.addFunction ("has_subgroup", &RouteGroup::has_subgroup)
|
||||
.addFunction ("make_subgroup", &RouteGroup::make_subgroup)
|
||||
.addFunction ("destroy_subgroup", &RouteGroup::destroy_subgroup)
|
||||
.addFunction ("route_list", &RouteGroup::route_list)
|
||||
.endClass ()
|
||||
|
||||
.deriveClass <PresentationInfo, PBD::Stateful> ("PresentationInfo")
|
||||
|
@ -1342,6 +1373,10 @@ LuaBindings::common (lua_State* L)
|
|||
.beginConstStdList <boost::weak_ptr<Route> > ("WeakRouteList")
|
||||
.endClass ()
|
||||
|
||||
// RouteList == std::list<boost::shared_ptr<Route> >
|
||||
.beginConstStdList <RouteGroup*> ("RouteGroupList")
|
||||
.endClass ()
|
||||
|
||||
// typedef std::vector<boost::shared_ptr<Source> > Region::SourceList
|
||||
.beginStdVector <boost::shared_ptr<Source> > ("SourceList")
|
||||
.endClass ()
|
||||
|
@ -1523,6 +1558,11 @@ LuaBindings::common (lua_State* L)
|
|||
.addConst ("MeterCustom", ARDOUR::MeterPoint(MeterCustom))
|
||||
.endNamespace ()
|
||||
|
||||
.beginNamespace ("Placement")
|
||||
.addConst ("PreFader", ARDOUR::Placement(PreFader))
|
||||
.addConst ("PostFader", ARDOUR::Placement(PostFader))
|
||||
.endNamespace ()
|
||||
|
||||
.beginNamespace ("NoteMode")
|
||||
.addConst ("Sustained", ARDOUR::NoteMode(Sustained))
|
||||
.addConst ("Percussive", ARDOUR::NoteMode(Percussive))
|
||||
|
@ -1758,6 +1798,9 @@ LuaBindings::common (lua_State* L)
|
|||
.addFunction ("worst_track_latency", &Session::worst_track_latency)
|
||||
.addFunction ("worst_playback_latency", &Session::worst_playback_latency)
|
||||
.addFunction ("cfg", &Session::cfg)
|
||||
.addFunction ("route_groups", &Session::route_groups)
|
||||
.addFunction ("new_route_group", &Session::new_route_group)
|
||||
.addFunction ("remove_route_group", (void (Session::*)(RouteGroup*))&Session::remove_route_group)
|
||||
.endClass ()
|
||||
|
||||
.beginClass <RegionFactory> ("RegionFactory")
|
||||
|
|
|
@ -2618,6 +2618,25 @@ Session::possible_states () const
|
|||
return possible_states(_path);
|
||||
}
|
||||
|
||||
RouteGroup*
|
||||
Session::new_route_group (const std::string& name)
|
||||
{
|
||||
RouteGroup* rg = NULL;
|
||||
|
||||
for (std::list<RouteGroup*>::const_iterator i = _route_groups.begin (); i != _route_groups.end (); ++i) {
|
||||
if ((*i)->name () == name) {
|
||||
rg = *i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!rg) {
|
||||
rg = new RouteGroup (*this, name);
|
||||
add_route_group (rg);
|
||||
}
|
||||
return (rg);
|
||||
}
|
||||
|
||||
void
|
||||
Session::add_route_group (RouteGroup* g)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user