LMMS
Loading...
Searching...
No Matches
component.h
Go to the documentation of this file.
1/*
2 * travesty, pure C VST3-compatible interface
3 * Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any purpose with
6 * or without fee is hereby granted, provided that the above copyright notice and this
7 * permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
10 * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
11 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#pragma once
18
19#include "base.h"
20#include "bstream.h"
21
22#include "align_push.h"
23
27
32
33static inline
35{
36 switch (type)
37 {
38 case V3_AUDIO:
39 return "V3_AUDIO";
40 case V3_EVENT:
41 return "V3_EVENT";
42 default:
43 return "[unknown]";
44 }
45}
46
51
52static inline
54{
55 switch (d)
56 {
57 case V3_INPUT:
58 return "V3_INPUT";
59 case V3_OUTPUT:
60 return "V3_OUTPUT";
61 default:
62 return "[unknown]";
63 }
64}
65
70
75
84
88
89struct v3_routing_info;
90
92#ifndef __cplusplus
93 struct v3_plugin_base;
94#endif
95 v3_result (V3_API *get_controller_class_id)(void* self, v3_tuid class_id);
96 v3_result (V3_API *set_io_mode)(void* self, int32_t io_mode);
97 int32_t (V3_API *get_bus_count)(void* self, int32_t media_type, int32_t bus_direction);
100 v3_result (V3_API *get_routing_info)(void* self, struct v3_routing_info* input, struct v3_routing_info* output);
103 v3_result (V3_API *set_active)(void* self, v3_bool state);
104 v3_result (V3_API *set_state)(void* self, struct v3_bstream **);
105 v3_result (V3_API *get_state)(void* self, struct v3_bstream **);
106};
107
108static constexpr const v3_tuid v3_component_iid =
109 V3_ID(0xE831FF31, 0xF2D54301, 0x928EBBEE, 0x25697802);
110
111#ifdef __cplusplus
112
116
117struct v3_component_cpp : v3_funknown {
118 v3_plugin_base base;
120};
121
122template<> inline
123constexpr v3_component* v3_cpp_obj(v3_component** obj)
124{
129 return static_cast<v3_component*>(
130 static_cast<void*>(static_cast<uint8_t*>(static_cast<void*>(*obj)) + sizeof(void*)*5));
131}
132
133#endif
134
135#include "align_pop.h"
#define V3_ID(a, b, c, d)
Definition base.h:111
#define V3_API
Definition base.h:59
int16_t v3_str_128[128]
Definition base.h:37
int32_t v3_result
Definition base.h:35
uint8_t v3_bool
Definition base.h:38
uint8_t v3_tuid[16]
Definition base.h:46
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
static constexpr const v3_tuid v3_component_iid
Definition component.h:108
v3_media_types
Definition component.h:28
@ V3_EVENT
Definition component.h:30
@ V3_AUDIO
Definition component.h:29
v3_bus_flags
Definition component.h:71
@ V3_DEFAULT_ACTIVE
Definition component.h:72
@ V3_IS_CONTROL_VOLTAGE
Definition component.h:73
v3_bus_types
Definition component.h:66
@ V3_MAIN
Definition component.h:67
@ V3_AUX
Definition component.h:68
static const char * v3_media_type_str(int32_t type)
Definition component.h:34
v3_bus_direction
Definition component.h:47
@ V3_OUTPUT
Definition component.h:49
@ V3_INPUT
Definition component.h:48
static const char * v3_bus_direction_str(int32_t d)
Definition component.h:53
unsigned d
Definition inflate.c:940
static int JUCE_CDECL comp(const void *a, const void *b)
Definition lsp.c:298
int int32_t
Definition mid.cpp:97
unsigned int uint32_t
Definition mid.cpp:100
unsigned char uint8_t
Definition mid.cpp:98
Definition bstream.h:27
Definition component.h:76
int32_t media_type
Definition component.h:77
int32_t bus_type
Definition component.h:81
v3_str_128 bus_name
Definition component.h:80
int32_t channel_count
Definition component.h:79
int32_t direction
Definition component.h:78
uint32_t flags
Definition component.h:82
Definition component.h:91
v3_result(V3_API *activate_bus)(void *self
int32_t int32_t int32_t v3_bool state
Definition component.h:102
struct v3_bstream ** v3_result(V3_API *get_state)(void *self
v3_result(V3_API *set_state)(void *self
int32_t int32_t int32_t bus_idx
Definition component.h:99
struct v3_routing_info struct v3_routing_info * output
Definition component.h:100
int32_t(V3_API *get_bus_count)(void *self
struct v3_routing_info * input
Definition component.h:100
v3_tuid class_id
Definition component.h:95
int32_t io_mode
Definition component.h:96
v3_result(V3_API *get_bus_info)(void *self
int32_t media_type
Definition component.h:97
int32_t int32_t bus_direction
Definition component.h:97
int32_t int32_t int32_t struct v3_bus_info * bus_info
Definition component.h:99
Definition base.h:142
Definition base.h:155