1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mmf/common/midistandardcustomcommands.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,1045 @@
1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// 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
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __MIDISTANDARDCUSTOMCOMMANDS_H__
1.20 +#define __MIDISTANDARDCUSTOMCOMMANDS_H__
1.21 +
1.22 +#include <mmf/common/mmfcontroller.h>
1.23 +#include <midiclientutility.h>
1.24 +#include <mmf/common/mmfmidi.h>
1.25 +
1.26 +/**
1.27 +Interface UID for the Midi Controller API.
1.28 +
1.29 +@publishedAll
1.30 +@released
1.31 +*/
1.32 +const TUid KUidInterfaceMidi = { 0x101F945C };
1.33 +
1.34 +/**
1.35 +Describe a MIDI event.
1.36 +Contains a UID to define the actual event type, and an integer to define the event code.
1.37 +
1.38 +@publishedAll
1.39 +@released
1.40 +*/
1.41 +class CMMFMidiEvent: public CBase
1.42 + {
1.43 +public:
1.44 + IMPORT_C CMMFMidiEvent(TUid aEventType, TInt aErrorCode);
1.45 + IMPORT_C CMMFMidiEvent();
1.46 + IMPORT_C ~CMMFMidiEvent();
1.47 + IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
1.48 + IMPORT_C void InternalizeL(RReadStream& aStream);
1.49 + IMPORT_C void CopyL(const CMMFMidiEvent& aOther);
1.50 + /**
1.51 + @internalTechnology
1.52 + */
1.53 + void ZeroMembers();
1.54 +public:
1.55 + /**
1.56 + * A UID to define the type of MIDI event.
1.57 + */
1.58 + TUid iEventType;
1.59 + /**
1.60 + * The error code associated with the MIDI event.
1.61 + */
1.62 + TInt iErrorCode;
1.63 + /**
1.64 + * Old state of the MIDI client utility object.
1.65 + */
1.66 + TMidiState iOldState;
1.67 + /**
1.68 + * Current state of the MIDI client utility object.
1.69 + */
1.70 + TMidiState iNewState;
1.71 + /**
1.72 + * General purpose time stamp in microseconds.
1.73 + */
1.74 + TTimeIntervalMicroSeconds iMicroSeconds;
1.75 + /**
1.76 + * General purpose time stamp in micro beats per minute.
1.77 + */
1.78 + TInt64 iMicroBeats;
1.79 + /**
1.80 + * Channel
1.81 + */
1.82 + TInt iChannel;
1.83 + /**
1.84 + * Volume in decibel of a logical channel.
1.85 + */
1.86 + TReal32 iVolumeInDecibels;
1.87 + /**
1.88 + * Mute state of a track or of a channel.
1.89 + */
1.90 + TBool iMute;
1.91 + /**
1.92 + * Meta data entry.
1.93 + * Client will retrieve meta data entry by calling GetMetaDataEntryL()
1.94 + * using this TInt to indicate which meta data entry to retrieve.
1.95 + */
1.96 + TInt iMetaDataEntryId;
1.97 + /**
1.98 + * Array of logical {channel, MIP} value pairs.
1.99 + */
1.100 + RArray<TMipMessageEntry> iMipMessage;
1.101 + /**
1.102 + * Polyphony of the MIDI engine.
1.103 + */
1.104 + TInt iPolyphony;
1.105 + /**
1.106 + * Identifier of a bank occupying, at most, 14 bits.
1.107 + */
1.108 + TInt iBankId;
1.109 + /**
1.110 + * Identifier of a specific instrument.
1.111 + */
1.112 + TInt iInstrumentId;
1.113 + /**
1.114 + * Tempo value in micro beats per minute.
1.115 + */
1.116 + TInt iTempoMicroBeats;
1.117 + };
1.118 +
1.119 +/**
1.120 +@internalComponent
1.121 +*/
1.122 +enum TMMFMidiControllerMessages
1.123 + {
1.124 + EMMFMidiControllerSetPositionMicroBeats,
1.125 + EMMFMidiControllerPositionMicroBeats,
1.126 + EMMFMidiControllerPlayNote,
1.127 + EMMFMidiControllerPlayNoteWithStartTime,
1.128 + EMMFMidiControllerStopNotes,
1.129 + EMMFMidiControllerNoteOn,
1.130 + EMMFMidiControllerNoteOff,
1.131 + EMMFMidiControllerPlaybackRate,
1.132 + EMMFMidiControllerSetPlaybackRate,
1.133 + EMMFMidiControllerMaxPlaybackRate,
1.134 + EMMFMidiControllerMinPlaybackRate,
1.135 + EMMFMidiControllerTempo,
1.136 + EMMFMidiControllerSetTempo,
1.137 + EMMFMidiControllerPitch,
1.138 + EMMFMidiControllerSetPitch,
1.139 + EMMFMidiControllerDurationMicroBeats,
1.140 + EMMFMidiControllerNumTracks,
1.141 + EMMFMidiControllerSetTrackMute,
1.142 + EMMFMidiControllerMimeType,
1.143 + EMMFMidiControllerSetSyncUpdateCallbackInterval,
1.144 + EMMFMidiControllerSendMessage,
1.145 + EMMFMidiControllerSendMessageWithTimeStamp,
1.146 + EMMFMidiControllerSendMipMessage,
1.147 + EMMFMidiControllerNumberOfBanks,
1.148 + EMMFMidiControllerGetBankId,
1.149 + EMMFMidiControllerLoadCustomBank,
1.150 + EMMFMidiControllerLoadCustomBankData,
1.151 + EMMFMidiControllerUnloadCustomBank,
1.152 + EMMFMidiControllerCustomBankLoaded,
1.153 + EMMFMidiControllerUnloadAllCustomBanks,
1.154 + EMMFMidiControllerNumberOfInstruments,
1.155 + EMMFMidiControllerGetInstrumentId,
1.156 + EMMFMidiControllerInstrumentName,
1.157 + EMMFMidiControllerCopyInstrumentName,
1.158 + EMMFMidiControllerSetInstrument,
1.159 + EMMFMidiControllerLoadCustomInstrument,
1.160 + EMMFMidiControllerLoadCustomInstrumentData,
1.161 + EMMFMidiControllerUnloadCustomInstrument,
1.162 + EMMFMidiControllerPercussionKeyName,
1.163 + EMMFMidiControllerCopyPercussionKeyName,
1.164 + EMMFMidiControllerSetStopTime,
1.165 + EMMFMidiControllerStopTime,
1.166 + EMMFMidiControllerPolyphony,
1.167 + EMMFMidiControllerSetMaxPolyphony,
1.168 + EMMFMidiControllerChannelsSupported,
1.169 + EMMFMidiControllerChannelVolume,
1.170 + EMMFMidiControllerMaxChannelVolume,
1.171 + EMMFMidiControllerSetChannelVolume,
1.172 + EMMFMidiControllerSetChannelMute,
1.173 + EMMFMidiControllerVolume,
1.174 + EMMFMidiControllerMaxVolume,
1.175 + EMMFMidiControllerSetVolume,
1.176 + EMMFMidiControllerSetVolumeRamp,
1.177 + EMMFMidiControllerGetBalance,
1.178 + EMMFMidiControllerSetBalance,
1.179 + EMMFMidiControllerGetRepeats,
1.180 + EMMFMidiControllerSetRepeats,
1.181 + EMMFMidiControllerSetBank,
1.182 + EMMFMidiControllerIsTrackMute,
1.183 + EMMFMidiControllerIsChannelMute,
1.184 + EMMFMidiControllerGetInstrument,
1.185 + EMMFMidiControllerClose,
1.186 + EMMFMidiControllerStop,
1.187 + EMMFMidiControllerReceiveEvents,
1.188 + EMMFMidiControllerRetrieveEvent,
1.189 + EMMFMidiControllerCancelReceiveEvents,
1.190 + EMMFMidiControllerMaxPolyphony
1.191 + };
1.192 +
1.193 +/**
1.194 +Client class to access functionality specific to a MIDI controller.
1.195 +The class uses the custom command function of the controller plugin, and removes the necessity
1.196 +for the client to formulate the custom commands.
1.197 +
1.198 +@publishedAll
1.199 +@released
1.200 +*/
1.201 +class RMidiControllerCustomCommands : public RMMFCustomCommandsBase
1.202 + {
1.203 +public:
1.204 + IMPORT_C RMidiControllerCustomCommands(RMMFController& aController);
1.205 + IMPORT_C TInt SetPositionMicroBeats(TInt64 aMicroBeats) const;
1.206 + IMPORT_C TInt PositionMicroBeats(TInt64& aMicroBeats) const;
1.207 + IMPORT_C TInt PlayNote(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity);
1.208 + IMPORT_C TInt PlayNote(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity);
1.209 + IMPORT_C TInt StopNotes(TInt aChannel);
1.210 + IMPORT_C TInt NoteOn(TInt aChannel,TInt aNote,TInt aVelocity);
1.211 + IMPORT_C TInt NoteOff(TInt aChannel,TInt aNote,TInt aVelocity);
1.212 + IMPORT_C TInt PlaybackRate(TInt& aPlayBackRate) const;
1.213 + IMPORT_C TInt SetPlaybackRate(TInt aPlayBackRate);
1.214 + IMPORT_C TInt MaxPlaybackRate(TInt& aMaxRate) const;
1.215 + IMPORT_C TInt MinPlaybackRate(TInt& aMinRate) const;
1.216 + IMPORT_C TInt TempoMicroBeatsPerMinute(TInt& aMicroBeatsPerMinute) const;
1.217 + IMPORT_C TInt SetTempo(TInt aMicroBeatsPerMinute);
1.218 + IMPORT_C TInt PitchTranspositionCents(TInt& aPitch) const;
1.219 + IMPORT_C TInt SetPitchTransposition(TInt aCents, TInt& aCentsApplied);
1.220 + IMPORT_C TInt DurationMicroBeats(TInt64& aDuration) const;
1.221 + IMPORT_C TInt NumTracks(TInt& aTracks) const;
1.222 + IMPORT_C TInt SetTrackMute(TInt aTrack, TBool aMuted) const;
1.223 + IMPORT_C TInt MimeType(TDes8& aMimeType) const;
1.224 + IMPORT_C TInt SetSyncUpdateCallbackInterval(const TTimeIntervalMicroSeconds& aMicroSeconds,TInt64 aMicroBeats=0);
1.225 + IMPORT_C TInt SendMessage(const TDesC8& aMidiMessage, TInt& aBytes);
1.226 + IMPORT_C TInt SendMessage(const TDesC8& aMidiMessage,const TTimeIntervalMicroSeconds& aTime, TInt& aBytes);
1.227 + IMPORT_C TInt SendMipMessage(const RArray<TMipMessageEntry>& aEntry);
1.228 + IMPORT_C TInt NumberOfBanks(TBool aCustom, TInt& aNumBanks) const;
1.229 + IMPORT_C TInt GetBankId(TBool aCustom, TInt aBankIndex, TInt& aBankId) const;
1.230 + IMPORT_C TInt LoadCustomBank(const TDesC& aFileName,TInt& aBankId);
1.231 + IMPORT_C TInt LoadCustomBankData(const TDesC8& aBankData,TInt& aBankId);
1.232 + IMPORT_C TInt UnloadCustomBank(TInt aBankId);
1.233 + IMPORT_C TInt CustomBankLoaded(TInt aBankId, TBool& aBankLoaded) const;
1.234 + IMPORT_C TInt UnloadAllCustomBanks();
1.235 + IMPORT_C TInt NumberOfInstruments(TInt aBankId, TBool aCustom, TInt& aNumInstruments) const;
1.236 + IMPORT_C TInt GetInstrumentId(TInt aBankId,TBool aCustom,TInt aInstrumentIndex, TInt& aInstrumentId) const;
1.237 + IMPORT_C HBufC* InstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) const;
1.238 + IMPORT_C TInt SetInstrument(TInt aChannel,TInt aBankId,TInt aInstrumentId);
1.239 + IMPORT_C TInt LoadCustomInstrument(const TDesC& aFileName, TInt aFileBankId, TInt aFileInstrumentId, TInt aMemoryBankId, TInt aMemoryInstrumentId);
1.240 + IMPORT_C TInt LoadCustomInstrumentData(const TDesC8& aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId);
1.241 + IMPORT_C TInt UnloadCustomInstrument(TInt aCustomBankId,TInt aInstrumentId);
1.242 + IMPORT_C HBufC* PercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) const;
1.243 + IMPORT_C TInt StopTime(TTimeIntervalMicroSeconds& aStopTime) const;
1.244 + IMPORT_C TInt SetStopTime(const TTimeIntervalMicroSeconds& aStopTime) const;
1.245 + IMPORT_C TInt Polyphony(TInt& aNumNotes) const;
1.246 + IMPORT_C TInt ChannelsSupported(TInt& aChannels) const;
1.247 + IMPORT_C TInt ChannelVolume(TInt aChannel, TReal32& aChannelVol) const;
1.248 + IMPORT_C TInt MaxChannelVolume(TReal32& aMaxVol) const;
1.249 + IMPORT_C TInt SetChannelVolume(TInt aChannel,TReal32 aVolume);
1.250 + IMPORT_C TInt SetChannelMute(TInt aChannel,TBool aMuted);
1.251 + IMPORT_C TInt Volume(TInt& aVolume) const;
1.252 + IMPORT_C TInt MaxVolume(TInt& aMaxVolume) const;
1.253 + IMPORT_C TInt SetVolume(TInt aVolume);
1.254 + IMPORT_C TInt SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
1.255 + IMPORT_C TInt GetBalance(TInt& aBalance) const;
1.256 + IMPORT_C TInt SetBalance(TInt aBalance);
1.257 + IMPORT_C TInt SetMaxPolyphony(TInt aMaxNotes);
1.258 + IMPORT_C TInt GetRepeats(TInt& aNumRepeats) const;
1.259 + IMPORT_C TInt SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
1.260 + IMPORT_C TInt SetBank(TBool aCustom);
1.261 + IMPORT_C TInt IsTrackMute(TInt aTrack, TBool& aTrackMute) const;
1.262 + IMPORT_C TInt IsChannelMute(TInt aChannel, TBool& aChannelMute) const;
1.263 + IMPORT_C TInt GetInstrument(TInt aChannel, TInt& aInstrumentId, TInt& aBankId);
1.264 + IMPORT_C TInt Close();
1.265 + IMPORT_C TInt Stop(const TTimeIntervalMicroSeconds& aFadeOutDuration);
1.266 + IMPORT_C void ReceiveEvents(TPckgBuf<TInt>& aEventSize, TRequestStatus& aStatus);
1.267 + IMPORT_C TInt RetrieveEvent(TDes8& aMidiEventPckg);
1.268 + IMPORT_C TInt CancelReceiveEvents();
1.269 + IMPORT_C TInt MaxPolyphony(TInt& aNumNotes) const;
1.270 + };
1.271 +
1.272 +
1.273 +/**
1.274 +Mixin class to be derived from by controller plugins wishing
1.275 +to support the MIDI controller custom commands.
1.276 +
1.277 +@publishedAll
1.278 +@released
1.279 +*/
1.280 +class MMidiCustomCommandImplementor
1.281 + {
1.282 +public:
1.283 + /**
1.284 + Change the position of the currently playing MIDI resource to the given position.
1.285 + May be called whenever a MIDI resource is open.
1.286 +
1.287 + @param aMicroBeats
1.288 + Metrical position to move to. Clamped to (0, DurationMicroBeats()).
1.289 + */
1.290 + virtual void MmcSetPositionMicroBeatsL(TInt64 aMicroBeats) = 0;
1.291 + /**
1.292 + Gets the current metrical position of the MIDI resource being played
1.293 +
1.294 + @param aMicroBeats
1.295 + (BPM*1000000) relative to the start of the resource
1.296 + */
1.297 + virtual void MmcPositionMicroBeatsL(TInt64& aMicroBeats) = 0;
1.298 + /**
1.299 + Synchronous function to play a single note.
1.300 + Multiple calls to this function will be accommodated as far as the MIDI engine can
1.301 + manage. The same functionality could be implemented using the SendMessage function
1.302 +
1.303 + @param aChannel
1.304 + Logical channel to play note on. 0 <= aChannel <= 15.
1.305 + @param aNote
1.306 + Note to play. 0 <= aNote <= 127
1.307 + @param aDuration
1.308 + Length of time to play note for.
1.309 + @param aNoteOnVelocity
1.310 + Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127.
1.311 + @param aNoteOffVelocity
1.312 + Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.
1.313 + */
1.314 + virtual void MmcPlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity) = 0;
1.315 + /**
1.316 + Synchronous function to play a single note at a specified time.
1.317 + Multiple calls to this function will be accommodated as far as the MIDI engine can
1.318 + manage. The same functionality could be implemented using the SendMessage function
1.319 +
1.320 + @param aChannel
1.321 + Logical channel to play note on. 0 <= aChannel <= 15.
1.322 + @param aNote
1.323 + Note to play. 0 <= aNote <= 127
1.324 + @param aStartTime
1.325 + Specifies the time at which to start playing the note, relative to the MIDI
1.326 + resource playing time or the time elapsed since Play() was called if no resource is present.
1.327 + @param aDuration
1.328 + Length of time to play note for.
1.329 + @param aNoteOnVelocity
1.330 + Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127.
1.331 + @param aNoteOffVelocity
1.332 + Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.
1.333 + */
1.334 + virtual void MmcPlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity) = 0;
1.335 + /**
1.336 + Stops the playback of all notes on the given channel,
1.337 + by means of an All Notes Off MIDI message
1.338 +
1.339 + @param aChannel
1.340 + Logical channel to stop notes on. 0 <= aChannel <= 15
1.341 + */
1.342 + virtual void MmcStopNotesL(TInt aChannel) = 0;
1.343 + /**
1.344 + Synchronous function to commence playback of a note.
1.345 + Multiple calls to this function will be accommodated as far as the MIDI engine can manage
1.346 +
1.347 + @param aChannel
1.348 + Logical channel to play note on. 0 <= aChannel <= 15.
1.349 + @param aNote
1.350 + Note to play. 0 <= aNote <= 127.
1.351 + @param aVelocity
1.352 + Velocity with which to start the note. The legal integer range
1.353 + is 0 <= aVelocity <= 127, but the value zero actually causes the
1.354 + message to be interpreted as a Note Off message instead of a Note On.
1.355 + */
1.356 + virtual void MmcNoteOnL(TInt aChannel,TInt aNote,TInt aVelocity) = 0;
1.357 + /**
1.358 + Synchronous function to terminate playback of a note.
1.359 + If no corresponding note is found then no error is raised
1.360 +
1.361 + @param aChannel
1.362 + Logical channel on which the note is playing. 0 <= aChannel <= 15.
1.363 + @param aNote
1.364 + Note to terminate. 0 <= aNote <= 127.
1.365 + @param aVelocity
1.366 + Velocity with which to stop the note. 0 <= aVelocity <= 127.
1.367 + There is no standard behaviour corresponding with note off velocity.
1.368 + */
1.369 + virtual void MmcNoteOffL(TInt aChannel,TInt aNote,TInt aVelocity) = 0;
1.370 + /**
1.371 + Gets the current playback rate factor of the currently open MIDI resource.
1.372 + The playback rate is independent from tempo,
1.373 + i.e., it can be used to give an overall speed factor for playback.
1.374 +
1.375 + @param aPlayBackRate
1.376 + Current playback rate in percent times 1000, i.e., 100000 means original
1.377 + playback speed, 200000 means double speed, and 50000 means half speed playback.
1.378 + */
1.379 + virtual void MmcPlaybackRateL(TInt& aPlayBackRate) = 0;
1.380 + /**
1.381 + Sets the playback rate for the playback of the current MIDI resource.
1.382 + The playback rate is independent from tempo,
1.383 + i.e., it can be used to give an overall speed factor for playback.
1.384 + May be called whether playback is in progress or not.
1.385 +
1.386 + @param aPlayBackRate
1.387 + Playback rate in percent times 1000, i.e., 100000 means original playback speed,
1.388 + 200000 means double speed, and 50000 means half speed playback.
1.389 + */
1.390 + virtual void MmcSetPlaybackRateL(TInt aPlayBackRate) = 0;
1.391 + /**
1.392 + Gets the maximum playback rate in milli-percentage from the MIDI engine.
1.393 + @see SetPlaybackRate() for milli-percentage details.
1.394 +
1.395 + @param aMaxRate
1.396 + Playback rate supported by MIDI player.
1.397 + */
1.398 + virtual void MmcMaxPlaybackRateL(TInt& aMaxRate) = 0;
1.399 + /**
1.400 + Gets the minimum playback rate in milli-percentage from the MIDI engine.
1.401 + @see SetPlaybackRate() for milli-percentage details.
1.402 +
1.403 + @param aMinRate
1.404 + Minimum playback rate supported by MIDI player.
1.405 + */
1.406 + virtual void MmcMinPlaybackRateL(TInt& aMinRate) = 0;
1.407 + /**
1.408 + Gets the current tempo of the currently open MIDI resource. The tempo is independent
1.409 + from the playback rate, i.e., the resulting playback speed will be affected by both.
1.410 +
1.411 + @param aMicroBeatsPerMinute
1.412 + Tempo at the current position of the currently open resource in microbeats
1.413 + per minute, i.e. BPM * 1000000. Filled in by the controller framework.
1.414 + */
1.415 + virtual void MmcTempoMicroBeatsPerMinuteL(TInt& aMicroBeatsPerMinute) = 0;
1.416 + /**
1.417 + Sets the tempo at which the current MIDI resource should be played.
1.418 + May be called whether playback is in progress or not. The tempo is
1.419 + independent from the playback rate, i.e., the resulting playback speed
1.420 + will be affected by both.
1.421 +
1.422 + @param aMicroBeatsPerMinute
1.423 + Tempo in microbeats per minute (BPM*1000000) to set.
1.424 + */
1.425 + virtual void MmcSetTempoL(TInt aMicroBeatsPerMinute) = 0;
1.426 + /**
1.427 + Gets the pitch shift in use for the currently open MIDI resource.
1.428 +
1.429 + @param aPitch
1.430 + Shift in cents, i.e. semitones * 100. One octave equals 1200 cents.
1.431 + @return One of the system-wide error codes.
1.432 + */
1.433 + virtual void MmcPitchTranspositionCentsL(TInt& aPitch) = 0;
1.434 + /**
1.435 + Sets the pitch shift to apply to the currently open MIDI resource.
1.436 + May be called during playback.
1.437 +
1.438 + @param aCents
1.439 + Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents.
1.440 + @param aCentsApplied
1.441 + Actual pitch shift applied - may differ from the requested value due
1.442 + to limitations of the MIDI engine.
1.443 + */
1.444 + virtual void MmcSetPitchTranspositionL(TInt aCents, TInt& aCentsApplied) = 0;
1.445 + /**
1.446 + Gets the length of the currently open MIDI resource in micro-beats
1.447 +
1.448 + @param aDuration
1.449 + Duration in microbeats (beats * 1000000).
1.450 + */
1.451 + virtual void MmcDurationMicroBeatsL(TInt64& aDuration) = 0;
1.452 + /**
1.453 + Gets the number of tracks present in the currently open MIDI resource.
1.454 +
1.455 + @param aTracks
1.456 + Number of tracks.
1.457 + */
1.458 + virtual void MmcNumTracksL(TInt& aTracks) = 0;
1.459 + /**
1.460 + Mutes or unmutes a particular track.
1.461 +
1.462 + @param aTrack
1.463 + Index of the track to mute - 0 <= aTrack < NumTracks().
1.464 + @param aMuted
1.465 + ETrue to mute the track, EFalse to unmute it.
1.466 + */
1.467 + virtual void MmcSetTrackMuteL(TInt aTrack, TBool aMuted) = 0;
1.468 + /**
1.469 + Gets the MIME type of the MIDI resource currently open.
1.470 +
1.471 + @param aMimeType
1.472 + Descriptor containing the MIDI mime type.
1.473 + */
1.474 + virtual void MmcMimeTypeL(TDes8& aMimeType) = 0;
1.475 + /**
1.476 + Sets the frequency at which MMIDIClientUtilityObserver::MmcuoSyncUpdateL() is called
1.477 + to allow other components to synchronise with playback of this MIDI resource.
1.478 +
1.479 + @param aMicroSeconds
1.480 + Temporal interval to callback at. Used in preference to aMicroBeats if both are set.
1.481 + @param aMicroBeats
1.482 + Metrical interval to callback at. Set both parameters to zero to cancel.
1.483 + */
1.484 + virtual void MmcSetSyncUpdateCallbackIntervalL(const TTimeIntervalMicroSeconds& aMicroSeconds,TInt64 aMicroBeats=0) = 0;
1.485 + /**
1.486 + Sends a single MIDI message to the MIDI engine.
1.487 +
1.488 + @param aMidiMessage
1.489 + Descriptor containing the MIDI message data. If there are several
1.490 + MIDI messages in the buffer, only the first one is processed.
1.491 + @param aBytes
1.492 + Number of bytes of the message buffer actually processed.
1.493 + */
1.494 + virtual void MmcSendMessageL(const TDesC8& aMidiMessage, TInt& aBytes) = 0;
1.495 + /**
1.496 + Sends a single MIDI message, with time stamp, to the MIDI engine.
1.497 +
1.498 + @param aMidiMessage
1.499 + Descriptor containing the MIDI message data. If there are several
1.500 + MIDI messages in the buffer, only the first one is processed.
1.501 + @param aTime
1.502 + The time at which to execute the message, relative to the MIDI resource playing
1.503 + time or the time elapsed since Play() was called if no resource is present.
1.504 + @param aBytes
1.505 + Number of bytes of the message buffer actually processed.
1.506 + */
1.507 + virtual void MmcSendMessageL(const TDesC8& aMidiMessage,const TTimeIntervalMicroSeconds& aTime, TInt& aBytes) = 0;
1.508 + /**
1.509 + Sends a mip message to the MIDI engine. This is a convenience function,
1.510 + because the same functionality could be achieved with the SendMessage() function.
1.511 +
1.512 + @param aEntry
1.513 + Array of logical {channel, MIP} value pairs to send, highest priority first.
1.514 + */
1.515 + virtual void MmcSendMipMessageL(const TArray<TMipMessageEntry>& aEntry) = 0;
1.516 + /**
1.517 + Gets the number of standard or custom sound banks currently available.
1.518 +
1.519 + @param aCustom
1.520 + Specifies whether to reference a custom or standard sound bank.
1.521 + @param aNumBanks
1.522 + Number of custom or standard sound banks available.
1.523 + */
1.524 + virtual void MmcNumberOfBanksL(TBool aCustom, TInt& aNumBanks) = 0;
1.525 + /**
1.526 + Gets the identifier of a sound bank. Bank identifier (aka bank number) is a
1.527 + 14-bit value consisting of MIDI bank MSB and LSB values.
1.528 +
1.529 + @param aCustom
1.530 + Specifies whether to reference a custom or standard sound bank.
1.531 + @param aBankIndex
1.532 + Index of sound bank where 0 <= aBankIndex < NumberOfBanks().
1.533 + @param aBankId
1.534 + Identifier of the specified bank occupying, at most, 14 bits.
1.535 + */
1.536 + virtual void MmcGetBankIdL(TBool aCustom, TInt aBankIndex, TInt& aBankId) = 0;
1.537 + /**
1.538 + Loads one or more custom sound banks from a file into memory for use.
1.539 + If several banks are loaded with consequent LoadCustomBanksL() function calls,
1.540 + the banks are combined if the bank sets have conflicting bank numbers.
1.541 +
1.542 + @param aFileName
1.543 + Name of the file containing the custom sound bank.
1.544 + @param aBankId
1.545 + Identifier of the custom sound bank loaded, occupying no more than 14 bits.
1.546 + */
1.547 + virtual void MmcLoadCustomBankL(const TDesC& aFileName,TInt& aBankId) = 0;
1.548 + /**
1.549 + Loads one or more custom sound banks from a descriptor into memory for use.
1.550 + If several banks are loaded with consequent LoadCustomBanksL() function calls,
1.551 + the banks are combined if the bank sets have conflicting bank numbers.
1.552 +
1.553 + @param aBankData
1.554 + Descriptor containing the custom sound bank.
1.555 + @param aBankId
1.556 + Identifier of the custom sound bank loaded, occupying no more than 14 bits.
1.557 + */
1.558 + virtual void MmcLoadCustomBankDataL(const TDesC8& aBankData,TInt& aBankId) = 0;
1.559 + /**
1.560 + Removes a custom sound bank from memory. Only valid for sound banks previously
1.561 + loaded from file. Once unloaded the custom sound bank is no longer available for use.
1.562 +
1.563 + @param aBankId
1.564 + Identifier of the custom sound bank to unload,occupying no more than 14 bits.
1.565 + */
1.566 + virtual void MmcUnloadCustomBankL(TInt aBankId) = 0;
1.567 + /**
1.568 + Query if a bank has been loaded to the memory.
1.569 +
1.570 + @param aBankId
1.571 + Identifier of the custom sound bank to check if it's in memory or not.
1.572 + @param aBankLoaded
1.573 + ETrue if the specified bank is in memory, EFalse otherwise.
1.574 + */
1.575 + virtual void MmcCustomBankLoadedL(TInt aBankId, TBool& aBankLoaded) = 0;
1.576 + /**
1.577 + Removes all custom sound banks from memory.
1.578 + */
1.579 + virtual void MmcUnloadAllCustomBanksL() = 0;
1.580 + /**
1.581 + Gets the number of instruments available in a given sound bank.
1.582 +
1.583 + @param aBankId
1.584 + Identifier of sound bank to reference, occupying no more than 14 bits.
1.585 + @param aCustom
1.586 + Specifies whether to reference a custom or standard sound bank.
1.587 + @param aNumInstruments
1.588 + Count of the number of instruments available for the specified sound bank.
1.589 + */
1.590 + virtual void MmcNumberOfInstrumentsL(TInt aBankId, TBool aCustom, TInt& aNumInstruments) = 0;
1.591 + /**
1.592 + Gets the identifier of an instrument.
1.593 +
1.594 + @param aBankId
1.595 + Identifier of the sound bank to reference, occupying no more than 14 bits.
1.596 + @param aCustom
1.597 + Specifies whether to reference a custom or standard sound bank.
1.598 + @param aInstrumentIndex
1.599 + Index of the instrument to reference where 0 <= aInstrumentIndex < NumberOfInstrumentsL().
1.600 + @param aInstrumentId
1.601 + Identifier of specified instrument. This may differ from the index since the
1.602 + index simply enumerates the instruments, whereas identifiers may not be
1.603 + contiguous, especially where certain instruments correspond to General MIDI-defined
1.604 + instruments but not all instruments are present. Instrument identifiers are
1.605 + between 0 and 127 inclusive.
1.606 + */
1.607 + virtual void MmcGetInstrumentIdL(TInt aBankId,TBool aCustom,TInt aInstrumentIndex, TInt& aInstrumentId) = 0;
1.608 + /**
1.609 + Gets the name of the given instrument.
1.610 +
1.611 + @param aBankId
1.612 + Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
1.613 + @param aCustom
1.614 + Specifies whether to reference a custom or standard sound bank.
1.615 + @param aInstrumentId
1.616 + Identifier of the instrument under scrutiny. 0 <= aInstrumentId <= 127.
1.617 + @return Buffer containing the name of the specified instrument.
1.618 + If it has no name then an empty descriptor is returned.
1.619 + */
1.620 + virtual const TDesC& MmcInstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) = 0;
1.621 + /**
1.622 + Sets a logical channel to use the given instrument.
1.623 +
1.624 + @param aChannel
1.625 + Logical channel to set the instrument for. 0 <= aChannel <= 15.
1.626 + @param aBankId
1.627 + Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
1.628 + The bank ID is a concatenation of MIDI bank MSB and LSB values.
1.629 + @param aInstrumentId
1.630 + Identifier of the instrument under scrutiny. 0 <= aInstrumentId <= 127.
1.631 + */
1.632 + virtual void MmcSetInstrumentL(TInt aChannel,TInt aBankId,TInt aInstrumentId) = 0;
1.633 + /**
1.634 + Loads an individual instrument from file into custom sound bank memory for use.
1.635 + The bank and instrument ids given in the file can be mapped into different bank
1.636 + and instrument ids in memory.
1.637 +
1.638 + @param aFileName
1.639 + Name of the file containing the instrument.
1.640 + @param aFileBankId
1.641 + Identifier of the bank in the file from which to load the instrument,
1.642 + occupying no more than 14 bits.
1.643 + @param aFileInstrumentId
1.644 + Identifier of the instrument to load. 0 <= aInstrumentId <= 127.
1.645 + @param aMemoryBankId
1.646 + Identifier of the custom bank in memory to load the instrument into,
1.647 + occupying no more than 14 bits.
1.648 + @param aMemoryInstrumentId
1.649 + Identifier of the instrument in memory to load the new instrument into.
1.650 + 0 <= aInstrumentId <= 127.
1.651 + */
1.652 + virtual void MmcLoadCustomInstrumentL(const TDesC& aFileName, TInt aFileBankId, TInt aFileInstrumentId, TInt aMemoryBankId, TInt aMemoryInstrumentId) = 0;
1.653 + /**
1.654 + Loads an individual instrument from descriptor into custom sound bank memory for use.
1.655 + The bank and instrument ids given in the descriptor can be mapped into different bank
1.656 + and instrument ids in memory.
1.657 +
1.658 + @param aInstrumentData
1.659 + Descriptor containing the instrument.
1.660 + @param aBankDataId
1.661 + Identifier of the bank in the descriptor from which to load the instrument,
1.662 + occupying no more than 14 bits.
1.663 + @param aInstrumentDataId
1.664 + Identifier of the instrument to load. 0 <= aInstrumentId <= 127.
1.665 + @param aMemoryBankId
1.666 + Identifier of the custom bank in memory to load the instrument into,
1.667 + occupying no more than 14 bits.
1.668 + @param aMemoryInstrumentId
1.669 + Identifier of the instrument in memory to load the new instrument into.
1.670 + 0 <= aInstrumentId <= 127.
1.671 + */
1.672 + virtual void MmcLoadCustomInstrumentDataL(const TDesC8& aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId) = 0;
1.673 + /**
1.674 + Removes an instrument from custom sound bank memory.
1.675 + Only valid for instruments previously loaded from file.
1.676 + Once unloaded the instrument is no longer available for use.
1.677 +
1.678 + @param aCustomBankId
1.679 + Identifier of the custom sound bank containing the instrument
1.680 + to unload, occupying no more than 14 bits.
1.681 + @param aInstrumentId
1.682 + Identifier of the instrument to unload. 0 <= aInstrumentId <= 127.
1.683 + */
1.684 + virtual void MmcUnloadCustomInstrumentL(TInt aCustomBankId,TInt aInstrumentId) = 0;
1.685 + /**
1.686 + Gets the name of a particular percussion key corresponding to a given note.
1.687 +
1.688 + @param aNote
1.689 + Note to query. 0 <= aNote <= 127.
1.690 + @param aBankId
1.691 + Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
1.692 + The bank ID is a concatenation of MIDI bank MSB and LSB values.
1.693 + @param aCustom
1.694 + Specifies whether to reference a custom or standard sound bank.
1.695 + @param aInstrumentId
1.696 + Identifier of an instrument.
1.697 + @return Descriptor containing the name of the percussion key.
1.698 + If the key does not have a name then an empty descriptor is returned.
1.699 + */
1.700 + virtual const TDesC& MmcPercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) = 0;
1.701 + /**
1.702 + Get the stop time currently set for the MIDI resource.
1.703 +
1.704 + @param aStopTime
1.705 + Time at which playback will stop, relative to the start of the resource.
1.706 + @return Descriptor containing the name of the percussion key. If the key
1.707 + does not have a name then an empty descriptor is returned.
1.708 + */
1.709 + virtual void MmcStopTimeL(TTimeIntervalMicroSeconds& aStopTime) = 0;
1.710 + /**
1.711 + Sets the stop time to use for the currently open MIDI resource
1.712 +
1.713 + @param aStopTime
1.714 + Time at which playback will stop, relative to the start of the resource.
1.715 + Clamped to 0 and the duration of the resource.
1.716 + */
1.717 + virtual void MmcSetStopTimeL(const TTimeIntervalMicroSeconds& aStopTime) = 0;
1.718 + /**
1.719 + Gets the number of currently active voices.
1.720 +
1.721 + @param aNumNotes
1.722 + The number of currently active voices.
1.723 + */
1.724 + virtual void MmcPolyphonyL(TInt& aNumNotes) = 0;
1.725 + /**
1.726 + Get the maximum number of logical channels supported by the MIDI engine.
1.727 +
1.728 + @param aChannels
1.729 + The maximum number of logical channels that the MIDI engine supports, 0 <= aChannels <=15.
1.730 + */
1.731 + virtual void MmcChannelsSupportedL(TInt& aChannels) = 0;
1.732 + /**
1.733 + Get the current volume setting of a logical channel.
1.734 +
1.735 + @param aChannel
1.736 + Logical channel to query. 0 <= aChannel <= 15.
1.737 + @param aChannelVol
1.738 + Volume currently set on the specified channel in decibels.
1.739 + */
1.740 + virtual void MmcChannelVolumeL(TInt aChannel, TReal32& aChannelVol) = 0;
1.741 + /**
1.742 + Gets the Maximum volume setting that may be applied to a logical channel.
1.743 +
1.744 + @param aMaxVol
1.745 + Maximum volume setting. Minimum value is -infinity dB, which is
1.746 + the smallest possible value that TReal32 supports.
1.747 + */
1.748 + virtual void MmcMaxChannelVolumeL(TReal32& aMaxVol) = 0;
1.749 + /**
1.750 + Set the volume of a channel.
1.751 +
1.752 + @param aChannel
1.753 + Logical channel to set the volume on. 0 <= aChannel <= 15.
1.754 + @param aVolume
1.755 + The channel volume can be set within a range. The minimum channel
1.756 + volume is -infinity dB, which is the smallest possible value that
1.757 + TReal32 supports while the maximum channel volume is set via MaxVolumeL()
1.758 + which represents the volume level in dB corresponding to the MIDI Channel
1.759 + Volume controller.
1.760 + */
1.761 + virtual void MmcSetChannelVolumeL(TInt aChannel,TReal32 aVolume) = 0;
1.762 + /**
1.763 + Set the muting state of a channel without changing its volume setting.
1.764 + When unmuted the channel goes back to its previous volume setting.
1.765 +
1.766 + @param aChannel
1.767 + Logical channel to set the mute state of. 0 <= aChannel <= 15.
1.768 + @param aMuted
1.769 + ETrue to mute the channel, EFalse to unmute it.
1.770 + */
1.771 + virtual void MmcSetChannelMuteL(TInt aChannel,TBool aMuted) = 0;
1.772 + /**
1.773 + Gets the overall volume of the MIDI client.
1.774 +
1.775 + @param aVolume
1.776 + The current overall volume setting.
1.777 + */
1.778 + virtual void MmcVolumeL(TInt& aVolume) = 0;
1.779 + /**
1.780 + Maximum volume setting that may be applied overall.
1.781 +
1.782 + @param aMaxVolume
1.783 + Maximum volume setting. Minimum value is always zero which is silent.
1.784 + */
1.785 + virtual void MmcMaxVolumeL(TInt& aMaxVolume) = 0;
1.786 + /**
1.787 + Set the overall volume of the MIDI client.
1.788 + This setting scales all channel volumes respectively so the actual volume
1.789 + that a channel is played at becomes (overall volume * channel volume / max volume).
1.790 +
1.791 + @param aVolume Overall volume setting to use.
1.792 + */
1.793 + virtual void MmcSetVolumeL(TInt aVolume) = 0;
1.794 + /**
1.795 + Length of time over which the volume is faded up from zero to the current settings
1.796 + when playback is started.
1.797 +
1.798 + @param aRampDuration
1.799 + Duration of the ramping period.
1.800 + */
1.801 + virtual void MmcSetVolumeRampL(const TTimeIntervalMicroSeconds& aRampDuration) = 0;
1.802 + /**
1.803 + Get the current stereo balance value.
1.804 +
1.805 + @param aBalance
1.806 + Balance value ranging from KMMFBalanceMaxLeft to KMMFBalanceMaxRight.
1.807 + */
1.808 + virtual void MmcGetBalanceL(TInt& aBalance) = 0;
1.809 + /**
1.810 + Set the current stereo balance value.
1.811 +
1.812 + @param aBalance
1.813 + Balance value to set. Defaults to KMMFBalanceCenter to restore equal left-right balance.
1.814 + */
1.815 + virtual void MmcSetBalanceL(TInt aBalance) = 0;
1.816 + /**
1.817 + Set the max polyphony level the engine can handle.
1.818 +
1.819 + @param aMaxNotes
1.820 + Max polyphony level, 0 <= PolyphonyL() <= aMaxNotes.
1.821 + */
1.822 + virtual void MmcSetMaxPolyphonyL(TInt aMaxNotes) = 0;
1.823 + /**
1.824 + Gets the number of times the current opened resources have to be repeated.
1.825 +
1.826 + @param aNumRepeats
1.827 + The number of time the current opened resources have to be repeated.
1.828 + */
1.829 + virtual void MmcGetRepeatsL(TInt& aNumRepeats) = 0;
1.830 + /**
1.831 + Set the number of times to repeat the current MIDI resource.
1.832 + After Stop() has been called, repeat number of times and the trailing silence are reset.
1.833 +
1.834 + @param aRepeatNumberOfTimes
1.835 + Number of times to repeat the resource during playback. This includes the first playing.
1.836 + @param aTrailingSilence
1.837 + Time in microseconds to pause between repeats.
1.838 + */
1.839 + virtual void MmcSetRepeatsL(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence) = 0;
1.840 + /**
1.841 + Tell the MIDI engine to use a custom bank or a standard bank.
1.842 +
1.843 + @param aCustom
1.844 + If Etrue the custom bank in memory is used otherwise the standard bank
1.845 + is used leaving the custom bank in memory.
1.846 + */
1.847 + virtual void MmcSetBankL(TBool aCustom) = 0;
1.848 + /**
1.849 + Gets the muting status of a specific track.
1.850 +
1.851 + @param aTrack
1.852 + The track to query.
1.853 + @param aTrackMute
1.854 + The mute status of the track.
1.855 + */
1.856 + virtual void MmcIsTrackMuteL(TInt aTrack, TBool& aTrackMute) = 0;
1.857 + /**
1.858 + Gets the muting status of a specific channel.
1.859 +
1.860 + @param aChannel
1.861 + The channel to query.
1.862 + @param aChannelMute
1.863 + The mute status of the channel.
1.864 + */
1.865 + virtual void MmcIsChannelMuteL(TInt aChannel, TBool& aChannelMute) = 0;
1.866 + /**
1.867 + Gets the instrument assigned to a specified channel.
1.868 +
1.869 + @param aChannel
1.870 + Logical channel, 0 <= aChannel <= 15.
1.871 + @param aInstrumentId
1.872 + Identifier of the instrument assigned to aChannel. 0 <= aInstrumentId <= 127.
1.873 + @param aBankId
1.874 + Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
1.875 + */
1.876 + virtual void MmcGetInstrumentL(TInt aChannel, TInt& aInstrumentId, TInt& aBankId) = 0;
1.877 + /**
1.878 + Closes any currently open resources, such as files, descriptors or URLs in use.
1.879 + Does nothing if there is nothing currently open.
1.880 + */
1.881 + virtual void MmcCloseL() = 0;
1.882 + /**
1.883 + Stops playback of a resource but does not change the current position or release any resources.
1.884 + Pauses the internal timer if no resource is open.
1.885 +
1.886 + @param aFadeOutDuration
1.887 + Length of time over which the volume is faded out from the current settings to zero.
1.888 + */
1.889 + virtual void MmcStopL(const TTimeIntervalMicroSeconds& aFadeOutDuration) = 0;
1.890 + /**
1.891 + Gets the max polyphony level the engine can handle.
1.892 +
1.893 + @param aNumNotes
1.894 + Max polyphony level, PolyphonyL() <= aMaxNotes.
1.895 + */
1.896 + virtual void MmcMaxPolyphonyL(TInt& aMaxNotes) = 0;
1.897 + };
1.898 +
1.899 +
1.900 +/**
1.901 +@internalComponent
1.902 +*/
1.903 +class CMidiEventReceiver : public CBase
1.904 + {
1.905 +public:
1.906 + static CMidiEventReceiver* NewL(const TMMFMessage& aMessage);
1.907 + ~CMidiEventReceiver();
1.908 + void PrepareEventL(const CMMFMidiEvent& aEvent);
1.909 + void SendEventL(TMMFMessage& aMessage);
1.910 + TBool IsWaitingToSendEvent();
1.911 +private:
1.912 + CMidiEventReceiver(const TMMFMessage& aMessage);
1.913 +private:
1.914 + TMMFMessage iMessage;
1.915 + CBufFlat* iEventBuf;
1.916 + };
1.917 +
1.918 +
1.919 +/**
1.920 +Mixin class to define an object capable of handling a MIDI event within the controller framework.
1.921 +
1.922 +@publishedAll
1.923 +@released
1.924 +*/
1.925 +class MMidiEventHandler
1.926 + {
1.927 +public:
1.928 + /**
1.929 + Send an event to the client.
1.930 +
1.931 + @param aEvent
1.932 + The MIDI event.
1.933 + @return One of the system-wide error codes.
1.934 + */
1.935 + virtual TInt SendMidiEventToClient(const CMMFMidiEvent& aEvent) = 0;
1.936 + };
1.937 +
1.938 +
1.939 +/**
1.940 +Custom command parser class to be used by controller plugins wishing to support
1.941 +MIDI controller commands.
1.942 +The controller plugin must be derived from MMidiCustomCommandImplementor
1.943 +to use this class. The controller plugin should create an object of this type and add
1.944 +it to the list of custom command parsers in the controller framework.
1.945 +
1.946 +@publishedAll
1.947 +@released
1.948 +*/
1.949 +class CMidiCustomCommandParser : public CMMFCustomCommandParserBase,
1.950 + public MMidiEventHandler
1.951 + {
1.952 +public:
1.953 + IMPORT_C static CMidiCustomCommandParser* NewL(MMidiCustomCommandImplementor& aImplementor);
1.954 + IMPORT_C ~CMidiCustomCommandParser();
1.955 + /**
1.956 + @internalTechnology
1.957 + */
1.958 + void HandleRequest(TMMFMessage& aMessage);
1.959 + virtual TInt SendMidiEventToClient(const CMMFMidiEvent& aEvent);
1.960 +private:
1.961 + CMidiCustomCommandParser(MMidiCustomCommandImplementor& aImplementor);
1.962 + // Internal request handling methods.
1.963 + void DoHandleRequestL(TMMFMessage& aMessage);
1.964 +
1.965 + TBool DoSetPositionMicroBeatsL(TMMFMessage& aMessage);
1.966 + TBool DoPositionMicroBeatsL(TMMFMessage& aMessage);
1.967 + TBool DoPlayNoteL(TMMFMessage& aMessage);
1.968 + TBool DoPlayNoteWithStartTimeL(TMMFMessage& aMessage);
1.969 + TBool DoStopNotesL(TMMFMessage& aMessage);
1.970 + TBool DoNoteOnL(TMMFMessage& aMessage);
1.971 + TBool DoNoteOffL(TMMFMessage& aMessage);
1.972 + TBool DoPlaybackRateL(TMMFMessage& aMessage);
1.973 + TBool DoSetPlaybackRateL(TMMFMessage& aMessage);
1.974 + TBool DoMaxPlaybackRateL(TMMFMessage& aMessage);
1.975 + TBool DoMinPlaybackRateL(TMMFMessage& aMessage);
1.976 + TBool DoTempoMicroBeatsPerMinuteL(TMMFMessage& aMessage);
1.977 + TBool DoSetTempoL(TMMFMessage& aMessage);
1.978 + TBool DoPitchTranspositionCentsL(TMMFMessage& aMessage);
1.979 + TBool DoSetPitchTranspositionL(TMMFMessage& aMessage);
1.980 + TBool DoDurationMicroBeatsL(TMMFMessage& aMessage);
1.981 + TBool DoNumTracksL(TMMFMessage& aMessage);
1.982 + TBool DoSetTrackMuteL(TMMFMessage& aMessage);
1.983 + TBool DoMimeTypeL(TMMFMessage& aMessage);
1.984 + TBool DoSetSyncUpdateCallbackIntervalL(TMMFMessage& aMessage);
1.985 + TBool DoSendMessageL(TMMFMessage& aMessage);
1.986 + TBool DoSendMessageWithTimeStampL(TMMFMessage& aMessage);
1.987 + TBool DoSendMipMessageL(TMMFMessage& aMessage);
1.988 + TBool DoNumberOfBanksL(TMMFMessage& aMessage);
1.989 + TBool DoGetBankIdL(TMMFMessage& aMessage);
1.990 + TBool DoLoadCustomBankL(TMMFMessage& aMessage);
1.991 + TBool DoLoadCustomBankDataL(TMMFMessage& aMessage);
1.992 + TBool DoUnloadCustomBankL(TMMFMessage& aMessage);
1.993 + TBool DoCustomBankLoadedL(TMMFMessage& aMessage);
1.994 + TBool DoUnloadAllCustomBanksL(TMMFMessage& aMessage);
1.995 + TBool DoNumberOfInstrumentsL(TMMFMessage& aMessage);
1.996 + TBool DoGetInstrumentIdL(TMMFMessage& aMessage);
1.997 + TBool DoInstrumentNameL(TMMFMessage& aMessage);
1.998 + TBool DoCopyInstrumentNameL(TMMFMessage& aMessage);
1.999 + TBool DoSetInstrumentL(TMMFMessage& aMessage);
1.1000 + TBool DoLoadCustomInstrumentL(TMMFMessage& aMessage);
1.1001 + TBool DoLoadCustomInstrumentDataL(TMMFMessage& aMessage);
1.1002 + TBool DoUnloadCustomInstrumentL(TMMFMessage& aMessage);
1.1003 + TBool DoPercussionKeyNameL(TMMFMessage& aMessage);
1.1004 + TBool DoCopyPercussionKeyNameL(TMMFMessage& aMessage);
1.1005 + TBool DoStopTimeL(TMMFMessage& aMessage);
1.1006 + TBool DoSetStopTimeL(TMMFMessage& aMessage);
1.1007 + TBool DoPolyphonyL(TMMFMessage& aMessage);
1.1008 + TBool DoChannelsSupportedL(TMMFMessage& aMessage);
1.1009 + TBool DoChannelVolumeL(TMMFMessage& aMessage);
1.1010 + TBool DoMaxChannelVolumeL(TMMFMessage& aMessage);
1.1011 + TBool DoSetChannelVolumeL(TMMFMessage& aMessage);
1.1012 + TBool DoSetChannelMuteL(TMMFMessage& aMessage);
1.1013 + TBool DoVolumeL(TMMFMessage& aMessage);
1.1014 + TBool DoMaxVolumeL(TMMFMessage& aMessage);
1.1015 + TBool DoSetVolumeL(TMMFMessage& aMessage);
1.1016 + TBool DoSetVolumeRampL(TMMFMessage& aMessage);
1.1017 + TBool DoGetBalanceL(TMMFMessage& aMessage);
1.1018 + TBool DoSetBalanceL(TMMFMessage& aMessage);
1.1019 + TBool DoSetMaxPolyphonyL(TMMFMessage& aMessage);
1.1020 + TBool DoGetRepeatsL(TMMFMessage& aMessage);
1.1021 + TBool DoSetRepeatsL(TMMFMessage& aMessage);
1.1022 + TBool DoSetBankL(TMMFMessage& aMessage);
1.1023 + TBool DoIsTrackMuteL(TMMFMessage& aMessage);
1.1024 + TBool DoIsChannelMuteL(TMMFMessage& aMessage);
1.1025 + TBool DoGetInstrumentL(TMMFMessage& aMessage);
1.1026 + TBool DoCloseL(TMMFMessage& aMessage);
1.1027 + TBool DoStopL(TMMFMessage& aMessage);
1.1028 + TBool DoReceiveEventsL(TMMFMessage& aMessage);
1.1029 + TBool DoRetrieveEventL(TMMFMessage& aMessage);
1.1030 + TBool DoCancelReceiveEventsL(TMMFMessage& aMessage);
1.1031 +
1.1032 + void DoCreateBufFromUintArrayL(RArray<TUint>& aArray);
1.1033 + void DoCreateBufFromFourCCArrayL(RArray<TFourCC>& aArray);
1.1034 + TBool DoMaxPolyphonyL(TMMFMessage& aMessage);
1.1035 +private:
1.1036 + /** The object that implements the MIDI controller interface */
1.1037 + MMidiCustomCommandImplementor& iImplementor;
1.1038 +
1.1039 + CMidiEventReceiver* iMidiEventReceiver;
1.1040 + /** The events waiting to be sent to the client.*/
1.1041 + RPointerArray<CMMFMidiEvent> iMidiEvents;
1.1042 +
1.1043 + // variable length data waiting to be copied back to the client
1.1044 + CBufFlat* iInstrumentName;
1.1045 + CBufFlat* iPercussionKeyName;
1.1046 + };
1.1047 +
1.1048 +#endif