Usine SDK  HH3-7.01.001
Create user modules for Usine Software
Public Member Functions | List of all members
UserModuleBase Class Referenceabstract

Base class for every User's module. More...

Public Member Functions

virtual void onProcessVideo ()
 Called by the the video thread to process video frames only for ModuleInfo::ModuleType == mtVideo Don't process video outside this procedure. More...
 

Module Constants

Used by usine to populate browser infos and module infos.

static const AnsiCharPtr MODULE_NAME
 
static const AnsiCharPtr MODULE_DESC
 
static const AnsiCharPtr MODULE_VERSION
 

Mandatory Callbacks

Usine need them to collect mandatory infos and update the module.

virtual void onGetModuleInfo (MasterInfo *pMasterInfo, ModuleInfo *pModuleInfo)=0
 Usine call it to obtain the module characteristics. More...
 
virtual void onGetParamInfo (int ParamIndex, TParamInfo *pParamInfo)=0
 Usine call it for each parameters of the module to obtain it's characteristics. More...
 
virtual void onSetEventAddress (int ParamIndex, UsineEventPtr pEvent)
 Usine call it for each parameters of the module to obtain the event handle of the parameter. More...
 
virtual void onCallBack (UsineMessage *Message)
 Usine call it to inform the module something happened. More...
 

Query System Callbacks

Needed if Query system is used.

virtual int onGetNumberOfParams (int queryIndex)
 Usine call it to obtain the number of parameters of the module depending of the query result. More...
 
virtual void onAfterQuery (MasterInfo *pMasterInfo, ModuleInfo *pModuleInfo, int queryIndex)
 Usine call it after the query pop-up is closed. More...
 

Real-time Audio and Data Callback

Usine call it if ModuleInfo::DontProcess is not set to FALSE in onGetModuleInfo.

virtual void onProcess ()
 Be careful here because it's called from the audio thread at each audio tick of the audio engine. More...
 

Chunk System Callbacks

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 onGetChunkLen (LongBool Preset)
 To get the chunk length estimation. More...
 
virtual void onGetChunk (void *chunk, LongBool Preset)
 Provide a chunk handle to fill with additional info's. More...
 
virtual void onSetChunk (const void *chunk, int sizeInBytes, LongBool Preset)
 Provide a chunk handle filled by Usine to restore them into the module. More...
 

Settings Callbacks

Implement them if the module need to add some entries in the Settings Panel.

virtual void onCreateSettings ()
 To add some entries in the Settings panel. More...
 
virtual void onSettingsHasChanged ()
 Called when something change in one of entries.
 

Graphics Canvas Callbacks

Implement them if the module type is mtControl.

virtual void onResize (float contentWidth, float contentHeight)
 Called when Usine resize the Graphic canvas. More...
 
virtual void 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 onCreateCommands ()
 To add some entries in the Contextual Menu. More...
 

Automation Recording Callback

Usine call it if ModuleInfo::CanRecord is set to TRUE in onGetModuleInfo.

virtual void onSetRecordedValue (TPrecision X, TPrecision Y, TPrecision Z)
 Usine call it when replaying recorded curves. More...
 

Randomize Callback

Implement it to respond to a randomize command from Usine.

virtual void onRandomize ()
 Activate it with pModuleInfo->CanBeRandomized = TRUE in onGetModuleInfo.
 

Reset Callback

Implement it to respond to a reset command from Usine.

virtual void onReset ()
 Activate it with pModuleInfo->CanBeReset = TRUE in onGetModuleInfo.
 

SetQuickColor Callback

Implement it to respond to a Set quick colorfrom Usine.

Parameters
colorchoosen color in the quick color menu.
virtual void onSetQuickColor (TColorUsine color)
 

Mouse and Multi-touch Callbacks

Implement them if the module type is mtControl and need to be informed of mouse and/or multi-touch events.

virtual void onMouseMove (TShiftState Shift, float X, float Y)
 
virtual void onMouseDown (TMouseButton MouseButton, TShiftState Shift, float X, float Y)
 
virtual void onMouseUp (TMouseButton MouseButton, TShiftState Shift, float X, float Y)
 
virtual void onMouseWheel (TShiftState Shift, int WheelDelta)
 
virtual void onMouseMoveMulti (TShiftState Shift, UsineEventPtr X, UsineEventPtr Y)
 
virtual void onMouseDownMulti (TMouseButton MouseButton, TShiftState Shift, UsineEventPtr X, UsineEventPtr Y)
 
virtual void onMouseUpMulti (TMouseButton MouseButton, TShiftState Shift, UsineEventPtr X, UsineEventPtr Y)
 

Optional Callbacks

virtual void onInitModule (MasterInfo *pMasterInfo, ModuleInfo *pModuleInfo)
 Usine call it after onGetModuleInfo. More...
 
