Copyright © 2008-2023 MultiMedia Soft

TracksBoard.ControlIconAddFromMemory method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds a new two states control icon to the Tracksboard by taking its bitmaps from two memory buffers: once added, each control icon is immediately positioned on the left amplitude vertical ruler for each of the available tracks; for this reason the bVisibleLeft field of the TRACKSBOARD_RULERS_SETTINGS data structure must be set to "true".

 

Each control icon can have two bitmaps representing two different situations; on the screenshot below, taken from the TracksBoard sample project available with the installer, two control icons are added, one providing the possibility to mute / unmute the track and the other one providing the possibility to lock / unlock the track; by default each track is in "unmute" status and in "unlock" status (status 1); when in status 1 the tooltip text represents what will happen after clicking the control icon with the mouse: once clicked, the bitmap will show the "mute" status (status 2) and the tooltip text will show that, by clicking the control again, the track will be brought back to the "unmute" status (status 1).

 

 

This is obviously a simple usage of control icons, you may decide to use these control icons for any purpose you may have.

 

When one of the control icons is clicked, the TracksBoardControlPressed event is raised.

 

The vertical and horizontal alignment of control icons can be modified through the TracksBoard.ControlIconsAlignmentSet method.

 

For details about the use of the TracksBoard refer to the How to use the TracksBoard to visually compose songs tutorial.

For further details about methods of the TracksBoard refer to the TracksBoard object section.

 

 

Syntax

 

[Visual Basic]

Public Function ControlIconAddFromMemory (

ByRef nUniqueId as Int32,

pBufferStatus1() as Byte,

nBufferLenStatus1 as Int32,

strTextStatus1 as String,

pBufferStatus2() as Byte,

nBufferLenStatus2 as Int32,

strTextStatus2 as String,

nReserved as Int16

) as enumErrorCodes


 

[C#]

public enumErrorCodes ControlIconAddFromMemory (

ref Int32 nUniqueId,

byte[] pBufferStatus1,

Int32 nBufferLenStatus1,

string strTextStatus1,

byte[] pBufferStatus2,

Int32 nBufferLenStatus2,

string strTextStatus2,

Int16 nReserved

);


 

[C++]

public: enumErrorCodes ControlIconAddFromMemory (

Int32 __gc *nUniqueId,

unsigned char __gc[] pBufferStatus1,

Int32 nBufferLenStatus1,

string strTextStatus1,

unsigned char __gc[] pBufferStatus2,

Int32 nBufferLenStatus2,

string strTextStatus2,

Int16 nReserved

);


 

 

Parameter

Description

 

 

nUniqueId

Reference to a value that, on return from the method call, will contain the unique identifier of the newly added control icon: this unique identifier will be passed to the TracksBoardControlPressed event when the control icon is clicked.

pBufferStatus1

Input memory buffer containing the picture file for status 1.

Supported graphic formats are BMP, ICO, GIF, JPG, TIF and PNG.

nBufferLenStatus1

Length of the previous input memory buffer expressed in bytes

strTextStatus1

String to display on the tooltip when the mouse is hovering the control icon in its status 1.

pBufferStatus2

Input memory buffer containing the picture file for status 2.

Supported graphic formats are BMP, ICO, GIF, JPG, TIF and PNG.

nBufferLenStatus2

Length of the previous input memory buffer expressed in bytes

strTextStatus2

String to display on the tooltip when the mouse is hovering the control icon in its status 2.

nReserved

Reserved for future uses.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.