Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <midiclientutility.h>
Link against: midiclient.lib

Class CMidiClientUtility

class CMidiClientUtility : public CBase;

Description

Utility class to provide a standard client interface to a MIDI controller.

Derivation

Members

Defined in CMidiClientUtility:

Inherited from CBase:


Construction and destruction


NewL(MMidiClientUtilityObserver &,TInt,TMdaPriorityPreference)

Capability: MultimediaDD A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD.

IMPORT_C static CMidiClientUtility* NewL(MMidiClientUtilityObserver &aObserver, TInt aPriority=EMdaPriorityNormal, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);

Description

Static factory function for creating a MIDI client utility object. This function is synchronous, unlike the other factory functions, because it doesn't need to perform any MIDI resource initialisation The underlying controller that is created will be given its own heap.

Parameters

MMidiClientUtilityObserver &aObserver

Reference to an object to receive callbacks on completion of asynchronous functions.

TInt aPriority

Priority of this client - defaults to EMdaPriorityNormal.

TMdaPriorityPreference aPref

Priority preference of this client - defaults to EMdaPriorityPreferenceTimeAndQuality.

Return value

CMidiClientUtility *

Fully constructed utility object ready to have an OpenXxxx() function called.


NewL(MMidiClientUtilityObserver &,TInt,TMdaPriorityPreference,TBool)

Capability: MultimediaDD A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD.

IMPORT_C static CMidiClientUtility* NewL(MMidiClientUtilityObserver &aObserver, TInt aPriority, TMdaPriorityPreference aPref, TBool aUseSharedHeap);

Description

Static factory function for creating a MIDI client utility object. This function is synchronous, unlike the other factory functions, because it doesn't need to perform any MIDI resource initialisation.

Parameters

MMidiClientUtilityObserver &aObserver

Reference to an object to receive callbacks on completion of asynchronous functions.

TInt aPriority

Priority of this client - defaults to EMdaPriorityNormal.

TMdaPriorityPreference aPref

Priority preference of this client - defaults to EMdaPriorityPreferenceTimeAndQuality.

TBool aUseSharedHeap

Select if the underlying controller will have its own heap or share a single heap with other controller instances. The default behaviour, or if this value is EFalse, is that each controller is created with its own heap. The alternative, if the value is ETrue, is that controllers share a special heap with other controllers created the same way. Each heap uses a chunk, so this avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then ETrue should be provided to prevent running out of heaps or chunks.

Return value

CMidiClientUtility *

Fully constructed utility object ready to have an OpenXxxx() function called.


~CMidiClientUtility()

virtual ~CMidiClientUtility();

Description

Destructor

[Top]


Member functions


State()const

IMPORT_C TMidiState State() const;

Description

Gets the current state of the MIDI client utility with regard to MIDI resources

Return value

TMidiState

The current state of the utility


OpenFile(const TDesC &)

IMPORT_C void OpenFile(const TDesC &aFileName);

Description

Asynchronous function to open a file containing MIDI data and perform initialisation ready for playback

Parameters

const TDesC16 &aFileName

Name of the MIDI file to open


OpenFile(const RFile &)

IMPORT_C void OpenFile(const RFile &aFile);

Description

Asynchronous function to open a file containing MIDI data and perform initialisation ready for playback

Parameters

const RFile &aFile

Open handle to the midi file to read


OpenFile(const TMMSource &)

IMPORT_C void OpenFile(const TMMSource &aSource);

Description

Asynchronous function to open a file containing MIDI data and perform initialisation ready for playback

Parameters

const TMMSource &aSource


OpenDes(const TDesC8 &)

IMPORT_C void OpenDes(const TDesC8 &aDescriptor);

Description

Asynchronous function to open a descriptor containing MIDI data and perform initialisation ready for playback

Parameters

const TDesC8 &aDescriptor

descriptor containing MIDI data


OpenUrl(const TDesC &,TInt,const TDesC8 &)

IMPORT_C void OpenUrl(const TDesC &aUrl, TInt aIapId=KUseDefaultIap, const TDesC8 &aMimeType=KNullDesC8);

Description

Asynchronous function to open a URL containing MIDI data and perform initialisation ready for playback

Parameters

const TDesC16 &aUrl

Uniform Resource Locator for a MIDI data stream

TInt aIapId

Identifier of the Internet Access Point to use - available from CommDB, the comms connections database. Defaults to using the default access point, as defined by CommDB

const TDesC8 &aMimeType

Mime type of the MIDI data stream to be played. Defaults to nothing in which case the an attempt will be made to recognise the type of the MIDI data automatically.