virtual void onBlocSizeChange (int BlocSize)
 Usine call it when the Usine BlockSize is changed. More...
 
virtual void onSampleRateChange (double SampleRate)
 Usine call it when the SampleRate is changed. More...
 

Child Window Callbacks

Implement them if the module implement a child window.

See also
Module child window
virtual void onOpenEditor ()
 
virtual void onBringToFront ()
 
virtual void onCloseEditor ()
 
virtual void onResizeEditor (int width, int height)
 

MIDI Out Callbacks

Usine call them to send MIDI messages to a Midi Out Device.

Not for public use.

virtual void onMidiSendOut (int DeviceID, UsineMidiCode Code)
 Send one midi code. More...
 
virtual void onMidiSendOutArray (int DeviceID, UsineMidiCode **arrayCode, int arraySize)
 Send a block of midi code. More...
 
virtual void onMidiSysexSendOut (int DeviceID, char **Sysex, int sysexSize)
 Send a Sysex message. More...
 

DMX Out Callback

Usine call it to send DMX packet to a Dmx Out Device.

Not for public use.

virtual void 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 sdkDrawPoint (TPointF point, TColorUsine color, float size, LongBool rounded)
 
void sdkDrawLine (TPointF p1, TPointF p2, TColorUsine color, float strokeThickness)
 
void sdkDrawPolyLine (TPointFArray points, int sizeList, TColorUsine color, float strokeThickness)
 
void sdkFillPolyLine (TPointFArray points, int sizeList, TColorUsine color)
 
void sdkFillRect (TRectF rect, TColorUsine color, float radius, TColorUsine borderColor, float borderWith)
 
void sdkFillText (TRectF rect, AnsiCharPtr text, TColorUsine textColor, float fontSize, LongBool isBold=FALSE, LongBool isWordWrap=FALSE, TTextAlign alignHorizontal=taCenter, TTextAlign alignVertical=taCenter, LongBool isVertical=FALSE)
 
void sdkDrawPathStart ()
 Tell Usine to start a path sequence. More...
 
void sdkDrawPathMoveTo (TPointF point)
 Move the current position inside the path. More...
 
void sdkDrawPathLineTo (TPointF point)
 Add a line to the path, from the current position to the point provided. More...
 
void sdkDrawPathQuadCurveTo (TPointF control, TPointF point)
 Add a quadratic curve to the path, from the current position to the point provided. More...
 
void sdkDrawPathClose ()
 Add a line to close the path, from the current position to the first point of the path. More...
 
void sdkDrawPathDraw (TColorUsine color, float strokeThickness)
 Draw the current path with the color and thickness provided. More...
 
void sdkDrawPathFill (TColorUsine color)
 Fill a valid path with the color and thickness provided. More...
 
void sdkRepaintPanel (void)
 Ask Usine to repaint the module Panel. More...
 

Automation Recording

To record some values for the Automation Recording system.

void sdkStopRecord ()
 
void sdkProcessRecord (TPrecision X, TPrecision Y, TPrecision Z)
 

Settings options

Use them in onCreateSettings to add some entries in the Settings Panel.

void sdkAddSettingLineCaption (AnsiCharPtr tab, AnsiCharPtr caption="", TColorUsine color=0, LongBool Translate=FALSE)
 To add a text entry in a Tab of the Settings Panel.
 
void sdkAddSettingLineColor (AnsiCharPtr tab, TColorUsine *pVal, AnsiCharPtr Caption, LongBool Translate=FALSE)
 To add a color selector entry in a Tab of the Settings Panel.
 
void sdkAddSettingLineBoolean (AnsiCharPtr tab, LongBool *pVal, AnsiCharPtr Caption, LongBool Translate=FALSE)
 To add a boolean entry in a Tab of the Settings Panel.
 
void 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 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 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 sdkAddSettingsLineString (AnsiCharPtr tab, AnsiCharPtr pVal, AnsiCharPtr caption, LongBool Translate=FALSE)
 To add a string entry in a Tab of the Settings Panel.
 
void sdkSetSettingValue (AnsiCharPtr settingName, UsineEventPtr settingEvent)
 Setter for an existing setting line entry.
 
UsineEventPtr 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 sdkAddCommand (AnsiCharPtr name, NativeInt CallbackId, LongBool Translate=FALSE)
 To add a Command entry in the module Contextual Menu.
 
void sdkAddCommandSeparator (AnsiCharPtr name, LongBool Translate=FALSE)
 To add a named separator in the module Contextual Menu.
 

Lan Remote request

Use it if a parameter have the LAN Remote activated.

See also
TParamInfo::IsShared
void sdkNeedRemoteUpdate (int numParam)
 Ask Usine to update a parameter on LAN Remote clients.
 

