Add structs for the CLAP note name extension

This commit is contained in:
Robbert van der Helm
2022-10-21 17:02:28 +02:00
parent 257e3b4a34
commit 39b0f75fad
5 changed files with 180 additions and 0 deletions
@@ -0,0 +1,41 @@
// yabridge: a Wine plugin bridge
// Copyright (C) 2020-2022 Robbert van der Helm
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "note-name.h"
#include "../../../utils.h"
namespace clap {
namespace ext {
namespace note_name {
NoteName::NoteName(const clap_note_name_t& original)
: name(original.name),
port(original.port),
key(original.key),
channel(original.channel) {}
void NoteName::reconstruct(clap_note_name_t& note_name) const {
note_name = clap_note_name_t{};
strlcpy_buffer<sizeof(note_name.name)>(note_name.name, name);
note_name.port = port;
note_name.key = key;
note_name.channel = channel;
}
} // namespace note_name
} // namespace ext
} // namespace clap