JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
vsteditcontroller.cpp
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2// Project : VST SDK
3//
4// Category : Helpers
5// Filename : public.sdk/source/vst/vsteditcontroller.cpp
6// Created by : Steinberg, 04/2005
7// Description : VST Edit Controller Implementation
8//
9//-----------------------------------------------------------------------------
10// LICENSE
11// (c) 2023, Steinberg Media Technologies GmbH, All Rights Reserved
12//-----------------------------------------------------------------------------
13// Redistribution and use in source and binary forms, with or without modification,
14// are permitted provided that the following conditions are met:
15//
16// * Redistributions of source code must retain the above copyright notice,
17// this list of conditions and the following disclaimer.
18// * Redistributions in binary form must reproduce the above copyright notice,
19// this list of conditions and the following disclaimer in the documentation
20// and/or other materials provided with the distribution.
21// * Neither the name of the Steinberg Media Technologies nor the names of its
22// contributors may be used to endorse or promote products derived from this
23// software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34// OF THE POSSIBILITY OF SUCH DAMAGE.
35//-----------------------------------------------------------------------------
36
40
41#include <cstdio>
42
43namespace Steinberg {
44namespace Vst {
45
46KnobMode EditController::hostKnobMode = kCircularMode;
47
48//------------------------------------------------------------------------
49// EditController Implementation
50//------------------------------------------------------------------------
51EditController::EditController ()
52{
53}
54
55//------------------------------------------------------------------------
56tresult PLUGIN_API EditController::initialize (FUnknown* context)
57{
58 return ComponentBase::initialize (context);
59}
60
61//------------------------------------------------------------------------
62tresult PLUGIN_API EditController::terminate ()
63{
64 parameters.removeAll ();
65
66 componentHandler.reset ();
67 componentHandler2.reset ();
68
70}
71
72//------------------------------------------------------------------------
73tresult PLUGIN_API EditController::setComponentState (IBStream* /*state*/)
74{
75 return kNotImplemented;
76}
77
78//------------------------------------------------------------------------
79tresult PLUGIN_API EditController::setState (IBStream* /*state*/)
80{
81 return kNotImplemented;
82}
83
84//------------------------------------------------------------------------
85tresult PLUGIN_API EditController::getState (IBStream* /*state*/)
86{
87 return kNotImplemented;
88}
89
90//------------------------------------------------------------------------
92{
93 return parameters.getParameterCount ();
94}
95
96//------------------------------------------------------------------------
97tresult PLUGIN_API EditController::getParameterInfo (int32 paramIndex, ParameterInfo& info)
98{
99 if (Parameter* parameter = parameters.getParameterByIndex (paramIndex))
100 {
101 info = parameter->getInfo ();
102 return kResultTrue;
103 }
104 return kResultFalse;
105}
106
107//------------------------------------------------------------------------
108tresult PLUGIN_API EditController::getParamStringByValue (ParamID tag, ParamValue valueNormalized,
109 String128 string)
110{
111 if (Parameter* parameter = getParameterObject (tag))
112 {
113 parameter->toString (valueNormalized, string);
114 return kResultTrue;
115 }
116 return kResultFalse;
117}
118
119//------------------------------------------------------------------------
120tresult PLUGIN_API EditController::getParamValueByString (ParamID tag, TChar* string,
121 ParamValue& valueNormalized)
122{
123 if (Parameter* parameter = getParameterObject (tag))
124 {
125 if (parameter->fromString (string, valueNormalized))
126 {
127 return kResultTrue;
128 }
129 }
130 return kResultFalse;
131}
132
133//------------------------------------------------------------------------
135 ParamValue valueNormalized)
136{
137 if (Parameter* parameter = getParameterObject (tag))
138 {
139 return parameter->toPlain (valueNormalized);
140 }
141 return valueNormalized;
142}
143
144//------------------------------------------------------------------------
146{
147 if (Parameter* parameter = getParameterObject (tag))
148 {
149 return parameter->toNormalized (plainValue);
150 }
151 return plainValue;
152}
153
154//------------------------------------------------------------------------
156{
157 if (Parameter* parameter = getParameterObject (tag))
158 {
159 return parameter->getNormalized ();
160 }
161 return 0.;
162}
163
164//------------------------------------------------------------------------
166{
167 if (Parameter* parameter = getParameterObject (tag))
168 {
169 parameter->setNormalized (value);
170 return kResultTrue;
171 }
172 return kResultFalse;
173}
174
175//------------------------------------------------------------------------
177{
178 if (componentHandler == newHandler)
179 {
180 return kResultTrue;
181 }
182
183 componentHandler = newHandler;
184 componentHandler2.reset ();
185
186 // try to get the extended version
187 if (newHandler)
188 {
189 newHandler->queryInterface (IComponentHandler2::iid, (void**)&componentHandler2);
190 }
191 return kResultTrue;
192}
193
194//------------------------------------------------------------------------
196{
197 if (componentHandler)
198 {
199 return componentHandler->beginEdit (tag);
200 }
201 return kResultFalse;
202}
203
204//------------------------------------------------------------------------
205tresult EditController::performEdit (ParamID tag, ParamValue valueNormalized)
206{
207 if (componentHandler)
208 {
209 return componentHandler->performEdit (tag, valueNormalized);
210 }
211 return kResultFalse;
212}
213
214//------------------------------------------------------------------------
216{
217 if (componentHandler)
218 {
219 return componentHandler->endEdit (tag);
220 }
221 return kResultFalse;
222}
223
224//------------------------------------------------------------------------
226{
227 if (componentHandler2)
228 {
229 return componentHandler2->startGroupEdit ();
230 }
231 return kNotImplemented;
232}
233
234//------------------------------------------------------------------------
236{
237 if (componentHandler2)
238 {
239 return componentHandler2->finishGroupEdit ();
240 }
241 return kNotImplemented;
242}
243
244//------------------------------------------------------------------------
246{
247 if (Parameter* parameter = getParameterObject (tag))
248 {
249 info = parameter->getInfo ();
250 return kResultTrue;
251 }
252 return kResultFalse;
253}
254
255//------------------------------------------------------------------------
256tresult EditController::setDirty (TBool state)
257{
258 if (componentHandler2)
259 {
260 return componentHandler2->setDirty (state);
261 }
262 return kNotImplemented;
263}
264
265//------------------------------------------------------------------------
266tresult EditController::requestOpenEditor (FIDString name)
267{
268 if (componentHandler2)
269 {
270 return componentHandler2->requestOpenEditor (name);
271 }
272 return kNotImplemented;
273}
274
275#ifndef NO_PLUGUI
276//------------------------------------------------------------------------
277// EditorView Implementation
278//------------------------------------------------------------------------
279EditorView::EditorView (EditController* _controller, ViewRect* size)
280: CPluginView (size), controller (_controller)
281{
282}
283
284//------------------------------------------------------------------------
285EditorView::~EditorView ()
286{
287 if (controller)
288 {
289 controller->editorDestroyed (this);
290 controller = nullptr;
291 }
292}
293
294//------------------------------------------------------------------------
296{
297 if (controller)
298 {
299 controller->editorAttached (this);
300 }
301}
302
303//------------------------------------------------------------------------
305{
306 if (controller)
307 {
308 controller->editorRemoved (this);
309 }
310}
311#endif // NO_PLUGUI
312
313//------------------------------------------------------------------------
314// EditControllerEx1 implementation
315//------------------------------------------------------------------------
316EditControllerEx1::EditControllerEx1 ()
317{
318 UpdateHandler::instance ();
319}
320
321//------------------------------------------------------------------------
322EditControllerEx1::~EditControllerEx1 ()
323{
324}
325
326//------------------------------------------------------------------------
327tresult PLUGIN_API EditControllerEx1::terminate ()
328{
329 units.clear ();
330
331 for (const auto& programList : programLists)
332 {
333 if (programList)
334 programList->removeDependent (this);
335 }
336 programLists.clear ();
337 programIndexMap.clear ();
338
340}
341
342//------------------------------------------------------------------------
344{
345 units.emplace_back (unit, false);
346 return true;
347}
348
349//------------------------------------------------------------------------
350tresult PLUGIN_API EditControllerEx1::getUnitInfo (int32 unitIndex, UnitInfo& info /*out*/)
351{
352 if (unitIndex < 0 || unitIndex >= static_cast<int32> (units.size ()))
353 return kResultFalse;
354 if (Unit* unit = units.at (unitIndex))
355 {
356 info = unit->getInfo ();
357 return kResultTrue;
358 }
359 return kResultFalse;
360}
361
362//------------------------------------------------------------------------
364{
365 tresult result = kResultFalse;
366 FUnknownPtr<IUnitHandler> unitHandler (componentHandler);
367 if (unitHandler)
368 result = unitHandler->notifyUnitSelection (selectedUnit);
369 return result;
370}
371
372//------------------------------------------------------------------------
374{
375 programIndexMap[list->getID ()] = programLists.size ();
376 programLists.emplace_back (list, false);
377 list->addDependent (this);
378 return true;
379}
380
381//------------------------------------------------------------------------
383{
384 auto it = programIndexMap.find (listId);
385 return it == programIndexMap.end () ? nullptr : programLists[it->second];
386}
387
388//------------------------------------------------------------------------
390{
391 tresult result = kResultFalse;
392 FUnknownPtr<IUnitHandler> unitHandler (componentHandler);
393 if (unitHandler)
394 result = unitHandler->notifyProgramListChange (listId, programIndex);
395 return result;
396}
397
398//------------------------------------------------------------------------
400{
401 return static_cast<int32> (programLists.size ());
402}
403
404//------------------------------------------------------------------------
405tresult PLUGIN_API EditControllerEx1::getProgramListInfo (int32 listIndex,
406 ProgramListInfo& info /*out*/)
407{
408 if (listIndex < 0 || listIndex >= static_cast<int32> (programLists.size ()))
409 return kResultFalse;
410 info = programLists[listIndex]->getInfo ();
411 return kResultTrue;
412}
413
414//------------------------------------------------------------------------
415tresult PLUGIN_API EditControllerEx1::getProgramName (ProgramListID listId, int32 programIndex,
416 String128 name /*out*/)
417{
418 ProgramIndexMap::const_iterator it = programIndexMap.find (listId);
419 if (it != programIndexMap.end ())
420 {
421 return programLists[it->second]->getProgramName (programIndex, name);
422 }
423 return kResultFalse;
424}
425
426//------------------------------------------------------------------------
427tresult EditControllerEx1::setProgramName (ProgramListID listId, int32 programIndex,
428 const String128 name /*in*/)
429{
430 ProgramIndexMap::const_iterator it = programIndexMap.find (listId);
431 if (it != programIndexMap.end ())
432 {
433 return programLists[it->second]->setProgramName (programIndex, name);
434 }
435 return kResultFalse;
436}
437
438//------------------------------------------------------------------------
439tresult PLUGIN_API EditControllerEx1::getProgramInfo (ProgramListID listId, int32 programIndex,
440 CString attributeId /*in*/,
441 String128 attributeValue /*out*/)
442{
443 ProgramIndexMap::const_iterator it = programIndexMap.find (listId);
444 if (it != programIndexMap.end ())
445 {
446 return programLists[it->second]->getProgramInfo (programIndex, attributeId, attributeValue);
447 }
448 return kResultFalse;
449}
450
451//------------------------------------------------------------------------
453 int32 programIndex)
454{
455 ProgramIndexMap::const_iterator it = programIndexMap.find (listId);
456 if (it != programIndexMap.end ())
457 {
458 return programLists[it->second]->hasPitchNames (programIndex);
459 }
460 return kResultFalse;
461}
462
463//------------------------------------------------------------------------
464tresult PLUGIN_API EditControllerEx1::getProgramPitchName (ProgramListID listId, int32 programIndex,
465 int16 midiPitch, String128 name /*out*/)
466{
467 ProgramIndexMap::const_iterator it = programIndexMap.find (listId);
468 if (it != programIndexMap.end ())
469 {
470 return programLists[it->second]->getPitchName (programIndex, midiPitch, name);
471 }
472 return kResultFalse;
473}
474
475//------------------------------------------------------------------------
476void PLUGIN_API EditControllerEx1::update (FUnknown* changedUnknown, int32 /*message*/)
477{
478 auto* programList = FCast<ProgramList> (changedUnknown);
479 if (programList)
480 {
481 FUnknownPtr<IUnitHandler> unitHandler (componentHandler);
482 if (unitHandler)
483 unitHandler->notifyProgramListChange (programList->getID (), kAllProgramInvalid);
484 }
485}
486
487//------------------------------------------------------------------------
488// Unit implementation
489//------------------------------------------------------------------------
490Unit::Unit ()
491{
492 memset (&info, 0, sizeof (UnitInfo));
493}
494
495//------------------------------------------------------------------------
496Unit::Unit (const String128 name, UnitID unitId, UnitID parentUnitId, ProgramListID programListId)
497{
498 setName (name);
499 info.id = unitId;
500 info.parentUnitId = parentUnitId;
501 info.programListId = programListId;
502}
503
504//------------------------------------------------------------------------
505Unit::Unit (const UnitInfo& info) : info (info)
506{
507}
508
509//------------------------------------------------------------------------
510void Unit::setName (const String128 newName)
511{
512 UString128 (newName).copyTo (info.name, 128);
513}
514
515//------------------------------------------------------------------------
516// ProgramList implementation
517//------------------------------------------------------------------------
518ProgramList::ProgramList (const String128 name, ProgramListID listId, UnitID unitId)
519: unitId (unitId), parameter (nullptr)
520{
521 UString128 (name).copyTo (info.name, 128);
522 info.id = listId;
523 info.programCount = 0;
524}
525
526//------------------------------------------------------------------------
527ProgramList::ProgramList (const ProgramList& programList)
528: info (programList.info)
529, unitId (programList.unitId)
530, programNames (programList.programNames)
531, parameter (nullptr)
532{
533}
534
535//------------------------------------------------------------------------
537{
538 ++info.programCount;
539 programNames.emplace_back (name);
540 programInfos.emplace_back ();
541 return static_cast<int32> (programNames.size ()) - 1;
542}
543
544//------------------------------------------------------------------------
545bool ProgramList::setProgramInfo (int32 programIndex, CString attributeId, const String128 value)
546{
547 if (programIndex >= 0 && programIndex < static_cast<int32> (programNames.size ()))
548 {
549 programInfos.at (programIndex).insert (std::make_pair (attributeId, value));
550 return true;
551 }
552 return false;
553}
554
555//------------------------------------------------------------------------
556tresult ProgramList::getProgramInfo (int32 programIndex, CString attributeId,
557 String128 value /*out*/)
558{
559 if (programIndex >= 0 && programIndex < static_cast<int32> (programNames.size ()))
560 {
561 StringMap::const_iterator it = programInfos[programIndex].find (attributeId);
562 if (it != programInfos[programIndex].end ())
563 {
564 if (!it->second.empty ())
565 {
566 memset (value, 0, sizeof (String128));
567 it->second.copy (value, 128);
568 return kResultTrue;
569 }
570 }
571 }
572 return kResultFalse;
573}
574
575//------------------------------------------------------------------------
576tresult ProgramList::getProgramName (int32 programIndex, String128 name /*out*/)
577{
578 if (programIndex >= 0 && programIndex < static_cast<int32> (programNames.size ()))
579 {
580 memset (name, 0, sizeof (String128));
581 programNames.at (programIndex).copy (name, 128);
582 return kResultTrue;
583 }
584 return kResultFalse;
585}
586
587//------------------------------------------------------------------------
588tresult ProgramList::setProgramName (int32 programIndex, const String128 name /*in*/)
589{
590 if (programIndex >= 0 && programIndex < static_cast<int32> (programNames.size ()))
591 {
592 programNames.at (programIndex) = name;
593 if (parameter)
594 {
595 static_cast<StringListParameter*> (parameter)->replaceString (programIndex, name);
596 }
597 return kResultTrue;
598 }
599 return kResultFalse;
600}
601
602//------------------------------------------------------------------------
604{
605 if (parameter == nullptr)
606 {
607 auto* listParameter = new StringListParameter (
608 info.name, info.id, nullptr,
610 unitId);
611 for (const auto& programName : programNames)
612 {
613 listParameter->appendString (programName.data ());
614 }
615 parameter = listParameter;
616 }
617 return parameter;
618}
619
620//------------------------------------------------------------------------
621// ProgramListWithPitchNames implementation
622//-----------------------------------------------------------------------------
623ProgramListWithPitchNames::ProgramListWithPitchNames (const String128 name, ProgramListID listId,
624 UnitID unitId)
625: ProgramList (name, listId, unitId)
626{
627}
628
629//-----------------------------------------------------------------------------
631{
632 int32 index = ProgramList::addProgram (name);
633 if (index >= 0)
634 pitchNames.emplace_back ();
635 return index;
636}
637
638//-----------------------------------------------------------------------------
639bool ProgramListWithPitchNames::setPitchName (int32 programIndex, int16 pitch,
640 const String128 pitchName)
641{
642 if (programIndex < 0 || programIndex >= getCount ())
643 return false;
644
645 bool nameChanged = true;
647 pitchNames[programIndex].insert (std::make_pair (pitch, pitchName));
648 if (!res.second)
649 {
650 if (res.first->second == pitchName)
651 nameChanged = false;
652 else
653 res.first->second = pitchName;
654 }
655
656 if (nameChanged)
657 changed ();
658 return true;
659}
660
661//-----------------------------------------------------------------------------
662bool ProgramListWithPitchNames::removePitchName (int32 programIndex, int16 pitch)
663{
664 bool result = false;
665 if (programIndex >= 0 && programIndex < getCount ())
666 {
667 result = pitchNames.at (programIndex).erase (pitch) != 0;
668 }
669 if (result)
670 changed ();
671 return result;
672}
673
674//-----------------------------------------------------------------------------
675tresult ProgramListWithPitchNames::hasPitchNames (int32 programIndex)
676{
677 if (programIndex >= 0 && programIndex < getCount ())
678 return (pitchNames.at (programIndex).empty () == true) ? kResultFalse : kResultTrue;
679 return kResultFalse;
680}
681
682//-----------------------------------------------------------------------------
683tresult ProgramListWithPitchNames::getPitchName (int32 programIndex, int16 midiPitch,
684 String128 name /*out*/)
685{
686 if (programIndex >= 0 && programIndex < getCount ())
687 {
688 PitchNameMap::const_iterator it = pitchNames[programIndex].find (midiPitch);
689 if (it != pitchNames[programIndex].end ())
690 {
691 memset (name, 0, sizeof (String128));
692 it->second.copy (name, 128);
693 return kResultTrue;
694 }
695 }
696 return kResultFalse;
697}
698
699//------------------------------------------------------------------------
700} // namespace Vst
701} // namespace Steinberg
T at(T... args)
Plug-In view default implementation.
Definition pluginview.h:50
virtual void changed(int32 msg=kChanged)
Inform all dependents, that the object has changed.
Definition fobject.cpp:193
FUnknownPtr - automatic interface conversion and smart pointer in one.
Definition funknown.h:417
The basic interface of all interfaces.
Definition funknown.h:375
virtual tresult PLUGIN_API queryInterface(const TUID _iid, void **obj)=0
Query for a pointer to the specified interface.
Base class for streams.
Definition ibstream.h:30
UTF-16 string with fixed buffer size.
Definition ustring.h:82
const UString & copyTo(char16 *dst, int32 dstSize) const
Copy to UTF-16 buffer (dstSize is in code unit (count of char16)).
Definition ustring.cpp:125
tresult PLUGIN_API initialize(FUnknown *context) SMTG_OVERRIDE
The host passes a number of interfaces as context to initialize the plug-in class.
tresult PLUGIN_API terminate() SMTG_OVERRIDE
This function is called before the plug-in is unloaded and can be used for cleanups.
tresult PLUGIN_API getProgramInfo(ProgramListID listId, int32 programIndex, CString attributeId, String128 attributeValue) SMTG_OVERRIDE
Gets for a given program list ID, program index and attributeId the associated attribute value.
tresult PLUGIN_API getProgramListInfo(int32 listIndex, ProgramListInfo &info) SMTG_OVERRIDE
Gets for a given index the Program List Info.
tresult PLUGIN_API getUnitInfo(int32 unitIndex, UnitInfo &info) SMTG_OVERRIDE
Gets UnitInfo for a given index in the flat list of unit.
tresult PLUGIN_API getProgramName(ProgramListID listId, int32 programIndex, String128 name) SMTG_OVERRIDE
Gets for a given program list ID and program index its program name.
ProgramList * getProgramList(ProgramListID listId) const
Returns the ProgramList associated to a given listId.
virtual tresult notifyUnitSelection()
Notifies the host about the selected Unit.
tresult PLUGIN_API getProgramPitchName(ProgramListID listId, int32 programIndex, int16 midiPitch, String128 name) SMTG_OVERRIDE
Gets the PitchName for a given program list ID, program index and pitch.
tresult notifyProgramListChange(ProgramListID listId, int32 programIndex=kAllProgramInvalid)
Notifies the host about program list changes.
int32 PLUGIN_API getProgramListCount() SMTG_OVERRIDE
Component intern program structure.
tresult PLUGIN_API terminate() SMTG_OVERRIDE
This function is called before the plug-in is unloaded and can be used for cleanups.
bool addProgramList(ProgramList *list)
Adds a given program list.
tresult PLUGIN_API hasProgramPitchNames(ProgramListID listId, int32 programIndex) SMTG_OVERRIDE
Returns kResultTrue if the given program index of a given program list ID supports PitchNames.
void PLUGIN_API update(FUnknown *changedUnknown, int32 message) SMTG_OVERRIDE
Inform the dependent, that the passed FUnknown has changed.
bool addUnit(Unit *unit)
Adds a given unit.
Default implementation for a VST 3 edit controller.
virtual Parameter * getParameterObject(ParamID tag)
Gets for a given tag the parameter object.
virtual tresult getParameterInfoByTag(ParamID tag, ParameterInfo &info)
Gets for a given tag the parameter information.
int32 PLUGIN_API getParameterCount() SMTG_OVERRIDE
Returns the number of parameters exported.
tresult PLUGIN_API setComponentHandler(IComponentHandler *handler) SMTG_OVERRIDE
Gets from host a handler which allows the Plugin-in to communicate with the host.
virtual tresult performEdit(ParamID tag, ParamValue valueNormalized)
will inform the host about the value change
virtual tresult finishGroupEdit()
calls IComponentHandler2::finishGroupEdit() if host supports it
tresult PLUGIN_API initialize(FUnknown *context) SMTG_OVERRIDE
The host passes a number of interfaces as context to initialize the plug-in class.
virtual tresult startGroupEdit()
calls IComponentHandler2::startGroupEdit() if host supports it
ParamValue PLUGIN_API plainParamToNormalized(ParamID tag, ParamValue plainValue) SMTG_OVERRIDE
Returns for a given paramID and a plain value its normalized value.
tresult PLUGIN_API setParamNormalized(ParamID tag, ParamValue value) SMTG_OVERRIDE
Sets the normalized value to the parameter associated to the paramID.
ParamValue PLUGIN_API normalizedParamToPlain(ParamID tag, ParamValue valueNormalized) SMTG_OVERRIDE
Returns for a given paramID and a normalized value its plain representation (for example -6 for -6dB ...
virtual tresult requestOpenEditor(FIDString name=ViewType::kEditor)
Calls IComponentHandler2::requestOpenEditor (name) if host supports it.
tresult PLUGIN_API getState(IBStream *state) SMTG_OVERRIDE
Gets the controller state.
virtual tresult setDirty(TBool state)
Calls IComponentHandler2::setDirty (state) if host supports it.
tresult PLUGIN_API getParamValueByString(ParamID tag, TChar *string, ParamValue &valueNormalized) SMTG_OVERRIDE
Gets for a given paramID and string its normalized value.
tresult PLUGIN_API getParameterInfo(int32 paramIndex, ParameterInfo &info) SMTG_OVERRIDE
Gets for a given index the parameter information.
virtual tresult beginEdit(ParamID tag)
to be called before a serie of performEdit
tresult PLUGIN_API getParamStringByValue(ParamID tag, ParamValue valueNormalized, String128 string) SMTG_OVERRIDE
Gets for a given paramID and normalized value its associated string representation.
ParamValue PLUGIN_API getParamNormalized(ParamID tag) SMTG_OVERRIDE
Returns the normalized value of the parameter associated to the paramID.
tresult PLUGIN_API terminate() SMTG_OVERRIDE
This function is called before the plug-in is unloaded and can be used for cleanups.
virtual tresult endEdit(ParamID tag)
to be called after a serie of performEdit
tresult PLUGIN_API setComponentState(IBStream *state) SMTG_OVERRIDE
Receives the component state.
tresult PLUGIN_API setState(IBStream *state) SMTG_OVERRIDE
Sets the controller state.
void attachedToParent() SMTG_OVERRIDE
Calls when this view will be attached to its parent view.
void removedFromParent() SMTG_OVERRIDE
Calls when this view will be removed from its parent view.
Host callback interface for an edit controller: Vst::IComponentHandler.
int32 getParameterCount() const
Returns the count of parameters.
void removeAll()
Removes all parameters.
Parameter * getParameterByIndex(int32 index) const
Gets parameter by index.
Description of a Parameter.
int32 addProgram(const String128 name) SMTG_OVERRIDE
Adds a program to the end of the list.
bool setPitchName(int32 programIndex, int16 pitch, const String128 pitchName)
Sets a name for the given program index and a given pitch.
bool removePitchName(int32 programIndex, int16 pitch)
Removes the PitchName entry for the given program index and a given pitch.
virtual int32 addProgram(const String128 name)
Adds a program to the end of the list.
virtual bool setProgramInfo(int32 programIndex, CString attributeId, const String128 value)
Sets a program attribute value.
virtual Parameter * getParameter()
Creates and returns the program parameter.
Description of a StringListParameter.
void setName(const String128 newName)
Sets a new Unit Name.
T clear(T... args)
T emplace_back(T... args)
T end(T... args)
T find(T... args)
T insert(T... args)
T make_pair(T... args)
memset
int32 KnobMode
Knob Mode Type.
ProgramListID programListId
id of program list used in unit (kNoProgramListId = no programs used in this unit)
Definition ivstunits.h:49
String128 name
name of program list
Definition ivstunits.h:59
uint32 ParamID
parameter identifier
Definition vsttypes.h:81
TChar String128[128]
128 character UTF-16 string
Definition vsttypes.h:69
char16 TChar
UTF-16 character.
Definition vsttypes.h:68
double ParamValue
parameter value type
Definition vsttypes.h:80
UnitID parentUnitId
identifier of parent unit (kNoParentUnitId: does not apply, this unit is the root)
Definition ivstunits.h:47
int32 programCount
number of programs in this list
Definition ivstunits.h:60
String128 name
name, optional for the root component, required otherwise
Definition ivstunits.h:48
UnitID id
unit identifier
Definition ivstunits.h:46
int32 ProgramListID
program list identifier
Definition vsttypes.h:82
int32 UnitID
unit identifier
Definition vsttypes.h:79
const char8 * CString
C-String.
Definition vsttypes.h:70
ProgramListID id
program list identifier
Definition ivstunits.h:58
@ kCircularMode
Circular with jump to clicked position.
Basic Program List Description.
Definition ivstunits.h:57
Basic Unit Description.
Definition ivstunits.h:45
T size(T... args)
Graphical rectangle structure.
Definition iplugview.h:35
Controller Parameter Info.
@ kIsList
parameter should be displayed as list in generic editor or automation editing [SDK 3....
@ kCanAutomate
parameter can be automated
@ kIsProgramChange
parameter is a program change (unitId gives info about associated unit