Frame manipulation

Utils functions to help manipulate video frames

void sdkGetInputFrame (int numInput, PTUsineFrame frame)
 
void sdkSetOutputFrame (int numOutput, PTUsineFrame frame)
 
void sdkClearFrame (PTUsineFrame frame, TColorUsine color)
 
void sdkGetNewFrame (PTUsineFrame frame, int width, int height, LongBool permanent)
 
void sdkCopyFrame (PTUsineFrame srcFrame, PTUsineFrame destFrame)
 
void sdkSetPixel (PTUsineFrame frame, int X, int Y, TUsinePixel pixel)
 
TUsinePixel sdkGetPixel (PTUsineFrame frame, int X, int Y)
 
TUsinePixel sdkColorToPixel (TColorUsine color)
 
TColorUsine sdkPixelToColor (TUsinePixel pixel)
 

Events manipulation

Utils functions to help manipulate events

bool sdkCompareEvt (UsineEventPtr e1, UsineEventPtr e2)
 
void sdkCopyEvt (UsineEventPtr scr, UsineEventPtr dest)
 
void sdkConcatEvt (UsineEventPtr i1, UsineEventPtr i2, UsineEventPtr o)
 
void sdkShiftEvt (int n, UsineEventPtr input, UsineEventPtr output)
 
void sdkSetEvtSize (UsineEventPtr ev, int size)
 
int sdkGetEvtSize (UsineEventPtr ev)
 
void sdkSetEvtMaxSize (UsineEventPtr ev, int size)
 
void sdkDestroyEvt (UsineEventPtr &ev)
 
void sdkCreateEvt (UsineEventPtr &ev, int originalsize)
 
void sdkMoveBLOC32 (TPrecision *src, TPrecision *dest, int size)
 
void sdkSetEvtData (UsineEventPtr ev, TPrecision value)
 
TPrecision sdkGetEvtData (UsineEventPtr ev)
 
void sdkSetEvtArrayData (UsineEventPtr ev, int idx, TPrecision value)
 
TPrecision sdkGetEvtArrayData (UsineEventPtr ev, int idx)
 
void sdkSetEvtPointer (UsineEventPtr ev, void *value)
 
void * sdkGetEvtPointer (UsineEventPtr ev)
 
void sdkSetEvtColor (UsineEventPtr ev, TColorUsine value)
 
TColorUsine sdkGetEvtColor (UsineEventPtr ev)
 
void sdkSetEvtArrayColor (UsineEventPtr ev, int idx, TColorUsine value)
 
TColorUsine sdkGetEvtArrayColor (UsineEventPtr ev, int idx)
 
void sdkSetEvtArrayMidi (UsineEventPtr ev, int idx, UsineMidiCode midi)
 
UsineMidiCode sdkGetEvtArrayMidi (UsineEventPtr ev, int idx)
 
void sdkSetEvtPChar (UsineEventPtr ev, AnsiCharPtr text)
 
AnsiCharPtr sdkGetEvtPChar (UsineEventPtr ev)
 
TPrecisionsdkGetEvtDataAddr (UsineEventPtr ev)
 
T3DPointF sdkGetEvt3DPoint (UsineEventPtr ev, int pointIndex)
 

Events data utils

Utils functions to operate on events data's

void sdkAddEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkAddEvt2 (UsineEventPtr in1, UsineEventPtr in2)
 
void sdkSubEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkSubEvt2 (UsineEventPtr in1, UsineEventPtr in2)
 
void sdkDivEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkMultEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkMultEvt2 (UsineEventPtr in1, UsineEventPtr in2)
 
void sdkMultEvt2Audio (UsineEventPtr in1, UsineEventPtr in2)
 
void sdkMultEvt1 (TPrecision m, UsineEventPtr out)
 
void sdkModEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkPowerEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkExpEvt1 (UsineEventPtr in1)
 
void sdkSqrtEvt1 (UsineEventPtr in1)
 
void sdkSetEvtNbLines (UsineEventPtr in1, int nbLines)
 
int sdkGetEvtNbLines (UsineEventPtr in1)
 
TPrecision sdkMaxEvt1 (UsineEventPtr in1)
 
TPrecision sdkMinEvt1 (UsineEventPtr in1)
 
void sdkMaxEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkMinEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkThreshEvt2 (const UsineEventPtr in1, UsineEventPtr out, TPrecision min, TPrecision max)
 
void sdkThreshEvt1 (UsineEventPtr in1, TPrecision min, TPrecision max)
 
void sdkMixMidiEvt3 (UsineEventPtr in1, UsineEventPtr in2, UsineEventPtr out)
 
void sdkMixMidiEvt2 (UsineEventPtr in1, UsineEventPtr in2)
 
