Usine SDK
HH6
Create user modules for Usine Software
|
Classes | |
class | UserModuleBase |
Base class for every User's module. A User module is a class inherited from UserModuleBase, providing complete communication with Usine and all the necessary stuff to customize the module behaviour. In addition, this base class provides a ton of utility functions to help you integrate your data in the module. More... | |
Functions | |
UserModuleBase::UserModuleBase () | |
Implementation of the abstract class provided to derive user modules from. More... | |
TColorAhsl | sdkColorArgbToColorAhsl (TColorArgb c1) |
Various helpers around colors. More... | |
TColorArgb | sdkColorAhslToColorArgb (TColorAhsl c1) |
Calculate RGB from HSL, reverse of RGB2HSL() More... | |
TUsineColor | sdkColorArgbToAlphaColor (TColorArgb c1) |
RGB color to Usine color format. | |
TColorArgb | sdkAlphaColorToColorArgb (TUsineColor c1) |
Usine color format to RGB color. | |
TUsineColor | sdkColorAhslToAlphaColor (TColorAhsl c1) |
HSL color to Usine color format. | |
TColorAhsl | sdkAlphaColorToColorAhsl (TUsineColor c1) |
Usine color format to HSL color. | |
TColorArgb | sdkColorAgrb (float r, float g, float b, float a=1.0) |
RGB color constructor. | |
TColorAhsl | sdkColorAhsl (float h, float s, float l, float a=1.0) |
HSL color constructor. More... | |
TUsineColor | sdkAlphaColor (float r, float g, float b, float a=1.0) |
Usine color constructor. More... | |
TUsineColor | sdkAlphaColor (int r, int g, int b, int a=255) |
Usine color constructor. More... | |
TPointF | sdkPointF (float x, float y) |
Construct a TPointF. More... | |
bool | sdkPointInRect (int X, int Y, TPointI LeftTop, TPointI RightBottom) |
Test if coordinate is in a rect bound. More... | |
bool | sdkPointInRect (TPointI Coords, TPointI LeftTop, TPointI RightBottom) |
Test if coordinate is in a rect bound. More... | |
TPointF | sdkBezier4 (TPointF p1, TPointF p2, TPointF p3, TPointF p4, float mu) |
Four control point Bezier interpolation. More... | |
float | sdkBezier4 (float p1, float p2, float p3, float p4, float mu) |
Four control float Bezier interpolation. More... | |
Mandatory Functions | |
void | CreateModule (void *&pModule, AnsiCharPtr optionalString, LongBool Flag, TMasterInfo *pMasterInfo, AnsiCharPtr optionalContent) |
Called by Usine to instantiate the User Module When opening the Browser section where is stored the module. When adding the module in a patch. When loading a saved workspace or patch. More... | |
void | DestroyModule (void *pModule) |
Called by Usine to destroy the User Module When clearing a workspace or patch. Before recreate module. When closing Usine. More... | |
void | GetBrowserInfo (TModuleInfo *pModuleInfo) |
Called by usine to get module informations for the browser When the browser open the folder where the module is stored. | |
Module Constants | |
static const AnsiCharPtr | UserModuleBase::MODULE_NAME |
static const AnsiCharPtr | UserModuleBase::MODULE_DESC |
static const AnsiCharPtr | UserModuleBase::MODULE_VERSION |
Mandatory Callbacks | |
Usine need them to collect mandatory infos and update the module. | |
virtual void | UserModuleBase::onGetModuleInfo (TMasterInfo *pMasterInfo, TModuleInfo *pModuleInfo)=0 |
Usine call it to obtain the module characteristics. You have to fill the TModuleInfo structure with infos describing the module. TMasterInfo can be used to obtain some useful infos but always test if the handle is valid as it can be nullptr. More... | |
virtual void | UserModuleBase::onGetParamInfo (int ParamIndex, TParamInfo *pParamInfo)=0 |
Usine call it for each parameters of the module to obtain it's characteristics. More... | |
virtual void | UserModuleBase::onSetEventAddress (int ParamIndex, UsineEventPtr pEvent) |
Usine call it for each parameters of the module to obtain the event handle of the parameter. Deprecated in HH3, use TModuleInfo::EventPtr. More... | |
virtual void | UserModuleBase::onCallBack (TUsineMessage *Message) |
Usine call it to inform the module something happened. More... | |
Query System Callbacks | |
virtual int | UserModuleBase::onGetNumberOfParams (int queryResult1, int queryResult2) |
Usine call it to obtain the number of parameters of the module depending of the query result. More... | |
virtual void | UserModuleBase::onAfterQuery (TMasterInfo *pMasterInfo, TModuleInfo *pModuleInfo, int queryResult1, int queryResult2) |
Usine call it after the query pop-up is closed. It let you do some things depending of the query choice. More... | |
Real-time Audio and Data Callback | |
Usine call it if TModuleInfo::DontProcess is not set to TRUE in onGetModuleInfo. | |
virtual void | UserModuleBase::onProcess () |
Be careful here because it's called from the audio thread at each audio tick of the audio engine. Keep it optimized and try to avoid any memory allocation. More... | |
Real-time Video processing | |
Called by the the video thread to process video frames only for TModuleInfo::ModuleType == mtVideo Don't process video outside this procedure.
| |
virtual void | UserModuleBase::onProcessVideo () |
Load and Save Chunk System | |
Implement them if the module need to save some additional info. A chunk is a memory block containing some binary data. Usine store those chunk in patch and workspace files and use them to store/restore presets. | |
virtual int | UserModuleBase::onGetChunkLen (LongBool Preset) |
To get the chunk length estimation. More... | |
virtual void | UserModuleBase::onGetChunk (void *chunk, LongBool Preset) |
Provide a chunk handle to fill with additional info's. More... | |
virtual void | UserModuleBase::onSetChunk (const void *chunk, int sizeInBytes, LongBool Preset) |
Provide a chunk handle filled by Usine to restore them into the module. More... | |
virtual void | UserModuleBase::onAfterLoading () |
Called after the module is loaded in Usine. | |
Settings Callbacks | |
Implement them if the module need to add some entries in the Settings Panel. | |
virtual void | UserModuleBase::onCreateSettings () |
To add some entries in the Settings panel. Typical use is some calls to Settings options functions. | |
virtual void | UserModuleBase::onSettingsHasChanged () |
Called when something change in one of entries. | |
Graphics Canvas Callbacks | |
virtual void | UserModuleBase::onResize (float contentWidth, float contentHeight) |
Called when Usine resize the Graphic canvas. More... | |
virtual void | UserModuleBase::onPaint () |
Called before Usine draw the module canvas Use it to draw the module canvas. More... | |
Contextual Menu Callback | |
Implement it if the module need to add some entries in the Contextual Menu. | |
virtual void | UserModuleBase::onCreateCommands () |
To add some entries in the Contextual Menu. Typical use is some calls to Contextual Menus commands. | |
Automation Recording Callback | |
Usine call it if TModuleInfo::CanRecord is set to TRUE in onGetModuleInfo. | |
virtual void | UserModuleBase::onSetRecordedValue (TPrecision X, TPrecision Y, TPrecision Z) |
Usine call it when replaying recorded curves. The module have to affect those values to the concerned variables. More... | |
Randomize Callback | |
virtual void | UserModuleBase::onRandomize () |
Activate it with pModuleInfo->CanBeRandomized = TRUE in onGetModuleInfo. | |
Reset Callback | |
virtual void | UserModuleBase::onReset () |
Activate it with pModuleInfo->CanBeReset = TRUE in onGetModuleInfo. | |
SetQuickColor Callback | |||
Implement it to respond to a Set quick colorfrom Usine.
| |||
virtual void | UserModuleBase::onSetQuickColor (TUsineColor color) | ||
onMouseMove | |
virtual void | UserModuleBase::onMouseMove (TShiftState Shift, float X, float Y) |
virtual void | UserModuleBase::onMouseDown (TMouseButton MouseButton, TShiftState Shift, float X, float Y) |
Called by Usine when the mouse is clicked down on the control. | |
virtual void | UserModuleBase::onMouseUp (TMouseButton MouseButton, TShiftState Shift, float X, float Y) |
Called by Usine when the mouse is clicked up on the control. | |
virtual void | UserModuleBase::onMouseWheel (TShiftState Shift, int WheelDelta) |
Called by Usine when the mouse wheel is moved on the control. | |
virtual void | UserModuleBase::onMouseMoveMulti (TShiftState Shift, UsineEventPtr X, UsineEventPtr Y, UsineEventPtr Pressed) |
Called by Usine when control receives a touch-screen move event. | |
virtual void | UserModuleBase::onMouseMoveMulti (TShiftState Shift, UsineEventClass *X, UsineEventClass *Y, UsineEventClass *Pressed) |
Called by Usine when control receives a touch-screen move event. | |
virtual void | UserModuleBase::onMouseDownMulti (TMouseButton MouseButton, TShiftState Shift, UsineEventPtr X, UsineEventPtr Y, UsineEventPtr Pressed) |
Called by Usine when control receives a touch-screen down event. | |
virtual void | UserModuleBase::onMouseDownMulti (TMouseButton MousButton, TShiftState Shift, UsineEventClass *X, UsineEventClass *Y, UsineEventClass *Pressed) |
Called by Usine when control receives a touch-screen down event. | |
virtual void | UserModuleBase::onMouseUpMulti (TMouseButton MouseButton, TShiftState Shift, UsineEventPtr X, UsineEventPtr Y, UsineEventPtr Pressed) |
Called by Usine when control receives a touch-screen up event. | |
virtual void | UserModuleBase::onMouseUpMulti (TMouseButton MouseButton, TShiftState Shift, UsineEventClass *X, UsineEventClass *Y, UsineEventClass *Pressed) |
Optional Callbacks | |
virtual void | UserModuleBase::onInitModule (TMasterInfo *pMasterInfo, TModuleInfo *pModuleInfo) |
Usine call it after onGetModuleInfo. It let you initialising some stuff. More... | |
virtual void | UserModuleBase::onBlocSizeChange (int BlocSize) |
Usine call it when the Usine BlockSize is changed. More... | |
virtual void | UserModuleBase::onSampleRateChange (double SampleRate) |
Usine call it when the SampleRate is changed. More... | |
MIDI Out Callbacks | |
Usine call them to send MIDI messages to a Midi Out Device. Not for public use. | |
virtual void | UserModuleBase::onMidiSendOut (int DeviceID, TUsineMidiCode Code) |
Send one midi code. More... | |
virtual void | UserModuleBase::onMidiSendOutArray (int DeviceID, TUsineMidiCode **arrayCode, int arraySize) |
Send a block of midi code. More... | |
virtual void | UserModuleBase::onMidiSysexSendOut (int DeviceID, char **Sysex, int sysexSize) |
Send a Sysex message. More... | |
ILDA Out Callback | |
Usine call it to send ILDA frame to a ILDA Out Device. Not for public use. | |
virtual void | UserModuleBase::onLaserSendOut (int DeviceID, TUsineILDAPoint **arrayPoint, int arraySize, int speedPPS) |
Send an Laser frame. More... | |
DMX Out Callback | |
Usine call it to send DMX packet to a Dmx Out Device. Not for public use. | |
virtual void | UserModuleBase::onDMXSendOut (int deviceId, char *ByteArray, int len, int universeNum=1) |
Send a Dmx message. More... | |
Graphic Canvas | |
Use them in the onPaint callback to draw into a module canvas. | |
void | UserModuleBase::sdkDrawPoint (TPointF point, TUsineColor color, float pointSize, LongBool rounded) |
Draw a point. | |
void | UserModuleBase::sdkDrawLine (TPointF p1, TPointF p2, TUsineColor color, float strokeThickness) |
Draw a line. | |
void | UserModuleBase::sdkDrawPolyLine (TPointFPtr points, int numOfPoints, TUsineColor color, float strokeThickness) |
Draw a polygon, points are stored in an array. | |
void | UserModuleBase::sdkFillPolyLine (TPointFPtr points, int numOfPoints, TUsineColor color) |
Fille a polygon, points are stored in an array. | |
void | UserModuleBase::sdkFillRect (TRectF rect, TUsineColor color, float roundRadius, TUsineColor borderColor, float borderWith) |
Fill a round rectangle. | |
void | UserModuleBase::sdkFillText (TRectF rect, AnsiCharPtr text, TUsineColor textColor, float fontSize, LongBool isBold=FALSE, LongBool isWordWrap=FALSE, TTextAlign alignHorizontal=taCenter, TTextAlign alignVertical=taCenter, LongBool isVertical=FALSE) |
Fill a text. | |
void | UserModuleBase::sdkBitBlit (TUsinePixelPtr pArray, int W, int H, TRectF destRect) |
Draw an array of pixels. More... | |
Graphic Path | |
Example of constructing a path // begin draw path sequence sdkDrawPathStart (); // move to where we want to start the path sdkDrawPathMoveTo (sdkPointF(0.25, 0.25)); // add a line sdkDrawPathLineTo (sdkPointF(0.75, 0.25)); // add a curve // close the path sdkDrawPathClose (); // end the command sequence and ask to draw the path sdkDrawPathDraw (colorTrajectory, thicknessTrajectory); | |
void | UserModuleBase::sdkDrawPathStart () |
Tell Usine to start a path sequence. A path must begin with this function, followed by a sequence of command describing the path structure and finally drawn or filled. | |
void | UserModuleBase::sdkDrawPathMoveTo (TPointF point) |
Move the current position inside the path. More... | |
void | UserModuleBase::sdkDrawPathLineTo (TPointF point) |
Add a line to the path, from the current position to the point provided. More... | |
void | UserModuleBase::sdkDrawPathQuadCurveTo (TPointF control, TPointF point) |
Add a quadratic curve to the path, from the current position to the point provided. The curve don't pass by the control point. More... | |
void | UserModuleBase::sdkDrawPathClose () |
Add a line to close the path, from the current position to the first point of the path. More... | |
void | UserModuleBase::sdkDrawPathDraw (TUsineColor color, float strokeThickness) |
Draw the current path with the color and thickness provided. More... | |
void | UserModuleBase::sdkDrawPathFill (TUsineColor color) |
Fill a valid path with the color and thickness provided. More... | |
void | UserModuleBase::sdkRepaintPanel (void) |
Ask Usine to repaint the module Panel. The result is a call to the onPaint callback. | |
Automation Recording | |
void | UserModuleBase::sdkStopRecord () |
Stops the recording. | |
void | UserModuleBase::sdkProcessRecord (TPrecision X, TPrecision Y, TPrecision Z) |
Start the recording process if it is not started and processes the recording. to stop the recording use sdkStopRecord. More... | |
Settings options | |
Use them in onCreateSettings to add some entries in the Settings Panel. | |
void | UserModuleBase::sdkAddSettingLineCaption (AnsiCharPtr tab, AnsiCharPtr caption="", TUsineColor color=0, LongBool Translate=FALSE) |
To add a text entry in a Tab of the Settings Panel. | |
void | UserModuleBase::sdkAddSettingLineColor (AnsiCharPtr tab, TUsineColor *pVal, AnsiCharPtr Caption, LongBool Translate=FALSE) |
To add a color selector entry in a Tab of the Settings Panel. | |
void | UserModuleBase::sdkAddSettingLineBoolean (AnsiCharPtr tab, LongBool *pVal, AnsiCharPtr Caption, LongBool Translate=FALSE) |
To add a boolean entry in a Tab of the Settings Panel. | |
void | UserModuleBase::sdkAddSettingLineInteger (AnsiCharPtr tab, int *pVal, AnsiCharPtr Caption, int min, int max, TScale scale, AnsiCharPtr symbol, int defaultValue, LongBool Translate=FALSE) |
To add an integer entry in a Tab of the Settings Panel. | |
void | UserModuleBase::sdkAddSettingLineSingle (AnsiCharPtr tab, float *pVal, AnsiCharPtr caption, float min, float max, TScale scale, AnsiCharPtr symbol, AnsiCharPtr format, float defaultValue, LongBool Translate=FALSE) |
To add a decimal number entry in a Tab of the Settings Panel. | |
void | UserModuleBase::sdkAddSettingLineCombobox (AnsiCharPtr tab, int *pVal, AnsiCharPtr caption, AnsiCharPtr commaText, LongBool Translate=FALSE) |
To add a combo box entry in a Tab of the Settings Panel. | |
void | UserModuleBase::sdkAddSettingsLineString (AnsiCharPtr tab, AnsiCharPtr pVal, AnsiCharPtr caption, LongBool Translate=FALSE) |
To add a string entry in a Tab of the Settings Panel. | |
void | UserModuleBase::sdkSetSettingValue (AnsiCharPtr settingName, UsineEventPtr settingEvent) |
Setter for an existing setting line entry. | |
UsineEventPtr | UserModuleBase::sdkGetSettingValue (AnsiCharPtr settingName) |
Getter for an existing setting line entry. | |
Contextual Menus commands | |
Use them in the onCreateCommands callback to add commands in the module Contextual Menu. | |
void | UserModuleBase::sdkAddCommand (AnsiCharPtr name, NativeInt CallbackId, LongBool Translate=FALSE) |
To add a Command entry in the module Contextual Menu. | |
void | UserModuleBase::sdkAddCommandSeparator (AnsiCharPtr name, LongBool Translate=FALSE) |
To add a named separator in the module Contextual Menu. | |
Video Frame manipulation | |
void | UserModuleBase::sdkGetInputFrame (int numInput, TUsineFramePtr frame) |
Get incoming video Frames. | |
void | UserModuleBase::sdkSetOutputFrame (int numOutput, TUsineFramePtr frame) |
Set outgoing video Frames. | |
void | UserModuleBase::sdkClearFrame (TUsineFramePtr frame, TUsineColor color) |
Clear, fill a frame with a color. | |
void | UserModuleBase::sdkGetNewFrame (TUsineFramePtr frame, int width, int height, LongBool permanent) |
Get a new frame. More... | |
void | UserModuleBase::sdkReleaseFrame (TUsineFramePtr frame) |
Release permanent frames. | |
void | UserModuleBase::sdkCopyFrame (TUsineFramePtr srcFrame, TUsineFramePtr destFrame) |
Copy a frame into another. | |
void | UserModuleBase::sdkSetDimmerFrame (TUsineFramePtr frame, float dimmer) |
Apply a dimmer in the range [0..1] to a frame. | |
void | UserModuleBase::sdkSetPixel (TUsineFramePtr frame, int X, int Y, TUsinePixel pixel) |
Set a pixel at position X,Y in the frame. | |
TUsinePixel | UserModuleBase::sdkGetPixel (TUsineFramePtr frame, int X, int Y) |
Get a pixel at position X,Y in the frame. | |
TUsinePixel | UserModuleBase::sdkColorToPixel (TUsineColor color) |
Transforms a TUsineColor into a TUsinePixel. | |
TUsineColor | UserModuleBase::sdkPixelToColor (TUsinePixel pixel) |
Transforms a TUsinePixel into a TUsineColor. | |
Critical Sections | |
void | UserModuleBase::sdkLockPatch () |
Lock the execution of the current patch to prevent memory access conflicts between the audio thread and other threads like IDLE, video, etc. | |
void | UserModuleBase::sdkUnLockPatch () |
UnLock the execution of the current patch. | |
void | UserModuleBase::sdkCriticalSectionLock (TCriticalSectionPtr pCriticalSection, UINT32 timeout=0) |
Lock a critical section. More... | |
LongBool | UserModuleBase::sdkCriticalSectionTryLock (TCriticalSectionPtr pCriticalSection) |
TryLock a critical section. | |
void | UserModuleBase::sdkCriticalSectionUnLock (TCriticalSectionPtr pCriticalSection) |
UnLock a critical section. | |
TCriticalSectionPtr | UserModuleBase::sdkCriticalSectionCreate (AnsiCharPtr name, LongBool shared=FALSE) |
Create a critical section. More... | |
void | UserModuleBase::sdkCriticalSectionDestroy (TCriticalSectionPtr pCriticalSection) |
Destroy a critical section. | |
Threads | |
TThreadPtr | UserModuleBase::sdkThreadCreate (AnsiCharPtr name, FuncThreadProcess ProcessThreadProc, TThreadPriority priority, UINT32 timeout) |
Create a thread. More... | |
void | UserModuleBase::sdkThreadDestroy (TThreadPtr pThread) |
Destroy a thread. | |
void | UserModuleBase::sdkThreadRestart (TThreadPtr pThread) |
restart a thread. | |
void | UserModuleBase::sdkThreadSetTimeOut (TThreadPtr pThread, UINT32 timeout) |
set timeout of a thread. More... | |
Parameters setters | |
Utils functions to update some Parameter property other than the Event data. | |
void | UserModuleBase::sdkSetListBoxCommaText (int numParam, AnsiCharPtr commaText) |
If the parameter is of type ptListBox, change the comma text defining the list content. More... | |
void | UserModuleBase::sdkSetParamCaption (int numParam, AnsiCharPtr caption) |
Change the name of a parameter. It's the name showed in Usine. More... | |
void | UserModuleBase::sdkSetParamVisible (int numParam, LongBool visible) |
Set a parameter visible or not. More... | |
void | UserModuleBase::sdkRecreateParam (int numParam, TParamInfo *pParamInfo) |
Recreate a parameter with new settings. More... | |
void | UserModuleBase::sdkSetParamValueText (int numParam, AnsiCharPtr valueText) |
If the parameter is of type ptTextField, change the text content. More... | |
void | UserModuleBase::sdkRepaintParam (int numParam) |
Ask Usine to Update the parameter. Usually used after one of the function above. More... | |
Usine Objects functions | |
void | UserModuleBase::sdkUsineObjectSetFloat (AnsiCharPtr name, TPrecision floatValue) |
Set the float value of an Usine-Object. | |
void | UserModuleBase::sdkUsineObjectSetInteger (AnsiCharPtr name, int integerValue) |
Set the integer value of an Usine-Object. | |
void | UserModuleBase::sdkUsineObjectSetArray (AnsiCharPtr name, int index, TPrecision floatValue) |
Set the float value of an Usine-Object array at the index position. | |
void | UserModuleBase::sdkUsineObjectSetMIDI (AnsiCharPtr name, int index, TUsineMidiCode midiValue) |
Set the Midi value of an Usine-Object array at the index position. | |
void | UserModuleBase::sdkUsineObjectSetColor (AnsiCharPtr name, TUsineColor colorValue) |
Set the color value of an Usine-Object. | |
void | UserModuleBase::sdkUsineObjectSetArrayColor (AnsiCharPtr name, int index, TUsineColor colorValue) |
Set the color value of an Usine-Object array at the index position. | |
void | UserModuleBase::sdkUsineObjectSetTrigger (AnsiCharPtr name) |
Set a trigger value of an Usine-Object. | |
void | UserModuleBase::sdkUsineObjectSetAnsiChar (AnsiCharPtr name, AnsiCharPtr v) |
Set the text value of an Usine-Object. | |
TPrecision | UserModuleBase::sdkUsineObjectGetFloat (AnsiCharPtr name) |
Get the float value of an Usine-Object. | |
int | UserModuleBase::sdkUsineObjectGetInteger (AnsiCharPtr name) |
Get the integer value of an Usine-Object. | |
TPrecision | UserModuleBase::sdkUsineObjectGetArray (AnsiCharPtr name, int index) |
Get the float value of an Usine-Object array at the index position. | |
TUsineMidiCode | UserModuleBase::sdkUsineObjectGetMIDI (AnsiCharPtr name, int index) |
Get the Midi value of an Usine-Object array at the index position. | |
TUsineColor | UserModuleBase::sdkUsineObjectGetColor (AnsiCharPtr name) |
Get the color value of an Usine-Object. | |
TUsineColor | UserModuleBase::sdkUsineObjectGetArrayColor (AnsiCharPtr name, int index) |
Get the array value of an Usine-Object array at the index position. | |
AnsiCharPtr | UserModuleBase::sdkUsineObjectGetAnsiChar (AnsiCharPtr name) |
Get the text value of an Usine-Object. | |
int | UserModuleBase::sdkUsineObjectGetLength (AnsiCharPtr name) |
Get the size of the Event associated to an Usine-Object. | |
void | UserModuleBase::sdkUsineObjectSetLength (AnsiCharPtr name, int l) |
Set the size of the Event associated to an Usine-Object. | |
AnsiCharPtr | UserModuleBase::sdkUsineObjectFind (AnsiCharPtr name) |
Returns the list (as a comma-text) of all Usine-Objects that match with the name parameter. | |
LongBool | UserModuleBase::sdkUsineObjectExists (AnsiCharPtr name) |
Returns TRUE if the Usine-Objects exists. | |
AnsiCharPtr | UserModuleBase::sdkUsineObjectListHash () |
Returns the Hash of all Usine-Objects. This allows to determines if the list of all the Usine-Objects has changed. | |
Usine Core infos and services | |
void | UserModuleBase::sdkSendUsineMsg (AnsiCharPtr Msg) |
Usine internal messages. | |
void | UserModuleBase::sdkNotifyUsine (NativeInt Target, NativeInt Msg, NativeInt WParam=0, NativeInt LParam=0, int Delay=0) |
Usine notification. More... | |
TVstTimeInfo * | UserModuleBase::sdkGetVstTimeInfo () |
To access the current TVstTimeInfo structure of Usine. | |
double | UserModuleBase::sdkGetTimeMs () |
To get the Usine global time in millisecond, precision up to nanoseconde. | |
LongBool | UserModuleBase::sdkPatchIsRunning () |
To check if the patch containing the module is running. | |
LongBool | UserModuleBase::sdkPatchLoading () |
To check if the patch containing the module is loading. | |
LongBool | UserModuleBase::sdkPatchJustActivated () |
To check if the patch has just started. | |
LongBool | UserModuleBase::sdkRefreshSpeedClock () |
Gets a tick clock at the refresh-speed of Usine, generally every 25 ms. this can reduce the cpu load for non priority tasks. More... | |
LongBool | UserModuleBase::sdkSlowClock () |
Gets a tick clock at the slow-speed of Usine, generally every second. this can reduce the cpu load for very low priority tasks. More... | |
void * | UserModuleBase::sdkGetUsineUserModule () |
To get the pointer of the Usine module. Do not use directly. | |
AnsiCharPtr | UserModuleBase::sdkGetUsineVersionNum () |
To get the version number of Usine as a string. | |
void | UserModuleBase::sdkSetModuleUserName (AnsiCharPtr name) |
set the name of the module (as it appear in the patch, on the module title) | |
AnsiCharPtr | UserModuleBase::sdkGetModuleUserName () |
get the name of the module (as it appear in the patch, on the module title) | |
Module child window | |
A User module can create and manage an independent child window for it's own use. Note that only one child window at a time per module is possible.
| |
void * | UserModuleBase::sdkCreateDeskWindow () |
void | UserModuleBase::sdkDestroyDeskWindow () |
void * | UserModuleBase::sdkShowDeskWindow () |
void | UserModuleBase::sdkHideDeskWindow () |
void | UserModuleBase::sdkSetDeskWindowClientSize (int clientWidth, int clientHeight) |
void | UserModuleBase::sdkSetDeskWindowCaption (TModuleInfo *pModuleInfo, AnsiCharPtr name) |
Converter utils | |
Useful to convert between pixel coord and graphic canvas unit. | |
float | UserModuleBase::sdkPixelToHeightPercent (float pixel) |
Transform the Y position in pixels into [0..1]. | |
float | UserModuleBase::sdkPixelToWidthPercent (float pixel) |
Transform the X position in pixels into [0..1]. | |
float | UserModuleBase::sdkHeightPercentToPixel (float percent) |
Transform [0..1] percent Y position into the position in pixels. | |
float | UserModuleBase::sdkWidthPercentToPixel (float percent) |
Transform [0..1] percent X position into the position in pixels. | |
void CreateModule | ( | void *& | pModule, |
AnsiCharPtr | optionalString, | ||
LongBool | Flag, | ||
TMasterInfo * | pMasterInfo, | ||
AnsiCharPtr | optionalContent | ||
) |
Called by Usine to instantiate the User Module When opening the Browser section where is stored the module. When adding the module in a patch. When loading a saved workspace or patch.
pModule | Handle for the new instantiated module |
optionalString | optional string passed to the constructor ie. the plugin filename |
Flag | compatibility flag must be FALSE on recent versions of Usine |
pMasterInfo | Handle to the TMasterInfo structure |
optionalContent |
void DestroyModule | ( | void * | pModule | ) |
Called by Usine to destroy the User Module When clearing a workspace or patch. Before recreate module. When closing Usine.
pModule | Handle for the new instantiated module |
UserModuleBase::UserModuleBase | ( | ) |
Implementation of the abstract class provided to derive user modules from.
2013/05/15 first release for Hollyhock CPP SDK 6.00.226
This file is part of the Usine CPP SDK Version 6
Please, report bugs and patch to Usine forum : suppo rt@b rainm odul ar.co m
All dependencies are under there own licence.
Copyright (C) 2023 BrainModular, BeSpline, Adamson
|
pure virtual |
Usine call it to obtain the module characteristics. You have to fill the TModuleInfo structure with infos describing the module. TMasterInfo can be used to obtain some useful infos but always test if the handle is valid as it can be nullptr.
pMasterInfo | The TMasterInfo structure. can be null. |
pModuleInfo | The TModuleInfo structure to describe the module characteristics |
|
pure virtual |
Usine call it for each parameters of the module to obtain it's characteristics.
ParamIndex | The index of the parameter. |
pParamInfo | Handle to the info structure of the parameter. |
|
inlinevirtual |
Usine call it for each parameters of the module to obtain the event handle of the parameter. Deprecated in HH3, use TModuleInfo::EventPtr.
ParamIndex | The index of the parameter. |
pEvent | Handle to the event of the parameter. |
|
inlinevirtual |
Usine call it to inform the module something happened.
Message | Provide various infos about what happened. |
|
inlinevirtual |
Usine call it to obtain the number of parameters of the module depending of the query result.
queryIndex | The index of the choice made in the query popup |
|
inlinevirtual |
Usine call it after the query pop-up is closed. It let you do some things depending of the query choice.
pMasterInfo | The TMasterInfo structure. |
pModuleInfo | The TModuleInfo structure. |
queryIndex | The index of the choice made in the query pop-up |
|
inlinevirtual |
Be careful here because it's called from the audio thread at each audio tick of the audio engine. Keep it optimized and try to avoid any memory allocation.
|
inlinevirtual |
To get the chunk length estimation.
Preset | Tell if it's a preset or a patch chunk. TRUE = preset chunk, FALSE = .pat/.wkp chunk. |
|
inlinevirtual |
Provide a chunk handle to fill with additional info's.
chunk | The chunk pointer to fill. |
Preset | Tell if it's a preset or a patch chunk. TRUE = preset chunk, FALSE = .pat/.wkp chunk. |
|
inlinevirtual |
Provide a chunk handle filled by Usine to restore them into the module.
chunk | The chunk pointer to read from. |
sizeInBytes | The size of the chunk. |
Preset | Tell if it's a preset or a patch chunk. TRUE = preset chunk, FALSE = .pat/.wkp chunk. |
|
inlinevirtual |
Called when Usine resize the Graphic canvas.
contentWidth | the new width of the canvas. |
contentHeight | the new height of the canvas. |
|
inlinevirtual |
Called before Usine draw the module canvas Use it to draw the module canvas.
|
inlinevirtual |
Usine call it when replaying recorded curves. The module have to affect those values to the concerned variables.
X | New value of the first curve. |
Y | New value of the second curve. |
Z | New value of the third curve. |
|
inlinevirtual |
Usine call it after onGetModuleInfo. It let you initialising some stuff.
pMasterInfo | The TMasterInfo structure. |
pModuleInfo | The TModuleInfo structure. |
|
inlinevirtual |
Usine call it when the Usine BlockSize is changed.
BlocSize | The new BlocSize. |
|
inlinevirtual |
Usine call it when the SampleRate is changed.
SampleRate | The new SampleRate. |
|
inlinevirtual |
Send one midi code.
DeviceID | Index of the device to address. |
Code | The midi message to send. |
|
inlinevirtual |
Send a block of midi code.
DeviceID | Index of the device to address. |
arrayCode | The array of midi message to send. |
arraySize | The size of the array. |
|
inlinevirtual |
Send a Sysex message.
DeviceID | Index of the device to address. |
Sysex | The Sysex message to send. |
sysexSize | The size of the Sysex message in byte. |
|
inlinevirtual |
Send an Laser frame.
DeviceID | Index of the device to address. |
arrayPoint | The array of ILDAPoints to send. |
arraySize | The size of the ILDAPoints array. |
|
inlinevirtual |
Send a Dmx message.
deviceId | Index of the device to address. |
ByteArray | The Dmx packet to send. |
len | The size of the Dmx packet in byte. |
universeNum | The DMX universe to address, in case the device can manage more than one, start at 1, default value of 1. |
|
inline |
Draw an array of pixels.
pArray | pointer to the first element of the pixels array |
W | width of the pixels array |
H | height of the pixels array |
destRect | destination rectangle in normalized coordinates (0..1). No verification of the pixels array size is made so be sure that W and H have the right values. |
|
inline |
Move the current position inside the path.
|
inline |
Add a line to the path, from the current position to the point provided.
Add a quadratic curve to the path, from the current position to the point provided. The curve don't pass by the control point.
|
inline |
Add a line to close the path, from the current position to the first point of the path.
|
inline |
Draw the current path with the color and thickness provided.
|
inline |
Fill a valid path with the color and thickness provided.
|
inline |
Start the recording process if it is not started and processes the recording. to stop the recording use sdkStopRecord.
|
inline |
Get a new frame.
permanent | Determines if the frame has a short lifespan (FALSE) or an infinite (TRUE) |
Permanent frames must be destroyed by sdkReleaseFrame
Non permanent frames are released automatically
|
inline |
Lock a critical section.
timeout | must be used with precautions |
|
inline |
Create a critical section.
name | is a name givent to the CS for debug purposes |
|
inline |
Create a thread.
priority | priority of the thread : tpIDLE,tpLow,tpMedium,tpHigh |
timeout | timeout of the thread (execution clock) in ms. if timeout is UINT32_MAX then the thread will wait until the sdkThreadRestart is called |
|
inline |
set timeout of a thread.
timeout | timeout of the thread (execution clock) in ms |
|
inline |
If the parameter is of type ptListBox, change the comma text defining the list content.
numParam | the param index. |
|
inline |
Change the name of a parameter. It's the name showed in Usine.
numParam | the param index. |
|
inline |
Set a parameter visible or not.
numParam | the param index. |
|
inline |
Recreate a parameter with new settings.
numParam | the param index. |
pParamInfo | pointer to TParamInfo structure |
|
inline |
If the parameter is of type ptTextField, change the text content.
numParam | the param index. |
|
inline |
Ask Usine to Update the parameter. Usually used after one of the function above.
numParam | the param index. |
|
inline |
Usine notification.
Send a message to Usine, Usine's setup or this user module. A delay maybe specified.
|
inline |
Gets a tick clock at the refresh-speed of Usine, generally every 25 ms. this can reduce the cpu load for non priority tasks.
if (sdkRefreshSpeedClock()) { doSomething(); }
|
inline |
Gets a tick clock at the slow-speed of Usine, generally every second. this can reduce the cpu load for very low priority tasks.
if (sdkSlowClock()) { doSomething(); }
TColorAhsl sdkColorArgbToColorAhsl | ( | TColorArgb | c1 | ) |
Various helpers around colors.
Calculates HSL from RGB.
Hue | is in degrees, |
Lightness | is between 0 and 1, |
Saturation | is between 0 and 1. |
TColorArgb sdkColorAhslToColorArgb | ( | TColorAhsl | c1 | ) |
Calculate RGB from HSL, reverse of RGB2HSL()
Hue | is in degrees |
Lightness | is between 0 and 1 |
Saturation | is between 0 and 1 |
TColorAhsl sdkColorAhsl | ( | float | h, |
float | s, | ||
float | l, | ||
float | a = 1.0 |
||
) |
HSL color constructor.
h | : float between 0 and 360 |
s | : float between 0 and 1 |
l | : float between 0 and 1 |
TUsineColor sdkAlphaColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a = 1.0 |
||
) |
Usine color constructor.
r | : float between 0 and 1 |
g | : float between 0 and 1 |
b | : float between 0 and 1 TUsineColor : the new created color |
TUsineColor sdkAlphaColor | ( | int | r, |
int | g, | ||
int | b, | ||
int | a = 255 |
||
) |
Usine color constructor.
r | : int between 0 and 255 |
g | : float between 0 and 255 |
b | : float between 0 and 255 TUsineColor : the new created color |
TPointF sdkPointF | ( | float | x, |
float | y | ||
) |
Test if coordinate is in a rect bound.
X | x coordinates to test |
Y | y coordinates to test |
LeftTop | Left top coordinates of the rect bound |
RightBottom | Right bottom coordinates of the rect bound. |
Test if coordinate is in a rect bound.
Coords | : coordinates to test |
LeftTop | : left top coordinates of the rect bound |
RightBottom | : right bottom coordinates of the rect bound |
Four control point Bezier interpolation.
mu | ranges from 0 to 1, start to end of curve |
float sdkBezier4 | ( | float | p1, |
float | p2, | ||
float | p3, | ||
float | p4, | ||
float | mu | ||
) |
Four control float Bezier interpolation.
mu | ranges from 0 to 1, start to end of curve |