first vaguely working version using PresentationInfo
[ardour.git] / libs / ardour / luabindings.cc
index 6c687de56cf20c10cef2e59ae5f08f7bf75b6781..765402efac93285c1638455c99ef170172472865 100644 (file)
@@ -171,6 +171,7 @@ CLASSKEYS(boost::weak_ptr<ARDOUR::Route>);
 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Region> >);
 CLASSKEYS(std::list<ARDOUR::AudioRange>);
 CLASSKEYS(Evoral::Beats);
+CLASSKEYS(ARDOUR::PortEngine);
 CLASSKEYS(ARDOUR::PortManager);
 CLASSKEYS(ARDOUR::AudioEngine);
 CLASSKEYS(void);
@@ -459,6 +460,8 @@ LuaBindings::common (lua_State* L)
                .endClass ()
 
                .beginWSPtrClass <Port> ("Port")
+               .addCast<MidiPort> ("to_midiport")
+               .addCast<AudioPort> ("to_audioport")
                .addFunction ("name", &Port::name)
                .addFunction ("pretty_name", &Port::pretty_name)
                .addFunction ("receives_input", &Port::receives_input)
@@ -471,6 +474,7 @@ LuaBindings::common (lua_State* L)
                .addFunction ("connected_to", (bool (Port::*)(Port*)const)&Port::connected_to)
                .addFunction ("connect", (int (Port::*)(Port*))&Port::connect)
                .addFunction ("disconnect", (int (Port::*)(Port*))&Port::disconnect)
+               //.addStaticFunction ("port_offset", &Port::port_offset) // static
                .endClass ()
 
                .deriveWSPtrClass <AudioPort, Port> ("AudioPort")
@@ -479,6 +483,7 @@ LuaBindings::common (lua_State* L)
                .deriveWSPtrClass <MidiPort, Port> ("MidiPort")
                .addFunction ("input_active", &MidiPort::input_active)
                .addFunction ("set_input_active", &MidiPort::set_input_active)
+               .addFunction ("get_midi_buffer", &MidiPort::get_midi_buffer) // DSP only
                .endClass ()
 
                .beginWSPtrClass <PortSet> ("PortSet")
@@ -578,10 +583,10 @@ LuaBindings::common (lua_State* L)
                .addCast<MidiTrack> ("to_midi_track")
                .addFunction ("set_name", &Track::set_name)
                .addFunction ("can_record", &Track::can_record)
-               .addFunction ("record_enabled", &Track::record_enabled)
-               .addFunction ("record_safe", &Track::record_safe)
-               .addFunction ("set_record_enabled", &Track::set_record_enabled)
-               .addFunction ("set_record_safe", &Track::set_record_safe)
+               //.addFunction ("record_enabled", &Track::record_enabled)
+               //.addFunction ("record_safe", &Track::record_safe)
+               //.addFunction ("set_record_enabled", &Track::set_record_enabled)
+               //.addFunction ("set_record_safe", &Track::set_record_safe)
                .addFunction ("bounceable", &Track::bounceable)
                .addFunction ("bounce", &Track::bounce)
                .addFunction ("bounce_range", &Track::bounce_range)
@@ -956,6 +961,9 @@ LuaBindings::common (lua_State* L)
                .addFunction ("set_output_device_name", &AudioBackend::set_output_device_name)
                .endClass()
 
+               .beginClass <PortEngine> ("PortEngine")
+               .endClass()
+
                .beginClass <PortManager> ("PortManager")
                .addFunction ("port_engine", &PortManager::port_engine)
                .addFunction ("connected", &PortManager::connected)
@@ -1025,7 +1033,7 @@ LuaBindings::common (lua_State* L)
                .addFunction ("record_status", &Session::record_status)
                .addFunction ("route_by_id", &Session::route_by_id)
                .addFunction ("route_by_name", &Session::route_by_name)
-               .addFunction ("route_by_remote_id", &Session::route_by_remote_id)
+               // STRIPABLE .addFunction ("route_by_remote_id", &Session::route_by_remote_id)
                .addFunction ("track_by_diskstream_id", &Session::track_by_diskstream_id)
                .addFunction ("source_by_id", &Session::source_by_id)
                .addFunction ("controllable_by_id", &Session::controllable_by_id)
@@ -1107,8 +1115,10 @@ LuaBindings::dsp (lua_State* L)
                .beginClass <MidiBuffer> ("MidiBuffer")
                .addEqualCheck ()
                .addFunction ("silence", &MidiBuffer::silence)
-               .addFunction ("empty", &MidiBuffer::empty)
+               .addFunction ("push_event", (bool (MidiBuffer::*)(const Evoral::MIDIEvent<framepos_t>&))&MidiBuffer::push_back)
+               .addFunction ("push_back", (bool (MidiBuffer::*)(framepos_t, size_t, const uint8_t*))&MidiBuffer::push_back)
                // TODO iterators..
+               .addExtCFunction ("table", &luabridge::CFunc::listToTable<const Evoral::MIDIEvent<framepos_t>, MidiBuffer>)
                .endClass()
 
                .beginClass <BufferSet> ("BufferSet")
@@ -1135,8 +1145,8 @@ LuaBindings::dsp (lua_State* L)
                // add Ctor?
                .addFunction ("type", &Evoral::MIDIEvent<framepos_t>::type)
                .addFunction ("channel", &Evoral::MIDIEvent<framepos_t>::channel)
-               .addFunction ("set_type", &Evoral::MIDIEvent<framepos_t>::type)
-               .addFunction ("set_channel", &Evoral::MIDIEvent<framepos_t>::channel)
+               .addFunction ("set_type", &Evoral::MIDIEvent<framepos_t>::set_type)
+               .addFunction ("set_channel", &Evoral::MIDIEvent<framepos_t>::set_channel)
                .endClass ()
                .endNamespace ();