void sdkFadeInAudioEvt (UsineEventPtr TPCMin)
 
void sdkFadeOutAudioEvt (UsineEventPtr TPCMin)
 
void sdkClearAudioEvt (UsineEventPtr in1)
 
void sdkSmoothPrecision (TPrecision &oldValue, UsineEventPtr currentEvent, TPrecision factor)
 
void sdkSmoothEvent (TPrecision &oldValue, UsineEventPtr currentEvent, TPrecision target, TPrecision factor)
 

Parameters setters

Utils functions to update some Parameter property other than the Event data.

void sdkSetListBoxCommatext (int numParam, AnsiCharPtr commaText)
 If the parameter is of type ptListBox, change the comma text defining the list content. More...
 
void sdkSetParamCaption (int numParam, AnsiCharPtr caption)
 Change the name of a parameter. More...
 
void sdkSetParamVisible (int numParam, LongBool visible)
 Set a parameter visible or not. More...
 
void sdkSetParamValueText (int numParam, AnsiCharPtr valueText)
 If the parameter is of type ptTextField, change the text content. More...
 
void sdkRepaintParam (int numParam)
 Ask Usine to Update the parameter. More...
 

Audio Channels query

To use with the audio multi channels query.

AnsiCharPtr sdkGetAudioQueryTitle ()
 Get the title string for the popup.
 
AnsiCharPtr sdkGetAudioQueryChannelList ()
 Get the query string list for an multi channels query.
 
int sdkGetAudioQueryToNbChannels (int qQueryIndex)
 Get the number of channels from the query index choice.
 
AnsiCharPtr sdkGetAudioQueryChannelNames (AnsiCharPtr prefix, int index, int queryIndex)
 Get the name of a channel.
 

Usine Core infos and services

AnsiCharPtr sdkGetUsineBlockSizeList ()
 Get the list of possible usine block size.
 
int sdkGetUsineDefaultBlockSizeIndex ()
 Get the default usine block size.
 
void sdkUsineAudioDeviceIOCallback (float **inputChannelData, int numInputChannels, float **outputChannelData, int numOutputChannels, int numSamples)
 Low level , not for public use Usine audio callback.
 
void sdkUsineMidiDeviceCallback (int deviceID, double TimeStamp, UsineMidiCode midiData)
 Low level , not for public use Usine midi callback.
 
void sdkUsineMidiSysexDeviceCallback (int deviceID, double TimeStamp, char **sysEx, int size)
 Low level , not for public use Usine midi sysex callback.
 
void sdkSendUsineMsg (AnsiCharPtr Msg)
 Usine internal messages.
 
void sdkNotifyUsine (int Target, int Msg, int Param1=0, int Param2=0)
 Usine notification.
 
VstTimeInfosdkGetVstTimeInfo ()
 To access the current VstTimeInfo structure of Usine.
 
int sdkGetBlocSize ()
 To get the current Usine block size.
 
double sdkGetSampleRate ()
 To get the current Usine sample rate.
 
void * sdkGetUsineMainWindow ()
 PC only, Usine mainform handle (THandle)
 
void * sdkGetUsineNSView ()
 MAC only, Usine NSView.
 
void * sdkGetUsineNSApplication ()
 MAC only, Usine NSApplication.
 
TColorUsine sdkGetUsineColor (TUsineColorSet colorName)
 To get a named color from the Usine ColorSet.
 
double sdkGetTimeMs ()
 To get the Usine global time in millisecond, precision up to nanoseconde.
 
AnsiCharPtr sdkGetTrans (AnsiCharPtr StringID)
 Translate a StringID to the current Usine language.
 
LongBool sdkPatchIsRunning ()
 To check if the patch containing the module is running.
 
void * sdkGetUsineUserModule ()
 To get the pointer of the module.
 
AnsiCharPtr sdkGetUsineVersionNum ()
 To get the version number of Usine as a string.
 
TUsineVersionType sdkGetUsineVersionType ()
 To get the version type of Usine. More...
 
AnsiCharPtr sdkGetUsineLanguage ()
 To get the current language used in Usine. More...
 
int sdkGetUsineSaveVersion ()
 To get the of the save format of Usine.
 
int sdkGetUsineMaxAudioInputs ()
 To get the maximum audio inputs Usine can accept.
 
int sdkGetUsineMaxAudioOutputs ()
 To get the maximum audio outputs Usine can accept.
 
int sdkGetUsineMaxMidiDevices ()
 To get the maximum Midi device Usine can accept.
 
int sdkGetUsineMaxPolyphony ()
 To get the current polyphony of Usine.
 
void sdkSetModuleUserName (AnsiCharPtr name)
 set the name of the module (as it appear in the patch, on the module title)
 