Close()

IMPORT_C void Close();

Description

Asynchronous function which closes any currently open resources, such as files, descriptors or URLs in use. Does nothing if there is nothing currently open.


Play()

IMPORT_C void Play();

Description

Asynchronous function to initiate or resume playback of a previously opened resource. Also used to start an internal timer to establish a zero-time for the media stream time relative to which commands with timestamps are timed against


Stop(const TTimeIntervalMicroSeconds &)

IMPORT_C void Stop(const TTimeIntervalMicroSeconds &aFadeOutDuration);

Description

Stops playback of a resource but does not change the current position or release any resources. Pauses the internal timer if no resource is open

Parameters

const TTimeIntervalMicroSeconds &aFadeOutDuration

Length of time over which the volume is faded out from the current settings to zero.


PlayNoteL(TInt,TInt,const TTimeIntervalMicroSeconds &,TInt,TInt)

IMPORT_C void PlayNoteL(TInt aChannel, TInt aNote, const TTimeIntervalMicroSeconds &aDuration, TInt aNoteOnVelocity, TInt aNoteOffVelocity);

Description

Synchronous function to play a single note. Multiple calls to this function will be accommodated as far as the MIDI engine can manage. The same functionality could be implemented using the SendMessage function

Parameters

TInt aChannel

Logical channel to play note on. 0 <= aChannel <= 15.

TInt aNote

Note to play. 0 <= aNote <= 127

const TTimeIntervalMicroSeconds &aDuration

Length of time to play note for.

TInt aNoteOnVelocity

Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127.

TInt aNoteOffVelocity

Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.


PlayNoteL(TInt,TInt,const TTimeIntervalMicroSeconds &,const TTimeIntervalMicroSeconds &,TInt,TInt)

IMPORT_C void PlayNoteL(TInt aChannel, TInt aNote, const TTimeIntervalMicroSeconds &aStartTime, const TTimeIntervalMicroSeconds &aDuration, TInt aNoteOnVelocity, TInt aNoteOffVelocity);

Description

Synchronous function to play a single note at a specified time. Multiple calls to this function will be accommodated as far as the MIDI engine can manage. The same functionality could be implemented using the SendMessage function

Parameters

TInt aChannel

Logical channel to play note on. 0 <= aChannel <= 15.

TInt aNote

Note to play. 0 <= aNote <= 127

const TTimeIntervalMicroSeconds &aStartTime

specifies the time at which to start playing the note, relative to the MIDI resource playing time or the time elapsed since CMidiClientUtility::Play() was called if no resource is present

const TTimeIntervalMicroSeconds &aDuration

Length of time to play note for.

TInt aNoteOnVelocity

Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127.

TInt aNoteOffVelocity

Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.


StopNotes(TInt)

IMPORT_C void StopNotes(TInt aChannel);

Description

Stops the playback of all notes on the given channel, by means of an All Notes Off MIDI message

Parameters

TInt aChannel

Logical channel to stop notes on. 0 <= aChannel <= 15


NoteOnL(TInt,TInt,TInt)

IMPORT_C void NoteOnL(TInt aChannel, TInt aNote, TInt aVelocity);

Description

Synchronous function to commence playback of a note. Multiple calls to this function will be accommodated as far as the MIDI engine can manage

Parameters

TInt aChannel

Logical channel to play note on. 0 <= aChannel <= 15

TInt aNote

Note to play. 0 <= aNote <= 127

TInt aVelocity

Velocity with which to start the note. The legal integer range is 0 <= aVelocity <= 127, but the value zero actually causes the message to be interpreted as a Note Off message instead of a Note On.


NoteOffL(TInt,TInt,TInt)

IMPORT_C void NoteOffL(TInt aChannel, TInt aNote, TInt aVelocity);

Description

Synchronous function to terminate playback of a note. If no corresponding note is found then no error is raised.

Parameters

TInt aChannel

Logical channel on which the note is playing. 0 <= aChannel <= 15.

TInt aNote

Note to terminate. 0 <= aNote <= 127.

TInt aVelocity

Velocity with which to stop the note. 0 <= aVelocity <= 127. There is no standard behaviour corresponding with note off velocity.


PlaybackRateL()const

IMPORT_C TInt PlaybackRateL() const;

Description

Gets the current playback rate factor of the currently open MIDI resource. The playback rate is independent from tempo, i.e., it can be used to give an overall speed factor for playback

Return value

TInt

Current playback rate in percent times 1000, i.e., 100000 means original playback speed, 200000 means double speed, and 50000 means half speed playback


SetPlaybackRateL(TInt)

