13
0
Commit Graph

20 Commits

Author SHA1 Message Date
7094c82e75
Add Lua bindings to std::shared_ptr<T const>
This is required after the recent RCU change to return
const shared pointers for read (295dbd8e1).
2023-04-19 01:46:58 +02:00
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
46b14498f8
Prepare Lua bindings for std::set::insert 2022-10-17 23:09:04 +02:00
34c4602e61
Lua Array, assert indices > 0 2020-02-06 17:30:21 +01:00
5e1a73a28c
Add Lua typecast from C++ vector to C-Array
This is useful for MIDI bytes amongst other things
2019-12-01 21:32:10 +01:00
3da07e6736
Special case Lua copy-construction of trackable instances
This fixes an crashing issue with ArdourUI.SelectionList a bug
introduced in 6dc3bdf252 and 35dcd46d7d.

Since removal of the special cases in 35dcd46d7d, when using
a C-pointer in a std::list<>,
  std::list<class*>::push_back(TypeListValue)
TypeListValues<>'s Head was expanded to  "class*& const"
implied by void ::push_back(const T& value);

This resulted in lifetime issues with a classes that derive
from sigc::trackable (e.g. Ardour's Selection).
The reference leaves scope and isn't duplicated when it is pushed back
to the std::list<>.

The script scripts/select_every_2nd_region.lua crashed because entries
in the SelectionList were no longer valid.

Previously (before 6dc3bdf252) TypeListValues explicitly
copy-constructed the value to work around the lifetime issue.
This new solution bypasses the issue by directly using the c-pointer
without dereferencing it.
2019-04-12 05:45:27 +02:00
412b6a4cb9 Lua: make external (static) functions available for const objects.
This fixes iterators on const std::lists<>& and const std::map<>&
2017-03-30 04:15:28 +02:00
bc300ddab7 Make Lua std::set bindings more generic, (prepare for multiset etc) 2017-03-18 14:35:29 +01:00
a2094b6831 Lua: provide instance-equal check as '==' comparator.
This deprecated explicit the "sameinstance()" method
2017-03-16 20:08:17 +01:00
86bfe4eff6 Lua binding for std::map<>::at() 2016-10-07 03:39:22 +02:00
a4da0747e1 allow to access data-members in weak/shared ptr classes 2016-08-26 19:01:09 +02:00
1d7c144967 add "sameinstance()" lua binding for all shared/weak ptrs 2016-08-26 18:25:15 +02:00
67083d65e4 add lua/C++ dynamic_cast<> 2016-06-01 13:59:31 +02:00
50d6f146f4 allow lua to access array at an offset 2016-05-21 15:55:14 +02:00
204c8016c7 allow to compare C class instances from lua 2016-04-14 03:08:02 +02:00
2c71196a6c allow to bind functions with reference args in global lua namespace 2016-03-18 19:59:37 +01:00
a8ae47ada2 LuaBridge: support argument references via table return 2016-02-22 22:06:47 +01:00
12a58015a3 customize LuaBridge
* introduce boost::shared_ptr support
* support enum & const
* allow to add non-class member functions
* STL iterators (vector, list, set, bitset & map)
* support reference arguments (framecnt_t&)
* add support for arrays of basic types (e.g. float*, int*)
* fix compiler warnings
2016-02-22 22:06:47 +01:00
2b575e4746 NO-OP whitespace 2016-02-22 22:06:47 +01:00
e98f21dd29 add LuaBridge
https://github.com/vinniefalco/LuaBridge
2016-02-22 22:06:47 +01:00