AnsiCharPtr sdkGetModuleUserName ()
 get the name of the module (as it appear in the patch, on the module title)
 

Usine Paths getters

To get the path to access some important folders of Usine.

AnsiCharPtr sdkGetUsineSoundPath ()
 The Sound folder as configured in the Global setting Tab.
 
AnsiCharPtr sdkGetUserLibPath ()
 The Patch library folder as configured in the Global setting Tab.
 
AnsiCharPtr sdkGetUsineRecordPath ()
 The Record Out folder as configured in the Global setting Tab.
 
AnsiCharPtr sdkGetGlobalApplicationPath ()
 The install folder of Usine.
 
AnsiCharPtr sdkGetCurrentWorkspacePath ()
 The path of the current workspace.
 
AnsiCharPtr sdkGetCurrentPatchPath ()
 The path of the patch containing the module.
 
AnsiCharPtr sdkGetUsineTempPath ()
 The Temp folder Used by Usine.
 
AnsiCharPtr sdkGetUsinePlugInsPath ()
 Not for public use.
 

Files utils

LongBool sdkProcessOpenDialog (AnsiCharPtr *filename, AnsiCharPtr initialDir, AnsiCharPtr filter)
 Show a dialog window to open a file.
 
LongBool sdkProcessSaveDialog (AnsiCharPtr *filename, AnsiCharPtr initialDir, AnsiCharPtr filter)
 Show a dialog window to save a file.
 
AnsiCharPtr sdkFindFile (AnsiCharPtr *filename, AnsiCharPtr initialDir)
 Ask Usine to search if a file exist.
 

Audio Files manipulation

AudioFilePtr sdkCreateAudioFile ()
 
void sdkDestroyAudioFile (AudioFilePtr audiofile)
 
TPrecision sdkGetSampleAudioFile (AudioFilePtr audiofile, int channel, int pos)
 
void sdkGetBlocSampleAudioFile (AudioFilePtr audiofile, int channel, int pos, UsineEventPtr evt)
 
int sdkGetSizeAudioFile (AudioFilePtr audiofile)
 
int sdkGetChannelAudioFile (AudioFilePtr audiofile)
 
int sdkGetSampleRateAudioFile (AudioFilePtr audiofile)
 
int sdkGetBitPerSampleAudioFile (AudioFilePtr audiofile)
 
void sdkLoadInMemoryAudioFile (AudioFilePtr audiofile, AnsiCharPtr name)
 
void sdkLoadStayOnDiskAudioFile (AudioFilePtr audiofile, AnsiCharPtr name)
 
void sdkGetPeaksAudioFile (AudioFilePtr audiofile, UsineEventPtr evt)
 
void sdkSaveToDiskAudioFile (AudioFilePtr audiofile, AnsiCharPtr name, int nbChannels)
 
void sdkSetChannelsAudioFile (AudioFilePtr audiofile, int nbChannels)
 
void sdkSetSizeAudioFile (AudioFilePtr audiofile, int size)
 
void sdkSetSampleAudioFile (AudioFilePtr audiofile, int channel, int pos, TPrecision sample)
 
void sdkClearAudioFile (AudioFilePtr audiofile)
 

Math utils

TPrecision sdkLinearInterpolation (TPrecision f, TPrecision a, TPrecision b)
 Linear interpolation on a TPrecision value. More...
 
TPrecision sdkCubicInterpolation (TPrecision fr, TPrecision inm1, TPrecision inp, TPrecision inp1, TPrecision inp2)
 Cubic interpolation on a TPrecision value. More...
 
TPrecision sdkSplineInterpolation (TPrecision fr, TPrecision inm1, TPrecision inp, TPrecision inp1, TPrecision inp2)
 Spline interpolation on a TPrecision value. More...
 

Trace functions

void sdkTraceChar (AnsiCharPtr s)
 Show a string in the Trace Panel.
 
void sdkTraceInt (int i)
 Show an integer in the Trace Panel.
 
void sdkTracePrecision (TPrecision f)
 Show a decimal number in the Trace Panel.
 
void sdkTraceErrorChar (AnsiCharPtr s)
 Show a string in the Trace Panel with the error tag.
 
void sdkTraceWarningChar (AnsiCharPtr s)
 Show a string in the Trace Panel with the warning tag.
 
void sdkTraceSplashChar (AnsiCharPtr s, int autoClose)
 Show a string in the SplashForm.
 
void sdkTraceLogChar (AnsiCharPtr s, LongBool showInSplashForm=FALSE)
 Print a string in the LogUsine.log file. Optionally show it in the SplashForm.
 

Dialog popups

int sdkDialogConfirmationYesNoCancel (AnsiCharPtr msg)
 A dialog popup with Yes, No and Cancel buttons. More...
 