IMPORT_C void SetPlaybackRateL(TInt aRate);

Description

Sets the playback rate for the playback of the current MIDI resource. The playback rate is independent from tempo, i.e., it can be used to give an overall speed factor for playback. May be called whether playback is in progress or not.

Parameters

TInt aRate

Playback rate in percent times 1000, i.e., 100000 means original playback speed, 200000 means double speed, and 50000 means half speed playback


MaxPlaybackRateL()const

IMPORT_C TInt MaxPlaybackRateL() const;

Description

Gets the maximum playback rate in milli-percentage from the MIDI engine.

Return value

TInt

Maximum playback rate supported by MIDI player


MinPlaybackRateL()const

IMPORT_C TInt MinPlaybackRateL() const;

Description

Gets the minimum playback rate in milli-percentage from the MIDI engine.

Return value

TInt

Minimum playback rate supported by MIDI player.


TempoMicroBeatsPerMinuteL()const

IMPORT_C TInt TempoMicroBeatsPerMinuteL() const;

Description

Gets the current tempo of the currently open MIDI resource. The tempo is independent from the playback rate, i.e., the resulting playback speed will be affected by both.

Return value

TInt

Tempo at the current position of the currently open resource in microbeats per minute, i.e. BPM * 1000000. Filled in by the controller framework


SetTempoL(TInt)

IMPORT_C void SetTempoL(TInt aMicroBeatsPerMinute);

Description

Sets the tempo at which the current MIDI resource should be played. May be called whether playback is in progress or not. The tempo is independent from the playback rate, i.e., the resulting playback speed will be affected by both

Parameters

TInt aMicroBeatsPerMinute

Tempo in microbeats per minute (BPM*1000000) to set


PitchTranspositionCentsL()const

IMPORT_C TInt PitchTranspositionCentsL() const;

Description

Gets the pitch shift in use for the currently open MIDI resource

Return value

TInt

Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents


SetPitchTranspositionL(TInt)

IMPORT_C TInt SetPitchTranspositionL(TInt aCents);

Description

Sets the pitch shift to apply to the currently open MIDI resource. May be called during playback aCents parameter is not checked - if the value is out of range, it is expected KErrArgument is return by MIDI engine.

Parameters

TInt aCents

Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents

Return value

TInt

Actual pitch shift applied - may differ from the requested value due to limitations of the MIDI engine


DurationMicroSecondsL()const

IMPORT_C TTimeIntervalMicroSeconds DurationMicroSecondsL() const;

Description

Gets the length of the currently open MIDI resource in micro-seconds

Return value

TTimeIntervalMicroSeconds

Duration in microseconds (seconds * 1000000).


DurationMicroBeatsL()const

IMPORT_C TInt64 DurationMicroBeatsL() const;

Description

Gets the length of the currently open MIDI resource in micro-beats

Return value

TInt64

Duration in microbeats (beats * 1000000).


NumTracksL()const

IMPORT_C TInt NumTracksL() const;

Description

Gets the number of tracks present in the currently open MIDI resource

Return value

TInt

Number of tracks


SetTrackMuteL(TInt,TBool)const

IMPORT_C void SetTrackMuteL(TInt aTrack, TBool aMuted) const;

Description

Mutes or unmutes a particular track

Parameters

TInt aTrack

Index of the track to mute - 0 <= aTrack < CMidiClientUtility::NumTracksL()const.

TBool aMuted

ETrue to mute the track, EFalse to unmute it.


MimeTypeL()

IMPORT_C const TDesC8& MimeTypeL();

Description

Gets the MIME type of the MIDI resource currently open

Return value

const TDesC8 &

Descriptor containing the MIDI mime type


PositionMicroSecondsL()const

IMPORT_C TTimeIntervalMicroSeconds PositionMicroSecondsL() const;

Description

Gets the current temporal position of the MIDI resource being played.

Return value

TTimeIntervalMicroSeconds

Microseconds relative to the start of the resource


SetPositionMicroSecondsL(const TTimeIntervalMicroSeconds &)

IMPORT_C void SetPositionMicroSecondsL(const TTimeIntervalMicroSeconds &aPosition);

Description

Change the position of the currently playing MIDI resource to the given position. May be called whenever a MIDI resource is open

Parameters

const TTimeIntervalMicroSeconds &aPosition

Temporal position to move to. Clamped to (0, CMidiClientUtility::DurationMicroSecondsL()const).


PositionMicroBeatsL()const

IMPORT_C TInt64 PositionMicroBeatsL() const;

Description

Gets the current metrical position of the MIDI resource being played

Return value

TInt64

