Jamba C++ API
4.1.0
|
T
for all params (RTRawVstParam
, RTParam
, GUIRawVstParam
, GUIVstParam
, GUIJmbParam
, GUIOptionalParam
).operator *
) to all params as a shortcut to invoke .value()
(which is the preferred way to fix the deprecated warnings)T
) in many instancestoUTF8String()
for Jmb parameter when no serializer is provided by checking the availability of ostream<<
for T
_
for the switch container view (for example to use as an overlay that is shown/hidden)This release contains a lot of big changes. Although I tried my best to be backward compatible there may be a few changes that might be breaking.
IGUIParameter
and typed hierarchy (ITGUIParameter<T>
) as the base of all GUI parametersGUIOptionalParam
to handle Vst, Jmb or no parameter in a consistent fashionIGUIParameter::asDiscreteParameter(int32 iStepCount)
) to convert (if possible) any parameter into a discrete parameter (which is a parameter backed by an int32
with a given number of steps)MomentaryButtonView
and ToggleButtonView
to use discrete parameter concept (thus allowing other types than bool
) and allowing to override the value of the steps representing on and off.SwitchViewContainer
to use discrete parameter concept, thus allowing to use any Vst or Jmb parameter that is (or can be interpreted as) a discrete parameter.ParamAware
(formerly GUIParamCxAware
) and StateAware
(formerly PluginAccessor
) (added deprecation warnings for old names) and related.GUIState
(similar to Vst parameters)IDiscreteConverter<T>
concept for Jmb parameters to be able to convert a Jmb parameter to a discrete parameterParamDisplayView
to display the value of any parameter (Vst or Jmb)DebugParamDisplayView
to display and highlight the value of a parameter (very useful during development)ListAttribute
to handle attributes backed by a list of values (for example enumeration) // Example (from StepButtonView.h) registerListAttribute<EArrowDirection>("arrow-direction", &StepButtonView::getArrowDirection, &StepButtonView::setArrowDirection, { {"auto", EArrowDirection::kAuto}, {"up", EArrowDirection::kUp}, {"right", EArrowDirection::kRight}, {"down", EArrowDirection::kDown}, {"left", EArrowDirection::kLeft} }
DiscreteTypeParamConverter
: // Example: with DiscreteTypeParamConverter, no need to specify size in advance. Also note the // use of the initializer list to initialize it. fEnumClassVst = vst<DiscreteTypeParamConverter<EEnumClass>>(EJambaTestPluginParamID::kEnumClassVst, STR16("EnumClassVst"), { {EEnumClass::kEnumClass0, STR16("kEC0 (vst)")}, {EEnumClass::kEnumClass1, STR16("kEC1 (vst)")}, {EEnumClass::kEnumClass2, STR16("kEC2 (vst)")}, {EEnumClass::kEnumClass3, STR16("kEC3 (vst)")}, }) .add();
jamba-test-plugin
to the Jamba project as a unit test/development plugin for Jamba (demonstrates ALL available views)test.sh
to conveniently run the jamba tests (which are declared by jamba-test-plugin
) from the command linetest_jamba
target to run the jamba tests from the IDEICustomViewLifecycle
which is now used instead of GUIParamCxAware
(in CustomViewFactory
)ParamAware::unregisterAll()
followed by ParamAware::registerParameters()
registerParameters
method that you implement in your view is much simpler because it does not have to handle previously registered parameters (which was not trivial to keep an accurate track of)StepButtonView
and DiscreteButtonView
now use discrete values only (no longer double
). Check the documentation on how to use it instead (ex: an increment of 0.1
can be converted to an increment of 1
with a step count of 10
).TagID
to be an unsigned int (ParamID
aka uint32
)DiscreteValueParamConverter
to be an int32
initialize
API to match superclassbuild_vst3
, test_vst3
, install_vst3
, install_vst2
, build_au
and install_au
install_vst2
or install_vst3
)jamba.sh
and jamba.bat
to use the new cmake targets (making the scripts more generic)build_vst3
by setting an optional BUILD_VST3_TARGET
variabletest_vst3
by setting an optional TEST_VST3_TARGET
variablebuild_au
by setting an optional BUILD_AU_TARGET
variablejamba.sh
script to handle filename with white spaces and install audio unit before validation (validation tool unfortunately works from an installed component, not a file...)jamba.sh
script (jamba.sh validate-au
) which runs the auvaltool
utility on the audio unit pluginViews::SwitchContainerView
)Views::TextButtonView
)Views::MomentaryButtonView
)step
value). This button can be used for radio groups, tabs, etc... (check Views::DiscreteButtonView
)Views::createCustomView
(defined in Views/CustomViewCreator.h
). Check commit. The function takes an additional 2 parameters which can be safely ignored if you don't need them.Views::registerGlobalKeyboardHook
)AudioBuffers
and Channel
(copyFrom
and forEachSample
). Defined const
and non const
versions.TextViewButton
on which you can register a onClickListener
or implement onClick
. Also handles disabled state.ScrollbarView
which implements a scrollbar tied to 2 parameters (offset and zoom)CustomController
to implement a custom controller tied into Jamba (access to Vst/Jmb parameters and state)GUIController::switchToView
)GUIJmbParameter::updateIf
to update the value in place when necessaryGUIParamCxAware
registerCallback<bool>(fParams->fMyParam, [this] (GUIVstParam<bool> &iParam) { flushCache(); });
verifyView
method): auto button = dynamic_cast<Views::TextButtonView *>(iView); if(button) { auto callback = [] (Views::TextButtonView *iButton, GUIJmbParam<SampleData> &iParam) { iButton->setMouseEnabled(iParam->hasUndoHistory()); }; fState->registerConnectionFor(button) ->registerCallback<SampleData>(fState->fSampleData, std::move(callback), true); }
Parameters::vst<>()
(resp. Parameters::jmb<>()
) that get passed through the converter (resp. serializer) allowing syntax like fPlayModeHold = vst<BooleanParamConverter>(1201, // param ID STR16("Play Mode"), // param title STR16("Trigger"), STR16("Hold")) // BooleanParamConverter args
EnumParamConverter
for Vst parameters backed by an enumRange
conceptCustomViewCreator
code to simplify writing individual attributes. Introduced MarginAttribute
, RangeAttribute
, and GradientAttribute
Lerp
class to deal with type parameters differently (TFloat
for math precision, X
for type of x, Y
for type of y). Introduced SPLerp
(single precision) and DPLerp
(double precision) as well as several convenient methods. Example: // this will interpolate (SP=single precision) // X -> the time (long) from the range [0, fFadeDuration] // Y -> to the alpha (uint8_t) range [255, 0] (opaque -> transparent) // Note that although X and Y types are integer flavors, the interpolation will use floats // and the value returned will be cast to uint8_t fColor.alpha = Utils::mapValueSPXY<long, uint8_t>(iTime, 0, fFadeDuration, 255, 0);
GUIParamCxAware
(which is the class used for registering parameters) has been simplified with registerParam
methods (when the type is known).PluginAccessor
into its own header fileCustomViewInitializer
AudioBuffers
now properly handles null buffersjamba.sh
(resp jamba.bat
) scriptXcode
as the cmake generator on macOSDebug::ParamTable
and Debug::ParamLine
to display parameters => example