epoc32/include/mmf/common/mmfmidi.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// Mmf\Common\MmfMidi.h
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __MMF_COMMON_MMFMIDI_H__
williamr@2
    19
#define __MMF_COMMON_MMFMIDI_H__
williamr@2
    20
williamr@2
    21
// Standard EPOC32 includes
williamr@2
    22
#include <e32base.h>
williamr@2
    23
williamr@2
    24
// Public Media Server includes
williamr@2
    25
#include <mmf/common/mmfbase.h>
williamr@2
    26
#include <mmf/common/mmfutilities.h>
williamr@2
    27
williamr@2
    28
#include <midiclientutility.h>
williamr@2
    29
williamr@2
    30
/**
williamr@2
    31
MIDI event usued by a MIDI controller to signal to a 
williamr@2
    32
client that a MIDI source open request has completed.
williamr@2
    33
williamr@2
    34
@publishedAll
williamr@2
    35
@released
williamr@2
    36
*/
williamr@2
    37
const TUid KMMFEventCategoryMidiOpenDataSourceComplete = {0x101F8F85};
williamr@2
    38
williamr@2
    39
/**
williamr@2
    40
MIDI event used by a MIDI controller to signal to a 
williamr@2
    41
client that play of a MIDI resource has commenced.
williamr@2
    42
williamr@2
    43
@publishedAll
williamr@2
    44
@released
williamr@2
    45
*/
williamr@2
    46
const TUid KMMFEventCategoryMidiPlaying = {0x101F8F86};
williamr@2
    47
williamr@2
    48
/**
williamr@2
    49
MIDI event used by a MIDI controller to signal to 
williamr@2
    50
a client that play of a MIDI resource has commenced 
williamr@2
    51
but not all SP-MIDI requirements can be met.
williamr@2
    52
williamr@2
    53
@publishedAll
williamr@2
    54
@released
williamr@2
    55
*/
williamr@2
    56
const TUid KMMFEventCategoryMidiPlaybackIncompatible = {0x101F8F87};
williamr@2
    57
williamr@2
    58
/**
williamr@2
    59
MIDI event used by a MIDI controller to signal to a client that play
williamr@2
    60
of a MIDI resource has commenced but due to system resource constraints
williamr@2
    61
and SP-MIDI content constraints, there is no audible MIDI content
williamr@2
    62
during playback.
williamr@2
    63
williamr@2
    64
@publishedAll
williamr@2
    65
@released
williamr@2
    66
*/
williamr@2
    67
const TUid KMMFEventCategoryMidiPlaybackSilent = {0x101F8F88};
williamr@2
    68
williamr@2
    69
/**
williamr@2
    70
MIDI event used by a MIDI controller to signal to
williamr@2
    71
a client that play of a MIDI resource has completed.
williamr@2
    72
williamr@2
    73
@publishedAll
williamr@2
    74
@released
williamr@2
    75
*/
williamr@2
    76
const TUid KMMFEventCategoryMidiPlayingComplete = {0x101F8F89};
williamr@2
    77
williamr@2
    78
/**
williamr@2
    79
MIDI event used by a MIDI controller to signal to
williamr@2
    80
a client a sync update event. The frequency of this event is
williamr@2
    81
set by the client with SetSyncUpdateCallbackIntervalL.
williamr@2
    82
williamr@2
    83
@publishedAll
williamr@2
    84
@released
williamr@2
    85
*/
williamr@2
    86
const TUid KMMFEventCategoryMidiSyncUpdate = {0x101F8F8A};
williamr@2
    87
williamr@2
    88
/**
williamr@2
    89
MIDI event used by a MIDI controller to signal to
williamr@2
    90
a client that any currently opened resources have been closed.
williamr@2
    91
williamr@2
    92
@publishedAll
williamr@2
    93
@released
williamr@2
    94
*/
williamr@2
    95
const TUid KMMFEventCategoryMidiClose = {0x101F8F8B};
williamr@2
    96
williamr@2
    97
/**
williamr@2
    98
MIDI event used by a MIDI controller to signal to a client that the 
williamr@2
    99
MIDI controller has been primed and it's ready to play.
williamr@2
   100
williamr@2
   101
@publishedAll
williamr@2
   102
@released
williamr@2
   103
*/
williamr@2
   104
const TUid KMMFEventCategoryMidiPrime = {0x101F8F8C};
williamr@2
   105
williamr@2
   106