Microbeats (BPM*1000000) relative to the start of the resource


SetPositionMicroBeatsL(TInt64)

IMPORT_C void SetPositionMicroBeatsL(TInt64 aMicroBeats);

Description

Change the position of the currently playing MIDI resource to the given position. May be called whenever a MIDI resource is open.

Parameters

TInt64 aMicroBeats

Metrical position to move to. Clamped to (0, CMidiClientUtility::DurationMicroBeatsL()const).


SetSyncUpdateCallbackIntervalL(const TTimeIntervalMicroSeconds &,TInt64)

IMPORT_C void SetSyncUpdateCallbackIntervalL(const TTimeIntervalMicroSeconds &aMicroSeconds, TInt64 aMicroBeats=0);

Description

Sets the frequency at which MMIDIClientUtilityObserver::MmcuoSyncUpdateL(…) is called to allow other components to synchronise with playback of this MIDI resource

Parameters

const TTimeIntervalMicroSeconds &aMicroSeconds

Temporal interval to callback at. Used in preference to aMicroBeats if both are set

TInt64 aMicroBeats

Metrical interval to callback at. Set both parameters to zero to cancel.


SendMessageL(const TDesC8 &)

IMPORT_C TInt SendMessageL(const TDesC8 &aMidiMessage);

Description

Sends a single MIDI message to the MIDI engine

Parameters

const TDesC8 &aMidiMessage

Descriptor containing the MIDI message data. If there are several MIDI messages in the buffer, only the first one is processed

Return value

TInt


SendMessageL(const TDesC8 &,const TTimeIntervalMicroSeconds &)

IMPORT_C TInt SendMessageL(const TDesC8 &aMidiMessage, const TTimeIntervalMicroSeconds &aTime);

Description

Sends a single MIDI message, with time stamp, to the MIDI engine

Parameters

const TDesC8 &aMidiMessage

Descriptor containing the MIDI message data. If there are several MIDI messages in the buffer, only the first one is processed

const TTimeIntervalMicroSeconds &aTime

The time at which to execute the message, relative to the MIDI resource playing time or the time elapsed since CMidiClientUtility::Play() was called if no resource is present

Return value

TInt


SendMipMessageL(const RArray< TMipMessageEntry > &)

IMPORT_C void SendMipMessageL(const RArray< TMipMessageEntry > &aEntry);

Description

Sends a mip message to the MIDI engine. This is a convenience function, because the same functionality could be achieved with the SendMessage() function

Parameters

const RArray< TMipMessageEntry > &aEntry

Array of logical {channel, MIP} value pairs to send, highest priority first


NumberOfBanksL(TBool)const

IMPORT_C TInt NumberOfBanksL(TBool aCustom) const;

Description

Gets the number of standard or custom sound banks currently available

Parameters

TBool aCustom

Specifies whether to reference a custom or standard sound bank

Return value

TInt

Number of custom or standard sound banks available


GetBankIdL(TBool,TInt)const

IMPORT_C TInt GetBankIdL(TBool aCustom, TInt aBankIndex) const;

Description

Gets the identifier of a sound bank. Bank identifier (aka bank number) is a 14-bit value consisting of MIDI bank MSB and LSB values

Parameters

TBool aCustom

Specifies whether to reference a custom or standard sound bank

TInt aBankIndex

Index of sound bank where 0 <= aBankIndex < NumberOfBanksL(…)

Return value

TInt

Identifier of the specified bank occupying, at most, 14 bits


LoadCustomBankL(const TDesC &,TInt &)

IMPORT_C void LoadCustomBankL(const TDesC &aFileName, TInt &aBankCollectionIndex);

Description

Loads one or more custom sound banks from a file into memory for use. If several banks are loaded with consequent LoadCustomBanksL() function calls, the banks are combined if the bank sets have colliding bank numbers

Parameters

const TDesC16 &aFileName

Name of the file containing the custom sound bank

TInt &aBankCollectionIndex

Identifier of the custom sound bank loaded, occupying no more than 14 bits


LoadCustomBankDataL(const TDesC8 &,TInt &)

IMPORT_C void LoadCustomBankDataL(const TDesC8 &aBankData, TInt &aBankCollectionIndex);

Description

Loads one or more custom sound banks from a descriptor into memory for use. If several banks are loaded with consequent LoadCustomBanksL() function calls, the banks are combined if the bank sets have colliding bank numbers

Parameters

const TDesC8 &aBankData

Descriptor containing the custom sound bank

TInt &aBankCollectionIndex

Identifier of the custom sound bank loaded, occupying no more than 14 bits.