int sdkDialogConfirmationYesNo (AnsiCharPtr msg)
 A dialog popup with Yes and No buttons. More...
 
int sdkDialogInformationOk (AnsiCharPtr msg)
 A dialog popup with OK button. More...
 
int sdkDialogConfirmationOKCancel (AnsiCharPtr msg)
 A dialog popup with OK and Cancel buttons. More...
 

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.

See also
Child Window Callbacks
void * sdkCreateDeskWindow ()
 
void sdkDestroyDeskWindow ()
 
void * sdkShowDeskWindow ()
 
void sdkHideDeskWindow ()
 
void sdkSetDeskWindowClientSize (int clientWidth, int clientHeight)
 
void sdkSetDeskWindowCaption (ModuleInfo *pModuleInfo, AnsiCharPtr name)
 

Converter utils

Useful to convert between pixel coord and graphic canvas unit.

float sdkPixelToHeightPercent (float pixel)
 
float sdkPixelToWidthPercent (float pixel)
 
float sdkHeightPercentToPixel (float percent)
 
float sdkWidthPercentToPixel (float percent)
 

Detailed Description

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.

Member Function Documentation

§ onGetModuleInfo()

virtual void UserModuleBase::onGetModuleInfo ( MasterInfo pMasterInfo,
ModuleInfo pModuleInfo 
)
pure virtual

Usine call it to obtain the module characteristics.

You have to fill the ModuleInfo structure with infos describing the module. MasterInfo can be used to obtain some useful infos but always test if the handle is valid as it can be nullptr.

Parameters
pMasterInfoThe MasterInfo structure. can be null.
pModuleInfoThe ModuleInfo structure to describe the module characteristics

§ onGetParamInfo()

virtual void UserModuleBase::onGetParamInfo ( int  ParamIndex,
TParamInfo pParamInfo 
)
pure virtual

Usine call it for each parameters of the module to obtain it's characteristics.

Parameters
ParamIndexThe index of the parameter.
pParamInfoHandle to the info structure of the parameter.

§ onSetEventAddress()

virtual void UserModuleBase::onSetEventAddress ( int  ParamIndex,
UsineEventPtr  pEvent 
)
inlinevirtual

Usine call it for each parameters of the module to obtain the event handle of the parameter.

Deprecated in HH3, use ModuleInfo::EventPtr

Parameters
ParamIndexThe index of the parameter.
pEventHandle to the event of the parameter.

§ onCallBack()

virtual void UserModuleBase::onCallBack ( UsineMessage Message)
inlinevirtual

Usine call it to inform the module something happened.

Parameters
MessageProvide various infos about what happened.

§ onGetNumberOfParams()

virtual int UserModuleBase::onGetNumberOfParams ( int  queryIndex)
inlinevirtual

Usine call it to obtain the number of parameters of the module depending of the query result.

Parameters
queryIndexThe index of the choice made in the query popup
Returns
Number of parameters of the module

§ onAfterQuery()

virtual void UserModuleBase::onAfterQuery ( MasterInfo pMasterInfo,
ModuleInfo pModuleInfo,
int  queryIndex 
)
inlinevirtual

Usine call it after the query pop-up is closed.

It let you do some things depending of the query choice.

Parameters
pMasterInfoThe MasterInfo structure.
pModuleInfoThe ModuleInfo structure.
queryIndexThe index of the choice made in the query pop-up

§ onProcess()

virtual void UserModuleBase::onProcess ( )
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.

See also
ModuleInfo::DontProcess

§ onProcessVideo()

virtual void UserModuleBase::onProcessVideo ( )
inlinevirtual

Called by the the video thread to process video frames only for ModuleInfo::ModuleType == mtVideo Don't process video outside this procedure.

See also
ModuleInfo::ModuleType

§ onGetChunkLen()

virtual int UserModuleBase::onGetChunkLen ( LongBool  Preset)
inlinevirtual

To get the chunk length estimation.

Parameters
PresetTell if it's a preset or a patch chunk. TRUE = preset chunk, FALSE = .pat/.wkp chunk.
Returns
The estimated size of the chunk in byte.

§ onGetChunk()

virtual void UserModuleBase::onGetChunk ( void *  chunk,
LongBool  Preset 
)
inlinevirtual

Provide a chunk handle to fill with additional info's.

Parameters
chunkThe chunk pointer to fill.
PresetTell if it's a preset or a patch chunk. TRUE = preset chunk, FALSE = .pat/.wkp chunk.

§ onSetChunk()

virtual void UserModuleBase::onSetChunk ( const void *  chunk,
int  sizeInBytes,
LongBool  Preset 
)
inlinevirtual

Provide a chunk handle filled by Usine to restore them into the module.

