mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-15 07:53:55 +02:00
Add missing fields in events
Thanks GCC.
This commit is contained in:
@@ -50,12 +50,14 @@ YaChordEvent::YaChordEvent() {}
|
|||||||
YaChordEvent::YaChordEvent(const Steinberg::Vst::ChordEvent& event)
|
YaChordEvent::YaChordEvent(const Steinberg::Vst::ChordEvent& event)
|
||||||
: root(event.root),
|
: root(event.root),
|
||||||
bass_note(event.bassNote),
|
bass_note(event.bassNote),
|
||||||
|
mask(event.mask),
|
||||||
text(tchar_pointer_to_u16string(event.text, event.textLen)) {}
|
text(tchar_pointer_to_u16string(event.text, event.textLen)) {}
|
||||||
|
|
||||||
Steinberg::Vst::ChordEvent YaChordEvent::get() const {
|
Steinberg::Vst::ChordEvent YaChordEvent::get() const {
|
||||||
return Steinberg::Vst::ChordEvent{
|
return Steinberg::Vst::ChordEvent{
|
||||||
.root = root,
|
.root = root,
|
||||||
.bassNote = bass_note,
|
.bassNote = bass_note,
|
||||||
|
.mask = mask,
|
||||||
.textLen = static_cast<uint16>(text.size()),
|
.textLen = static_cast<uint16>(text.size()),
|
||||||
.text = u16string_to_tchar_pointer(text)};
|
.text = u16string_to_tchar_pointer(text)};
|
||||||
}
|
}
|
||||||
@@ -64,11 +66,13 @@ YaScaleEvent::YaScaleEvent() {}
|
|||||||
|
|
||||||
YaScaleEvent::YaScaleEvent(const Steinberg::Vst::ScaleEvent& event)
|
YaScaleEvent::YaScaleEvent(const Steinberg::Vst::ScaleEvent& event)
|
||||||
: root(event.root),
|
: root(event.root),
|
||||||
|
mask(event.mask),
|
||||||
text(tchar_pointer_to_u16string(event.text, event.textLen)) {}
|
text(tchar_pointer_to_u16string(event.text, event.textLen)) {}
|
||||||
|
|
||||||
Steinberg::Vst::ScaleEvent YaScaleEvent::get() const {
|
Steinberg::Vst::ScaleEvent YaScaleEvent::get() const {
|
||||||
return Steinberg::Vst::ScaleEvent{
|
return Steinberg::Vst::ScaleEvent{
|
||||||
.root = root,
|
.root = root,
|
||||||
|
.mask = mask,
|
||||||
.textLen = static_cast<uint16>(text.size()),
|
.textLen = static_cast<uint16>(text.size()),
|
||||||
.text = u16string_to_tchar_pointer(text)};
|
.text = u16string_to_tchar_pointer(text)};
|
||||||
}
|
}
|
||||||
@@ -118,10 +122,14 @@ YaEvent::YaEvent(const Steinberg::Vst::Event& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Steinberg::Vst::Event YaEvent::get() const {
|
Steinberg::Vst::Event YaEvent::get() const {
|
||||||
|
// We of course can't fully initialize a field with an untagged union
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||||
Steinberg::Vst::Event event{.busIndex = bus_index,
|
Steinberg::Vst::Event event{.busIndex = bus_index,
|
||||||
.sampleOffset = sample_offset,
|
.sampleOffset = sample_offset,
|
||||||
.ppqPosition = ppq_position,
|
.ppqPosition = ppq_position,
|
||||||
.flags = flags};
|
.flags = flags};
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
std::visit(
|
std::visit(
|
||||||
overload{
|
overload{
|
||||||
[&](const Steinberg::Vst::NoteOnEvent& specific_event) {
|
[&](const Steinberg::Vst::NoteOnEvent& specific_event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user