os/mm/mmlibs/mmfw/MIDI/inc/midistandardcustomcommands.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef __MIDISTANDARDCUSTOMCOMMANDS_H__
sl@0
    17
#define __MIDISTANDARDCUSTOMCOMMANDS_H__
sl@0
    18
sl@0
    19
#include <mmf/common/mmfcontroller.h>
sl@0
    20
#include <midiclientutility.h>
sl@0
    21
#include <mmf/common/mmfmidi.h>
sl@0
    22
sl@0
    23
/**
sl@0
    24
Interface UID for the Midi Controller API.
sl@0
    25
sl@0
    26
@publishedAll
sl@0
    27
@released
sl@0
    28
*/
sl@0
    29
const TUid KUidInterfaceMidi = { 0x101F945C };
sl@0
    30
sl@0
    31
/**
sl@0
    32
Describe a MIDI event.
sl@0
    33
Contains a UID to define the actual event type, and an integer to define the event code.
sl@0
    34
sl@0
    35
@publishedAll
sl@0
    36
@released
sl@0
    37
*/
sl@0
    38
class CMMFMidiEvent: public CBase
sl@0
    39
	{
sl@0
    40
public:
sl@0
    41
	IMPORT_C CMMFMidiEvent(TUid aEventType, TInt aErrorCode);
sl@0
    42
	IMPORT_C CMMFMidiEvent();
sl@0
    43
	IMPORT_C ~CMMFMidiEvent();
sl@0
    44
	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
sl@0
    45
	IMPORT_C void InternalizeL(RReadStream& aStream);
sl@0
    46
	IMPORT_C void CopyL(const CMMFMidiEvent& aOther);
sl@0
    47
	/**
sl@0
    48
    @internalTechnology
sl@0
    49
    */
sl@0
    50
	void ZeroMembers();
sl@0
    51
public:
sl@0
    52
   /**
sl@0
    53
    * A UID to define the type of MIDI event.
sl@0
    54
    */
sl@0
    55
	TUid iEventType;
sl@0
    56
   /**
sl@0
    57
    * The error code associated with the MIDI event.
sl@0
    58
    */
sl@0
    59
	TInt iErrorCode;
sl@0
    60
   /**
sl@0
    61
    * Old state of the MIDI client utility object.
sl@0
    62
    */
sl@0
    63
	TMidiState iOldState;
sl@0
    64
   /**
sl@0
    65
    * Current state of the MIDI client utility object.
sl@0
    66
    */
sl@0
    67
	TMidiState iNewState;
sl@0
    68
   /**
sl@0
    69
    * General purpose time stamp in microseconds.
sl@0
    70
    */
sl@0
    71
	TTimeIntervalMicroSeconds iMicroSeconds;
sl@0
    72
   /**
sl@0
    73
    * General purpose time stamp in micro beats per minute. 
sl@0
    74
    */
sl@0
    75
	TInt64 iMicroBeats;
sl@0
    76
   /**
sl@0
    77
    * Channel
sl@0
    78
    */
sl@0
    79
	TInt iChannel;
sl@0
    80
   /**
sl@0
    81
    * Volume in decibel of a logical channel.
sl@0
    82
    */
sl@0
    83
	TReal32 iVolumeInDecibels;
sl@0
    84
   /**
sl@0
    85
    * Mute state of a track or of a channel.
sl@0
    86
    */
sl@0
    87
	TBool iMute;
sl@0
    88
   /**
sl@0
    89
    * Meta data entry. 
sl@0
    90
	* Client will retrieve meta data entry by calling GetMetaDataEntryL()
sl@0
    91
	* using this TInt to indicate which meta data entry to retrieve.
sl@0
    92
    */
sl@0
    93
	TInt iMetaDataEntryId;
sl@0
    94
   /**
sl@0
    95
    * Array of logical {channel, MIP} value pairs.
sl@0
    96
    */
sl@0
    97
	RArray<TMipMessageEntry> iMipMessage; 
sl@0
    98
   /**
sl@0
    99
    * Polyphony of the MIDI engine.
sl@0
   100
    */
sl@0
   101
	TInt iPolyphony;
sl@0
   102
   /**
sl@0
   103
    * Identifier of a bank occupying, at most, 14 bits.
sl@0
   104
    */
sl@0
   105
	TInt iBankId;
sl@0
   106
   /**
sl@0
   107
    * Identifier of a specific instrument.
sl@0
   108
    */
sl@0
   109
	TInt iInstrumentId;
sl@0
   110
   /**
sl@0
   111
    * Tempo value in micro beats per minute.
sl@0
   112
    */
sl@0
   113
	TInt iTempoMicroBeats;
sl@0
   114
	};
sl@0
   115
sl@0
   116
/**
sl@0
   117
Client class to access functionality specific to a MIDI controller.
sl@0
   118
The class uses the custom command function of the controller plugin, and removes the necessity
sl@0
   119
for the client to formulate the custom commands.
sl@0
   120
sl@0
   121
@publishedAll
sl@0
   122
@released
sl@0
   123
*/
sl@0
   124
class RMidiControllerCustomCommands : public RMMFCustomCommandsBase
sl@0
   125
	{
sl@0
   126
public:
sl@0
   127
	IMPORT_C RMidiControllerCustomCommands(RMMFController& aController);
sl@0
   128
	IMPORT_C TInt SetPositionMicroBeats(TInt64 aMicroBeats) const;
sl@0
   129
	IMPORT_C TInt PositionMicroBeats(TInt64& aMicroBeats) const;
sl@0
   130
	IMPORT_C TInt PlayNote(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity);
sl@0
   131
	IMPORT_C TInt PlayNote(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity);
sl@0
   132
	IMPORT_C TInt StopNotes(TInt aChannel);
sl@0
   133
	IMPORT_C TInt NoteOn(TInt aChannel,TInt aNote,TInt aVelocity);
sl@0
   134
	IMPORT_C TInt NoteOff(TInt aChannel,TInt aNote,TInt aVelocity);
sl@0
   135
	IMPORT_C TInt PlaybackRate(TInt& aPlayBackRate) const;
sl@0
   136
	IMPORT_C TInt SetPlaybackRate(TInt aPlayBackRate);
sl@0
   137
	IMPORT_C TInt MaxPlaybackRate(TInt& aMaxRate) const;
sl@0
   138
	IMPORT_C TInt MinPlaybackRate(TInt& aMinRate) const;
sl@0
   139
	IMPORT_C TInt TempoMicroBeatsPerMinute(TInt& aMicroBeatsPerMinute) const;
sl@0
   140
	IMPORT_C TInt SetTempo(TInt aMicroBeatsPerMinute);
sl@0
   141
	IMPORT_C TInt PitchTranspositionCents(TInt& aPitch) const;
sl@0
   142
	IMPORT_C TInt SetPitchTransposition(TInt aCents, TInt& aCentsApplied);
sl@0
   143
	IMPORT_C TInt DurationMicroBeats(TInt64& aDuration) const;
sl@0
   144
	IMPORT_C TInt NumTracks(TInt& aTracks) const;
sl@0
   145
	IMPORT_C TInt SetTrackMute(TInt aTrack, TBool aMuted) const;
sl@0
   146
	IMPORT_C TInt MimeType(TDes8& aMimeType) const;
sl@0
   147
	IMPORT_C TInt SetSyncUpdateCallbackInterval(const TTimeIntervalMicroSeconds& aMicroSeconds,TInt64 aMicroBeats=0);
sl@0
   148
	IMPORT_C TInt SendMessage(const TDesC8& aMidiMessage, TInt& aBytes);
sl@0
   149
	IMPORT_C TInt SendMessage(const TDesC8& aMidiMessage,const TTimeIntervalMicroSeconds& aTime, TInt& aBytes);
sl@0
   150
	IMPORT_C TInt SendMipMessage(const RArray<TMipMessageEntry>& aEntry);
sl@0
   151
	IMPORT_C TInt NumberOfBanks(TBool aCustom, TInt& aNumBanks) const;
sl@0
   152
	IMPORT_C TInt GetBankId(TBool aCustom, TInt aBankIndex, TInt& aBankId) const;
sl@0
   153
	IMPORT_C TInt LoadCustomBank(const TDesC& aFileName,TInt& aBankId);
sl@0
   154
	IMPORT_C TInt LoadCustomBankData(const TDesC8& aBankData,TInt& aBankId);
sl@0
   155
	IMPORT_C TInt UnloadCustomBank(TInt aBankId);
sl@0
   156
	IMPORT_C TInt CustomBankLoaded(TInt aBankId, TBool& aBankLoaded) const;
sl@0
   157
	IMPORT_C TInt UnloadAllCustomBanks();
sl@0
   158
	IMPORT_C TInt NumberOfInstruments(TInt aBankId, TBool aCustom, TInt& aNumInstruments) const;
sl@0
   159
	IMPORT_C TInt GetInstrumentId(TInt aBankId,TBool aCustom,TInt aInstrumentIndex, TInt& aInstrumentId) const;
sl@0
   160
	IMPORT_C HBufC* InstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) const;