Parameters
chunkThe chunk pointer to read from.
sizeInBytesThe size of the chunk.
PresetTell if it's a preset or a patch chunk. TRUE = preset chunk, FALSE = .pat/.wkp chunk.

§ onCreateSettings()

virtual void UserModuleBase::onCreateSettings ( )
inlinevirtual

To add some entries in the Settings panel.

Typical use is some calls to Settings options functions

§ onResize()

virtual void UserModuleBase::onResize ( float  contentWidth,
float  contentHeight 
)
inlinevirtual

Called when Usine resize the Graphic canvas.

Parameters
contentWidththe new width of the canvas.
contentHeightthe new height of the canvas.

§ onPaint()

virtual void UserModuleBase::onPaint ( )
inlinevirtual

Called before Usine draw the module canvas Use it to draw the module canvas.

See also
Graphic Canvas

§ onCreateCommands()

virtual void UserModuleBase::onCreateCommands ( )
inlinevirtual

To add some entries in the Contextual Menu.

Typical use is some calls to Contextual Menus commands

§ onSetRecordedValue()

virtual void UserModuleBase::onSetRecordedValue ( TPrecision  X,
TPrecision  Y,
TPrecision  Z 
)
inlinevirtual

Usine call it when replaying recorded curves.

The module have to affect those values to the concerned variables.

Parameters
XNew value of the first curve.
YNew value of the second curve.
ZNew value of the third curve.

§ onInitModule()

virtual void UserModuleBase::onInitModule ( MasterInfo pMasterInfo,
ModuleInfo pModuleInfo 
)
inlinevirtual

Usine call it after onGetModuleInfo.

It let you initialising some stuff.

Parameters
pMasterInfoThe MasterInfo structure.
pModuleInfoThe ModuleInfo structure.

§ onBlocSizeChange()

virtual void UserModuleBase::onBlocSizeChange ( int  BlocSize)
inlinevirtual

Usine call it when the Usine BlockSize is changed.

Parameters
BlocSizeThe new BlocSize.

§ onSampleRateChange()

virtual void UserModuleBase::onSampleRateChange ( double  SampleRate)
inlinevirtual

Usine call it when the SampleRate is changed.

Parameters
SampleRateThe new SampleRate.

§ onMidiSendOut()

virtual void UserModuleBase::onMidiSendOut ( int  DeviceID,
UsineMidiCode  Code 
)
inlinevirtual

Send one midi code.

Parameters
DeviceIDIndex of the device to address.
CodeThe midi message to send.

§ onMidiSendOutArray()

virtual void UserModuleBase::onMidiSendOutArray ( int  DeviceID,
UsineMidiCode **  arrayCode,
int  arraySize 
)
inlinevirtual

Send a block of midi code.

Parameters
DeviceIDIndex of the device to address.
arrayCodeThe array of midi message to send.
arraySizeThe size of the array.

§ onMidiSysexSendOut()

virtual void UserModuleBase::onMidiSysexSendOut ( int  DeviceID,
char **  Sysex,
int  sysexSize 
)
inlinevirtual

Send a Sysex message.

Parameters
DeviceIDIndex of the device to address.
SysexThe Sysex message to send.
sysexSizeThe size of the Sysex message in byte.

§ onDMXSendOut()

virtual void UserModuleBase::onDMXSendOut ( int  deviceId,
char *  ByteArray,
int  len,
int  universeNum = 1 
)
inlinevirtual

Send a Dmx message.

Parameters
deviceIdIndex of the device to address.
ByteArrayThe Dmx packet to send.
lenThe size of the Dmx packet in byte.
universeNumThe DMX universe to address, in case the device can manage more than one, start at 1, default value of 1.

§ sdkDrawPathStart()

void UserModuleBase::sdkDrawPathStart ( )
inline

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.

Example of constructing a path

// begin draw path sequence
// move to where we want to start the path
// add a line
// add a curve
sdkDrawPathQuadCurveTo (sdkPointF(0.75, 0.75), sdkPointF(0.25, 0.75));
// close the path
// end the command sequence and ask to draw the path
sdkDrawPathDraw (colorTrajectory, thicknessTrajectory);

§ sdkDrawPathMoveTo()

void UserModuleBase::sdkDrawPathMoveTo ( TPointF  point)
inline

Move the current position inside the path.

See also
sdkDrawPathStart

§ sdkDrawPathLineTo()

void UserModuleBase::sdkDrawPathLineTo ( TPointF  point)
inline

Add a line to the path, from the current position to the point provided.

See also
sdkDrawPathStart

§ sdkDrawPathQuadCurveTo()

void UserModuleBase::sdkDrawPathQuadCurveTo ( TPointF  control,
TPointF  point 
)
inline

