3 * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #include "CarlaDefines.h"
20 #include "CarlaNativeExtUI.hpp"
22 // -----------------------------------------------------------------------
24 class NotesPlugin
: public NativePluginAndUiClass
27 NotesPlugin(const NativeHostDescriptor
* const host
)
28 : NativePluginAndUiClass(host
, "notes-ui"),
32 // -------------------------------------------------------------------
33 // Plugin parameter calls
35 uint32_t getParameterCount() const override
40 const NativeParameter
* getParameterInfo(const uint32_t index
) const override
45 static NativeParameter param
;
47 param
.hints
= static_cast<NativeParameterHints
>(NATIVE_PARAMETER_IS_ENABLED
48 |NATIVE_PARAMETER_IS_AUTOMATABLE
49 |NATIVE_PARAMETER_IS_INTEGER
);
52 param
.ranges
.def
= 1.0f
;
53 param
.ranges
.min
= 1.0f
;
54 param
.ranges
.max
= 100.0f
;
55 param
.ranges
.step
= 1.0f
;
56 param
.ranges
.stepSmall
= 1.0f
;
57 param
.ranges
.stepLarge
= 1.0f
;
58 param
.scalePointCount
= 0;
59 param
.scalePoints
= nullptr;
64 float getParameterValue(const uint32_t index
) const override
69 return static_cast<float>(fCurPage
);
72 // -------------------------------------------------------------------
75 void setParameterValue(const uint32_t index
, const float value
) override
80 fCurPage
= static_cast<int>(value
);
83 // -------------------------------------------------------------------
84 // Plugin process calls
86 void process(const float* const*, float**, const uint32_t, const NativeMidiEvent
* const, const uint32_t) override
93 PluginClassEND(NotesPlugin
)
94 CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(NotesPlugin
)
97 // -----------------------------------------------------------------------
99 static const NativePluginDescriptor notesDesc
= {
100 /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY
,
101 /* hints */ static_cast<NativePluginHints
>(NATIVE_PLUGIN_IS_RTSAFE
102 |NATIVE_PLUGIN_HAS_UI
),
103 /* supports */ NATIVE_PLUGIN_SUPPORTS_NOTHING
,
112 /* maker */ "falkTX",
113 /* copyright */ "GNU GPL v2+",
114 PluginDescriptorFILL(NotesPlugin
)
117 // -----------------------------------------------------------------------
120 void carla_register_native_plugin_notes();
123 void carla_register_native_plugin_notes()
125 carla_register_native_plugin(¬esDesc
);
128 // -----------------------------------------------------------------------