sl@0
   161
	IMPORT_C TInt SetInstrument(TInt aChannel,TInt aBankId,TInt aInstrumentId);
sl@0
   162
	IMPORT_C TInt LoadCustomInstrument(const TDesC& aFileName, TInt aFileBankId, TInt aFileInstrumentId, TInt aMemoryBankId, TInt aMemoryInstrumentId);
sl@0
   163
	IMPORT_C TInt LoadCustomInstrumentData(const TDesC8& aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId);
sl@0
   164
	IMPORT_C TInt UnloadCustomInstrument(TInt aCustomBankId,TInt aInstrumentId);
sl@0
   165
	IMPORT_C HBufC* PercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) const;
sl@0
   166
	IMPORT_C TInt StopTime(TTimeIntervalMicroSeconds& aStopTime) const;
sl@0
   167
	IMPORT_C TInt SetStopTime(const TTimeIntervalMicroSeconds& aStopTime) const;
sl@0
   168
	IMPORT_C TInt Polyphony(TInt& aNumNotes) const;
sl@0
   169
	IMPORT_C TInt ChannelsSupported(TInt& aChannels) const;
sl@0
   170
	IMPORT_C TInt ChannelVolume(TInt aChannel, TReal32& aChannelVol) const;
sl@0
   171
	IMPORT_C TInt MaxChannelVolume(TReal32& aMaxVol) const;
sl@0
   172
	IMPORT_C TInt SetChannelVolume(TInt aChannel,TReal32 aVolume);
sl@0
   173
	IMPORT_C TInt SetChannelMute(TInt aChannel,TBool aMuted);
sl@0
   174
	IMPORT_C TInt Volume(TInt& aVolume) const;
sl@0
   175
	IMPORT_C TInt MaxVolume(TInt& aMaxVolume) const;
sl@0
   176
	IMPORT_C TInt SetVolume(TInt aVolume);
sl@0
   177
	IMPORT_C TInt SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
sl@0
   178
	IMPORT_C TInt GetBalance(TInt& aBalance) const;
sl@0
   179
	IMPORT_C TInt SetBalance(TInt aBalance);
sl@0
   180
	IMPORT_C TInt SetMaxPolyphony(TInt aMaxNotes);
sl@0
   181
	IMPORT_C TInt GetRepeats(TInt& aNumRepeats) const;
sl@0
   182
	IMPORT_C TInt SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
sl@0
   183
 	IMPORT_C TInt SetBank(TBool aCustom);
sl@0
   184
	IMPORT_C TInt IsTrackMute(TInt aTrack, TBool& aTrackMute) const;
sl@0
   185
	IMPORT_C TInt IsChannelMute(TInt aChannel, TBool& aChannelMute) const;
sl@0
   186
	IMPORT_C TInt GetInstrument(TInt aChannel, TInt& aInstrumentId, TInt& aBankId);
sl@0
   187
	IMPORT_C TInt Close();
sl@0
   188
	IMPORT_C TInt Stop(const TTimeIntervalMicroSeconds& aFadeOutDuration);
sl@0
   189
	IMPORT_C void ReceiveEvents(TPckgBuf<TInt>& aEventSize, TRequestStatus& aStatus);
sl@0
   190
	IMPORT_C TInt RetrieveEvent(TDes8& aMidiEventPckg);
sl@0
   191
	IMPORT_C TInt CancelReceiveEvents();
sl@0
   192
	IMPORT_C TInt MaxPolyphony(TInt& aNumNotes) const;
sl@0
   193
	};
sl@0
   194
sl@0
   195
sl@0
   196
/**
sl@0
   197
Mixin class to be derived from by controller plugins wishing 
sl@0
   198
to support the MIDI controller custom commands.
sl@0
   199
sl@0
   200
@publishedAll
sl@0
   201
@released
sl@0
   202
*/
sl@0
   203
class MMidiCustomCommandImplementor
sl@0
   204
	{
sl@0
   205
public:
sl@0
   206
    /**
sl@0
   207
    Change the position of the currently playing MIDI resource to the given position.
sl@0
   208
    May be called whenever a MIDI resource is open.
sl@0
   209
    
sl@0
   210
    @param aMicroBeats 
sl@0
   211
	       Metrical position to move to. Clamped to (0, DurationMicroBeats()).
sl@0
   212
    */
sl@0
   213
	virtual void  MmcSetPositionMicroBeatsL(TInt64 aMicroBeats) = 0;
sl@0
   214
    /**
sl@0
   215
    Gets the current metrical position of the MIDI resource being played
sl@0
   216
    
sl@0
   217
    @param aMicroBeats 
sl@0
   218
	       (BPM*1000000) relative to the start of the resource
sl@0
   219
    */
sl@0
   220
	virtual void  MmcPositionMicroBeatsL(TInt64& aMicroBeats) = 0;
sl@0
   221
    /**
sl@0
   222
    Synchronous function to play a single note.
sl@0
   223
    Multiple calls to this function will be accommodated as far as the MIDI engine can
sl@0
   224
    manage. The same functionality could be implemented using the SendMessage function
sl@0
   225
    
sl@0
   226
    @param aChannel 
sl@0
   227
	       Logical channel to play note on. 0 <= aChannel <= 15.
sl@0
   228
    @param aNote 
sl@0
   229
	       Note to play. 0 <= aNote <= 127
sl@0
   230
    @param aDuration 
sl@0
   231
	       Length of time to play note for.
sl@0
   232
    @param aNoteOnVelocity 
sl@0
   233
	       Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127.
sl@0
   234
    @param aNoteOffVelocity 
sl@0
   235
	       Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.
sl@0
   236
    */
sl@0
   237
	virtual void  MmcPlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity) = 0;