/**
williamr@2
   107
MIDI event used by a MIDI controller to signal to a client that the MIDI
williamr@2
   108
resource has encountered a tempo change message in the MIDI data stream.
williamr@2
   109
williamr@2
   110
@publishedAll
williamr@2
   111
@released
williamr@2
   112
*/
williamr@2
   113
const TUid KMMFEventCategoryTempoChanged = {0x101F8F8D};
williamr@2
   114
williamr@2
   115
/**
williamr@2
   116
MIDI event used by a MIDI controller to signal to a client that the MIDI
williamr@2
   117
resource has encountered a volume change message in the MIDI data stream.
williamr@2
   118
williamr@2
   119
@publishedAll
williamr@2
   120
@released
williamr@2
   121
*/
williamr@2
   122
const TUid KMMFEventCategoryVolumeChanged = {0x101F8F8E};
williamr@2
   123
williamr@2
   124
/**
williamr@2
   125
MIDI event used by a MIDI controller to signal to a client that the 
williamr@2
   126
MIDI resource has encountered a mute message in the MIDI data stream.
williamr@2
   127
williamr@2
   128
@publishedAll
williamr@2
   129
@released
williamr@2
   130
*/
williamr@2
   131
const TUid KMMFEventCategoryMuteChanged = {0x101F8F8F};
williamr@2
   132
williamr@2
   133
/**
williamr@2
   134
MIDI event used by a MIDI controller to signal to a client that the polyphony
williamr@2
   135
of the MIDI engine has changed.
williamr@2
   136
williamr@2
   137
@publishedAll
williamr@2
   138
@released
williamr@2
   139
*/
williamr@2
   140
const TUid KMMFEventCategoryPolyphonyChanged = {0x101F8F90};
williamr@2
   141
williamr@2
   142
/**
williamr@2
   143
MIDI event used by a MIDI controller to signal to a client that
williamr@2
   144
an instrument has been changed on a channel.
williamr@2
   145
williamr@2
   146
@publishedAll
williamr@2
   147
@released
williamr@2
   148
*/
williamr@2
   149
const TUid KMMFEventCategoryInstrumentChanged = {0x101F8F91};
williamr@2
   150
williamr@2
   151
/**
williamr@2
   152
MIDI event used by a MIDI controller to signal to a client that a timed
williamr@2
   153
meta data entry has been found in the MIDI data stream.
williamr@2
   154
williamr@2
   155
@publishedAll
williamr@2
   156
@released
williamr@2
   157
*/
williamr@2
   158
const TUid KMMFEventCategoryMetaDataEntryFound  = {0x101F8F92};
williamr@2
   159
williamr@2
   160
/**
williamr@2
   161
MIDI event used by a MIDI controller to signal to a client that a 
williamr@2
   162
MIP message has been found in the MIDI data stream.
williamr@2
   163
williamr@2
   164
@publishedAll
williamr@2
   165
@released
williamr@2
   166
*/
williamr@2
   167
const TUid KMMFEventCategoryMipMessageReceived  = {0x101F8F93};
williamr@2
   168
williamr@2
   169
/**
williamr@2
   170
@internalComponent
williamr@2
   171
*/
williamr@2
   172
class TMMFMidiConfig1
williamr@2
   173
	{
williamr@2
   174
public:
williamr@2
   175
	inline TMMFMidiConfig1();
williamr@2
   176
public:
williamr@2
   177
	/** 
williamr@2
   178
	 * Number of tracks present in the currently open MIDI resource.
williamr@2
   179
	 */
williamr@2
   180
	TInt iNumTracks;
williamr@2
   181
williamr@2
   182
	/** 
williamr@2
   183
	 * Current state of the MIDI client utility object 
williamr@2
   184
	 * (EMidiStateClosedDisengaged,EMidiStateOpenDisengaged,EMidiStateOpenPlaying,EMidiStatePlaybackIncompatible,
williamr@2
   185
	 *  EMidiStatePlaybackSilent, EMidiStateClosedEngaged, EMidiStateOpenEngaged).
williamr@2
   186
	 */
williamr@2
   187
	 
williamr@2
   188
	TInt iState;
williamr@2
   189
williamr@2
   190
	/** 
williamr@2
   191
	 * Tempo in microbeats per minute (BPM*1000000).
williamr@2
   192
	 */
williamr@2
   193
	TInt iTempo;
williamr@2
   194
williamr@2
   195
	/** 
williamr@2
   196
	 * Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents.
williamr@2
   197
	 */
williamr@2
   198
	TInt iPitch;
williamr@2
   199
williamr@2
   200
	/** 
williamr@2
   201
	 * Array of logical {channel, MIP} value pairs to send SP-MIDI MIP message to the MIDI engine.
williamr@2
   202
	 */
williamr@2
   203
	const TArray<TMipMessageEntry>* iMipMessage; 
williamr@2
   204
williamr@2
   205
	/** 
williamr@2
   206
	 * The maximum number of notes that the MIDI engine supports simultaneously (polyphony).
williamr@2
   207
	 */
williamr@2
   208
	TInt iNumNotes; 
williamr@2
   209
williamr@2
   210
	/** 
williamr@2
   211
	 * Max polyphony level: 0 <= PolyphonyL() <= iMaxNotes.
williamr@2
   212
	 */
williamr@2
   213
	TInt iMaxNotes;
williamr@2
   214
williamr@2
   215
	/** 
williamr@2
   216
	 * Overall volume of the MIDI client.
williamr@2
   217
	 */
williamr@2
   218
	TInt iVolume;
williamr@2
   219
williamr@2
   220
	/** 
williamr@2
   221
	 * Maximum volume that may be applied overall to the MIDI client.
williamr@2
   222
	 */
williamr@2
   223
	TInt iMaxVolume;
williamr@2
   224
williamr@2
   225
	/** 
williamr@2
   226
	 * Length of time over which the volume is faded up from zero to the current settings when playback is started.
williamr@2
   227
	 */
williamr@2
   228
	TTimeIntervalMicroSeconds iRampDuration;
williamr@2
   229
williamr@2
   230
	/** 
williamr@2
   231
	 * Stereo balance value: KMMFBalanceMaxLeft <= iBalance <= KMMFBalanceMaxRight.
williamr@2
   232
	 */
williamr@2
   233
	TInt iBalance;
williamr@2
   234
williamr@2
   235
	/** 
williamr@2
   236
	 * The number of times the current opened resources has to be repeated.
williamr@2
   237
	 * This includes the first instance of playing.
williamr@2
   238
	 */
williamr@2
   239
	TInt iNumRepeats;
williamr@2
   240
williamr@2
   241
	/** 
williamr@2
   242
	 * Length of time over which the volume is faded out from the current settings to zero.
williamr@2
   243
	 */
williamr@2
   244
	TTimeIntervalMicroSeconds iFadeOutDuration;
williamr@2
   245
	};
williamr@2
   246
williamr@2
   247
/**
williamr@2
   248
@internalComponent
williamr@2
   249
*/
williamr@2
   250
class TMMFMidiConfig2
williamr@2
   251
	{
williamr@2
   252
public:
williamr@2
   253
	inline TMMFMidiConfig2();
williamr@2
   254
public:
williamr@2
   255
	/** 
williamr@2
   256
	 * Index of the track to mute: 0 <= iTrack < NumTracksL().
williamr@2
   257
	 */
williamr@2
   258
	TInt iTrack;
williamr@2
   259
williamr@2
   260
	/** 
williamr@2
   261
	 * ETrue to mute the track/channel, EFalse to unmute it.
williamr@2
   262
	 */
williamr@2
   263
	TBool iMuted;
williamr@2
   264
williamr@2
   265
	/** 
williamr@2
   266
	 * Note to play ot to terminate: 0 <= iNote <= 127.
williamr@2
   267
	 */
williamr@2
   268
	TInt iNote;
williamr@2
   269
williamr@2
   270
	/** 
williamr@2
   271
	 * Length of time to play the note for.
williamr@2
   272
	 */
williamr@2
   273
	TTimeIntervalMicroSeconds iDurationMicroSeconds;
williamr@2
   274
williamr@2
   275
	/** 
williamr@2
   276
	 * Specifying the time at which to start playing the note.
williamr@2
   277
	 * It's relative to the MIDI resource playing time or the time elapsed
williamr@2
   278
	 * since Play() was called if no resource is present.
williamr@2
   279
	 */
williamr@2
   280
	TTimeIntervalMicroSeconds iStartTime;
williamr@2
   281
williamr@2
   282
	/** 
williamr@2
   283
	 * Velocity with which to start the note: 0 <= iNoteOnVelocity <= 127.
williamr@2
   284
	 */
williamr@2
   285
	TInt iNoteOnVelocity;
williamr@2
   286
williamr@2
   287
	/** 
williamr@2
   288
	 * Velocity with which to stop the note: 0 <= iNoteOffVelocity <= 127.
williamr@2
   289
	 */
williamr@2
   290
	TInt iNoteOffVelocity;
williamr@2
   291
williamr@2
   292
	/** 
williamr@2
   293
	 * Number of standard or custom sound banks currently available.
williamr@2
   294
	 */
williamr@2
   295
	TInt iNumBanks;
williamr@2
   296
williamr@2
   297
	/** 
williamr@2
   298
	 * Specifies whether to reference a custom or standard sound bank.
williamr@2
   299
	 */
williamr@2
   300
	TBool iCustom;
williamr@2
   301
williamr@2
   302
	/** 
williamr@2
   303
	 * Index of custom/deault bank: 0 <= iBankIndex < NumberOfBanksL()
williamr@2
   304
	 */
williamr@2
   305
	TInt iBankIndex;
williamr@2
   306
williamr@2
   307
	/** 
williamr@2
   308
	 * Custom/deault Bank's Identifier.
williamr@2
   309
	 */
williamr@2
   310
	TInt iBankId;
williamr@2
   311
williamr@2
   312
	/** 
williamr@2
   313
	 * Identifier of the custom bank in memory.
williamr@2
   314
	 */
williamr@2
   315
	TInt iMemoryBankId;
williamr@2
   316
williamr@2
   317
	/** 
williamr@2
   318
	 * Name of the file containing the custom sound bank or the name 
williamr@2
   319
	 * of the file containing the instrument. Includes the directory path. 
williamr@2
   320
	 */
williamr@2
   321
	const TDesC* iFileName;
williamr@2
   322
williamr@2
   323
	/** 
williamr@2
   324
	 * Descriptor containing the custom sound bank.
williamr@2
   325
	 */
williamr@2
   326
	const TDesC8* iBankData;
williamr@2
   327
williamr@2
   328
	/** 
williamr@2
   329
	 * Descriptor containing the instrument.
williamr@2
   330
	 */
williamr@2
   331
	const TDesC8* iInstrumentData;
williamr@2
   332
williamr@2
   333
	/** 
williamr@2
   334
	 * ETrue if the specified bank is in memory, EFalse otherwise.
williamr@2
   335
	 */
williamr@2
   336
	TBool iBankLoaded;
williamr@2
   337
williamr@2
   338
	/** 
williamr@2
   339
	 * Number of instruments available for the specified sound bank.
williamr@2
   340
	 */
williamr@2
   341
	TInt iNumInstruments;
williamr@2
   342
williamr@2
   343
	/** 
williamr@2
   344
	 * Index of the instrument to reference: 0 <= aInstrumentIndex < NumberOfInstrumentsL().
williamr@2
   345
	 */
williamr@2
   346
	TInt iInstrumentIndex;
williamr@2
   347
williamr@2
   348
	/** 
williamr@2
   349
	 * Identifier of specified instrument. This may differ from the index 
williamr@2
   350
	 * since the index simply enumerates the instruments, whereas identifiers 
williamr@2
   351
	 * may not be contiguous, especially where certain instruments correspond 
williamr@2
   352
	 * to General MIDI-defined instruments but not all instruments are present.
williamr@2
   353
	 * 0 <= iInstrumentId <= 127.
williamr@2
   354
	 */
williamr@2
   355
	TInt iInstrumentId;
williamr@2
   356
williamr@2
   357
	/** 
williamr@2
   358
	 * Identifier of the instrument in memory.
williamr@2
   359
	 */
williamr@2
   360
	TInt iMemoryInstrumentId;
williamr@2
   361
williamr@2
   362
	/** 
williamr@2
   363
	 * Current metrical position of the MIDI resource being played.
williamr@2
   364
	 * Microbeats (BPM*1000000) relative to the start of the resource.
williamr@2
   365
	 */
williamr@2
   366
	TInt64 iPositionMicroBeats;
williamr@2
   367
williamr@2
   368
	/** 
williamr@2
   369
	 * Length of the currently open MIDI resource.
williamr@2
   370
	 * Duration in microbeats (beats * 1000000).
williamr@2
   371
	 */
williamr@2
   372
	TInt64 iDurationMicroBeats;
williamr@2
   373
williamr@2
   374
	/** 
williamr@2
   375
	 * Time at which playback will stop, relative to the start of the resource.
williamr@2
   376
	 * Clamped to 0 and the duration of the resource.
williamr@2
   377
	 */
williamr@2
   378
	TTimeIntervalMicroSeconds iStopTime;
williamr@2
   379
williamr@2
   380
	/** 
williamr@2
   381
	 * Logical channel: 0 <= iChannel < ChannelsSupportedL().
williamr@2
   382
	 */
williamr@2
   383
	TInt iChannel;
williamr@2
   384
williamr@2
   385
	/** 
williamr@2
   386
	 * Volume level in dB corresponding to the MIDI Channel:
williamr@2
   387
	 * -infinity <= iChannelVol <= MaxVolumeL().
williamr@2
   388
	 */
williamr@2
   389
	TReal32 iChannelVol;
williamr@2
   390
williamr@2
   391
	/** 
williamr@2
   392
	 * Maximum volume setting in dB, should always be 0 dB and 
williamr@2
   393
	 * correspond to the MIDI Channel Volume controller maximum value.
williamr@2
   394
	 */
williamr@2
   395
	TReal32 iMaxChannelVol;
williamr@2
   396
	};
williamr@2
   397
williamr@2
   398
/**
williamr@2
   399
@internalComponent
williamr@2
   400
*/
williamr@2
   401
class TMMFMidiConfig3
williamr@2
   402
	{
williamr@2
   403
public:
williamr@2
   404
	inline TMMFMidiConfig3();
williamr@2
   405
public:
williamr@2
   406
	/** 
williamr@2
   407
	 * Temporal interval between MmcuoSyncUpdate callback.
williamr@2
   408
	 */
williamr@2
   409
	TTimeIntervalMicroSeconds iCallbackIntervalMicroSeconds;
williamr@2
   410
williamr@2
   411
	/** 
williamr@2
   412
	 * Metrical interval between MmcuoSyncUpdate callback.
williamr@2
   413
	 */
williamr@2
   414
	TInt64 iCallbackIntervalMicroBeats;
williamr@2
   415
williamr@2
   416
	/** 
williamr@2
   417
	 * Number of bytes of the MIDI message buffer actually processed when client
williamr@2
   418
	 * calls SendMessageL.
williamr@2
   419
	 */
williamr@2
   420
	TInt iBytesProcessed;
williamr@2
   421
williamr@2
   422
	/** 
williamr@2
   423
	 * Time at which to execute the MIDI message sent by SendMessageL.
williamr@2
   424
	 * It's relative to the MIDI resource playing time or the time elapsed 
williamr@2
   425
	 * since Play() was called if no resource is present.
williamr@2
   426
	 */
williamr@2
   427
	TTimeIntervalMicroSeconds iTimeStamp;
williamr@2
   428
williamr@2
   429
	/** 
williamr@2
   430
	 * Number of time to repeat the resource during playback. This includes the first playing.
williamr@2
   431
	 */
williamr@2
   432
	TInt iRepeatNumberOfTimes;
williamr@2
   433
williamr@2
   434
	/** 
williamr@2
   435
	 * Time in microseconds to pause between repeats.
williamr@2
   436
	 */
williamr@2
   437
	TTimeIntervalMicroSeconds iTrailingSilence;
williamr@2
   438
williamr@2
   439
	/** 
williamr@2
   440
	 * Playback rate for the playback of the current MIDI resource
williamr@2
   441
	 * in percent times 1000, i.e., 100000 means original playback speed,
williamr@2
   442
	 * 200000 means double speed, and 50000 means half speed playback.
williamr@2
   443
	 */
williamr@2
   444
	TInt iPlayBackRate;
williamr@2
   445
williamr@2
   446
	/** 
williamr@2
   447
	 * Maximum playback rate supported by MIDI player.
williamr@2
   448
	 */
williamr@2
   449
	TInt iPlayBackMaxRate;
williamr@2
   450
williamr@2
   451
	/** 
williamr@2
   452
	 * Minimum playback rate supported by MIDI player.
williamr@2
   453
	 */
williamr@2
   454
	TInt iPlayBackMinRate;
williamr@2
   455
williamr@2
   456
	/** 
williamr@2
   457
	 * Descriptor containing a MIDI message data. If there
williamr@2
   458
	 * are several MIDI messages in the buffer, only the first
williamr@2
   459
	 * one is processed.
williamr@2
   460
	 */
williamr@2
   461
	const TDesC8* iMidiMessage;
williamr@2
   462
	};
williamr@2
   463
williamr@2
   464
inline TMMFMidiConfig1::TMMFMidiConfig1()
williamr@2
   465
{};
williamr@2
   466
williamr@2
   467
inline TMMFMidiConfig2::TMMFMidiConfig2()
williamr@2
   468
{};
williamr@2
   469
williamr@2
   470
inline TMMFMidiConfig3::TMMFMidiConfig3()
williamr@2
   471
{};
williamr@2
   472
williamr@2
   473
#endif