UnloadCustomBankL(TInt)

IMPORT_C void UnloadCustomBankL(TInt aBankCollectionIndex);

Description

Removes a custom sound bank from memory. Only valid for sound banks previously loaded from file. Once unloaded the custom sound bank is no longer available for use.

Parameters

TInt aBankCollectionIndex

Identifier of the custom sound bank to unload, occupying no more than 14 bits


CustomBankLoadedL(TInt)const

IMPORT_C TBool CustomBankLoadedL(TInt aBankCollectionIndex) const;

Description

Query if a bank has been loaded to the memory

Parameters

TInt aBankCollectionIndex

Identifier of the custom sound bank to check if it's in memory or not

Return value

TBool

ETrue if the specified bank is in memory, EFalse otherwise


UnloadAllCustomBanksL()

IMPORT_C void UnloadAllCustomBanksL();

Description

Removes all custom sound banks from memory.


NumberOfInstrumentsL(TInt,TBool)const

IMPORT_C TInt NumberOfInstrumentsL(TInt aBankId, TBool aCustom) const;

Description

Gets the number of instruments available in a given sound bank

Parameters

TInt aBankId

Identifier of sound bank to reference, occupying no more than 14 bits

TBool aCustom

Specifies whether to reference a custom or standard sound bank

Return value

TInt

Count of the number of instruments available for the specified sound bank


GetInstrumentIdL(TInt,TBool,TInt)const

IMPORT_C TInt GetInstrumentIdL(TInt aBankId, TBool aCustom, TInt aInstrumentIndex) const;

Description

Gets the identifier of an instrument.

Parameters

TInt aBankId

Identifier of the sound bank to reference, occupying no more than 14 bits.

TBool aCustom

Specifies whether to reference a custom or standard sound bank.

TInt aInstrumentIndex

Index of the instrument to reference where 0 <= aInstrumentIndex < CMidiClientUtility::NumberOfInstrumentsL(TInt,TBool)const.

Return value

TInt

Identifier of specified instrument. This may differ from the index since the index simply enumerates the instruments, whereas identifiers may not be contiguous, especially where certain instruments correspond to General MIDI-defined instruments but not all instruments are present. Instrument identifiers are between 0 and 127 inclusive.


InstrumentNameL(TInt,TBool,TInt)const

IMPORT_C HBufC* InstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) const;

Description

Gets the name of the given instrument.

Parameters

TInt aBankId

Identifier of the bank that the instrument belongs to, occupying no more than 14 bits

TBool aCustom

Specifies whether to reference a custom or standard sound bank

TInt aInstrumentId

Identifier of the instrument under scrutiny. 0 <= iInstrumentId <= 127.

Return value

HBufC16 *

Buffer containing the name of the specified instrument. If it has no name then an empty descriptor is returned


GetInstrumentL(TInt,TInt &,TInt &)

IMPORT_C void GetInstrumentL(TInt aChannel, TInt &aInstrumentId, TInt &aBankId);

Description

Gets the instrument assigned to a specified channel

Parameters

TInt aChannel

Logical channel, 0 <= aChannel <= 15.

TInt &aInstrumentId

Identifier of the instrument assigned to aChannel. 0 <= iInstrumentId <= 127

TInt &aBankId

Identifier of the bank that the instrument belongs to, occupying no more than 14 bits


SetInstrumentL(TInt,TInt,TInt)

IMPORT_C void SetInstrumentL(TInt aChannel, TInt aBankId, TInt aInstrumentId);

Description

Sets a logical channel to use the given instrument.

Parameters

TInt aChannel

Logical channel to set the instrument for. 0 <= aChannel <= 15

TInt aBankId

Identifier of the bank that the instrument belongs to, occupying no more than 14 bits. The bank ID is a concatenation of MIDI bank MSB and LSB values

TInt aInstrumentId

Identifier of the instrument under scrutiny. 0 <= iInstrumentId <= 127.


LoadCustomInstrumentL(const TDesC &,TInt,TInt,TInt,TInt)

IMPORT_C void LoadCustomInstrumentL(const TDesC &aFileName, TInt aFileBankId, TInt aFileInstrumentId, TInt aMemoryBankId, TInt aMemoryInstrumentId);

Description

Loads an individual instrument from file into custom sound bank memory for use. The bank and instrument ids given in the file can be mapped into different bank and instrument ids in memory

Parameters

const TDesC16 &aFileName

Name of the file containing the instrument

TInt aFileBankId

Identifier of the bank in the file from which to load the instrument, occupying no more than 14 bits

TInt aFileInstrumentId