sl@0
   238
    /**
sl@0
   239
    Synchronous function to play a single note at a specified time.
sl@0
   240
    Multiple calls to this function will be accommodated as far as the MIDI engine can
sl@0
   241
    manage. The same functionality could be implemented using the SendMessage function
sl@0
   242
    
sl@0
   243
    @param aChannel 
sl@0
   244
	       Logical channel to play note on. 0 <= aChannel <= 15.
sl@0
   245
    @param aNote 
sl@0
   246
	       Note to play. 0 <= aNote <= 127
sl@0
   247
    @param aStartTime 
sl@0
   248
	       Specifies the time at which to start playing the note, relative to the MIDI
sl@0
   249
		   resource playing time or the time elapsed since Play() was called if no resource is present.
sl@0
   250
    @param aDuration 
sl@0
   251
	       Length of time to play note for.
sl@0
   252
    @param aNoteOnVelocity 
sl@0
   253
	       Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127.
sl@0
   254
    @param aNoteOffVelocity 
sl@0
   255
	       Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.
sl@0
   256
    */
sl@0
   257
	virtual void  MmcPlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity) = 0;
sl@0
   258
    /**
sl@0
   259
    Stops the playback of all notes on the given channel,
sl@0
   260
    by means of an All Notes Off MIDI message
sl@0
   261
    
sl@0
   262
    @param aChannel 
sl@0
   263
	       Logical channel to stop notes on. 0 <= aChannel <= 15
sl@0
   264
    */
sl@0
   265
	virtual void  MmcStopNotesL(TInt aChannel) = 0;
sl@0
   266
    /**
sl@0
   267
    Synchronous function to commence playback of a note.
sl@0
   268
    Multiple calls to this function will be accommodated as far as the MIDI engine can manage
sl@0
   269
    
sl@0
   270
    @param aChannel 
sl@0
   271
	       Logical channel to play note on. 0 <= aChannel <= 15.
sl@0
   272
    @param aNote 
sl@0
   273
	       Note to play. 0 <= aNote <= 127.
sl@0
   274
    @param aVelocity 
sl@0
   275
	       Velocity with which to start the note. The legal integer range
sl@0
   276
		   is 0 <= aVelocity <= 127, but the value zero actually causes the 
sl@0
   277
		   message to be interpreted as a Note Off message instead of a Note On.
sl@0
   278
    */
sl@0
   279
	virtual void  MmcNoteOnL(TInt aChannel,TInt aNote,TInt aVelocity) = 0;
sl@0
   280
    /**
sl@0
   281
    Synchronous function to terminate playback of a note.
sl@0
   282
    If no corresponding note is found then no error is raised
sl@0
   283
    
sl@0
   284
    @param aChannel 
sl@0
   285
	       Logical channel on which the note is playing. 0 <= aChannel <= 15.
sl@0
   286
    @param aNote
sl@0
   287
	       Note to terminate. 0 <= aNote <= 127.
sl@0
   288
    @param aVelocity 
sl@0
   289
	       Velocity with which to stop the note. 0 <= aVelocity <= 127.
sl@0
   290
           There is no standard behaviour corresponding with note off velocity.
sl@0
   291
    */
sl@0
   292
	virtual void  MmcNoteOffL(TInt aChannel,TInt aNote,TInt aVelocity) = 0;
sl@0
   293
    /**
sl@0
   294
    Gets the current playback rate factor of the currently open MIDI resource.
sl@0
   295
    The playback rate is independent from tempo,
sl@0
   296
    i.e., it can be used to give an overall speed factor for playback.
sl@0
   297
    
sl@0
   298
    @param aPlayBackRate 
sl@0
   299
	       Current playback rate in percent times 1000, i.e., 100000 means original 
sl@0
   300
		   playback speed, 200000 means double speed, and 50000 means half speed playback.
sl@0
   301
    */
sl@0
   302
	virtual void  MmcPlaybackRateL(TInt& aPlayBackRate) = 0;
sl@0
   303
    /**
sl@0
   304
    Sets the playback rate for the playback of the current MIDI resource.
sl@0
   305
    The playback rate is independent from tempo,
sl@0
   306
    i.e., it can be used to give an overall speed factor for playback.
sl@0
   307
    May be called whether playback is in progress or not.
sl@0
   308
    
sl@0
   309
    @param aPlayBackRate 
sl@0
   310
	       Playback rate in percent times 1000, i.e., 100000 means original playback speed,
sl@0
   311
		   200000 means double speed, and 50000 means half speed playback.
sl@0
   312
    */
sl@0
   313
	virtual void  MmcSetPlaybackRateL(TInt aPlayBackRate) = 0;
sl@0
   314
    /**
sl@0
   315
    Gets the maximum playback rate in milli-percentage from the MIDI engine.
sl@0
   316
    @see SetPlaybackRate() for milli-percentage details.
sl@0
   317
    
sl@0
   318
    @param aMaxRate 
sl@0
   319
	       Playback rate supported by MIDI player.
sl@0
   320
    */
sl@0
   321
	virtual void  MmcMaxPlaybackRateL(TInt& aMaxRate) = 0;
sl@0
   322
    /**
sl@0
   323
    Gets the minimum playback rate in milli-percentage from the MIDI engine.
sl@0
   324
    @see SetPlaybackRate() for milli-percentage details.
sl@0
   325
    
sl@0
   326
    @param aMinRate 
sl@0
   327
	       Minimum playback rate supported by MIDI player.
sl@0
   328
    */
sl@0
   329
	virtual void  MmcMinPlaybackRateL(TInt& aMinRate) = 0;
sl@0
   330
    /**
sl@0
   331
    Gets the current tempo of the currently open MIDI resource. The tempo is independent
sl@0
   332
    from the playback rate, i.e., the resulting playback speed will be affected by both.
sl@0
   333
    
sl@0
   334
    @param  aMicroBeatsPerMinute 
sl@0
   335
	        Tempo at the current position of the currently open resource in microbeats
sl@0
   336
			per minute, i.e. BPM * 1000000. Filled in by the controller framework.
sl@0
   337
    */
sl@0
   338
	virtual void  MmcTempoMicroBeatsPerMinuteL(TInt& aMicroBeatsPerMinute) = 0;
sl@0
   339
    /**
sl@0
   340
    Sets the tempo at which the current MIDI resource should be played.
sl@0
   341
    May be called whether playback is in progress or not. The tempo is 
sl@0
   342
	independent from the playback rate, i.e., the resulting playback speed
sl@0
   343
	will be affected by both.
sl@0
   344
    
sl@0
   345
    @param aMicroBeatsPerMinute 
sl@0
   346
	       Tempo in microbeats per minute (BPM*1000000) to set.
sl@0
   347
    */
sl@0
   348
	virtual void  MmcSetTempoL(TInt aMicroBeatsPerMinute) = 0;
sl@0
   349
    /**
sl@0
   350
    Gets the pitch shift in use for the currently open MIDI resource.
sl@0
   351
    
sl@0
   352
    @param aPitch 
sl@0
   353
	       Shift in cents, i.e. semitones * 100. One octave equals 1200 cents.
sl@0
   354
    @return One of the system-wide error codes.
sl@0
   355
    */
sl@0
   356
	virtual void  MmcPitchTranspositionCentsL(TInt& aPitch) = 0;
sl@0
   357
    /**
sl@0
   358
    Sets the pitch shift to apply to the currently open MIDI resource.
sl@0
   359
    May be called during playback.
sl@0
   360
    
sl@0
   361
    @param aCents 
sl@0
   362
	       Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents.
sl@0
   363
    @param aCentsApplied 
sl@0
   364
	       Actual pitch shift applied - may differ from the requested value due
sl@0
   365
		   to limitations of the MIDI engine.
sl@0
   366
    */
sl@0
   367
	virtual void  MmcSetPitchTranspositionL(TInt aCents, TInt& aCentsApplied) = 0;
sl@0
   368
    /**
sl@0
   369
    Gets the length of the currently open MIDI resource in micro-beats
sl@0
   370
    
sl@0
   371
    @param aDuration 
sl@0
   372
	       Duration in microbeats (beats * 1000000).
sl@0
   373
    */
sl@0
   374
	virtual void  MmcDurationMicroBeatsL(TInt64& aDuration) = 0;
sl@0
   375
    /**
sl@0
   376
    Gets the number of tracks present in the currently open MIDI resource.
sl@0
   377
    
sl@0
   378
    @param aTracks 
sl@0
   379
	       Number of tracks.
sl@0
   380
    */
sl@0
   381
	virtual void  MmcNumTracksL(TInt& aTracks) = 0;
sl@0
   382
    /**
sl@0
   383
    Mutes or unmutes a particular track.
sl@0
   384
    
sl@0
   385
    @param aTrack 
sl@0
   386
	       Index of the track to mute - 0 <= aTrack < NumTracks().
sl@0
   387
    @param aMuted 
sl@0
   388
	       ETrue to mute the track, EFalse to unmute it.
sl@0
   389
    */
sl@0
   390
	virtual void  MmcSetTrackMuteL(TInt aTrack, TBool aMuted) = 0;
sl@0
   391
    /**
sl@0
   392
    Gets the MIME type of the MIDI resource currently open.
sl@0
   393
    
sl@0
   394
    @param aMimeType
sl@0
   395
	       Descriptor containing the MIDI mime type.
sl@0
   396
    */
sl@0
   397
	virtual void  MmcMimeTypeL(TDes8& aMimeType) = 0;
sl@0
   398
    /**
sl@0
   399
    Sets the frequency at which MMIDIClientUtilityObserver::MmcuoSyncUpdateL() is called
sl@0
   400
    to allow other components to synchronise with playback of this MIDI resource.
sl@0
   401
    
sl@0
   402
    @param aMicroSeconds
sl@0
   403
	       Temporal interval to callback at. Used in preference to aMicroBeats if both are set.
sl@0
   404
    @param aMicroBeats
sl@0
   405
	       Metrical interval to callback at. Set both parameters to zero to cancel.
sl@0
   406
    */
sl@0
   407
	virtual void  MmcSetSyncUpdateCallbackIntervalL(const TTimeIntervalMicroSeconds& aMicroSeconds,TInt64 aMicroBeats=0) = 0;
sl@0
   408
    /**
sl@0
   409
    Sends a single MIDI message to the MIDI engine.
sl@0
   410
    
sl@0
   411
    @param aMidiMessage
sl@0
   412
	       Descriptor containing the MIDI message data. If there are several
sl@0
   413
           MIDI messages in the buffer, only the first one is processed.
sl@0
   414
    @param aBytes
sl@0
   415
	       Number of bytes of the message buffer actually processed.
sl@0
   416
    */
sl@0
   417
	virtual void  MmcSendMessageL(const TDesC8& aMidiMessage, TInt& aBytes) = 0;
sl@0
   418
    /**
sl@0
   419
    Sends a single MIDI message, with time stamp, to the MIDI engine.
sl@0
   420
    
sl@0
   421
    @param aMidiMessage 
sl@0
   422
	       Descriptor containing the MIDI message data. If there are several
sl@0
   423
		   MIDI messages in the buffer, only the first one is processed.
sl@0
   424
    @param aTime
sl@0
   425
	       The time at which to execute the message, relative to the MIDI resource playing
sl@0
   426
           time or the time elapsed since Play() was called if no resource is present.
sl@0
   427
    @param aBytes       
sl@0
   428
	       Number of bytes of the message buffer actually processed.
sl@0
   429
    */
sl@0
   430
	virtual void  MmcSendMessageL(const TDesC8& aMidiMessage,const TTimeIntervalMicroSeconds& aTime, TInt& aBytes) = 0;
sl@0
   431
    /**
sl@0
   432
    Sends a mip message to the MIDI engine. This is a convenience function,
sl@0
   433
    because the same functionality could be achieved with the SendMessage() function.
sl@0
   434
    
sl@0
   435
    @param aEntry 
sl@0
   436
	       Array of logical {channel, MIP} value pairs to send, highest priority first.
sl@0
   437
    */
sl@0
   438
	virtual void  MmcSendMipMessageL(const TArray<TMipMessageEntry>& aEntry) = 0;
sl@0
   439
    /**
sl@0
   440
    Gets the number of standard or custom sound banks currently available.
sl@0
   441
    
sl@0
   442
    @param aCustom
sl@0
   443
	       Specifies whether to reference a custom or standard sound bank.
sl@0
   444
    @param aNumBanks 
sl@0
   445
	       Number of custom or standard sound banks available.
sl@0
   446
    */
sl@0
   447
	virtual void  MmcNumberOfBanksL(TBool aCustom, TInt& aNumBanks) = 0;
sl@0
   448
    /**
sl@0
   449
    Gets the identifier of a sound bank. Bank identifier (aka bank number) is a
sl@0
   450
    14-bit value consisting of MIDI bank MSB and LSB values.
sl@0
   451
    
sl@0
   452
    @param  aCustom
sl@0
   453
            Specifies whether to reference a custom or standard sound bank.
sl@0
   454
    @param  aBankIndex
sl@0
   455
	        Index of sound bank where 0 <= aBankIndex < NumberOfBanks().
sl@0
   456
    @param  aBankId
sl@0
   457
            Identifier of the specified bank occupying, at most, 14 bits.
sl@0
   458
    */
sl@0
   459
	virtual void  MmcGetBankIdL(TBool aCustom, TInt aBankIndex, TInt& aBankId) = 0;
sl@0
   460
    /**
sl@0
   461
    Loads one or more custom sound banks from a file into memory for use.
sl@0
   462
    If several banks are loaded with consequent LoadCustomBanksL() function calls,
sl@0
   463
    the banks are combined if the bank sets have conflicting bank numbers.
sl@0
   464
    
sl@0
   465
    @param aFileName
sl@0
   466
	       Name of the file containing the custom sound bank.
sl@0
   467
    @param aBankId
sl@0
   468
	       Identifier of the custom sound bank loaded, occupying no more than 14 bits.
sl@0
   469
    */
sl@0
   470
	virtual void  MmcLoadCustomBankL(const TDesC& aFileName,TInt& aBankId) = 0;
sl@0
   471
    /**
sl@0
   472
    Loads one or more custom sound banks from a descriptor into memory for use.
sl@0
   473
    If several banks are loaded with consequent LoadCustomBanksL() function calls,
sl@0
   474
    the banks are combined if the bank sets have conflicting bank numbers.
sl@0
   475
    
sl@0
   476
    @param aBankData
sl@0
   477
	       Descriptor containing the custom sound bank.
sl@0
   478
    @param aBankId
sl@0
   479
	       Identifier of the custom sound bank loaded, occupying no more than 14 bits.
sl@0
   480
    */
sl@0
   481
	virtual void  MmcLoadCustomBankDataL(const TDesC8& aBankData,TInt& aBankId) = 0;