Add a quadratic curve to the path, from the current position to the point provided.

The curve don't pass by the control point.

See also
sdkDrawPathStart

§ sdkDrawPathClose()

void UserModuleBase::sdkDrawPathClose ( )
inline

Add a line to close the path, from the current position to the first point of the path.

See also
sdkDrawPathStart

§ sdkDrawPathDraw()

void UserModuleBase::sdkDrawPathDraw ( TColorUsine  color,
float  strokeThickness 
)
inline

Draw the current path with the color and thickness provided.

See also
sdkDrawPathStart

§ sdkDrawPathFill()

void UserModuleBase::sdkDrawPathFill ( TColorUsine  color)
inline

Fill a valid path with the color and thickness provided.

See also
sdkDrawPathStart

§ sdkRepaintPanel()

void UserModuleBase::sdkRepaintPanel ( void  )
inline

Ask Usine to repaint the module Panel.

The result is a call to the onPaint callback.

§ sdkSetListBoxCommatext()

void UserModuleBase::sdkSetListBoxCommatext ( int  numParam,
AnsiCharPtr  commaText 
)
inline

If the parameter is of type ptListBox, change the comma text defining the list content.

See also
onGetParamInfo;
Parameters
numParamthe param index.

§ sdkSetParamCaption()

void UserModuleBase::sdkSetParamCaption ( int  numParam,
AnsiCharPtr  caption 
)
inline

Change the name of a parameter.

It's the name showed in Usine.

Parameters
numParamthe param index.

§ sdkSetParamVisible()

void UserModuleBase::sdkSetParamVisible ( int  numParam,
LongBool  visible 
)
inline

Set a parameter visible or not.

Parameters
numParamthe param index.

§ sdkSetParamValueText()

void UserModuleBase::sdkSetParamValueText ( int  numParam,
AnsiCharPtr  valueText 
)
inline

If the parameter is of type ptTextField, change the text content.

See also
onGetParamInfo;
Parameters
numParamthe param index.

§ sdkRepaintParam()

void UserModuleBase::sdkRepaintParam ( int  numParam)
inline

Ask Usine to Update the parameter.

Usually used after one of the function above.

Parameters
numParamthe param index.

§ sdkGetUsineVersionType()

TUsineVersionType UserModuleBase::sdkGetUsineVersionType ( )
inline

To get the version type of Usine.

See also
TUsineVersionType.

§ sdkGetUsineLanguage()

AnsiCharPtr UserModuleBase::sdkGetUsineLanguage ( )
inline

To get the current language used in Usine.

Returns
a string naming the current language (En, Fr...)

§ sdkLinearInterpolation()

TPrecision UserModuleBase::sdkLinearInterpolation ( TPrecision  f,
TPrecision  a,
TPrecision  b 
)
inline

Linear interpolation on a TPrecision value.

Returns
The interpolated value.

§ sdkCubicInterpolation()

TPrecision UserModuleBase::sdkCubicInterpolation ( TPrecision  fr,
TPrecision  inm1,
TPrecision  inp,
TPrecision  inp1,
TPrecision  inp2 
)
inline

Cubic interpolation on a TPrecision value.

Returns
The interpolated value.

§ sdkSplineInterpolation()

TPrecision UserModuleBase::sdkSplineInterpolation ( TPrecision  fr,
TPrecision  inm1,
TPrecision  inp,
TPrecision  inp1,
TPrecision  inp2 
)
inline

Spline interpolation on a TPrecision value.

Returns
The interpolated value.

§ sdkDialogConfirmationYesNoCancel()

int UserModuleBase::sdkDialogConfirmationYesNoCancel ( AnsiCharPtr  msg)
inline

A dialog popup with Yes, No and Cancel buttons.

Parameters
msgThe message to show on the popup popup.
Returns
The choice of the user.
See also
TDialogsResults

§ sdkDialogConfirmationYesNo()

int UserModuleBase::sdkDialogConfirmationYesNo ( AnsiCharPtr  msg)
inline

A dialog popup with Yes and No buttons.

Parameters
msgThe message to show on the popup popup.
Returns
The choice of the user.
See also
TDialogsResults

§ sdkDialogInformationOk()

int UserModuleBase::sdkDialogInformationOk ( AnsiCharPtr  msg)
inline

A dialog popup with OK button.

Parameters
msgThe message to show on the popup popup.
Returns
The choice of the user.
See also
TDialogsResults

§ sdkDialogConfirmationOKCancel()

int UserModuleBase::sdkDialogConfirmationOKCancel ( AnsiCharPtr  msg)
inline

A dialog popup with OK and Cancel buttons.

Parameters
msgThe message to show on the popup popup.
Returns
The choice of the user.
See also
TDialogsResults

The documentation for this class was generated from the following files: