X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Flua_api.cc;h=001ddc11bf2ffb798693be7c178a49a6b712f7bc;hb=8cf323c15df3af076a7e69a4b24c5cb6329477c6;hp=7da81b29658108b6955e7dc2c7f28bb62301bb1a;hpb=4755c703f4b01cd7de01bda0c72686b93e34e120;p=ardour.git diff --git a/libs/ardour/lua_api.cc b/libs/ardour/lua_api.cc index 7da81b2965..001ddc11bf 100644 --- a/libs/ardour/lua_api.cc +++ b/libs/ardour/lua_api.cc @@ -122,6 +122,7 @@ ARDOUR::LuaAPI::new_plugin_info (const string& name, ARDOUR::PluginType type) #ifdef LV2_SUPPORT all_plugs.insert (all_plugs.end (), manager.lv2_plugin_info ().begin (), manager.lv2_plugin_info ().end ()); #endif + all_plugs.insert (all_plugs.end (), manager.lua_plugin_info ().begin (), manager.lua_plugin_info ().end ()); for (PluginInfoList::const_iterator i = all_plugs.begin (); i != all_plugs.end (); ++i) { if (((*i)->name == name || (*i)->unique_id == name) && (*i)->type == type) { @@ -342,7 +343,7 @@ ARDOUR::LuaAPI::sample_to_timecode_lua (lua_State *L) sample, timecode, false, false, s->timecode_frames_per_second (), s->timecode_drop_frames (), - s->frame_rate (), + s->sample_rate (), 0, false, 0); luabridge::Stack::push (L, timecode.hours); @@ -378,7 +379,7 @@ ARDOUR::LuaAPI::timecode_to_sample_lua (lua_State *L) Timecode::timecode_to_sample ( timecode, sample, false, false, - s->frame_rate (), + s->sample_rate (), 0, false, 0); luabridge::Stack::push (L, sample); @@ -485,7 +486,7 @@ ARDOUR::LuaAPI::hsla_to_rgba (lua_State *L) a = luabridge::Stack::get (L, 4); } - // we can't use ArdourCanvas::hsva_to_color here + // we can't use Gtkmm2ext::hsva_to_color here // besides we want HSL not HSV and without intermediate // color_to_rgba (rgba_to_color ()) double r, g, b; @@ -514,7 +515,7 @@ ARDOUR::LuaAPI::color_to_rgba (lua_State *L) /* libardour is no user of libcanvas, otherwise * we could just call - * ArdourCanvas::color_to_rgba (color, r, g, b, a); + * Gtkmm2ext::color_to_rgba (color, r, g, b, a); */ r = ((color >> 24) & 0xff) / 255.0; g = ((color >> 16) & 0xff) / 255.0; @@ -728,7 +729,7 @@ LuaAPI::Vamp::Vamp (const std::string& key, float sample_rate) if (bs > 0 && ss > 0 && bs <= 8192 && ss <= 8192) { _bufsize = bs; - _stepsize = bs; + _stepsize = ss; } } @@ -773,12 +774,12 @@ LuaAPI::Vamp::analyze (boost::shared_ptr r, uint32_t channel, float* data = new float[_bufsize]; float* bufs[1] = { data }; - framecnt_t len = r->readable_length(); - framepos_t pos = 0; + samplecnt_t len = r->readable_length(); + samplepos_t pos = 0; int rv = 0; while (1) { - framecnt_t to_read = std::min ((len - pos), _bufsize); + samplecnt_t to_read = std::min ((len - pos), _bufsize); if (r->read (data, pos, to_read, channel) != to_read) { rv = -1; break; @@ -814,8 +815,22 @@ LuaAPI::Vamp::process (const std::vector& d, ::Vamp::RealTime rt) return _plugin->process (bufs, rt); } -boost::shared_ptr > -LuaAPI::new_noteptr (uint8_t chan, Evoral::Beats beat_time, Evoral::Beats length, uint8_t note, uint8_t velocity) +boost::shared_ptr > +LuaAPI::new_noteptr (uint8_t chan, Temporal::Beats beat_time, Temporal::Beats length, uint8_t note, uint8_t velocity) +{ + return boost::shared_ptr > (new Evoral::Note(chan, beat_time, length, note, velocity)); +} + +std::list > > +LuaAPI::note_list (boost::shared_ptr mm) { - return boost::shared_ptr > (new Evoral::Note(chan, beat_time, length, note, velocity)); + typedef boost::shared_ptr > NotePtr; + + std::list note_ptr_list; + + const MidiModel::Notes& notes = mm->notes(); + for (MidiModel::Notes::const_iterator i = notes.begin(); i != notes.end(); ++i) { + note_ptr_list.push_back (*i); + } + return note_ptr_list; }