Identifier of the instrument to load. 0 <= aInstrumentId <= 127

TInt aMemoryBankId

Identifier of the custom bank in memory to load the instrument into, occupying no more than 14 bits.

TInt aMemoryInstrumentId

Identifier of the instrument in memory to load the new instrument into. 0 <= aInstrumentId <= 127.


LoadCustomInstrumentDataL(const TDesC8 &,TInt,TInt,TInt,TInt)

IMPORT_C void LoadCustomInstrumentDataL(const TDesC8 &aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId);

Description

Loads an individual instrument from descriptor into custom sound bank memory for use. The bank and instrument ids given in the descriptor can be mapped into different bank and instrument ids in memory

Parameters

const TDesC8 &aInstrumentData

Descriptor containing the instrument

TInt aBankDataId

Identifier of the bank in the descriptor from which to load the instrument, occupying no more than 14 bits

TInt aInstrumentDataId

Identifier of the instrument to load. 0 <= aInstrumentId <= 127

TInt aMemoryBankId

Identifier of the custom bank in memory to load the instrument into, occupying no more than 14 bits

TInt aMemoryInstrumentId

Identifier of the instrument in memory to load the new instrument into. 0 <= aInstrumentId <= 127.


UnloadCustomInstrumentL(TInt,TInt)

IMPORT_C void UnloadCustomInstrumentL(TInt aCustomBankId, TInt aInstrumentId);

Description

Removes an instrument from custom sound bank memory. Only valid for instruments previously loaded from file. Once unloaded the instrument is no longer available for use

Parameters

TInt aCustomBankId

Identifier of the custom sound bank containing the instrument to unload, occupying no more than 14 bits.

TInt aInstrumentId

Identifier of the instrument to unload. 0 <= aInstrumentId <= 127


PercussionKeyNameL(TInt,TInt,TBool,TInt)const

IMPORT_C HBufC* PercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) const;

Description

Gets the name of a particular percussion key corresponding to a given note.

Parameters

TInt aNote

Note to query. 0 <= aNote <= 127

TInt aBankId

Identifier of the bank that the instrument belongs to, occupying no more than 14 bits. The bank ID is a concatenation of MIDI bank MSB and LSB values.

TBool aCustom

Specifies whether to reference a custom or standard sound bank

TInt aInstrumentId

Identifier of an instrument

Return value

HBufC16 *

Descriptor containing the name of the percussion key. If the key does not have a name then an empty descriptor is returned


StopTimeL(TTimeIntervalMicroSeconds &)const

IMPORT_C void StopTimeL(TTimeIntervalMicroSeconds &aStopTime) const;

Description

Get the stop time currently set for the MIDI resource

Parameters

TTimeIntervalMicroSeconds &aStopTime

Time at which playback will stop, relative to the start of the resource


SetStopTimeL(const TTimeIntervalMicroSeconds &)

IMPORT_C void SetStopTimeL(const TTimeIntervalMicroSeconds &aStopTime);

Description

Sets the stop time to use for the currently open MIDI resource

Parameters

const TTimeIntervalMicroSeconds &aStopTime

Time at which playback will stop, relative to the start of the resource. Clamped to 0 and the duration of the resource


SetRepeatsL(TInt,const TTimeIntervalMicroSeconds &)

IMPORT_C void SetRepeatsL(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds &aTrailingSilence);

Description

Set the number of times to repeat the current MIDI resource. After CMidiClientUtility::Stop(const TTimeIntervalMicroSeconds &) has been called, repeat number of times and the trailing silence are reset

Parameters

TInt aRepeatNumberOfTimes

Number of time to repeat the resource during playback. This includes the first playing

const TTimeIntervalMicroSeconds &aTrailingSilence

Time in microseconds to pause between repeats


GetRepeats()const

IMPORT_C TInt GetRepeats() const;

Description

Gets the number of times the current opened resources has to be repeated

Return value

TInt

The number of time the current opened resources has to be repeated


PolyphonyL()const

IMPORT_C TInt PolyphonyL() const;

Description

Gets the number of currently active voices.

Return value

TInt

The number of currently active voices


SetMaxPolyphonyL(TInt)

IMPORT_C void SetMaxPolyphonyL(TInt aMaxNotes);

Description

Set the max polyphony the engine can handle

Parameters

TInt aMaxNotes

Max polyphony level, 0 <= CMidiClientUtility::PolyphonyL()const <= aMaxNotes


ChannelsSupportedL()const

IMPORT_C TInt ChannelsSupportedL() const;

Description

Gets the maximum number of logical channels supported by the MIDI engine.