sl@0
   482
    /**
sl@0
   483
    Removes a custom sound bank from memory. Only valid for sound banks previously
sl@0
   484
	loaded from file. Once unloaded the custom sound bank is no longer available for use.
sl@0
   485
    
sl@0
   486
    @param aBankId 
sl@0
   487
	       Identifier of the custom sound bank to unload,occupying no more than 14 bits.
sl@0
   488
    */
sl@0
   489
	virtual void  MmcUnloadCustomBankL(TInt aBankId) = 0;
sl@0
   490
    /**
sl@0
   491
    Query if a bank has been loaded to the memory.
sl@0
   492
    
sl@0
   493
    @param aBankId
sl@0
   494
	       Identifier of the custom sound bank to check if it's in memory or not.
sl@0
   495
    @param aBankLoaded
sl@0
   496
	       ETrue if the specified bank is in memory, EFalse otherwise.
sl@0
   497
    */
sl@0
   498
	virtual void  MmcCustomBankLoadedL(TInt aBankId, TBool& aBankLoaded) = 0;
sl@0
   499
    /**
sl@0
   500
    Removes all custom sound banks from memory.
sl@0
   501
    */
sl@0
   502
	virtual void  MmcUnloadAllCustomBanksL() = 0;
sl@0
   503
    /**
sl@0
   504
    Gets the number of instruments available in a given sound bank.
sl@0
   505
    
sl@0
   506
    @param aBankId
sl@0
   507
	       Identifier of sound bank to reference, occupying no more than 14 bits.
sl@0
   508
    @param aCustom
sl@0
   509
	       Specifies whether to reference a custom or standard sound bank.
sl@0
   510
    @param aNumInstruments
sl@0
   511
	       Count of the number of instruments available for the specified sound bank.
sl@0
   512
    */
sl@0
   513
	virtual void  MmcNumberOfInstrumentsL(TInt aBankId, TBool aCustom, TInt& aNumInstruments) = 0;
sl@0
   514
    /**
sl@0
   515
    Gets the identifier of an instrument.
sl@0
   516
    
sl@0
   517
    @param aBankId
sl@0
   518
	       Identifier of the sound bank to reference, occupying no more than 14 bits.
sl@0
   519
    @param aCustom
sl@0
   520
	       Specifies whether to reference a custom or standard sound bank.
sl@0
   521
    @param aInstrumentIndex
sl@0
   522
	       Index of the instrument to reference where 0 <= aInstrumentIndex < NumberOfInstrumentsL(). 
sl@0
   523
    @param aInstrumentId
sl@0
   524
	       Identifier of specified instrument. This may differ from the index since the
sl@0
   525
		   index simply enumerates the instruments, whereas identifiers may not be 
sl@0
   526
		   contiguous, especially where certain instruments correspond to General MIDI-defined
sl@0
   527
		   instruments but not all instruments are present. Instrument identifiers are
sl@0
   528
		   between 0 and 127 inclusive.
sl@0
   529
    */
sl@0
   530
	virtual void  MmcGetInstrumentIdL(TInt aBankId,TBool aCustom,TInt aInstrumentIndex, TInt& aInstrumentId) = 0;
sl@0
   531
    /**
sl@0
   532
    Gets the name of the given instrument.
sl@0
   533
    
sl@0
   534
    @param  aBankId
sl@0
   535
	        Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
sl@0
   536
    @param  aCustom
sl@0
   537
	        Specifies whether to reference a custom or standard sound bank.
sl@0
   538
    @param  aInstrumentId
sl@0
   539
	        Identifier of the instrument under scrutiny. 0 <= aInstrumentId <= 127.
sl@0
   540
    @return Buffer containing the name of the specified instrument.
sl@0
   541
            If it has no name then an empty descriptor is returned.
sl@0
   542
    */
sl@0
   543
	virtual const TDesC& MmcInstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) = 0;
sl@0
   544
    /**
sl@0
   545
    Sets a logical channel to use the given instrument.
sl@0
   546
    
sl@0
   547
    @param aChannel
sl@0
   548
	       Logical channel to set the instrument for. 0 <= aChannel <= 15.
sl@0
   549
    @param aBankId
sl@0
   550
	       Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
sl@0
   551
           The bank ID is a concatenation of MIDI bank MSB and LSB values.
sl@0
   552
    @param aInstrumentId
sl@0
   553
	       Identifier of the instrument under scrutiny. 0 <= aInstrumentId <= 127.
sl@0
   554
    */
sl@0
   555
	virtual void  MmcSetInstrumentL(TInt aChannel,TInt aBankId,TInt aInstrumentId) = 0;
sl@0
   556
    /**
sl@0
   557
    Loads an individual instrument from file into custom sound bank memory for use.
sl@0
   558
    The bank and instrument ids given in the file can be mapped into different bank
sl@0
   559
    and instrument ids in memory.
sl@0
   560
    
sl@0
   561
    @param aFileName
sl@0
   562
	       Name of the file containing the instrument.
sl@0
   563
    @param aFileBankId
sl@0
   564
	       Identifier of the bank in the file from which to load the instrument,
sl@0
   565
           occupying no more than 14 bits.
sl@0
   566
    @param aFileInstrumentId
sl@0
   567
	       Identifier of the instrument to load. 0 <= aInstrumentId <= 127.
sl@0
   568
    @param aMemoryBankId
sl@0
   569
	       Identifier of the custom bank in memory to load the instrument into,
sl@0
   570
           occupying no more than 14 bits.
sl@0
   571
    @param aMemoryInstrumentId
sl@0
   572
	       Identifier of the instrument in memory to load the new instrument into.
sl@0
   573
		   0 <= aInstrumentId <= 127.
sl@0
   574
    */
sl@0
   575
	virtual void  MmcLoadCustomInstrumentL(const TDesC& aFileName, TInt aFileBankId, TInt aFileInstrumentId, TInt aMemoryBankId, TInt aMemoryInstrumentId) = 0;
sl@0
   576
    /**
sl@0
   577
    Loads an individual instrument from descriptor into custom sound bank memory for use.
sl@0
   578
    The bank and instrument ids given in the descriptor can be mapped into different bank
sl@0
   579
    and instrument ids in memory.
sl@0
   580
    
sl@0
   581
    @param aInstrumentData
sl@0
   582
	       Descriptor containing the instrument.
sl@0
   583
    @param aBankDataId
sl@0
   584
	       Identifier of the bank in the descriptor from which to load the instrument,
sl@0
   585
           occupying no more than 14 bits.
sl@0
   586
    @param aInstrumentDataId
sl@0
   587
	       Identifier of the instrument to load. 0 <= aInstrumentId <= 127.
sl@0
   588
    @param aMemoryBankId
sl@0
   589
	       Identifier of the custom bank in memory to load the instrument into,
sl@0
   590
           occupying no more than 14 bits.
sl@0
   591
    @param aMemoryInstrumentId
sl@0
   592
	       Identifier of the instrument in memory to load the new instrument into.
sl@0
   593
		   0 <= aInstrumentId <= 127.
sl@0
   594
    */
sl@0
   595
	virtual void  MmcLoadCustomInstrumentDataL(const TDesC8& aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId) = 0;
sl@0
   596
    /**
sl@0
   597
    Removes an instrument from custom sound bank memory.
sl@0
   598
    Only valid for instruments previously loaded from file.
sl@0
   599
    Once unloaded the instrument is no longer available for use.
sl@0
   600
    
sl@0
   601
    @param aCustomBankId
sl@0
   602
	       Identifier of the custom sound bank containing the instrument 
sl@0
   603
           to unload, occupying no more than 14 bits.
sl@0
   604
    @param aInstrumentId
sl@0
   605
	       Identifier of the instrument to unload. 0 <= aInstrumentId <= 127.
sl@0
   606
    */
sl@0
   607
	virtual void  MmcUnloadCustomInstrumentL(TInt aCustomBankId,TInt aInstrumentId) = 0;
sl@0
   608
    /**
sl@0
   609
    Gets the name of a particular percussion key corresponding to a given note.
sl@0
   610
    
sl@0
   611
    @param aNote
sl@0
   612
	       Note to query. 0 <= aNote <= 127.
sl@0
   613
    @param aBankId
sl@0
   614
	       Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
sl@0
   615
           The bank ID is a concatenation of MIDI bank MSB and LSB values.
sl@0
   616
    @param aCustom
sl@0
   617
	       Specifies whether to reference a custom or standard sound bank.
sl@0
   618
    @param aInstrumentId
sl@0
   619
	       Identifier of an instrument.
sl@0
   620
    @return Descriptor containing the name of the percussion key.
sl@0
   621
            If the key does not have a name then an empty descriptor is returned.
sl@0
   622
    */
sl@0
   623
	virtual const TDesC& MmcPercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) = 0;
sl@0
   624
    /**
sl@0
   625
    Get the stop time currently set for the MIDI resource.
sl@0
   626
    
sl@0
   627
    @param aStopTime
sl@0
   628
	       Time at which playback will stop, relative to the start of the resource.
sl@0
   629
    @return Descriptor containing the name of the percussion key. If the key
sl@0
   630
            does not have a name then an empty descriptor is returned.
sl@0
   631
    */
sl@0
   632
	virtual void  MmcStopTimeL(TTimeIntervalMicroSeconds& aStopTime) = 0;
sl@0
   633
    /**
sl@0
   634
    Sets the stop time to use for the currently open MIDI resource
sl@0
   635
    
sl@0
   636
    @param aStopTime
sl@0
   637
	       Time at which playback will stop, relative to the start of the resource.
sl@0
   638
           Clamped to 0 and the duration of the resource.
sl@0
   639
    */
sl@0
   640
	virtual void  MmcSetStopTimeL(const TTimeIntervalMicroSeconds& aStopTime) = 0;
sl@0
   641
    /**
sl@0
   642
    Gets the number of currently active voices.
sl@0
   643
    
sl@0
   644
    @param aNumNotes
sl@0
   645
	       The number of currently active voices.
sl@0
   646
    */
sl@0
   647
	virtual void  MmcPolyphonyL(TInt& aNumNotes) = 0;
sl@0
   648
    /**
sl@0
   649
    Get the maximum number of logical channels supported by the MIDI engine.
sl@0
   650
    
sl@0
   651
    @param aChannels 
sl@0
   652
	       The maximum number of logical channels that the MIDI engine supports, 0 <= aChannels <=15.
sl@0
   653
    */
sl@0
   654
	virtual void  MmcChannelsSupportedL(TInt& aChannels) = 0;
sl@0
   655
    /**
sl@0
   656
    Get the current volume setting of a logical channel.
sl@0
   657
    
sl@0
   658
    @param aChannel
sl@0
   659
	       Logical channel to query. 0 <= aChannel <= 15.
sl@0
   660
    @param aChannelVol
sl@0
   661
	       Volume currently set on the specified channel in decibels.
sl@0
   662
    */
sl@0
   663
	virtual void  MmcChannelVolumeL(TInt aChannel, TReal32& aChannelVol) = 0;
sl@0
   664
    /**
sl@0
   665
    Gets the Maximum volume setting that may be applied to a logical channel.
sl@0
   666
    
sl@0
   667
    @param aMaxVol
sl@0
   668
	       Maximum volume setting. Minimum value is -infinity dB, which is 
sl@0
   669
	       the smallest possible value that TReal32 supports.
sl@0
   670
    */
sl@0
   671
	virtual void  MmcMaxChannelVolumeL(TReal32& aMaxVol) = 0;
sl@0
   672
    /**
sl@0
   673
    Set the volume of a channel.
sl@0
   674
    
sl@0
   675
    @param aChannel
sl@0
   676
	       Logical channel to set the volume on. 0 <= aChannel <= 15.
sl@0
   677
    @param aVolume
sl@0
   678
	       The channel volume can be set within a range. The minimum channel 
sl@0
   679
	       volume is -infinity dB, which is the smallest possible value that
sl@0
   680
	       TReal32 supports while the maximum channel volume is set via MaxVolumeL()
sl@0
   681
	       which represents the volume level in dB corresponding to the MIDI Channel 
sl@0
   682
	       Volume controller.
sl@0
   683
    */
sl@0
   684
	virtual void  MmcSetChannelVolumeL(TInt aChannel,TReal32 aVolume) = 0;
sl@0
   685
    /**
sl@0
   686
    Set the muting state of a channel without changing its volume setting.
sl@0
   687
    When unmuted the channel goes back to its previous volume setting.
sl@0
   688
    
sl@0
   689
    @param aChannel
sl@0
   690
	       Logical channel to set the mute state of. 0 <= aChannel <= 15.
sl@0
   691
    @param aMuted
sl@0
   692
	       ETrue to mute the channel, EFalse to unmute it.
sl@0
   693
    */
sl@0
   694
	virtual void  MmcSetChannelMuteL(TInt aChannel,TBool aMuted) = 0;
sl@0
   695
    /**
sl@0
   696
    Gets the overall volume of the MIDI client.
sl@0
   697
    
sl@0
   698
    @param aVolume
sl@0
   699
	       The current overall volume setting.
sl@0
   700
    */
sl@0
   701
	virtual void  MmcVolumeL(TInt& aVolume) = 0;
sl@0
   702
    /**
sl@0
   703
    Maximum volume setting that may be applied overall.
sl@0
   704
    
sl@0
   705
    @param aMaxVolume
sl@0
   706
	       Maximum volume setting. Minimum value is always zero which is silent.
sl@0
   707
    */
sl@0
   708
	virtual void  MmcMaxVolumeL(TInt& aMaxVolume) = 0;
sl@0
   709
    /**
sl@0
   710
    Set the overall volume of the MIDI client.
sl@0
   711
    This setting scales all channel volumes respectively so the actual volume
sl@0
   712
    that a channel is played at becomes (overall volume * channel volume / max volume).
sl@0
   713
    
sl@0
   714
    @param aVolume Overall volume setting to use.
sl@0
   715
    */
sl@0
   716
	virtual void  MmcSetVolumeL(TInt aVolume) = 0;
sl@0
   717
    /**
sl@0
   718
    Length of time over which the volume is faded up from zero to the current settings
sl@0
   719
    when playback is started.
sl@0
   720
    
sl@0
   721
    @param aRampDuration
sl@0
   722
	       Duration of the ramping period.
sl@0
   723
    */
sl@0
   724
	virtual void  MmcSetVolumeRampL(const TTimeIntervalMicroSeconds& aRampDuration) = 0;
sl@0
   725
    /**
sl@0
   726
    Get the current stereo balance value.
sl@0
   727
    
sl@0
   728
    @param aBalance
sl@0
   729
	       Balance value ranging from KMMFBalanceMaxLeft to KMMFBalanceMaxRight.
sl@0
   730
    */
sl@0
   731
	virtual void  MmcGetBalanceL(TInt& aBalance) = 0;
sl@0
   732
    /**
sl@0
   733
    Set the current stereo balance value.
sl@0
   734
    
sl@0
   735
    @param aBalance
sl@0
   736
	       Balance value to set. Defaults to KMMFBalanceCenter to restore equal left-right balance.
sl@0
   737
    */
sl@0
   738
	virtual void  MmcSetBalanceL(TInt aBalance) = 0;
sl@0
   739
    /**
sl@0
   740
    Set the max polyphony level the engine can handle.
sl@0
   741
    
sl@0
   742
    @param aMaxNotes
sl@0
   743
	       Max polyphony level,  0 <= PolyphonyL() <= aMaxNotes.
sl@0
   744
    */
sl@0
   745
	virtual void  MmcSetMaxPolyphonyL(TInt aMaxNotes) = 0;
sl@0
   746
    /**
sl@0
   747
    Gets the number of times the current opened resources have to be repeated.
sl@0
   748
    
sl@0
   749
    @param aNumRepeats
sl@0
   750
	       The number of time the current opened resources have to be repeated.
sl@0
   751
    */
sl@0
   752
	virtual void  MmcGetRepeatsL(TInt& aNumRepeats) = 0;
sl@0
   753
    /**
sl@0
   754
    Set the number of times to repeat the current MIDI resource.
sl@0
   755
    After Stop() has been called, repeat number of times and the trailing silence are reset.
sl@0
   756
    
sl@0
   757
    @param aRepeatNumberOfTimes
sl@0
   758
	       Number of times to repeat the resource during playback. This includes the first playing.
sl@0
   759
    @param aTrailingSilence 
sl@0
   760
	       Time in microseconds to pause between repeats.
sl@0
   761
    */
sl@0
   762
	virtual void  MmcSetRepeatsL(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence) = 0;
sl@0
   763
    /**
sl@0
   764
    Tell the MIDI engine to use a custom bank or a standard bank.
sl@0
   765
    
sl@0
   766
    @param aCustom
sl@0
   767
	       If Etrue the custom bank in memory is used otherwise the standard bank 
sl@0
   768
		   is used leaving the custom bank in memory.
sl@0
   769
    */
sl@0
   770
	virtual void  MmcSetBankL(TBool aCustom) = 0;
sl@0
   771
    /**
sl@0
   772
    Gets the muting status of a specific track.
sl@0
   773
    
sl@0
   774
    @param aTrack
sl@0
   775
	       The track to query.
sl@0
   776
    @param aTrackMute
sl@0
   777
	       The mute status of the track.
sl@0
   778
    */
sl@0
   779
	virtual void  MmcIsTrackMuteL(TInt aTrack, TBool& aTrackMute) = 0;
sl@0
   780
    /**
sl@0
   781
    Gets the muting status of a specific channel.
sl@0
   782
    
sl@0
   783
    @param aChannel
sl@0
   784
	       The channel to query.
sl@0
   785
    @param aChannelMute
sl@0
   786
	       The mute status of the channel.
sl@0
   787
    */
sl@0
   788
	virtual void  MmcIsChannelMuteL(TInt aChannel, TBool& aChannelMute) = 0;
sl@0
   789
    /**
sl@0
   790
    Gets the instrument assigned to a specified channel.
sl@0
   791
    
sl@0
   792
    @param aChannel
sl@0
   793
	       Logical channel, 0 <= aChannel <= 15.
sl@0
   794
    @param aInstrumentId
sl@0
   795
	       Identifier of the instrument assigned to aChannel. 0 <= aInstrumentId <= 127.
sl@0
   796
    @param aBankId
sl@0
   797
	       Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
sl@0
   798
    */
sl@0
   799
	virtual void  MmcGetInstrumentL(TInt aChannel, TInt& aInstrumentId, TInt& aBankId) = 0;
sl@0
   800
    /**
sl@0
   801
    Closes any currently open resources, such as files, descriptors or URLs in use.
sl@0
   802
    Does nothing if there is nothing currently open.
sl@0
   803
    */
sl@0
   804
	virtual void  MmcCloseL() = 0;
sl@0
   805
    /**
sl@0
   806
    Stops playback of a resource but does not change the current position or release any resources.
sl@0
   807
    Pauses the internal timer if no resource is open.
sl@0
   808
    
sl@0
   809
    @param aFadeOutDuration
sl@0
   810
	       Length of time over which the volume is faded out from the current settings to zero.
sl@0
   811
    */
sl@0
   812
	virtual void  MmcStopL(const TTimeIntervalMicroSeconds& aFadeOutDuration) = 0;
sl@0
   813
    /**
sl@0
   814
    Gets the max polyphony level the engine can handle.
sl@0
   815
    
sl@0
   816
    @param aNumNotes
sl@0
   817
	       Max polyphony level,  PolyphonyL() <= aMaxNotes.
sl@0
   818
    */
sl@0
   819
	virtual void  MmcMaxPolyphonyL(TInt& aMaxNotes) = 0;
sl@0
   820
	};
sl@0
   821
sl@0
   822
sl@0
   823
/**
sl@0
   824
Mixin class to define an object capable of handling a MIDI event within the controller framework.
sl@0
   825
sl@0
   826
@publishedAll
sl@0
   827
@released
sl@0
   828
*/
sl@0
   829
class MMidiEventHandler
sl@0
   830
	{
sl@0
   831
public:
sl@0
   832
    /**
sl@0
   833
    Send an event to the client.
sl@0
   834
	
sl@0
   835
    @param aEvent
sl@0
   836
	       The MIDI event.
sl@0
   837
	@return One of the system-wide error codes.
sl@0
   838
    */
sl@0
   839
	virtual TInt SendMidiEventToClient(const CMMFMidiEvent& aEvent) = 0;
sl@0
   840
	};
sl@0
   841
sl@0
   842
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
   843
#include <mmf/common/midieventreceiver.h>
sl@0
   844
#endif
sl@0
   845
sl@0
   846
class CMidiEventReceiver;
sl@0
   847
sl@0
   848
/**
sl@0
   849
Custom command parser class to be used by controller plugins wishing to support
sl@0
   850
MIDI controller commands.
sl@0
   851
The controller plugin must be derived from MMidiCustomCommandImplementor
sl@0
   852
to use this class. The controller plugin should create an object of this type and add 
sl@0
   853
it to the list of custom command parsers in the controller framework.
sl@0
   854
sl@0
   855
@publishedAll
sl@0
   856
@released
sl@0
   857
*/
sl@0
   858
class CMidiCustomCommandParser : public CMMFCustomCommandParserBase,
sl@0
   859
								 public MMidiEventHandler	
sl@0
   860
	{
sl@0
   861
public:
sl@0
   862
	IMPORT_C static CMidiCustomCommandParser* NewL(MMidiCustomCommandImplementor& aImplementor);
sl@0
   863
	IMPORT_C ~CMidiCustomCommandParser();
sl@0
   864
	/**
sl@0
   865
    @internalTechnology
sl@0
   866
    */
sl@0
   867
	void HandleRequest(TMMFMessage& aMessage);
sl@0
   868
	virtual TInt SendMidiEventToClient(const CMMFMidiEvent& aEvent);
sl@0
   869
private:
sl@0
   870
	CMidiCustomCommandParser(MMidiCustomCommandImplementor& aImplementor);
sl@0
   871
	// Internal request handling methods.
sl@0
   872
	void DoHandleRequestL(TMMFMessage& aMessage);
sl@0
   873
sl@0
   874
	TBool DoSetPositionMicroBeatsL(TMMFMessage& aMessage);
sl@0
   875
	TBool DoPositionMicroBeatsL(TMMFMessage& aMessage);
sl@0
   876
	TBool DoPlayNoteL(TMMFMessage& aMessage);
sl@0
   877
	TBool DoPlayNoteWithStartTimeL(TMMFMessage& aMessage);
sl@0
   878
	TBool DoStopNotesL(TMMFMessage& aMessage);
sl@0
   879
	TBool DoNoteOnL(TMMFMessage& aMessage);
sl@0
   880
	TBool DoNoteOffL(TMMFMessage& aMessage);
sl@0
   881
	TBool DoPlaybackRateL(TMMFMessage& aMessage);
sl@0
   882
	TBool DoSetPlaybackRateL(TMMFMessage& aMessage);
sl@0
   883
	TBool DoMaxPlaybackRateL(TMMFMessage& aMessage);
sl@0
   884
	TBool DoMinPlaybackRateL(TMMFMessage& aMessage);
sl@0
   885
	TBool DoTempoMicroBeatsPerMinuteL(TMMFMessage& aMessage);
sl@0
   886
	TBool DoSetTempoL(TMMFMessage& aMessage);
sl@0
   887
	TBool DoPitchTranspositionCentsL(TMMFMessage& aMessage);
sl@0
   888
	TBool DoSetPitchTranspositionL(TMMFMessage& aMessage);
sl@0
   889
	TBool DoDurationMicroBeatsL(TMMFMessage& aMessage);
sl@0
   890
	TBool DoNumTracksL(TMMFMessage& aMessage);
sl@0
   891
	TBool DoSetTrackMuteL(TMMFMessage& aMessage);
sl@0
   892
	TBool DoMimeTypeL(TMMFMessage& aMessage);
sl@0
   893
	TBool DoSetSyncUpdateCallbackIntervalL(TMMFMessage& aMessage);
sl@0
   894
	TBool DoSendMessageL(TMMFMessage& aMessage);
sl@0
   895
	TBool DoSendMessageWithTimeStampL(TMMFMessage& aMessage);
sl@0
   896
	TBool DoSendMipMessageL(TMMFMessage& aMessage);
sl@0
   897
	TBool DoNumberOfBanksL(TMMFMessage& aMessage);
sl@0
   898
	TBool DoGetBankIdL(TMMFMessage& aMessage);
sl@0
   899
	TBool DoLoadCustomBankL(TMMFMessage& aMessage);
sl@0
   900
	TBool DoLoadCustomBankDataL(TMMFMessage& aMessage);
sl@0
   901
	TBool DoUnloadCustomBankL(TMMFMessage& aMessage);
sl@0
   902
	TBool DoCustomBankLoadedL(TMMFMessage& aMessage);
sl@0
   903
	TBool DoUnloadAllCustomBanksL(TMMFMessage& aMessage);
sl@0
   904
	TBool DoNumberOfInstrumentsL(TMMFMessage& aMessage);
sl@0
   905
	TBool DoGetInstrumentIdL(TMMFMessage& aMessage);
sl@0
   906
	TBool DoInstrumentNameL(TMMFMessage& aMessage);
sl@0
   907
	TBool DoCopyInstrumentNameL(TMMFMessage& aMessage);
sl@0
   908
	TBool DoSetInstrumentL(TMMFMessage& aMessage);
sl@0
   909
	TBool DoLoadCustomInstrumentL(TMMFMessage& aMessage);
sl@0
   910
	TBool DoLoadCustomInstrumentDataL(TMMFMessage& aMessage);
sl@0
   911
	TBool DoUnloadCustomInstrumentL(TMMFMessage& aMessage);
sl@0
   912
	TBool DoPercussionKeyNameL(TMMFMessage& aMessage);
sl@0
   913
	TBool DoCopyPercussionKeyNameL(TMMFMessage& aMessage);
sl@0
   914
	TBool DoStopTimeL(TMMFMessage& aMessage);
sl@0
   915
	TBool DoSetStopTimeL(TMMFMessage& aMessage);
sl@0
   916
	TBool DoPolyphonyL(TMMFMessage& aMessage);
sl@0
   917
	TBool DoChannelsSupportedL(TMMFMessage& aMessage);
sl@0
   918
	TBool DoChannelVolumeL(TMMFMessage& aMessage);
sl@0
   919
	TBool DoMaxChannelVolumeL(TMMFMessage& aMessage);
sl@0
   920
	TBool DoSetChannelVolumeL(TMMFMessage& aMessage);
sl@0
   921
	TBool DoSetChannelMuteL(TMMFMessage& aMessage);
sl@0
   922
	TBool DoVolumeL(TMMFMessage& aMessage);
sl@0
   923
	TBool DoMaxVolumeL(TMMFMessage& aMessage);
sl@0
   924
	TBool DoSetVolumeL(TMMFMessage& aMessage);
sl@0
   925
	TBool DoSetVolumeRampL(TMMFMessage& aMessage);
sl@0
   926
	TBool DoGetBalanceL(TMMFMessage& aMessage);
sl@0
   927
	TBool DoSetBalanceL(TMMFMessage& aMessage);
sl@0
   928
	TBool DoSetMaxPolyphonyL(TMMFMessage& aMessage);
sl@0
   929
	TBool DoGetRepeatsL(TMMFMessage& aMessage);
sl@0
   930
	TBool DoSetRepeatsL(TMMFMessage& aMessage);
sl@0
   931
	TBool DoSetBankL(TMMFMessage& aMessage);
sl@0
   932
	TBool DoIsTrackMuteL(TMMFMessage& aMessage);
sl@0
   933
	TBool DoIsChannelMuteL(TMMFMessage& aMessage);
sl@0
   934
	TBool DoGetInstrumentL(TMMFMessage& aMessage);
sl@0
   935
	TBool DoCloseL(TMMFMessage& aMessage);
sl@0
   936
	TBool DoStopL(TMMFMessage& aMessage);
sl@0
   937
	TBool DoReceiveEventsL(TMMFMessage& aMessage);
sl@0
   938
	TBool DoRetrieveEventL(TMMFMessage& aMessage);
sl@0
   939
	TBool DoCancelReceiveEventsL(TMMFMessage& aMessage);
sl@0
   940
sl@0
   941
	void DoCreateBufFromUintArrayL(RArray<TUint>& aArray);
sl@0
   942
	void DoCreateBufFromFourCCArrayL(RArray<TFourCC>& aArray);
sl@0
   943
	TBool DoMaxPolyphonyL(TMMFMessage& aMessage);
sl@0
   944
private:
sl@0
   945
	/** The object that implements the MIDI controller interface */
sl@0
   946
	MMidiCustomCommandImplementor& iImplementor;
sl@0
   947
	
sl@0
   948
	CMidiEventReceiver* iMidiEventReceiver;
sl@0
   949
	/** The events waiting to be sent to the client.*/
sl@0
   950
	RPointerArray<CMMFMidiEvent> iMidiEvents;
sl@0
   951
sl@0
   952
	// variable length data waiting to be copied back to the client
sl@0
   953
	CBufFlat* iInstrumentName;
sl@0
   954
	CBufFlat* iPercussionKeyName;
sl@0
   955
	};
sl@0
   956
sl@0
   957
#endif