Add support to create midi regions from Lua

This commit is contained in:
Daniel Appelt 2025-08-22 12:31:21 +02:00 committed by Robin Gareus
parent a6e3708a8a
commit 26c9621aca
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 8 additions and 0 deletions

View file

@ -54,6 +54,7 @@
#include "region_view.h"
#include "processor_box.h"
#include "time_axis_view.h"
#include "midi_time_axis.h"
#include "time_axis_view_item.h"
#include "selection.h"
#include "script_selector.h"
@ -811,6 +812,7 @@ LuaInstance::register_classes (lua_State* L, bool sandbox)
.endClass ()
.deriveClass <TimeAxisView, AxisView> ("TimeAxisView")
.addCast<MidiTimeAxisView> ("to_midi_time_axis_view")
.addFunction ("order", &TimeAxisView::order)
.addFunction ("y_position", &TimeAxisView::y_position)
.addFunction ("effective_height", &TimeAxisView::effective_height)
@ -818,6 +820,10 @@ LuaInstance::register_classes (lua_State* L, bool sandbox)
.addFunction ("set_height", &TimeAxisView::set_height)
.endClass ()
.deriveClass <MidiTimeAxisView, TimeAxisView> ("MidiTimeAxisView")
.addFunction ("add_region", &MidiTimeAxisView::add_region)
.endClass ()
.deriveClass <StripableTimeAxisView, TimeAxisView> ("StripableTimeAxisView")
.endClass ()
@ -825,6 +831,7 @@ LuaInstance::register_classes (lua_State* L, bool sandbox)
.endClass ()
.deriveClass <TimeAxisViewItem, Selectable> ("TimeAxisViewItem")
.addFunction ("get_time_axis_view", &TimeAxisViewItem::get_time_axis_view)
.endClass ()
.deriveClass <RegionView, TimeAxisViewItem> ("RegionView")

View file

@ -238,6 +238,7 @@ CLASSINFO(Selectable);
CLASSINFO(Selection);
CLASSINFO(TimeAxisView);
CLASSINFO(TimeAxisViewItem);
CLASSINFO(MidiTimeAxisView);
CLASSINFO(TimeSelection);
CLASSINFO(TrackSelection);
CLASSINFO(TrackViewList);