Return value

TInt

The maximum number of logical channels that the MIDI engine supports, 0 <= aChannels <=15.


ChannelVolumeL(TInt)const

IMPORT_C TReal32 ChannelVolumeL(TInt aChannel) const;

Description

Get the current volume setting of a logical channel

Parameters

TInt aChannel

Logical channel to query. 0 <= aChannel <= 15.

Return value

TReal32

Volume currently set on the specified channel in decibels


MaxChannelVolumeL()const

IMPORT_C TReal32 MaxChannelVolumeL() const;

Description

Gets the Maximum volume setting that may be applied to a logical channel

Return value

TReal32

Maximum volume setting. Minimum value is -infinity dB, which is the smallest possible value that TReal32 supports.


SetChannelVolumeL(TInt,TReal32)

IMPORT_C void SetChannelVolumeL(TInt aChannel, TReal32 aVolumeInDecibels);

Description

Set the volume of a channel.

Parameters

TInt aChannel

Logical channel to set the volume on. 0 <= aChannel <= 15

TReal32 aVolumeInDecibels

Volume currently set on the specified channel in decibels. The minimum channel volume supported value is -infinity dB, which is the smallest possible value that TReal32 supports. The maximum channel volume can be set via CMidiClientUtility::MaxChannelVolumeL()const


SetChannelMuteL(TInt,TBool)

IMPORT_C void SetChannelMuteL(TInt aChannel, TBool aMuted);

Description

Set the muting state of a channel without changing its volume setting. When unmuted the channel goes back to its previous volume setting

Parameters

TInt aChannel

Logical channel to set the mute state of. 0 <= aChannel <= 15.

TBool aMuted

ETrue to mute the channel, EFalse to unmute it.


VolumeL()const

IMPORT_C TInt VolumeL() const;

Description

Gets the overall volume of the MIDI client.

Return value

TInt

The current overall volume setting


MaxVolumeL()const

IMPORT_C TInt MaxVolumeL() const;

Description

Maximum volume setting that may be applied overall.

Return value

TInt

Maximum volume setting. Minimum value is always zero which is silent


SetVolumeL(TInt)

IMPORT_C void SetVolumeL(TInt aVolume);

Description

Set the overall volume of the MIDI client. This setting scales all channel volumes respectively so the actual volume that a channel is played at is (overall volume * channel volume / max volume).

Parameters

TInt aVolume

Overall volume setting to use


SetVolumeRampL(const TTimeIntervalMicroSeconds &)

IMPORT_C void SetVolumeRampL(const TTimeIntervalMicroSeconds &aRampDuration);

Description

Length of time over which the volume is faded up from zero to the current settings when playback is started.

Parameters

const TTimeIntervalMicroSeconds &aRampDuration

Duration of the ramping period.


GetBalanceL()const

IMPORT_C TInt GetBalanceL() const;

Description

Get the current stereo balance value

Return value

TInt

Balance value ranging from KMMFBalanceMaxLeft to KMMFBalanceMaxRight


SetBalanceL(TInt)

IMPORT_C void SetBalanceL(TInt aBalance=KMMFBalanceCenter);

Description

Set the current stereo balance value

Parameters

TInt aBalance

Balance value to set. Defaults to KMMFBalanceCenter to restore equal left-right balance


SetPriorityL(TInt,TMdaPriorityPreference)

Capability: MultimediaDD A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that does not have MultimediaDD.

IMPORT_C void SetPriorityL(TInt aPriority, TMdaPriorityPreference aPref);

Description

Set the priority with which this client plays MIDI data

Parameters

TInt aPriority

Priority at which the MIDI playback should operate

TMdaPriorityPreference aPref

Priority preference to use if there should be contention with another client


NumberOfMetaDataEntriesL()const

IMPORT_C TInt NumberOfMetaDataEntriesL() const;

Description

Get the number of meta data entries currently known about in the currently open resource. XMF,SMF meta data are part of the XMF,SMF file header and can thus be examined before playback. If there is no XMF,SMF resource open, will return zero. Standard MIDI file meta data entries encountered during playback will be passed back via MMIDIClientUtilityObserver::MmcuoMetaDataEntryFound()

Return value

TInt

Number of XMF meta data entries currently known about


GetMetaDataEntryL(TInt)const

IMPORT_C CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex) const;

Description

Retrieve the specified XMF,SMF meta data entry.

Parameters

TInt aMetaDataIndex

Index of the meta data entry to retrieve

Return value

CMMFMetaDataEntry *

Meta data entry. Ownership is passed to the client.


SetBankL(TBool)

