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: // williamr@2: williamr@2: #ifndef __MIDISTANDARDCUSTOMCOMMANDS_H__ williamr@2: #define __MIDISTANDARDCUSTOMCOMMANDS_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: Interface UID for the Midi Controller API. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: const TUid KUidInterfaceMidi = { 0x101F945C }; williamr@2: williamr@2: /** williamr@2: Describe a MIDI event. williamr@2: Contains a UID to define the actual event type, and an integer to define the event code. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CMMFMidiEvent: public CBase williamr@2: { williamr@2: public: williamr@2: IMPORT_C CMMFMidiEvent(TUid aEventType, TInt aErrorCode); williamr@2: IMPORT_C CMMFMidiEvent(); williamr@2: IMPORT_C ~CMMFMidiEvent(); williamr@2: IMPORT_C void ExternalizeL(RWriteStream& aStream) const; williamr@2: IMPORT_C void InternalizeL(RReadStream& aStream); williamr@2: IMPORT_C void CopyL(const CMMFMidiEvent& aOther); williamr@2: /** williamr@2: @internalTechnology williamr@2: */ williamr@2: void ZeroMembers(); williamr@2: public: williamr@2: /** williamr@2: * A UID to define the type of MIDI event. williamr@2: */ williamr@2: TUid iEventType; williamr@2: /** williamr@2: * The error code associated with the MIDI event. williamr@2: */ williamr@2: TInt iErrorCode; williamr@2: /** williamr@2: * Old state of the MIDI client utility object. williamr@2: */ williamr@2: TMidiState iOldState; williamr@2: /** williamr@2: * Current state of the MIDI client utility object. williamr@2: */ williamr@2: TMidiState iNewState; williamr@2: /** williamr@2: * General purpose time stamp in microseconds. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iMicroSeconds; williamr@2: /** williamr@2: * General purpose time stamp in micro beats per minute. williamr@2: */ williamr@2: TInt64 iMicroBeats; williamr@2: /** williamr@2: * Channel williamr@2: */ williamr@2: TInt iChannel; williamr@2: /** williamr@2: * Volume in decibel of a logical channel. williamr@2: */ williamr@2: TReal32 iVolumeInDecibels; williamr@2: /** williamr@2: * Mute state of a track or of a channel. williamr@2: */ williamr@2: TBool iMute; williamr@2: /** williamr@2: * Meta data entry. williamr@2: * Client will retrieve meta data entry by calling GetMetaDataEntryL() williamr@2: * using this TInt to indicate which meta data entry to retrieve. williamr@2: */ williamr@2: TInt iMetaDataEntryId; williamr@2: /** williamr@2: * Array of logical {channel, MIP} value pairs. williamr@2: */ williamr@2: RArray iMipMessage; williamr@2: /** williamr@2: * Polyphony of the MIDI engine. williamr@2: */ williamr@2: TInt iPolyphony; williamr@2: /** williamr@2: * Identifier of a bank occupying, at most, 14 bits. williamr@2: */ williamr@2: TInt iBankId; williamr@2: /** williamr@2: * Identifier of a specific instrument. williamr@2: */ williamr@2: TInt iInstrumentId; williamr@2: /** williamr@2: * Tempo value in micro beats per minute. williamr@2: */ williamr@2: TInt iTempoMicroBeats; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @internalComponent williamr@2: */ williamr@2: enum TMMFMidiControllerMessages williamr@2: { williamr@2: EMMFMidiControllerSetPositionMicroBeats, williamr@2: EMMFMidiControllerPositionMicroBeats, williamr@2: EMMFMidiControllerPlayNote, williamr@2: EMMFMidiControllerPlayNoteWithStartTime, williamr@2: EMMFMidiControllerStopNotes, williamr@2: EMMFMidiControllerNoteOn, williamr@2: EMMFMidiControllerNoteOff, williamr@2: EMMFMidiControllerPlaybackRate, williamr@2: EMMFMidiControllerSetPlaybackRate, williamr@2: EMMFMidiControllerMaxPlaybackRate, williamr@2: EMMFMidiControllerMinPlaybackRate, williamr@2: EMMFMidiControllerTempo, williamr@2: EMMFMidiControllerSetTempo, williamr@2: EMMFMidiControllerPitch, williamr@2: EMMFMidiControllerSetPitch, williamr@2: EMMFMidiControllerDurationMicroBeats, williamr@2: EMMFMidiControllerNumTracks, williamr@2: EMMFMidiControllerSetTrackMute, williamr@2: EMMFMidiControllerMimeType, williamr@2: EMMFMidiControllerSetSyncUpdateCallbackInterval, williamr@2: EMMFMidiControllerSendMessage, williamr@2: EMMFMidiControllerSendMessageWithTimeStamp, williamr@2: EMMFMidiControllerSendMipMessage, williamr@2: EMMFMidiControllerNumberOfBanks, williamr@2: EMMFMidiControllerGetBankId, williamr@2: EMMFMidiControllerLoadCustomBank, williamr@2: EMMFMidiControllerLoadCustomBankData, williamr@2: EMMFMidiControllerUnloadCustomBank, williamr@2: EMMFMidiControllerCustomBankLoaded, williamr@2: EMMFMidiControllerUnloadAllCustomBanks, williamr@2: EMMFMidiControllerNumberOfInstruments, williamr@2: EMMFMidiControllerGetInstrumentId, williamr@2: EMMFMidiControllerInstrumentName, williamr@2: EMMFMidiControllerCopyInstrumentName, williamr@2: EMMFMidiControllerSetInstrument, williamr@2: EMMFMidiControllerLoadCustomInstrument, williamr@2: EMMFMidiControllerLoadCustomInstrumentData, williamr@2: EMMFMidiControllerUnloadCustomInstrument, williamr@2: EMMFMidiControllerPercussionKeyName, williamr@2: EMMFMidiControllerCopyPercussionKeyName, williamr@2: EMMFMidiControllerSetStopTime, williamr@2: EMMFMidiControllerStopTime, williamr@2: EMMFMidiControllerPolyphony, williamr@2: EMMFMidiControllerSetMaxPolyphony, williamr@2: EMMFMidiControllerChannelsSupported, williamr@2: EMMFMidiControllerChannelVolume, williamr@2: EMMFMidiControllerMaxChannelVolume, williamr@2: EMMFMidiControllerSetChannelVolume, williamr@2: EMMFMidiControllerSetChannelMute, williamr@2: EMMFMidiControllerVolume, williamr@2: EMMFMidiControllerMaxVolume, williamr@2: EMMFMidiControllerSetVolume, williamr@2: EMMFMidiControllerSetVolumeRamp, williamr@2: EMMFMidiControllerGetBalance, williamr@2: EMMFMidiControllerSetBalance, williamr@2: EMMFMidiControllerGetRepeats, williamr@2: EMMFMidiControllerSetRepeats, williamr@2: EMMFMidiControllerSetBank, williamr@2: EMMFMidiControllerIsTrackMute, williamr@2: EMMFMidiControllerIsChannelMute, williamr@2: EMMFMidiControllerGetInstrument, williamr@2: EMMFMidiControllerClose, williamr@2: EMMFMidiControllerStop, williamr@2: EMMFMidiControllerReceiveEvents, williamr@2: EMMFMidiControllerRetrieveEvent, williamr@2: EMMFMidiControllerCancelReceiveEvents, williamr@2: EMMFMidiControllerMaxPolyphony williamr@2: }; williamr@2: williamr@2: /** williamr@2: Client class to access functionality specific to a MIDI controller. williamr@2: The class uses the custom command function of the controller plugin, and removes the necessity williamr@2: for the client to formulate the custom commands. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class RMidiControllerCustomCommands : public RMMFCustomCommandsBase williamr@2: { williamr@2: public: williamr@2: IMPORT_C RMidiControllerCustomCommands(RMMFController& aController); williamr@2: IMPORT_C TInt SetPositionMicroBeats(TInt64 aMicroBeats) const; williamr@2: IMPORT_C TInt PositionMicroBeats(TInt64& aMicroBeats) const; williamr@2: IMPORT_C TInt PlayNote(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity); williamr@2: IMPORT_C TInt PlayNote(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity); williamr@2: IMPORT_C TInt StopNotes(TInt aChannel); williamr@2: IMPORT_C TInt NoteOn(TInt aChannel,TInt aNote,TInt aVelocity); williamr@2: IMPORT_C TInt NoteOff(TInt aChannel,TInt aNote,TInt aVelocity); williamr@2: IMPORT_C TInt PlaybackRate(TInt& aPlayBackRate) const; williamr@2: IMPORT_C TInt SetPlaybackRate(TInt aPlayBackRate); williamr@2: IMPORT_C TInt MaxPlaybackRate(TInt& aMaxRate) const; williamr@2: IMPORT_C TInt MinPlaybackRate(TInt& aMinRate) const; williamr@2: IMPORT_C TInt TempoMicroBeatsPerMinute(TInt& aMicroBeatsPerMinute) const; williamr@2: IMPORT_C TInt SetTempo(TInt aMicroBeatsPerMinute); williamr@2: IMPORT_C TInt PitchTranspositionCents(TInt& aPitch) const; williamr@2: IMPORT_C TInt SetPitchTransposition(TInt aCents, TInt& aCentsApplied); williamr@2: IMPORT_C TInt DurationMicroBeats(TInt64& aDuration) const; williamr@2: IMPORT_C TInt NumTracks(TInt& aTracks) const; williamr@2: IMPORT_C TInt SetTrackMute(TInt aTrack, TBool aMuted) const; williamr@2: IMPORT_C TInt MimeType(TDes8& aMimeType) const; williamr@2: IMPORT_C TInt SetSyncUpdateCallbackInterval(const TTimeIntervalMicroSeconds& aMicroSeconds,TInt64 aMicroBeats=0); williamr@2: IMPORT_C TInt SendMessage(const TDesC8& aMidiMessage, TInt& aBytes); williamr@2: IMPORT_C TInt SendMessage(const TDesC8& aMidiMessage,const TTimeIntervalMicroSeconds& aTime, TInt& aBytes); williamr@2: IMPORT_C TInt SendMipMessage(const RArray& aEntry); williamr@2: IMPORT_C TInt NumberOfBanks(TBool aCustom, TInt& aNumBanks) const; williamr@2: IMPORT_C TInt GetBankId(TBool aCustom, TInt aBankIndex, TInt& aBankId) const; williamr@2: IMPORT_C TInt LoadCustomBank(const TDesC& aFileName,TInt& aBankId); williamr@2: IMPORT_C TInt LoadCustomBankData(const TDesC8& aBankData,TInt& aBankId); williamr@2: IMPORT_C TInt UnloadCustomBank(TInt aBankId); williamr@2: IMPORT_C TInt CustomBankLoaded(TInt aBankId, TBool& aBankLoaded) const; williamr@2: IMPORT_C TInt UnloadAllCustomBanks(); williamr@2: IMPORT_C TInt NumberOfInstruments(TInt aBankId, TBool aCustom, TInt& aNumInstruments) const; williamr@2: IMPORT_C TInt GetInstrumentId(TInt aBankId,TBool aCustom,TInt aInstrumentIndex, TInt& aInstrumentId) const; williamr@2: IMPORT_C HBufC* InstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) const; williamr@2: IMPORT_C TInt SetInstrument(TInt aChannel,TInt aBankId,TInt aInstrumentId); williamr@2: IMPORT_C TInt LoadCustomInstrument(const TDesC& aFileName, TInt aFileBankId, TInt aFileInstrumentId, TInt aMemoryBankId, TInt aMemoryInstrumentId); williamr@2: IMPORT_C TInt LoadCustomInstrumentData(const TDesC8& aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId); williamr@2: IMPORT_C TInt UnloadCustomInstrument(TInt aCustomBankId,TInt aInstrumentId); williamr@2: IMPORT_C HBufC* PercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) const; williamr@2: IMPORT_C TInt StopTime(TTimeIntervalMicroSeconds& aStopTime) const; williamr@2: IMPORT_C TInt SetStopTime(const TTimeIntervalMicroSeconds& aStopTime) const; williamr@2: IMPORT_C TInt Polyphony(TInt& aNumNotes) const; williamr@2: IMPORT_C TInt ChannelsSupported(TInt& aChannels) const; williamr@2: IMPORT_C TInt ChannelVolume(TInt aChannel, TReal32& aChannelVol) const; williamr@2: IMPORT_C TInt MaxChannelVolume(TReal32& aMaxVol) const; williamr@2: IMPORT_C TInt SetChannelVolume(TInt aChannel,TReal32 aVolume); williamr@2: IMPORT_C TInt SetChannelMute(TInt aChannel,TBool aMuted); williamr@2: IMPORT_C TInt Volume(TInt& aVolume) const; williamr@2: IMPORT_C TInt MaxVolume(TInt& aMaxVolume) const; williamr@2: IMPORT_C TInt SetVolume(TInt aVolume); williamr@2: IMPORT_C TInt SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration); williamr@2: IMPORT_C TInt GetBalance(TInt& aBalance) const; williamr@2: IMPORT_C TInt SetBalance(TInt aBalance); williamr@2: IMPORT_C TInt SetMaxPolyphony(TInt aMaxNotes); williamr@2: IMPORT_C TInt GetRepeats(TInt& aNumRepeats) const; williamr@2: IMPORT_C TInt SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence); williamr@2: IMPORT_C TInt SetBank(TBool aCustom); williamr@2: IMPORT_C TInt IsTrackMute(TInt aTrack, TBool& aTrackMute) const; williamr@2: IMPORT_C TInt IsChannelMute(TInt aChannel, TBool& aChannelMute) const; williamr@2: IMPORT_C TInt GetInstrument(TInt aChannel, TInt& aInstrumentId, TInt& aBankId); williamr@2: IMPORT_C TInt Close(); williamr@2: IMPORT_C TInt Stop(const TTimeIntervalMicroSeconds& aFadeOutDuration); williamr@2: IMPORT_C void ReceiveEvents(TPckgBuf& aEventSize, TRequestStatus& aStatus); williamr@2: IMPORT_C TInt RetrieveEvent(TDes8& aMidiEventPckg); williamr@2: IMPORT_C TInt CancelReceiveEvents(); williamr@2: IMPORT_C TInt MaxPolyphony(TInt& aNumNotes) const; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: Mixin class to be derived from by controller plugins wishing williamr@2: to support the MIDI controller custom commands. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MMidiCustomCommandImplementor williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Change the position of the currently playing MIDI resource to the given position. williamr@2: May be called whenever a MIDI resource is open. williamr@2: williamr@2: @param aMicroBeats williamr@2: Metrical position to move to. Clamped to (0, DurationMicroBeats()). williamr@2: */ williamr@2: virtual void MmcSetPositionMicroBeatsL(TInt64 aMicroBeats) = 0; williamr@2: /** williamr@2: Gets the current metrical position of the MIDI resource being played williamr@2: williamr@2: @param aMicroBeats williamr@2: (BPM*1000000) relative to the start of the resource williamr@2: */ williamr@2: virtual void MmcPositionMicroBeatsL(TInt64& aMicroBeats) = 0; williamr@2: /** williamr@2: Synchronous function to play a single note. williamr@2: Multiple calls to this function will be accommodated as far as the MIDI engine can williamr@2: manage. The same functionality could be implemented using the SendMessage function williamr@2: williamr@2: @param aChannel williamr@2: Logical channel to play note on. 0 <= aChannel <= 15. williamr@2: @param aNote williamr@2: Note to play. 0 <= aNote <= 127 williamr@2: @param aDuration williamr@2: Length of time to play note for. williamr@2: @param aNoteOnVelocity williamr@2: Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127. williamr@2: @param aNoteOffVelocity williamr@2: Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127. williamr@2: */ williamr@2: virtual void MmcPlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity) = 0; williamr@2: /** williamr@2: Synchronous function to play a single note at a specified time. williamr@2: Multiple calls to this function will be accommodated as far as the MIDI engine can williamr@2: manage. The same functionality could be implemented using the SendMessage function williamr@2: williamr@2: @param aChannel williamr@2: Logical channel to play note on. 0 <= aChannel <= 15. williamr@2: @param aNote williamr@2: Note to play. 0 <= aNote <= 127 williamr@2: @param aStartTime williamr@2: Specifies the time at which to start playing the note, relative to the MIDI williamr@2: resource playing time or the time elapsed since Play() was called if no resource is present. williamr@2: @param aDuration williamr@2: Length of time to play note for. williamr@2: @param aNoteOnVelocity williamr@2: Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127. williamr@2: @param aNoteOffVelocity williamr@2: Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127. williamr@2: */ williamr@2: virtual void MmcPlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity) = 0; williamr@2: /** williamr@2: Stops the playback of all notes on the given channel, williamr@2: by means of an All Notes Off MIDI message williamr@2: williamr@2: @param aChannel williamr@2: Logical channel to stop notes on. 0 <= aChannel <= 15 williamr@2: */ williamr@2: virtual void MmcStopNotesL(TInt aChannel) = 0; williamr@2: /** williamr@2: Synchronous function to commence playback of a note. williamr@2: Multiple calls to this function will be accommodated as far as the MIDI engine can manage williamr@2: williamr@2: @param aChannel williamr@2: Logical channel to play note on. 0 <= aChannel <= 15. williamr@2: @param aNote williamr@2: Note to play. 0 <= aNote <= 127. williamr@2: @param aVelocity williamr@2: Velocity with which to start the note. The legal integer range williamr@2: is 0 <= aVelocity <= 127, but the value zero actually causes the williamr@2: message to be interpreted as a Note Off message instead of a Note On. williamr@2: */ williamr@2: virtual void MmcNoteOnL(TInt aChannel,TInt aNote,TInt aVelocity) = 0; williamr@2: /** williamr@2: Synchronous function to terminate playback of a note. williamr@2: If no corresponding note is found then no error is raised williamr@2: williamr@2: @param aChannel williamr@2: Logical channel on which the note is playing. 0 <= aChannel <= 15. williamr@2: @param aNote williamr@2: Note to terminate. 0 <= aNote <= 127. williamr@2: @param aVelocity williamr@2: Velocity with which to stop the note. 0 <= aVelocity <= 127. williamr@2: There is no standard behaviour corresponding with note off velocity. williamr@2: */ williamr@2: virtual void MmcNoteOffL(TInt aChannel,TInt aNote,TInt aVelocity) = 0; williamr@2: /** williamr@2: Gets the current playback rate factor of the currently open MIDI resource. williamr@2: The playback rate is independent from tempo, williamr@2: i.e., it can be used to give an overall speed factor for playback. williamr@2: williamr@2: @param aPlayBackRate williamr@2: Current playback rate in percent times 1000, i.e., 100000 means original williamr@2: playback speed, 200000 means double speed, and 50000 means half speed playback. williamr@2: */ williamr@2: virtual void MmcPlaybackRateL(TInt& aPlayBackRate) = 0; williamr@2: /** williamr@2: Sets the playback rate for the playback of the current MIDI resource. williamr@2: The playback rate is independent from tempo, williamr@2: i.e., it can be used to give an overall speed factor for playback. williamr@2: May be called whether playback is in progress or not. williamr@2: williamr@2: @param aPlayBackRate williamr@2: Playback rate 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: virtual void MmcSetPlaybackRateL(TInt aPlayBackRate) = 0; williamr@2: /** williamr@2: Gets the maximum playback rate in milli-percentage from the MIDI engine. williamr@2: @see SetPlaybackRate() for milli-percentage details. williamr@2: williamr@2: @param aMaxRate williamr@2: Playback rate supported by MIDI player. williamr@2: */ williamr@2: virtual void MmcMaxPlaybackRateL(TInt& aMaxRate) = 0; williamr@2: /** williamr@2: Gets the minimum playback rate in milli-percentage from the MIDI engine. williamr@2: @see SetPlaybackRate() for milli-percentage details. williamr@2: williamr@2: @param aMinRate williamr@2: Minimum playback rate supported by MIDI player. williamr@2: */ williamr@2: virtual void MmcMinPlaybackRateL(TInt& aMinRate) = 0; williamr@2: /** williamr@2: Gets the current tempo of the currently open MIDI resource. The tempo is independent williamr@2: from the playback rate, i.e., the resulting playback speed will be affected by both. williamr@2: williamr@2: @param aMicroBeatsPerMinute williamr@2: Tempo at the current position of the currently open resource in microbeats williamr@2: per minute, i.e. BPM * 1000000. Filled in by the controller framework. williamr@2: */ williamr@2: virtual void MmcTempoMicroBeatsPerMinuteL(TInt& aMicroBeatsPerMinute) = 0; williamr@2: /** williamr@2: Sets the tempo at which the current MIDI resource should be played. williamr@2: May be called whether playback is in progress or not. The tempo is williamr@2: independent from the playback rate, i.e., the resulting playback speed williamr@2: will be affected by both. williamr@2: williamr@2: @param aMicroBeatsPerMinute williamr@2: Tempo in microbeats per minute (BPM*1000000) to set. williamr@2: */ williamr@2: virtual void MmcSetTempoL(TInt aMicroBeatsPerMinute) = 0; williamr@2: /** williamr@2: Gets the pitch shift in use for the currently open MIDI resource. williamr@2: williamr@2: @param aPitch williamr@2: Shift in cents, i.e. semitones * 100. One octave equals 1200 cents. williamr@2: @return One of the system-wide error codes. williamr@2: */ williamr@2: virtual void MmcPitchTranspositionCentsL(TInt& aPitch) = 0; williamr@2: /** williamr@2: Sets the pitch shift to apply to the currently open MIDI resource. williamr@2: May be called during playback. williamr@2: williamr@2: @param aCents williamr@2: Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents. williamr@2: @param aCentsApplied williamr@2: Actual pitch shift applied - may differ from the requested value due williamr@2: to limitations of the MIDI engine. williamr@2: */ williamr@2: virtual void MmcSetPitchTranspositionL(TInt aCents, TInt& aCentsApplied) = 0; williamr@2: /** williamr@2: Gets the length of the currently open MIDI resource in micro-beats williamr@2: williamr@2: @param aDuration williamr@2: Duration in microbeats (beats * 1000000). williamr@2: */ williamr@2: virtual void MmcDurationMicroBeatsL(TInt64& aDuration) = 0; williamr@2: /** williamr@2: Gets the number of tracks present in the currently open MIDI resource. williamr@2: williamr@2: @param aTracks williamr@2: Number of tracks. williamr@2: */ williamr@2: virtual void MmcNumTracksL(TInt& aTracks) = 0; williamr@2: /** williamr@2: Mutes or unmutes a particular track. williamr@2: williamr@2: @param aTrack williamr@2: Index of the track to mute - 0 <= aTrack < NumTracks(). williamr@2: @param aMuted williamr@2: ETrue to mute the track, EFalse to unmute it. williamr@2: */ williamr@2: virtual void MmcSetTrackMuteL(TInt aTrack, TBool aMuted) = 0; williamr@2: /** williamr@2: Gets the MIME type of the MIDI resource currently open. williamr@2: williamr@2: @param aMimeType williamr@2: Descriptor containing the MIDI mime type. williamr@2: */ williamr@2: virtual void MmcMimeTypeL(TDes8& aMimeType) = 0; williamr@2: /** williamr@2: Sets the frequency at which MMIDIClientUtilityObserver::MmcuoSyncUpdateL() is called williamr@2: to allow other components to synchronise with playback of this MIDI resource. williamr@2: williamr@2: @param aMicroSeconds williamr@2: Temporal interval to callback at. Used in preference to aMicroBeats if both are set. williamr@2: @param aMicroBeats williamr@2: Metrical interval to callback at. Set both parameters to zero to cancel. williamr@2: */ williamr@2: virtual void MmcSetSyncUpdateCallbackIntervalL(const TTimeIntervalMicroSeconds& aMicroSeconds,TInt64 aMicroBeats=0) = 0; williamr@2: /** williamr@2: Sends a single MIDI message to the MIDI engine. williamr@2: williamr@2: @param aMidiMessage williamr@2: Descriptor containing the MIDI message data. If there are several williamr@2: MIDI messages in the buffer, only the first one is processed. williamr@2: @param aBytes williamr@2: Number of bytes of the message buffer actually processed. williamr@2: */ williamr@2: virtual void MmcSendMessageL(const TDesC8& aMidiMessage, TInt& aBytes) = 0; williamr@2: /** williamr@2: Sends a single MIDI message, with time stamp, to the MIDI engine. williamr@2: williamr@2: @param aMidiMessage williamr@2: Descriptor containing the MIDI message data. If there are several williamr@2: MIDI messages in the buffer, only the first one is processed. williamr@2: @param aTime williamr@2: The time at which to execute the message, relative to the MIDI resource playing williamr@2: time or the time elapsed since Play() was called if no resource is present. williamr@2: @param aBytes williamr@2: Number of bytes of the message buffer actually processed. williamr@2: */ williamr@2: virtual void MmcSendMessageL(const TDesC8& aMidiMessage,const TTimeIntervalMicroSeconds& aTime, TInt& aBytes) = 0; williamr@2: /** williamr@2: Sends a mip message to the MIDI engine. This is a convenience function, williamr@2: because the same functionality could be achieved with the SendMessage() function. williamr@2: williamr@2: @param aEntry williamr@2: Array of logical {channel, MIP} value pairs to send, highest priority first. williamr@2: */ williamr@2: virtual void MmcSendMipMessageL(const TArray& aEntry) = 0; williamr@2: /** williamr@2: Gets the number of standard or custom sound banks currently available. williamr@2: williamr@2: @param aCustom williamr@2: Specifies whether to reference a custom or standard sound bank. williamr@2: @param aNumBanks williamr@2: Number of custom or standard sound banks available. williamr@2: */ williamr@2: virtual void MmcNumberOfBanksL(TBool aCustom, TInt& aNumBanks) = 0; williamr@2: /** williamr@2: Gets the identifier of a sound bank. Bank identifier (aka bank number) is a williamr@2: 14-bit value consisting of MIDI bank MSB and LSB values. williamr@2: williamr@2: @param aCustom williamr@2: Specifies whether to reference a custom or standard sound bank. williamr@2: @param aBankIndex williamr@2: Index of sound bank where 0 <= aBankIndex < NumberOfBanks(). williamr@2: @param aBankId williamr@2: Identifier of the specified bank occupying, at most, 14 bits. williamr@2: */ williamr@2: virtual void MmcGetBankIdL(TBool aCustom, TInt aBankIndex, TInt& aBankId) = 0; williamr@2: /** williamr@2: Loads one or more custom sound banks from a file into memory for use. williamr@2: If several banks are loaded with consequent LoadCustomBanksL() function calls, williamr@2: the banks are combined if the bank sets have conflicting bank numbers. williamr@2: williamr@2: @param aFileName williamr@2: Name of the file containing the custom sound bank. williamr@2: @param aBankId williamr@2: Identifier of the custom sound bank loaded, occupying no more than 14 bits. williamr@2: */ williamr@2: virtual void MmcLoadCustomBankL(const TDesC& aFileName,TInt& aBankId) = 0; williamr@2: /** williamr@2: Loads one or more custom sound banks from a descriptor into memory for use. williamr@2: If several banks are loaded with consequent LoadCustomBanksL() function calls, williamr@2: the banks are combined if the bank sets have conflicting bank numbers. williamr@2: williamr@2: @param aBankData williamr@2: Descriptor containing the custom sound bank. williamr@2: @param aBankId williamr@2: Identifier of the custom sound bank loaded, occupying no more than 14 bits. williamr@2: */ williamr@2: virtual void MmcLoadCustomBankDataL(const TDesC8& aBankData,TInt& aBankId) = 0; williamr@2: /** williamr@2: Removes a custom sound bank from memory. Only valid for sound banks previously williamr@2: loaded from file. Once unloaded the custom sound bank is no longer available for use. williamr@2: williamr@2: @param aBankId williamr@2: Identifier of the custom sound bank to unload,occupying no more than 14 bits. williamr@2: */ williamr@2: virtual void MmcUnloadCustomBankL(TInt aBankId) = 0; williamr@2: /** williamr@2: Query if a bank has been loaded to the memory. williamr@2: williamr@2: @param aBankId williamr@2: Identifier of the custom sound bank to check if it's in memory or not. williamr@2: @param aBankLoaded williamr@2: ETrue if the specified bank is in memory, EFalse otherwise. williamr@2: */ williamr@2: virtual void MmcCustomBankLoadedL(TInt aBankId, TBool& aBankLoaded) = 0; williamr@2: /** williamr@2: Removes all custom sound banks from memory. williamr@2: */ williamr@2: virtual void MmcUnloadAllCustomBanksL() = 0; williamr@2: /** williamr@2: Gets the number of instruments available in a given sound bank. williamr@2: williamr@2: @param aBankId williamr@2: Identifier of sound bank to reference, occupying no more than 14 bits. williamr@2: @param aCustom williamr@2: Specifies whether to reference a custom or standard sound bank. williamr@2: @param aNumInstruments williamr@2: Count of the number of instruments available for the specified sound bank. williamr@2: */ williamr@2: virtual void MmcNumberOfInstrumentsL(TInt aBankId, TBool aCustom, TInt& aNumInstruments) = 0; williamr@2: /** williamr@2: Gets the identifier of an instrument. williamr@2: williamr@2: @param aBankId williamr@2: Identifier of the sound bank to reference, occupying no more than 14 bits. williamr@2: @param aCustom williamr@2: Specifies whether to reference a custom or standard sound bank. williamr@2: @param aInstrumentIndex williamr@2: Index of the instrument to reference where 0 <= aInstrumentIndex < NumberOfInstrumentsL(). williamr@2: @param aInstrumentId williamr@2: Identifier of specified instrument. This may differ from the index since the williamr@2: index simply enumerates the instruments, whereas identifiers may not be williamr@2: contiguous, especially where certain instruments correspond to General MIDI-defined williamr@2: instruments but not all instruments are present. Instrument identifiers are williamr@2: between 0 and 127 inclusive. williamr@2: */ williamr@2: virtual void MmcGetInstrumentIdL(TInt aBankId,TBool aCustom,TInt aInstrumentIndex, TInt& aInstrumentId) = 0; williamr@2: /** williamr@2: Gets the name of the given instrument. williamr@2: williamr@2: @param aBankId williamr@2: Identifier of the bank that the instrument belongs to, occupying no more than 14 bits. williamr@2: @param aCustom williamr@2: Specifies whether to reference a custom or standard sound bank. williamr@2: @param aInstrumentId williamr@2: Identifier of the instrument under scrutiny. 0 <= aInstrumentId <= 127. williamr@2: @return Buffer containing the name of the specified instrument. williamr@2: If it has no name then an empty descriptor is returned. williamr@2: */ williamr@2: virtual const TDesC& MmcInstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) = 0; williamr@2: /** williamr@2: Sets a logical channel to use the given instrument. williamr@2: williamr@2: @param aChannel williamr@2: Logical channel to set the instrument for. 0 <= aChannel <= 15. williamr@2: @param aBankId williamr@2: Identifier of the bank that the instrument belongs to, occupying no more than 14 bits. williamr@2: The bank ID is a concatenation of MIDI bank MSB and LSB values. williamr@2: @param aInstrumentId williamr@2: Identifier of the instrument under scrutiny. 0 <= aInstrumentId <= 127. williamr@2: */ williamr@2: virtual void MmcSetInstrumentL(TInt aChannel,TInt aBankId,TInt aInstrumentId) = 0; williamr@2: /** williamr@2: Loads an individual instrument from file into custom sound bank memory for use. williamr@2: The bank and instrument ids given in the file can be mapped into different bank williamr@2: and instrument ids in memory. williamr@2: williamr@2: @param aFileName williamr@2: Name of the file containing the instrument. williamr@2: @param aFileBankId williamr@2: Identifier of the bank in the file from which to load the instrument, williamr@2: occupying no more than 14 bits. williamr@2: @param aFileInstrumentId williamr@2: Identifier of the instrument to load. 0 <= aInstrumentId <= 127. williamr@2: @param aMemoryBankId williamr@2: Identifier of the custom bank in memory to load the instrument into, williamr@2: occupying no more than 14 bits. williamr@2: @param aMemoryInstrumentId williamr@2: Identifier of the instrument in memory to load the new instrument into. williamr@2: 0 <= aInstrumentId <= 127. williamr@2: */ williamr@2: virtual void MmcLoadCustomInstrumentL(const TDesC& aFileName, TInt aFileBankId, TInt aFileInstrumentId, TInt aMemoryBankId, TInt aMemoryInstrumentId) = 0; williamr@2: /** williamr@2: Loads an individual instrument from descriptor into custom sound bank memory for use. williamr@2: The bank and instrument ids given in the descriptor can be mapped into different bank williamr@2: and instrument ids in memory. williamr@2: williamr@2: @param aInstrumentData williamr@2: Descriptor containing the instrument. williamr@2: @param aBankDataId williamr@2: Identifier of the bank in the descriptor from which to load the instrument, williamr@2: occupying no more than 14 bits. williamr@2: @param aInstrumentDataId williamr@2: Identifier of the instrument to load. 0 <= aInstrumentId <= 127. williamr@2: @param aMemoryBankId williamr@2: Identifier of the custom bank in memory to load the instrument into, williamr@2: occupying no more than 14 bits. williamr@2: @param aMemoryInstrumentId williamr@2: Identifier of the instrument in memory to load the new instrument into. williamr@2: 0 <= aInstrumentId <= 127. williamr@2: */ williamr@2: virtual void MmcLoadCustomInstrumentDataL(const TDesC8& aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId) = 0; williamr@2: /** williamr@2: Removes an instrument from custom sound bank memory. williamr@2: Only valid for instruments previously loaded from file. williamr@2: Once unloaded the instrument is no longer available for use. williamr@2: williamr@2: @param aCustomBankId williamr@2: Identifier of the custom sound bank containing the instrument williamr@2: to unload, occupying no more than 14 bits. williamr@2: @param aInstrumentId williamr@2: Identifier of the instrument to unload. 0 <= aInstrumentId <= 127. williamr@2: */ williamr@2: virtual void MmcUnloadCustomInstrumentL(TInt aCustomBankId,TInt aInstrumentId) = 0; williamr@2: /** williamr@2: Gets the name of a particular percussion key corresponding to a given note. williamr@2: williamr@2: @param aNote williamr@2: Note to query. 0 <= aNote <= 127. williamr@2: @param aBankId williamr@2: Identifier of the bank that the instrument belongs to, occupying no more than 14 bits. williamr@2: The bank ID is a concatenation of MIDI bank MSB and LSB values. williamr@2: @param aCustom williamr@2: Specifies whether to reference a custom or standard sound bank. williamr@2: @param aInstrumentId williamr@2: Identifier of an instrument. williamr@2: @return Descriptor containing the name of the percussion key. williamr@2: If the key does not have a name then an empty descriptor is returned. williamr@2: */ williamr@2: virtual const TDesC& MmcPercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) = 0; williamr@2: /** williamr@2: Get the stop time currently set for the MIDI resource. williamr@2: williamr@2: @param aStopTime williamr@2: Time at which playback will stop, relative to the start of the resource. williamr@2: @return Descriptor containing the name of the percussion key. If the key williamr@2: does not have a name then an empty descriptor is returned. williamr@2: */ williamr@2: virtual void MmcStopTimeL(TTimeIntervalMicroSeconds& aStopTime) = 0; williamr@2: /** williamr@2: Sets the stop time to use for the currently open MIDI resource williamr@2: williamr@2: @param aStopTime 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: virtual void MmcSetStopTimeL(const TTimeIntervalMicroSeconds& aStopTime) = 0; williamr@2: /** williamr@2: Gets the number of currently active voices. williamr@2: williamr@2: @param aNumNotes williamr@2: The number of currently active voices. williamr@2: */ williamr@2: virtual void MmcPolyphonyL(TInt& aNumNotes) = 0; williamr@2: /** williamr@2: Get the maximum number of logical channels supported by the MIDI engine. williamr@2: williamr@2: @param aChannels williamr@2: The maximum number of logical channels that the MIDI engine supports, 0 <= aChannels <=15. williamr@2: */ williamr@2: virtual void MmcChannelsSupportedL(TInt& aChannels) = 0; williamr@2: /** williamr@2: Get the current volume setting of a logical channel. williamr@2: williamr@2: @param aChannel williamr@2: Logical channel to query. 0 <= aChannel <= 15. williamr@2: @param aChannelVol williamr@2: Volume currently set on the specified channel in decibels. williamr@2: */ williamr@2: virtual void MmcChannelVolumeL(TInt aChannel, TReal32& aChannelVol) = 0; williamr@2: /** williamr@2: Gets the Maximum volume setting that may be applied to a logical channel. williamr@2: williamr@2: @param aMaxVol williamr@2: Maximum volume setting. Minimum value is -infinity dB, which is williamr@2: the smallest possible value that TReal32 supports. williamr@2: */ williamr@2: virtual void MmcMaxChannelVolumeL(TReal32& aMaxVol) = 0; williamr@2: /** williamr@2: Set the volume of a channel. williamr@2: williamr@2: @param aChannel williamr@2: Logical channel to set the volume on. 0 <= aChannel <= 15. williamr@2: @param aVolume williamr@2: The channel volume can be set within a range. The minimum channel williamr@2: volume is -infinity dB, which is the smallest possible value that williamr@2: TReal32 supports while the maximum channel volume is set via MaxVolumeL() williamr@2: which represents the volume level in dB corresponding to the MIDI Channel williamr@2: Volume controller. williamr@2: */ williamr@2: virtual void MmcSetChannelVolumeL(TInt aChannel,TReal32 aVolume) = 0; williamr@2: /** williamr@2: Set the muting state of a channel without changing its volume setting. williamr@2: When unmuted the channel goes back to its previous volume setting. williamr@2: williamr@2: @param aChannel williamr@2: Logical channel to set the mute state of. 0 <= aChannel <= 15. williamr@2: @param aMuted williamr@2: ETrue to mute the channel, EFalse to unmute it. williamr@2: */ williamr@2: virtual void MmcSetChannelMuteL(TInt aChannel,TBool aMuted) = 0; williamr@2: /** williamr@2: Gets the overall volume of the MIDI client. williamr@2: williamr@2: @param aVolume williamr@2: The current overall volume setting. williamr@2: */ williamr@2: virtual void MmcVolumeL(TInt& aVolume) = 0; williamr@2: /** williamr@2: Maximum volume setting that may be applied overall. williamr@2: williamr@2: @param aMaxVolume williamr@2: Maximum volume setting. Minimum value is always zero which is silent. williamr@2: */ williamr@2: virtual void MmcMaxVolumeL(TInt& aMaxVolume) = 0; williamr@2: /** williamr@2: Set the overall volume of the MIDI client. williamr@2: This setting scales all channel volumes respectively so the actual volume williamr@2: that a channel is played at becomes (overall volume * channel volume / max volume). williamr@2: williamr@2: @param aVolume Overall volume setting to use. williamr@2: */ williamr@2: virtual void MmcSetVolumeL(TInt aVolume) = 0; williamr@2: /** williamr@2: Length of time over which the volume is faded up from zero to the current settings williamr@2: when playback is started. williamr@2: williamr@2: @param aRampDuration williamr@2: Duration of the ramping period. williamr@2: */ williamr@2: virtual void MmcSetVolumeRampL(const TTimeIntervalMicroSeconds& aRampDuration) = 0; williamr@2: /** williamr@2: Get the current stereo balance value. williamr@2: williamr@2: @param aBalance williamr@2: Balance value ranging from KMMFBalanceMaxLeft to KMMFBalanceMaxRight. williamr@2: */ williamr@2: virtual void MmcGetBalanceL(TInt& aBalance) = 0; williamr@2: /** williamr@2: Set the current stereo balance value. williamr@2: williamr@2: @param aBalance williamr@2: Balance value to set. Defaults to KMMFBalanceCenter to restore equal left-right balance. williamr@2: */ williamr@2: virtual void MmcSetBalanceL(TInt aBalance) = 0; williamr@2: /** williamr@2: Set the max polyphony level the engine can handle. williamr@2: williamr@2: @param aMaxNotes williamr@2: Max polyphony level, 0 <= PolyphonyL() <= aMaxNotes. williamr@2: */ williamr@2: virtual void MmcSetMaxPolyphonyL(TInt aMaxNotes) = 0; williamr@2: /** williamr@2: Gets the number of times the current opened resources have to be repeated. williamr@2: williamr@2: @param aNumRepeats williamr@2: The number of time the current opened resources have to be repeated. williamr@2: */ williamr@2: virtual void MmcGetRepeatsL(TInt& aNumRepeats) = 0; williamr@2: /** williamr@2: Set the number of times to repeat the current MIDI resource. williamr@2: After Stop() has been called, repeat number of times and the trailing silence are reset. williamr@2: williamr@2: @param aRepeatNumberOfTimes williamr@2: Number of times to repeat the resource during playback. This includes the first playing. williamr@2: @param aTrailingSilence williamr@2: Time in microseconds to pause between repeats. williamr@2: */ williamr@2: virtual void MmcSetRepeatsL(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence) = 0; williamr@2: /** williamr@2: Tell the MIDI engine to use a custom bank or a standard bank. williamr@2: williamr@2: @param aCustom williamr@2: If Etrue the custom bank in memory is used otherwise the standard bank williamr@2: is used leaving the custom bank in memory. williamr@2: */ williamr@2: virtual void MmcSetBankL(TBool aCustom) = 0; williamr@2: /** williamr@2: Gets the muting status of a specific track. williamr@2: williamr@2: @param aTrack williamr@2: The track to query. williamr@2: @param aTrackMute williamr@2: The mute status of the track. williamr@2: */ williamr@2: virtual void MmcIsTrackMuteL(TInt aTrack, TBool& aTrackMute) = 0; williamr@2: /** williamr@2: Gets the muting status of a specific channel. williamr@2: williamr@2: @param aChannel williamr@2: The channel to query. williamr@2: @param aChannelMute williamr@2: The mute status of the channel. williamr@2: */ williamr@2: virtual void MmcIsChannelMuteL(TInt aChannel, TBool& aChannelMute) = 0; williamr@2: /** williamr@2: Gets the instrument assigned to a specified channel. williamr@2: williamr@2: @param aChannel williamr@2: Logical channel, 0 <= aChannel <= 15. williamr@2: @param aInstrumentId williamr@2: Identifier of the instrument assigned to aChannel. 0 <= aInstrumentId <= 127. williamr@2: @param aBankId williamr@2: Identifier of the bank that the instrument belongs to, occupying no more than 14 bits. williamr@2: */ williamr@2: virtual void MmcGetInstrumentL(TInt aChannel, TInt& aInstrumentId, TInt& aBankId) = 0; williamr@2: /** williamr@2: Closes any currently open resources, such as files, descriptors or URLs in use. williamr@2: Does nothing if there is nothing currently open. williamr@2: */ williamr@2: virtual void MmcCloseL() = 0; williamr@2: /** williamr@2: Stops playback of a resource but does not change the current position or release any resources. williamr@2: Pauses the internal timer if no resource is open. williamr@2: williamr@2: @param aFadeOutDuration williamr@2: Length of time over which the volume is faded out from the current settings to zero. williamr@2: */ williamr@2: virtual void MmcStopL(const TTimeIntervalMicroSeconds& aFadeOutDuration) = 0; williamr@2: /** williamr@2: Gets the max polyphony level the engine can handle. williamr@2: williamr@2: @param aNumNotes williamr@2: Max polyphony level, PolyphonyL() <= aMaxNotes. williamr@2: */ williamr@2: virtual void MmcMaxPolyphonyL(TInt& aMaxNotes) = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: @internalComponent williamr@2: */ williamr@2: class CMidiEventReceiver : public CBase williamr@2: { williamr@2: public: williamr@2: static CMidiEventReceiver* NewL(const TMMFMessage& aMessage); williamr@2: ~CMidiEventReceiver(); williamr@2: void PrepareEventL(const CMMFMidiEvent& aEvent); williamr@2: void SendEventL(TMMFMessage& aMessage); williamr@2: TBool IsWaitingToSendEvent(); williamr@2: private: williamr@2: CMidiEventReceiver(const TMMFMessage& aMessage); williamr@2: private: williamr@2: TMMFMessage iMessage; williamr@2: CBufFlat* iEventBuf; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: Mixin class to define an object capable of handling a MIDI event within the controller framework. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MMidiEventHandler williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Send an event to the client. williamr@2: williamr@2: @param aEvent williamr@2: The MIDI event. williamr@2: @return One of the system-wide error codes. williamr@2: */ williamr@2: virtual TInt SendMidiEventToClient(const CMMFMidiEvent& aEvent) = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: Custom command parser class to be used by controller plugins wishing to support williamr@2: MIDI controller commands. williamr@2: The controller plugin must be derived from MMidiCustomCommandImplementor williamr@2: to use this class. The controller plugin should create an object of this type and add williamr@2: it to the list of custom command parsers in the controller framework. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CMidiCustomCommandParser : public CMMFCustomCommandParserBase, williamr@2: public MMidiEventHandler williamr@2: { williamr@2: public: williamr@2: IMPORT_C static CMidiCustomCommandParser* NewL(MMidiCustomCommandImplementor& aImplementor); williamr@2: IMPORT_C ~CMidiCustomCommandParser(); williamr@2: /** williamr@2: @internalTechnology williamr@2: */ williamr@2: void HandleRequest(TMMFMessage& aMessage); williamr@2: virtual TInt SendMidiEventToClient(const CMMFMidiEvent& aEvent); williamr@2: private: williamr@2: CMidiCustomCommandParser(MMidiCustomCommandImplementor& aImplementor); williamr@2: // Internal request handling methods. williamr@2: void DoHandleRequestL(TMMFMessage& aMessage); williamr@2: williamr@2: TBool DoSetPositionMicroBeatsL(TMMFMessage& aMessage); williamr@2: TBool DoPositionMicroBeatsL(TMMFMessage& aMessage); williamr@2: TBool DoPlayNoteL(TMMFMessage& aMessage); williamr@2: TBool DoPlayNoteWithStartTimeL(TMMFMessage& aMessage); williamr@2: TBool DoStopNotesL(TMMFMessage& aMessage); williamr@2: TBool DoNoteOnL(TMMFMessage& aMessage); williamr@2: TBool DoNoteOffL(TMMFMessage& aMessage); williamr@2: TBool DoPlaybackRateL(TMMFMessage& aMessage); williamr@2: TBool DoSetPlaybackRateL(TMMFMessage& aMessage); williamr@2: TBool DoMaxPlaybackRateL(TMMFMessage& aMessage); williamr@2: TBool DoMinPlaybackRateL(TMMFMessage& aMessage); williamr@2: TBool DoTempoMicroBeatsPerMinuteL(TMMFMessage& aMessage); williamr@2: TBool DoSetTempoL(TMMFMessage& aMessage); williamr@2: TBool DoPitchTranspositionCentsL(TMMFMessage& aMessage); williamr@2: TBool DoSetPitchTranspositionL(TMMFMessage& aMessage); williamr@2: TBool DoDurationMicroBeatsL(TMMFMessage& aMessage); williamr@2: TBool DoNumTracksL(TMMFMessage& aMessage); williamr@2: TBool DoSetTrackMuteL(TMMFMessage& aMessage); williamr@2: TBool DoMimeTypeL(TMMFMessage& aMessage); williamr@2: TBool DoSetSyncUpdateCallbackIntervalL(TMMFMessage& aMessage); williamr@2: TBool DoSendMessageL(TMMFMessage& aMessage); williamr@2: TBool DoSendMessageWithTimeStampL(TMMFMessage& aMessage); williamr@2: TBool DoSendMipMessageL(TMMFMessage& aMessage); williamr@2: TBool DoNumberOfBanksL(TMMFMessage& aMessage); williamr@2: TBool DoGetBankIdL(TMMFMessage& aMessage); williamr@2: TBool DoLoadCustomBankL(TMMFMessage& aMessage); williamr@2: TBool DoLoadCustomBankDataL(TMMFMessage& aMessage); williamr@2: TBool DoUnloadCustomBankL(TMMFMessage& aMessage); williamr@2: TBool DoCustomBankLoadedL(TMMFMessage& aMessage); williamr@2: TBool DoUnloadAllCustomBanksL(TMMFMessage& aMessage); williamr@2: TBool DoNumberOfInstrumentsL(TMMFMessage& aMessage); williamr@2: TBool DoGetInstrumentIdL(TMMFMessage& aMessage); williamr@2: TBool DoInstrumentNameL(TMMFMessage& aMessage); williamr@2: TBool DoCopyInstrumentNameL(TMMFMessage& aMessage); williamr@2: TBool DoSetInstrumentL(TMMFMessage& aMessage); williamr@2: TBool DoLoadCustomInstrumentL(TMMFMessage& aMessage); williamr@2: TBool DoLoadCustomInstrumentDataL(TMMFMessage& aMessage); williamr@2: TBool DoUnloadCustomInstrumentL(TMMFMessage& aMessage); williamr@2: TBool DoPercussionKeyNameL(TMMFMessage& aMessage); williamr@2: TBool DoCopyPercussionKeyNameL(TMMFMessage& aMessage); williamr@2: TBool DoStopTimeL(TMMFMessage& aMessage); williamr@2: TBool DoSetStopTimeL(TMMFMessage& aMessage); williamr@2: TBool DoPolyphonyL(TMMFMessage& aMessage); williamr@2: TBool DoChannelsSupportedL(TMMFMessage& aMessage); williamr@2: TBool DoChannelVolumeL(TMMFMessage& aMessage); williamr@2: TBool DoMaxChannelVolumeL(TMMFMessage& aMessage); williamr@2: TBool DoSetChannelVolumeL(TMMFMessage& aMessage); williamr@2: TBool DoSetChannelMuteL(TMMFMessage& aMessage); williamr@2: TBool DoVolumeL(TMMFMessage& aMessage); williamr@2: TBool DoMaxVolumeL(TMMFMessage& aMessage); williamr@2: TBool DoSetVolumeL(TMMFMessage& aMessage); williamr@2: TBool DoSetVolumeRampL(TMMFMessage& aMessage); williamr@2: TBool DoGetBalanceL(TMMFMessage& aMessage); williamr@2: TBool DoSetBalanceL(TMMFMessage& aMessage); williamr@2: TBool DoSetMaxPolyphonyL(TMMFMessage& aMessage); williamr@2: TBool DoGetRepeatsL(TMMFMessage& aMessage); williamr@2: TBool DoSetRepeatsL(TMMFMessage& aMessage); williamr@2: TBool DoSetBankL(TMMFMessage& aMessage); williamr@2: TBool DoIsTrackMuteL(TMMFMessage& aMessage); williamr@2: TBool DoIsChannelMuteL(TMMFMessage& aMessage); williamr@2: TBool DoGetInstrumentL(TMMFMessage& aMessage); williamr@2: TBool DoCloseL(TMMFMessage& aMessage); williamr@2: TBool DoStopL(TMMFMessage& aMessage); williamr@2: TBool DoReceiveEventsL(TMMFMessage& aMessage); williamr@2: TBool DoRetrieveEventL(TMMFMessage& aMessage); williamr@2: TBool DoCancelReceiveEventsL(TMMFMessage& aMessage); williamr@2: williamr@2: void DoCreateBufFromUintArrayL(RArray& aArray); williamr@2: void DoCreateBufFromFourCCArrayL(RArray& aArray); williamr@2: TBool DoMaxPolyphonyL(TMMFMessage& aMessage); williamr@2: private: williamr@2: /** The object that implements the MIDI controller interface */ williamr@2: MMidiCustomCommandImplementor& iImplementor; williamr@2: williamr@2: CMidiEventReceiver* iMidiEventReceiver; williamr@2: /** The events waiting to be sent to the client.*/ williamr@2: RPointerArray iMidiEvents; williamr@2: williamr@2: // variable length data waiting to be copied back to the client williamr@2: CBufFlat* iInstrumentName; williamr@2: CBufFlat* iPercussionKeyName; williamr@2: }; williamr@2: williamr@2: #endif