williamr@2: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Mmf\Common\MmfMidi.h williamr@2: // williamr@2: // williamr@2: williamr@2: #ifndef __MMF_COMMON_MMFMIDI_H__ williamr@2: #define __MMF_COMMON_MMFMIDI_H__ williamr@2: williamr@2: // Standard EPOC32 includes williamr@2: #include williamr@2: williamr@2: // Public Media Server includes williamr@2: #include williamr@2: #include williamr@2: williamr@2: #include williamr@2: williamr@2: /** williamr@2: MIDI event usued by a MIDI controller to signal to a williamr@2: client that a MIDI source open request has completed. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMidiOpenDataSourceComplete = {0x101F8F85}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a williamr@2: client that play of a MIDI resource has commenced. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMidiPlaying = {0x101F8F86}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to williamr@2: a client that play of a MIDI resource has commenced williamr@2: but not all SP-MIDI requirements can be met. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMidiPlaybackIncompatible = {0x101F8F87}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that play williamr@2: of a MIDI resource has commenced but due to system resource constraints williamr@2: and SP-MIDI content constraints, there is no audible MIDI content williamr@2: during playback. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMidiPlaybackSilent = {0x101F8F88}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to williamr@2: a client that play of a MIDI resource has completed. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMidiPlayingComplete = {0x101F8F89}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to williamr@2: a client a sync update event. The frequency of this event is williamr@2: set by the client with SetSyncUpdateCallbackIntervalL. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMidiSyncUpdate = {0x101F8F8A}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to williamr@2: a client that any currently opened resources have been closed. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMidiClose = {0x101F8F8B}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that the williamr@2: MIDI controller has been primed and it's ready to play. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMidiPrime = {0x101F8F8C}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that the MIDI williamr@2: resource has encountered a tempo change message in the MIDI data stream. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryTempoChanged = {0x101F8F8D}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that the MIDI williamr@2: resource has encountered a volume change message in the MIDI data stream. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryVolumeChanged = {0x101F8F8E}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that the williamr@2: MIDI resource has encountered a mute message in the MIDI data stream. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMuteChanged = {0x101F8F8F}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that the polyphony williamr@2: of the MIDI engine has changed. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryPolyphonyChanged = {0x101F8F90}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that williamr@2: an instrument has been changed on a channel. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryInstrumentChanged = {0x101F8F91}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that a timed williamr@2: meta data entry has been found in the MIDI data stream. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMetaDataEntryFound = {0x101F8F92}; williamr@2: williamr@2: /** williamr@2: MIDI event used by a MIDI controller to signal to a client that a williamr@2: MIP message has been found in the MIDI data stream. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KMMFEventCategoryMipMessageReceived = {0x101F8F93}; williamr@2: williamr@2: /** williamr@2: @internalComponent williamr@2: */ williamr@2: class TMMFMidiConfig1 williamr@2: { williamr@2: public: williamr@2: inline TMMFMidiConfig1(); williamr@2: public: williamr@2: /** williamr@2: * Number of tracks present in the currently open MIDI resource. williamr@2: */ williamr@2: TInt iNumTracks; williamr@2: williamr@2: /** williamr@2: * Current state of the MIDI client utility object williamr@2: * (EMidiStateClosedDisengaged,EMidiStateOpenDisengaged,EMidiStateOpenPlaying,EMidiStatePlaybackIncompatible, williamr@2: * EMidiStatePlaybackSilent, EMidiStateClosedEngaged, EMidiStateOpenEngaged). williamr@2: */ williamr@2: williamr@2: TInt iState; williamr@2: williamr@2: /** williamr@2: * Tempo in microbeats per minute (BPM*1000000). williamr@2: */ williamr@2: TInt iTempo; williamr@2: williamr@2: /** williamr@2: * Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents. williamr@2: */ williamr@2: TInt iPitch; williamr@2: williamr@2: /** williamr@2: * Array of logical {channel, MIP} value pairs to send SP-MIDI MIP message to the MIDI engine. williamr@2: */ williamr@2: const TArray* iMipMessage; williamr@2: williamr@2: /** williamr@2: * The maximum number of notes that the MIDI engine supports simultaneously (polyphony). williamr@2: */ williamr@2: TInt iNumNotes; williamr@2: williamr@2: /** williamr@2: * Max polyphony level: 0 <= PolyphonyL() <= iMaxNotes. williamr@2: */ williamr@2: TInt iMaxNotes; williamr@2: williamr@2: /** williamr@2: * Overall volume of the MIDI client. williamr@2: */ williamr@2: TInt iVolume; williamr@2: williamr@2: /** williamr@2: * Maximum volume that may be applied overall to the MIDI client. williamr@2: */ williamr@2: TInt iMaxVolume; williamr@2: williamr@2: /** williamr@2: * Length of time over which the volume is faded up from zero to the current settings when playback is started. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iRampDuration; williamr@2: williamr@2: /** williamr@2: * Stereo balance value: KMMFBalanceMaxLeft <= iBalance <= KMMFBalanceMaxRight. williamr@2: */ williamr@2: TInt iBalance; williamr@2: williamr@2: /** williamr@2: * The number of times the current opened resources has to be repeated. williamr@2: * This includes the first instance of playing. williamr@2: */ williamr@2: TInt iNumRepeats; williamr@2: williamr@2: /** williamr@2: * Length of time over which the volume is faded out from the current settings to zero. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iFadeOutDuration; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @internalComponent williamr@2: */ williamr@2: class TMMFMidiConfig2 williamr@2: { williamr@2: public: williamr@2: inline TMMFMidiConfig2(); williamr@2: public: williamr@2: /** williamr@2: * Index of the track to mute: 0 <= iTrack < NumTracksL(). williamr@2: */ williamr@2: TInt iTrack; williamr@2: williamr@2: /** williamr@2: * ETrue to mute the track/channel, EFalse to unmute it. williamr@2: */ williamr@2: TBool iMuted; williamr@2: williamr@2: /** williamr@2: * Note to play ot to terminate: 0 <= iNote <= 127. williamr@2: */ williamr@2: TInt iNote; williamr@2: williamr@2: /** williamr@2: * Length of time to play the note for. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iDurationMicroSeconds; williamr@2: williamr@2: /** williamr@2: * Specifying the time at which to start playing the note. williamr@2: * It's relative to the MIDI resource playing time or the time elapsed williamr@2: * since Play() was called if no resource is present. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iStartTime; williamr@2: williamr@2: /** williamr@2: * Velocity with which to start the note: 0 <= iNoteOnVelocity <= 127. williamr@2: */ williamr@2: TInt iNoteOnVelocity; williamr@2: williamr@2: /** williamr@2: * Velocity with which to stop the note: 0 <= iNoteOffVelocity <= 127. williamr@2: */ williamr@2: TInt iNoteOffVelocity; williamr@2: williamr@2: /** williamr@2: * Number of standard or custom sound banks currently available. williamr@2: */ williamr@2: TInt iNumBanks; williamr@2: williamr@2: /** williamr@2: * Specifies whether to reference a custom or standard sound bank. williamr@2: */ williamr@2: TBool iCustom; williamr@2: williamr@2: /** williamr@2: * Index of custom/deault bank: 0 <= iBankIndex < NumberOfBanksL() williamr@2: */ williamr@2: TInt iBankIndex; williamr@2: williamr@2: /** williamr@2: * Custom/deault Bank's Identifier. williamr@2: */ williamr@2: TInt iBankId; williamr@2: williamr@2: /** williamr@2: * Identifier of the custom bank in memory. williamr@2: */ williamr@2: TInt iMemoryBankId; williamr@2: williamr@2: /** williamr@2: * Name of the file containing the custom sound bank or the name williamr@2: * of the file containing the instrument. Includes the directory path. williamr@2: */ williamr@2: const TDesC* iFileName; williamr@2: williamr@2: /** williamr@2: * Descriptor containing the custom sound bank. williamr@2: */ williamr@2: const TDesC8* iBankData; williamr@2: williamr@2: /** williamr@2: * Descriptor containing the instrument. williamr@2: */ williamr@2: const TDesC8* iInstrumentData; williamr@2: williamr@2: /** williamr@2: * ETrue if the specified bank is in memory, EFalse otherwise. williamr@2: */ williamr@2: TBool iBankLoaded; williamr@2: williamr@2: /** williamr@2: * Number of instruments available for the specified sound bank. williamr@2: */ williamr@2: TInt iNumInstruments; williamr@2: williamr@2: /** williamr@2: * Index of the instrument to reference: 0 <= aInstrumentIndex < NumberOfInstrumentsL(). williamr@2: */ williamr@2: TInt iInstrumentIndex; williamr@2: williamr@2: /** williamr@2: * Identifier of specified instrument. This may differ from the index williamr@2: * since the index simply enumerates the instruments, whereas identifiers williamr@2: * may not be contiguous, especially where certain instruments correspond williamr@2: * to General MIDI-defined instruments but not all instruments are present. williamr@2: * 0 <= iInstrumentId <= 127. williamr@2: */ williamr@2: TInt iInstrumentId; williamr@2: williamr@2: /** williamr@2: * Identifier of the instrument in memory. williamr@2: */ williamr@2: TInt iMemoryInstrumentId; williamr@2: williamr@2: /** williamr@2: * Current metrical position of the MIDI resource being played. williamr@2: * Microbeats (BPM*1000000) relative to the start of the resource. williamr@2: */ williamr@2: TInt64 iPositionMicroBeats; williamr@2: williamr@2: /** williamr@2: * Length of the currently open MIDI resource. williamr@2: * Duration in microbeats (beats * 1000000). williamr@2: */ williamr@2: TInt64 iDurationMicroBeats; williamr@2: williamr@2: /** williamr@2: * Time at which playback will stop, relative to the start of the resource. williamr@2: * Clamped to 0 and the duration of the resource. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iStopTime; williamr@2: williamr@2: /** williamr@2: * Logical channel: 0 <= iChannel < ChannelsSupportedL(). williamr@2: */ williamr@2: TInt iChannel; williamr@2: williamr@2: /** williamr@2: * Volume level in dB corresponding to the MIDI Channel: williamr@2: * -infinity <= iChannelVol <= MaxVolumeL(). williamr@2: */ williamr@2: TReal32 iChannelVol; williamr@2: williamr@2: /** williamr@2: * Maximum volume setting in dB, should always be 0 dB and williamr@2: * correspond to the MIDI Channel Volume controller maximum value. williamr@2: */ williamr@2: TReal32 iMaxChannelVol; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @internalComponent williamr@2: */ williamr@2: class TMMFMidiConfig3 williamr@2: { williamr@2: public: williamr@2: inline TMMFMidiConfig3(); williamr@2: public: williamr@2: /** williamr@2: * Temporal interval between MmcuoSyncUpdate callback. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iCallbackIntervalMicroSeconds; williamr@2: williamr@2: /** williamr@2: * Metrical interval between MmcuoSyncUpdate callback. williamr@2: */ williamr@2: TInt64 iCallbackIntervalMicroBeats; williamr@2: williamr@2: /** williamr@2: * Number of bytes of the MIDI message buffer actually processed when client williamr@2: * calls SendMessageL. williamr@2: */ williamr@2: TInt iBytesProcessed; williamr@2: williamr@2: /** williamr@2: * Time at which to execute the MIDI message sent by SendMessageL. williamr@2: * It's relative to the MIDI resource playing time or the time elapsed williamr@2: * since Play() was called if no resource is present. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iTimeStamp; williamr@2: williamr@2: /** williamr@2: * Number of time to repeat the resource during playback. This includes the first playing. williamr@2: */ williamr@2: TInt iRepeatNumberOfTimes; williamr@2: williamr@2: /** williamr@2: * Time in microseconds to pause between repeats. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iTrailingSilence; williamr@2: williamr@2: /** williamr@2: * Playback rate for the playback of the current MIDI resource williamr@2: * in percent times 1000, i.e., 100000 means original playback speed, williamr@2: * 200000 means double speed, and 50000 means half speed playback. williamr@2: */ williamr@2: TInt iPlayBackRate; williamr@2: williamr@2: /** williamr@2: * Maximum playback rate supported by MIDI player. williamr@2: */ williamr@2: TInt iPlayBackMaxRate; williamr@2: williamr@2: /** williamr@2: * Minimum playback rate supported by MIDI player. williamr@2: */ williamr@2: TInt iPlayBackMinRate; williamr@2: williamr@2: /** williamr@2: * Descriptor containing a MIDI message data. If there williamr@2: * are several MIDI messages in the buffer, only the first williamr@2: * one is processed. williamr@2: */ williamr@2: const TDesC8* iMidiMessage; williamr@2: }; williamr@2: williamr@2: inline TMMFMidiConfig1::TMMFMidiConfig1() williamr@2: {}; williamr@2: williamr@2: inline TMMFMidiConfig2::TMMFMidiConfig2() williamr@2: {}; williamr@2: williamr@2: inline TMMFMidiConfig3::TMMFMidiConfig3() williamr@2: {}; williamr@2: williamr@2: #endif