Interface status: deprecated SetBankL is deprecated due to Mobile XMF specification requirement that user instruments (custom instruments) override standard instruments.

IMPORT_C void SetBankL(TBool aCustom);

Description

Parameters

TBool aCustom


IsTrackMuteL(TInt)const

IMPORT_C TBool IsTrackMuteL(TInt aTrack) const;

Description

Gets the muting status of a specific track

Parameters

TInt aTrack

The track to query

Return value

TBool

The mute status of the track.


IsChannelMuteL(TInt)const

IMPORT_C TBool IsChannelMuteL(TInt aChannel) const;

Description

Gets the muting status of a specific channel

Parameters

TInt aChannel

The channel to query

Return value

TBool

The mute status of the channel


CustomCommandSyncL(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &)

IMPORT_C void CustomCommandSyncL(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TDes8 &aDataFrom);

Description

Synchronously pass implementation-specific commands to the MIDI engine and receive a response

Parameters

const TPckgBuf &aDestination

Recipient of the message. Should be initialised with KUidInterfaceMIDI and a TInt describing the server-side object to which the command should be delivered. The TInt will usually be KMMFObjectHandleController, to deliver the message to the controller plugin, which is the default value.

TInt aFunction

Index of the function to perform

const TDesC8 &aDataTo1

First command data buffer to send, eg command parameters

const TDesC8 &aDataTo2

Second command data buffer to send, eg data parameters

TDes8 &aDataFrom

Buffer to receive data in response to the command. The user must ensure that it is large enough to hold all the data returned.


CustomCommandSyncL(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &)

IMPORT_C void CustomCommandSyncL(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2);

Description

Synchronously pass implementation-specific commands to the MIDI engine.

Parameters

const TPckgBuf &aDestination

Recipient of the message. Should be initialised with KUidInterfaceMIDI and a TInt describing the server-side object to which the command should be delivered. The TInt will usually be KMMFObjectHandleController, to deliver the message to the controller plugin, which is the default value.

TInt aFunction

Index of the function to perform

const TDesC8 &aDataTo1

First command data buffer to send, eg command parameters

const TDesC8 &aDataTo2

Second command data buffer to send, eg data parameters


CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TDes8 &,TRequestStatus &)

IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TDes8 &aDataFrom, TRequestStatus &aStatus);

Description

Asynchronously pass implementation-specific commands to the MIDI engine and receive a response

Parameters

const TPckgBuf &aDestination

aDestination Recipient of the message. Should be initialised with KUidInterfaceMIDI and a TInt describing the server-side object to which the command should be delivered. The TInt will usually be KMMFObjectHandleController, to deliver the message to the controller plugin, which is the default value.

TInt aFunction

Index of the function to perform

const TDesC8 &aDataTo1

First command data buffer to send, eg command parameters

const TDesC8 &aDataTo2

Second command data buffer to send, eg data parameters

TDes8 &aDataFrom

Buffer to receive data in response to the command. The user must ensure that it is large enough to hold all the data returned.

TRequestStatus &aStatus

Status flag belonging to an active object that will have it's RunL() called when this request complete


CustomCommandAsync(const TMMFMessageDestinationPckg &,TInt,const TDesC8 &,const TDesC8 &,TRequestStatus &)

IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TRequestStatus &aStatus);

Description

Asynchronously pass implementation-specific commands to the MIDI engine

Parameters

const TPckgBuf &aDestination

aDestination Recipient of the message. Should be initialised with KUidInterfaceMIDI and a TInt describing the server-side object to which the command should be delivered. The TInt will usually be KMMFObjectHandleController, to deliver the message to the controller plugin, which is the default value.

TInt aFunction

Index of the function to perform

const TDesC8 &aDataTo1

First command data buffer to send, eg command parameters

const TDesC8 &aDataTo2

Second command data buffer to send, eg data parameters

TRequestStatus &aStatus

Status flag belonging to an active object that will have it's RunL() called when this request complete


MaxPolyphonyL()const

IMPORT_C TInt MaxPolyphonyL() const;

Description

Get the maximum polyphony level that the engine can handle

Return value

TInt

The maximum number of simultaneous notes the engine can handle. 0 <= CMidiClientUtility::PolyphonyL()const <= CMidiClientUtility::MaxPolyphonyL()const


GetDRMCustomCommand()

IMPORT_C MMMFDRMCustomCommand* GetDRMCustomCommand();

Description

Gets a controller's DRM custom command implementation.

Return value

MMMFDRMCustomCommand *

A pointer to a controller's DRM custom command implementation or NULL if the interface can not be obtained