sl@0: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Mmf\Common\MmfMidiconfig.h sl@0: // sl@0: // sl@0: sl@0: #ifndef __MMF_COMMON_MMFMIDI_CONFIG_H__ sl@0: #define __MMF_COMMON_MMFMIDI_CONFIG_H__ sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: class TMMFMidiConfig1 sl@0: { sl@0: public: sl@0: inline TMMFMidiConfig1(); sl@0: public: sl@0: /** sl@0: * Number of tracks present in the currently open MIDI resource. sl@0: */ sl@0: TInt iNumTracks; sl@0: sl@0: /** sl@0: * Current state of the MIDI client utility object sl@0: * (EMidiStateClosedDisengaged,EMidiStateOpenDisengaged,EMidiStateOpenPlaying,EMidiStatePlaybackIncompatible, sl@0: * EMidiStatePlaybackSilent, EMidiStateClosedEngaged, EMidiStateOpenEngaged). sl@0: */ sl@0: sl@0: TInt iState; sl@0: sl@0: /** sl@0: * Tempo in microbeats per minute (BPM*1000000). sl@0: */ sl@0: TInt iTempo; sl@0: sl@0: /** sl@0: * Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents. sl@0: */ sl@0: TInt iPitch; sl@0: sl@0: /** sl@0: * Array of logical {channel, MIP} value pairs to send SP-MIDI MIP message to the MIDI engine. sl@0: */ sl@0: const TArray* iMipMessage; sl@0: sl@0: /** sl@0: * The maximum number of notes that the MIDI engine supports simultaneously (polyphony). sl@0: */ sl@0: TInt iNumNotes; sl@0: sl@0: /** sl@0: * Max polyphony level: 0 <= PolyphonyL() <= iMaxNotes. sl@0: */ sl@0: TInt iMaxNotes; sl@0: sl@0: /** sl@0: * Overall volume of the MIDI client. sl@0: */ sl@0: TInt iVolume; sl@0: sl@0: /** sl@0: * Maximum volume that may be applied overall to the MIDI client. sl@0: */ sl@0: TInt iMaxVolume; sl@0: sl@0: /** sl@0: * Length of time over which the volume is faded up from zero to the current settings when playback is started. sl@0: */ sl@0: TTimeIntervalMicroSeconds iRampDuration; sl@0: sl@0: /** sl@0: * Stereo balance value: KMMFBalanceMaxLeft <= iBalance <= KMMFBalanceMaxRight. sl@0: */ sl@0: TInt iBalance; sl@0: sl@0: /** sl@0: * The number of times the current opened resources has to be repeated. sl@0: * This includes the first instance of playing. sl@0: */ sl@0: TInt iNumRepeats; sl@0: sl@0: /** sl@0: * Length of time over which the volume is faded out from the current settings to zero. sl@0: */ sl@0: TTimeIntervalMicroSeconds iFadeOutDuration; sl@0: }; sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: class TMMFMidiConfig2 sl@0: { sl@0: public: sl@0: inline TMMFMidiConfig2(); sl@0: public: sl@0: /** sl@0: * Index of the track to mute: 0 <= iTrack < NumTracksL(). sl@0: */ sl@0: TInt iTrack; sl@0: sl@0: /** sl@0: * ETrue to mute the track/channel, EFalse to unmute it. sl@0: */ sl@0: TBool iMuted; sl@0: sl@0: /** sl@0: * Note to play ot to terminate: 0 <= iNote <= 127. sl@0: */ sl@0: TInt iNote; sl@0: sl@0: /** sl@0: * Length of time to play the note for. sl@0: */ sl@0: TTimeIntervalMicroSeconds iDurationMicroSeconds; sl@0: sl@0: /** sl@0: * Specifying the time at which to start playing the note. sl@0: * It's relative to the MIDI resource playing time or the time elapsed sl@0: * since Play() was called if no resource is present. sl@0: */ sl@0: TTimeIntervalMicroSeconds iStartTime; sl@0: sl@0: /** sl@0: * Velocity with which to start the note: 0 <= iNoteOnVelocity <= 127. sl@0: */ sl@0: TInt iNoteOnVelocity; sl@0: sl@0: /** sl@0: * Velocity with which to stop the note: 0 <= iNoteOffVelocity <= 127. sl@0: */ sl@0: TInt iNoteOffVelocity; sl@0: sl@0: /** sl@0: * Number of standard or custom sound banks currently available. sl@0: */ sl@0: TInt iNumBanks; sl@0: sl@0: /** sl@0: * Specifies whether to reference a custom or standard sound bank. sl@0: */ sl@0: TBool iCustom; sl@0: sl@0: /** sl@0: * Index of custom/deault bank: 0 <= iBankIndex < NumberOfBanksL() sl@0: */ sl@0: TInt iBankIndex; sl@0: sl@0: /** sl@0: * Custom/deault Bank's Identifier. sl@0: */ sl@0: TInt iBankId; sl@0: sl@0: /** sl@0: * Identifier of the custom bank in memory. sl@0: */ sl@0: TInt iMemoryBankId; sl@0: sl@0: /** sl@0: * Name of the file containing the custom sound bank or the name sl@0: * of the file containing the instrument. Includes the directory path. sl@0: */ sl@0: const TDesC* iFileName; sl@0: sl@0: /** sl@0: * Descriptor containing the custom sound bank. sl@0: */ sl@0: const TDesC8* iBankData; sl@0: sl@0: /** sl@0: * Descriptor containing the instrument. sl@0: */ sl@0: const TDesC8* iInstrumentData; sl@0: sl@0: /** sl@0: * ETrue if the specified bank is in memory, EFalse otherwise. sl@0: */ sl@0: TBool iBankLoaded; sl@0: sl@0: /** sl@0: * Number of instruments available for the specified sound bank. sl@0: */ sl@0: TInt iNumInstruments; sl@0: sl@0: /** sl@0: * Index of the instrument to reference: 0 <= aInstrumentIndex < NumberOfInstrumentsL(). sl@0: */ sl@0: TInt iInstrumentIndex; sl@0: sl@0: /** sl@0: * Identifier of specified instrument. This may differ from the index sl@0: * since the index simply enumerates the instruments, whereas identifiers sl@0: * may not be contiguous, especially where certain instruments correspond sl@0: * to General MIDI-defined instruments but not all instruments are present. sl@0: * 0 <= iInstrumentId <= 127. sl@0: */ sl@0: TInt iInstrumentId; sl@0: sl@0: /** sl@0: * Identifier of the instrument in memory. sl@0: */ sl@0: TInt iMemoryInstrumentId; sl@0: sl@0: /** sl@0: * Current metrical position of the MIDI resource being played. sl@0: * Microbeats (BPM*1000000) relative to the start of the resource. sl@0: */ sl@0: TInt64 iPositionMicroBeats; sl@0: sl@0: /** sl@0: * Length of the currently open MIDI resource. sl@0: * Duration in microbeats (beats * 1000000). sl@0: */ sl@0: TInt64 iDurationMicroBeats; sl@0: sl@0: /** sl@0: * Time at which playback will stop, relative to the start of the resource. sl@0: * Clamped to 0 and the duration of the resource. sl@0: */ sl@0: TTimeIntervalMicroSeconds iStopTime; sl@0: sl@0: /** sl@0: * Logical channel: 0 <= iChannel < ChannelsSupportedL(). sl@0: */ sl@0: TInt iChannel; sl@0: sl@0: /** sl@0: * Volume level in dB corresponding to the MIDI Channel: sl@0: * -infinity <= iChannelVol <= MaxVolumeL(). sl@0: */ sl@0: TReal32 iChannelVol; sl@0: sl@0: /** sl@0: * Maximum volume setting in dB, should always be 0 dB and sl@0: * correspond to the MIDI Channel Volume controller maximum value. sl@0: */ sl@0: TReal32 iMaxChannelVol; sl@0: }; sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: class TMMFMidiConfig3 sl@0: { sl@0: public: sl@0: inline TMMFMidiConfig3(); sl@0: public: sl@0: /** sl@0: * Temporal interval between MmcuoSyncUpdate callback. sl@0: */ sl@0: TTimeIntervalMicroSeconds iCallbackIntervalMicroSeconds; sl@0: sl@0: /** sl@0: * Metrical interval between MmcuoSyncUpdate callback. sl@0: */ sl@0: TInt64 iCallbackIntervalMicroBeats; sl@0: sl@0: /** sl@0: * Number of bytes of the MIDI message buffer actually processed when client sl@0: * calls SendMessageL. sl@0: */ sl@0: TInt iBytesProcessed; sl@0: sl@0: /** sl@0: * Time at which to execute the MIDI message sent by SendMessageL. sl@0: * It's relative to the MIDI resource playing time or the time elapsed sl@0: * since Play() was called if no resource is present. sl@0: */ sl@0: TTimeIntervalMicroSeconds iTimeStamp; sl@0: sl@0: /** sl@0: * Number of time to repeat the resource during playback. This includes the first playing. sl@0: */ sl@0: TInt iRepeatNumberOfTimes; sl@0: sl@0: /** sl@0: * Time in microseconds to pause between repeats. sl@0: */ sl@0: TTimeIntervalMicroSeconds iTrailingSilence; sl@0: sl@0: /** sl@0: * Playback rate for the playback of the current MIDI resource sl@0: * in percent times 1000, i.e., 100000 means original playback speed, sl@0: * 200000 means double speed, and 50000 means half speed playback. sl@0: */ sl@0: TInt iPlayBackRate; sl@0: sl@0: /** sl@0: * Maximum playback rate supported by MIDI player. sl@0: */ sl@0: TInt iPlayBackMaxRate; sl@0: sl@0: /** sl@0: * Minimum playback rate supported by MIDI player. sl@0: */ sl@0: TInt iPlayBackMinRate; sl@0: sl@0: /** sl@0: * Descriptor containing a MIDI message data. If there sl@0: * are several MIDI messages in the buffer, only the first sl@0: * one is processed. sl@0: */ sl@0: const TDesC8* iMidiMessage; sl@0: }; sl@0: sl@0: inline TMMFMidiConfig1::TMMFMidiConfig1() sl@0: {}; sl@0: sl@0: inline TMMFMidiConfig2::TMMFMidiConfig2() sl@0: {}; sl@0: sl@0: inline TMMFMidiConfig3::TMMFMidiConfig3() sl@0: {}; sl@0: sl@0: #endif //__MMF_COMMON_MMFMIDI_CONFIG_H__