1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/MIDI/src/midiclientutility.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,1196 @@
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 "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.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 +#include <midiclientutility.h>
1.20 +#include "midiclientutilitybody.h"
1.21 +
1.22 +
1.23 +/**
1.24 +Static factory function for creating a MIDI client utility object.
1.25 +This function is synchronous, unlike the other factory functions,
1.26 +because it doesn't need to perform any MIDI resource initialisation.
1.27 +
1.28 +@param aObserver
1.29 + Reference to an object to receive callbacks on completion of asynchronous functions.
1.30 +@param aPriority
1.31 + The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and
1.32 + EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
1.33 +@param aPref
1.34 + The Priority Preference - an additional audio policy parameter. The suggested default is
1.35 + EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional
1.36 + values may be supported by given phones and/or platforms, but should not be depended upon by
1.37 + portable code.
1.38 +@param aUseSharedHeap
1.39 + Select if the underlying controller will have its own heap or share a single heap with other
1.40 + controller instances.
1.41 + The default behaviour, or if this value is EFalse, is that each controller is created with
1.42 + its own heap. The alternative, if the value is ETrue, is that controllers share a special
1.43 + heap with other controllers created the same way. Each heap uses a chunk, so this avoids
1.44 + situations where the number of chunks per process is limited. The default behaviour is
1.45 + generally to be preferred, and should give lower overall memory usage. However, if many
1.46 + controllers are to be created for a particular thread, then ETrue should be provided to
1.47 + prevent running out of heaps or chunks.
1.48 +@return Fully constructed utility object ready to have an OpenXxxx() function called.
1.49 +
1.50 +Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
1.51 +several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference,
1.52 +the adaptation may consider other parameters such as the SecureId and Capabilities of the client process.
1.53 +Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may
1.54 +vary between different phones. Portable applications are advised not to assume any specific behaviour.
1.55 +*/
1.56 +EXPORT_C CMidiClientUtility* CMidiClientUtility::NewL(MMidiClientUtilityObserver& aObserver, TInt aPriority, TInt aPref, TBool aUseSharedHeap)
1.57 + {
1.58 + CMidiClientUtility* self = new(ELeave) CMidiClientUtility();
1.59 + CleanupStack::PushL(self);
1.60 + self->iBody = CMidiClientUtility::CBody::NewL(self, aObserver, aPriority, aPref, aUseSharedHeap );
1.61 + CleanupStack::Pop(self);
1.62 + return self;
1.63 + }
1.64 +
1.65 +/**
1.66 +Static factory function for creating a MIDI client utility object.
1.67 +This function is synchronous, unlike the other factory functions,
1.68 +because it doesn't need to perform any MIDI resource initialisation
1.69 +The underlying controller that is created will be given its own heap.
1.70 +
1.71 +@param aObserver
1.72 + Reference to an object to receive callbacks on completion of asynchronous functions.
1.73 +@param aPriority
1.74 + The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and
1.75 + EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
1.76 +@param aPref
1.77 + The Priority Preference - an additional audio policy parameter. The suggested default is
1.78 + EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional
1.79 + values may be supported by given phones and/or platforms, but should not be depended upon by
1.80 + portable code.
1.81 +@return Fully constructed utility object ready to have an OpenXxxx() function called.
1.82 +
1.83 +Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
1.84 +several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference,
1.85 +the adaptation may consider other parameters such as the SecureId and Capabilities of the client process.
1.86 +Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may
1.87 +vary between different phones. Portable applications are advised not to assume any specific behaviour.
1.88 +*/
1.89 +EXPORT_C CMidiClientUtility* CMidiClientUtility::NewL(MMidiClientUtilityObserver& aObserver, TInt aPriority, TInt aPref)
1.90 + {
1.91 + return NewL( aObserver, aPriority, aPref, EFalse );
1.92 + }
1.93 +
1.94 +CMidiClientUtility::~CMidiClientUtility()
1.95 + {
1.96 + delete iBody;
1.97 + }
1.98 +
1.99 +/**
1.100 +Asynchronous function to open a file containing MIDI data and perform
1.101 +initialisation ready for playback
1.102 +
1.103 +@param aFileName Name of the MIDI file to open
1.104 +*/
1.105 +EXPORT_C void CMidiClientUtility::OpenFile(const TDesC& aFileName)
1.106 + {
1.107 + iBody->OpenFile(aFileName);
1.108 + }
1.109 +
1.110 +/**
1.111 +Asynchronous function to open a file containing MIDI data and perform
1.112 +initialisation ready for playback
1.113 +
1.114 +@param aFile Open shared protected session handle to the midi file to read
1.115 +*/
1.116 +EXPORT_C void CMidiClientUtility::OpenFile(const RFile& aFile)
1.117 + {
1.118 + iBody->OpenFile(const_cast<RFile&>(aFile));
1.119 + }
1.120 +
1.121 +/**
1.122 +Asynchronous function to open a file containing MIDI data and perform
1.123 +initialisation ready for playback
1.124 +
1.125 +@param aFileSource TFileSource object which references either a filename or a
1.126 +file handle to the midi file to read
1.127 +*/
1.128 +EXPORT_C void CMidiClientUtility::OpenFile(const TMMSource& aSource)
1.129 + {
1.130 + iBody->OpenFile(aSource);
1.131 + }
1.132 +
1.133 +/**
1.134 +Asynchronous function to open a descriptor containing MIDI data and perform
1.135 +initialisation ready for playback
1.136 +
1.137 +@param aDescriptor descriptor containing MIDI data
1.138 +*/
1.139 +EXPORT_C void CMidiClientUtility::OpenDes(const TDesC8& aDescriptor)
1.140 + {
1.141 + iBody->OpenDes(aDescriptor);
1.142 + }
1.143 +
1.144 +/**
1.145 +Asynchronous function to open a URL containing MIDI data and perform
1.146 +initialisation ready for playback
1.147 +
1.148 +@param aUrl
1.149 + Uniform Resource Locator for a MIDI data stream
1.150 +@param aIapId
1.151 + Identifier of the Internet Access Point to use -
1.152 + available from CommDB, the comms connections database.
1.153 + Defaults to using the default access point, as defined by CommDB
1.154 +@param aMimeType
1.155 + Mime type of the MIDI data stream to be played.
1.156 + Defaults to nothing in which case the an attempt will be made to recognise the type of the MIDI data automatically.
1.157 +*/
1.158 +EXPORT_C void CMidiClientUtility::OpenUrl(const TDesC& aUrl,TInt aIapId,const TDesC8& aMimeType)
1.159 + {
1.160 + iBody->OpenUrl(aUrl, aIapId, aMimeType);
1.161 + }
1.162 +
1.163 +/**
1.164 +Asynchronous function to initiate or resume playback of a previously opened resource.
1.165 +Also used to start an internal timer to establish a zero-time for the media stream
1.166 +time relative to which commands with timestamps are timed against
1.167 +*/
1.168 +EXPORT_C void CMidiClientUtility::Play()
1.169 + {
1.170 + iBody->Play();
1.171 + }
1.172 +
1.173 +/**
1.174 +Stops playback of a resource but does not change the current position or release any resources.
1.175 +Pauses the internal timer if no resource is open
1.176 +
1.177 +@param aFadeOutDuration
1.178 + Length of time over which the volume is faded out from the current settings to zero.
1.179 +*/
1.180 +EXPORT_C void CMidiClientUtility::Stop(const TTimeIntervalMicroSeconds& aFadeOutDuration)
1.181 + {
1.182 + iBody->Stop(aFadeOutDuration);
1.183 + }
1.184 +
1.185 +/**
1.186 +Asynchronous function which closes any currently open resources, such as files, descriptors or URLs in use.
1.187 +Does nothing if there is nothing currently open.
1.188 +*/
1.189 +EXPORT_C void CMidiClientUtility::Close()
1.190 + {
1.191 + iBody->Close();
1.192 + }
1.193 +
1.194 +/**
1.195 +Gets the current state of the MIDI client utility with regard to MIDI resources
1.196 +
1.197 +@return The current state of the utility
1.198 +*/
1.199 +EXPORT_C TMidiState CMidiClientUtility::State() const
1.200 + {
1.201 + return iBody->State();
1.202 + }
1.203 +
1.204 +/**
1.205 +Synchronous function to play a single note.
1.206 +Multiple calls to this function will be accommodated as far as the MIDI engine can
1.207 +manage. The same functionality could be implemented using the SendMessage function
1.208 +
1.209 +@param aChannel
1.210 + Logical channel to play note on. 0 <= aChannel <= 15.
1.211 +@param aNote
1.212 + Note to play. 0 <= aNote <= 127
1.213 +@param aDuration
1.214 + Length of time to play note for.
1.215 +@param aNoteOnVelocity
1.216 + Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127.
1.217 +@param aNoteOffVelocity
1.218 + Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.
1.219 +*/
1.220 +EXPORT_C void CMidiClientUtility::PlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity)
1.221 + {
1.222 + iBody->PlayNoteL(aChannel, aNote, aDuration, aNoteOnVelocity, aNoteOffVelocity);
1.223 + }
1.224 +
1.225 +/**
1.226 +Synchronous function to play a single note at a specified time.
1.227 +Multiple calls to this function will be accommodated as far as the MIDI engine can
1.228 +manage. The same functionality could be implemented using the SendMessage function
1.229 +
1.230 +@param aChannel
1.231 + Logical channel to play note on. 0 <= aChannel <= 15.
1.232 +@param aNote
1.233 + Note to play. 0 <= aNote <= 127
1.234 +@param aStartTime
1.235 + specifies the time at which to start playing the note,
1.236 + relative to the MIDI resource playing time or the time elapsed since Play() was called if no resource is present
1.237 +@param aDuration
1.238 + Length of time to play note for.
1.239 +@param aNoteOnVelocity
1.240 + Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127.
1.241 +@param aNoteOffVelocity
1.242 + Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127.
1.243 +*/
1.244 +EXPORT_C void CMidiClientUtility::PlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aStartTime,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity)
1.245 + {
1.246 + iBody->PlayNoteL(aChannel, aNote, aStartTime, aDuration, aNoteOnVelocity, aNoteOffVelocity);
1.247 + }
1.248 +
1.249 +/**
1.250 +Stops the playback of all notes on the given channel,
1.251 +by means of an All Notes Off MIDI message
1.252 +
1.253 +@param aChannel
1.254 + Logical channel to stop notes on. 0 <= aChannel <= 15
1.255 +*/
1.256 +EXPORT_C void CMidiClientUtility::StopNotes(TInt aChannel)
1.257 + {
1.258 + iBody->StopNotes(aChannel);
1.259 + }
1.260 +
1.261 +/**
1.262 +Synchronous function to commence playback of a note.
1.263 +Multiple calls to this function will be accommodated as far as the MIDI engine can manage
1.264 +
1.265 +@param aChannel
1.266 + Logical channel to play note on. 0 <= aChannel <= 15
1.267 +@param aNote
1.268 + Note to play. 0 <= aNote <= 127
1.269 +@param aVelocity
1.270 + Velocity with which to start the note.
1.271 + The legal integer range is 0 <= aVelocity <= 127, but the value zero
1.272 + actually causes the message to be interpreted as a Note Off message
1.273 + instead of a Note On.
1.274 +*/
1.275 +EXPORT_C void CMidiClientUtility::NoteOnL(TInt aChannel,TInt aNote,TInt aVelocity)
1.276 + {
1.277 + iBody->NoteOnL(aChannel, aNote, aVelocity);
1.278 + }
1.279 +
1.280 +/**
1.281 +Synchronous function to terminate playback of a note. If no corresponding note
1.282 +is found then no error is raised.
1.283 +
1.284 +@param aChannel
1.285 + Logical channel on which the note is playing. 0 <= aChannel <= 15.
1.286 +@param aNote
1.287 + Note to terminate. 0 <= aNote <= 127.
1.288 +@param aVelocity
1.289 + Velocity with which to stop the note. 0 <= aVelocity <= 127. There is no
1.290 + standard behaviour corresponding with note off velocity.
1.291 +*/
1.292 +EXPORT_C void CMidiClientUtility::NoteOffL(TInt aChannel,TInt aNote,TInt aVelocity)
1.293 + {
1.294 + iBody->NoteOffL(aChannel, aNote, aVelocity);
1.295 + }
1.296 +
1.297 +/**
1.298 +Gets the current playback rate factor of the currently open MIDI resource.
1.299 +The playback rate is independent from tempo,
1.300 +i.e., it can be used to give an overall speed factor for playback
1.301 +
1.302 +@return Current playback rate in percent times 1000,
1.303 + i.e., 100000 means original playback speed, 200000 means double speed,
1.304 + and 50000 means half speed playback
1.305 +*/
1.306 +EXPORT_C TInt CMidiClientUtility::PlaybackRateL() const
1.307 + {
1.308 + return iBody->PlaybackRateL();
1.309 + }
1.310 +
1.311 +/**
1.312 +Sets the playback rate for the playback of the current MIDI resource.
1.313 +The playback rate is independent from tempo,
1.314 +i.e., it can be used to give an overall speed factor for playback.
1.315 +May be called whether playback is in progress or not.
1.316 +
1.317 +@param aRate
1.318 + Playback rate in percent times 1000,
1.319 + i.e., 100000 means original playback speed, 200000 means double speed,
1.320 + and 50000 means half speed playback
1.321 +*/
1.322 +EXPORT_C void CMidiClientUtility::SetPlaybackRateL(TInt aRate)
1.323 + {
1.324 + iBody->SetPlaybackRateL(aRate);
1.325 + }
1.326 +
1.327 +/**
1.328 +Gets the maximum playback rate in milli-percentage from the MIDI engine.
1.329 +@see SetPlaybackRate() for milli-percentage details
1.330 +
1.331 +@return Maximum playback rate supported by MIDI player
1.332 +*/
1.333 +EXPORT_C TInt CMidiClientUtility::MaxPlaybackRateL() const
1.334 + {
1.335 + return iBody->MaxPlaybackRateL();
1.336 + }
1.337 +
1.338 +/**
1.339 +Gets the minimum playback rate in milli-percentage from the MIDI engine.
1.340 +@see SetPlaybackRate() for milli-percentage details.
1.341 +
1.342 +@return Minimum playback rate supported by MIDI player.
1.343 +*/
1.344 +EXPORT_C TInt CMidiClientUtility::MinPlaybackRateL() const
1.345 + {
1.346 + return iBody->MinPlaybackRateL();
1.347 + }
1.348 +
1.349 +/**
1.350 +Gets the current tempo of the currently open MIDI resource. The tempo is independent
1.351 +from the playback rate, i.e., the resulting playback speed will be affected by both.
1.352 +
1.353 +@return Tempo at the current position of the currently open resource in microbeats per minute,
1.354 + i.e. BPM * 1000000. Filled in by the controller framework
1.355 +*/
1.356 +EXPORT_C TInt CMidiClientUtility::TempoMicroBeatsPerMinuteL() const
1.357 + {
1.358 + return iBody->TempoMicroBeatsPerMinuteL();
1.359 + }
1.360 +
1.361 +/**
1.362 +Sets the tempo at which the current MIDI resource should be played.
1.363 +May be called whether playback is in progress or not.
1.364 +The tempo is independent from the playback rate,
1.365 +i.e., the resulting playback speed will be affected by both
1.366 +
1.367 +@param aMicroBeatsPerMinute
1.368 + Tempo in microbeats per minute (BPM*1000000) to set
1.369 +*/
1.370 +EXPORT_C void CMidiClientUtility::SetTempoL(TInt aMicroBeatsPerMinute)
1.371 + {
1.372 + iBody->SetTempoL(aMicroBeatsPerMinute);
1.373 + }
1.374 +
1.375 +/**
1.376 +Gets the pitch shift in use for the currently open MIDI resource
1.377 +
1.378 +@return Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents
1.379 +*/
1.380 +EXPORT_C TInt CMidiClientUtility::PitchTranspositionCentsL() const
1.381 + {
1.382 + return iBody->PitchTranspositionCentsL();
1.383 + }
1.384 +
1.385 +/**
1.386 +Sets the pitch shift to apply to the currently open MIDI resource.
1.387 +May be called during playback
1.388 +aCents parameter is not checked - if the value is out of range, it is expected KErrArgument is return by MIDI engine.
1.389 +
1.390 +@param aCents
1.391 + Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents
1.392 +@return Actual pitch shift applied -
1.393 + may differ from the requested value due to limitations of the MIDI engine
1.394 +*/
1.395 +EXPORT_C TInt CMidiClientUtility::SetPitchTranspositionL(TInt aCents)
1.396 + {
1.397 + return iBody->SetPitchTranspositionL(aCents);
1.398 + }
1.399 +
1.400 +/**
1.401 +Gets the length of the currently open MIDI resource in micro-seconds
1.402 +
1.403 +@return Duration in microseconds (seconds * 1000000).
1.404 +*/
1.405 +EXPORT_C TTimeIntervalMicroSeconds CMidiClientUtility::DurationMicroSecondsL() const
1.406 + {
1.407 + return iBody->DurationMicroSecondsL();
1.408 + }
1.409 +
1.410 +/**
1.411 +Gets the length of the currently open MIDI resource in micro-beats
1.412 +
1.413 +@return Duration in microbeats (beats * 1000000).
1.414 +*/
1.415 +EXPORT_C TInt64 CMidiClientUtility::DurationMicroBeatsL() const
1.416 + {
1.417 + return iBody->DurationMicroBeatsL();
1.418 + }
1.419 +
1.420 +/**
1.421 +Gets the number of tracks present in the currently open MIDI resource
1.422 +
1.423 +@return Number of tracks
1.424 +*/
1.425 +EXPORT_C TInt CMidiClientUtility::NumTracksL() const
1.426 + {
1.427 + return iBody->NumTracksL();
1.428 + }
1.429 +
1.430 +/**
1.431 +Mutes or unmutes a particular track
1.432 +
1.433 +@param aTrack
1.434 + Index of the track to mute - 0 <= aTrack < NumTracksL().
1.435 +@param aMuted
1.436 + ETrue to mute the track, EFalse to unmute it.
1.437 +*/
1.438 +EXPORT_C void CMidiClientUtility::SetTrackMuteL(TInt aTrack,TBool aMuted) const
1.439 + {
1.440 + iBody->SetTrackMuteL(aTrack, aMuted);
1.441 + }
1.442 +
1.443 +
1.444 +/**
1.445 +Gets the MIME type of the MIDI resource currently open
1.446 +
1.447 +@return Descriptor containing the MIDI mime type
1.448 +*/
1.449 +EXPORT_C const TDesC8& CMidiClientUtility::MimeTypeL()
1.450 + {
1.451 + return iBody->MimeTypeL();
1.452 + }
1.453 +
1.454 +/**
1.455 +Gets the current temporal position of the MIDI resource being played.
1.456 +
1.457 +@return Microseconds relative to the start of the resource
1.458 +*/
1.459 +EXPORT_C TTimeIntervalMicroSeconds CMidiClientUtility::PositionMicroSecondsL() const
1.460 + {
1.461 + return iBody->PositionMicroSecondsL();
1.462 + }
1.463 +
1.464 +/**
1.465 +Change the position of the currently playing MIDI resource to the given position.
1.466 +May be called whenever a MIDI resource is open
1.467 +
1.468 +@param aPosition
1.469 + Temporal position to move to. Clamped to (0, DurationMicroSecondsL()).
1.470 +*/
1.471 +EXPORT_C void CMidiClientUtility::SetPositionMicroSecondsL(const TTimeIntervalMicroSeconds& aPosition)
1.472 + {
1.473 + iBody->SetPositionMicroSecondsL(aPosition);
1.474 + }
1.475 +
1.476 +/**
1.477 +Gets the current metrical position of the MIDI resource being played
1.478 +
1.479 +@return Microbeats (BPM*1000000) relative to the start of the resource
1.480 +*/
1.481 +EXPORT_C TInt64 CMidiClientUtility::PositionMicroBeatsL() const
1.482 + {
1.483 + return iBody->PositionMicroBeatsL();
1.484 + }
1.485 +
1.486 +/**
1.487 +Change the position of the currently playing MIDI resource to the given position.
1.488 +May be called whenever a MIDI resource is open.
1.489 +
1.490 +@param aMicroBeats
1.491 + Metrical position to move to. Clamped to (0, DurationMicroBeatsL()).
1.492 +*/
1.493 +EXPORT_C void CMidiClientUtility::SetPositionMicroBeatsL(TInt64 aMicroBeats)
1.494 + {
1.495 + iBody->SetPositionMicroBeatsL(aMicroBeats);
1.496 + }
1.497 +
1.498 +/**
1.499 +Sets the frequency at which MMIDIClientUtilityObserver::MmcuoSyncUpdateL(…) is called
1.500 +to allow other components to synchronise with playback of this MIDI resource
1.501 +
1.502 +@param aMicroSeconds
1.503 + Temporal interval to callback at. Used in preference to aMicroBeats if both are set
1.504 +@param aMicroBeats
1.505 + Metrical interval to callback at. Set both parameters to zero to cancel.
1.506 +*/
1.507 +EXPORT_C void CMidiClientUtility::SetSyncUpdateCallbackIntervalL(const TTimeIntervalMicroSeconds& aMicroSeconds,TInt64 aMicroBeats)
1.508 + {
1.509 + iBody->SetSyncUpdateCallbackIntervalL(aMicroSeconds, aMicroBeats);
1.510 + }
1.511 +
1.512 +/**
1.513 +Sends a single MIDI message to the MIDI engine
1.514 +
1.515 +@param aMidiMessage
1.516 + Descriptor containing the MIDI message data.
1.517 + If there are several MIDI messages in the buffer, only the first one is processed
1.518 +*/
1.519 +EXPORT_C TInt CMidiClientUtility::SendMessageL(const TDesC8& aMidiMessage)
1.520 + {
1.521 + return iBody->SendMessageL(aMidiMessage);
1.522 + }
1.523 +
1.524 +/**
1.525 +Sends a single MIDI message, with time stamp, to the MIDI engine
1.526 +
1.527 +@param aMidiMessage
1.528 + Descriptor containing the MIDI message data.
1.529 + If there are several MIDI messages in the buffer, only the first one is processed
1.530 +@param aTime
1.531 + The time at which to execute the message, relative to the MIDI resource playing
1.532 + time or the time elapsed since Play() was called if no resource is present
1.533 +*/
1.534 +EXPORT_C TInt CMidiClientUtility::SendMessageL(const TDesC8& aMidiMessage,const TTimeIntervalMicroSeconds& aTime)
1.535 + {
1.536 + return iBody->SendMessageL(aMidiMessage, aTime);
1.537 + }
1.538 +
1.539 +/**
1.540 +Sends a mip message to the MIDI engine. This is a convenience function,
1.541 +because the same functionality could be achieved with the SendMessage() function
1.542 +
1.543 +@param aEntry
1.544 + Array of logical {channel, MIP} value pairs to send, highest priority first
1.545 +*/
1.546 +EXPORT_C void CMidiClientUtility::SendMipMessageL(const RArray<TMipMessageEntry>& aEntry)
1.547 + {
1.548 + iBody->SendMipMessageL(aEntry);
1.549 + }
1.550 +
1.551 +/**
1.552 +Gets the number of standard or custom sound banks currently available
1.553 +
1.554 +@param aCustom
1.555 + Specifies whether to reference a custom or standard sound bank
1.556 +@return Number of custom or standard sound banks available
1.557 +*/
1.558 +EXPORT_C TInt CMidiClientUtility::NumberOfBanksL(TBool aCustom) const
1.559 + {
1.560 + return iBody->NumberOfBanksL(aCustom);
1.561 + }
1.562 +
1.563 +/**
1.564 +Gets the identifier of a sound bank. Bank identifier (aka bank number) is a
1.565 +14-bit value consisting of MIDI bank MSB and LSB values
1.566 +
1.567 +@param aCustom
1.568 + Specifies whether to reference a custom or standard sound bank
1.569 +@param aBankIndex
1.570 + Index of sound bank where 0 <= aBankIndex < NumberOfBanksL(…)
1.571 +@return Identifier of the specified bank occupying, at most, 14 bits
1.572 +*/
1.573 +EXPORT_C TInt CMidiClientUtility::GetBankIdL(TBool aCustom, TInt aBankIndex) const
1.574 + {
1.575 + return iBody->GetBankIdL(aCustom, aBankIndex);
1.576 + }
1.577 +
1.578 +/**
1.579 +Loads one or more custom sound banks from a file into memory for use.
1.580 +If several banks are loaded with consequent LoadCustomBanksL() function calls,
1.581 +the banks are combined if the bank sets have colliding bank numbers
1.582 +
1.583 +@param aFileName
1.584 + Name of the file containing the custom sound bank
1.585 +@param aBankCollectionIndex
1.586 + Identifier of the custom sound bank loaded, occupying no more than 14 bits
1.587 +*/
1.588 +EXPORT_C void CMidiClientUtility::LoadCustomBankL(const TDesC& aFileName, TInt& aBankCollectionIndex)
1.589 + {
1.590 + iBody->LoadCustomBankL(aFileName, aBankCollectionIndex);
1.591 + }
1.592 +
1.593 +/**
1.594 +Removes a custom sound bank from memory.
1.595 +Only valid for sound banks previously loaded from file.
1.596 +Once unloaded the custom sound bank is no longer available for use.
1.597 +
1.598 +@param aBankCollectionIndex
1.599 + Identifier of the custom sound bank to unload,
1.600 + occupying no more than 14 bits
1.601 +*/
1.602 +EXPORT_C void CMidiClientUtility::UnloadCustomBankL(TInt aBankCollectionIndex)
1.603 + {
1.604 + iBody->UnloadCustomBankL(aBankCollectionIndex);
1.605 + }
1.606 +
1.607 +/**
1.608 +Query if a bank has been loaded to the memory
1.609 +
1.610 +@param aBankCollectionIndex
1.611 + Identifier of the custom sound bank to check if it's in memory or not
1.612 +@return ETrue if the specified bank is in memory, EFalse otherwise
1.613 +*/
1.614 +EXPORT_C TBool CMidiClientUtility::CustomBankLoadedL(TInt aBankCollectionIndex) const
1.615 + {
1.616 + return iBody->CustomBankLoadedL(aBankCollectionIndex);
1.617 + }
1.618 +
1.619 +/**
1.620 +Removes all custom sound banks from memory.
1.621 +*/
1.622 +EXPORT_C void CMidiClientUtility::UnloadAllCustomBanksL()
1.623 + {
1.624 + iBody->UnloadAllCustomBanksL();
1.625 + }
1.626 +
1.627 +/**
1.628 +Gets the number of instruments available in a given sound bank
1.629 +
1.630 +@param aBankId
1.631 + Identifier of sound bank to reference, occupying no more than 14 bits
1.632 +@param aCustom
1.633 + Specifies whether to reference a custom or standard sound bank
1.634 +@return Count of the number of instruments available for the specified sound bank
1.635 +*/
1.636 +EXPORT_C TInt CMidiClientUtility::NumberOfInstrumentsL(TInt aBankId,TBool aCustom) const
1.637 + {
1.638 + return iBody->NumberOfInstrumentsL(aBankId, aCustom);
1.639 + }
1.640 +
1.641 +/**
1.642 +Gets the identifier of an instrument.
1.643 +
1.644 +@param aBankId
1.645 + Identifier of the sound bank to reference, occupying no more than 14 bits.
1.646 +@param aCustom
1.647 + Specifies whether to reference a custom or standard sound bank.
1.648 +@param aInstrumentIndex
1.649 + Index of the instrument to reference where 0 <= aInstrumentIndex < NumberOfInstrumentsL().
1.650 +@return Identifier of specified instrument.
1.651 + This may differ from the index since the index simply enumerates the instruments,
1.652 + whereas identifiers may not be contiguous, especially where certain instruments
1.653 + correspond to General MIDI-defined instruments but not all instruments are
1.654 + present. Instrument identifiers are between 0 and 127 inclusive.
1.655 +*/
1.656 +EXPORT_C TInt CMidiClientUtility::GetInstrumentIdL(TInt aBankId,TBool aCustom,TInt aInstrumentIndex) const
1.657 + {
1.658 + return iBody->GetInstrumentIdL(aBankId, aCustom, aInstrumentIndex);
1.659 + }
1.660 +
1.661 +/**
1.662 +Gets the name of the given instrument.
1.663 +
1.664 +@param aBankId
1.665 + Identifier of the bank that the instrument belongs to, occupying no more than 14 bits
1.666 +@param aCustom
1.667 + Specifies whether to reference a custom or standard sound bank
1.668 +@param aInstrumentId
1.669 + Identifier of the instrument under scrutiny. 0 <= iInstrumentId <= 127.
1.670 +@return Buffer containing the name of the specified instrument.
1.671 + If it has no name then an empty descriptor is returned
1.672 +*/
1.673 +EXPORT_C HBufC* CMidiClientUtility::InstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) const
1.674 + {
1.675 + return iBody->InstrumentNameL(aBankId, aCustom, aInstrumentId);
1.676 + }
1.677 +
1.678 +/**
1.679 +Sets a logical channel to use the given instrument.
1.680 +
1.681 +@param aChannel
1.682 + Logical channel to set the instrument for. 0 <= aChannel <= 15
1.683 +@param aBankId
1.684 + Identifier of the bank that the instrument belongs to,
1.685 + occupying no more than 14 bits.
1.686 + The bank ID is a concatenation of MIDI bank MSB and LSB values
1.687 +@param aInstrumentId
1.688 + Identifier of the instrument under scrutiny. 0 <= iInstrumentId <= 127.
1.689 +*/
1.690 +EXPORT_C void CMidiClientUtility::SetInstrumentL(TInt aChannel,TInt aBankId,TInt aInstrumentId)
1.691 + {
1.692 + iBody->SetInstrumentL(aChannel, aBankId, aInstrumentId);
1.693 + }
1.694 +
1.695 +/**
1.696 +Loads an individual instrument from file into custom sound bank memory for use.
1.697 +The bank and instrument ids given in the file can be mapped into different bank
1.698 +and instrument ids in memory
1.699 +
1.700 +@param aFileName
1.701 + Name of the file containing the instrument
1.702 +@param aFileBankId
1.703 + Identifier of the bank in the file from which to load the instrument,
1.704 + occupying no more than 14 bits
1.705 +@param aFileInstrumentId
1.706 + Identifier of the instrument to load. 0 <= aInstrumentId <= 127
1.707 +@param aMemoryBankId
1.708 + Identifier of the custom bank in memory to load the instrument into,
1.709 + occupying no more than 14 bits.
1.710 +@param aMemoryInstrumentId
1.711 + Identifier of the instrument in memory to load the new
1.712 + instrument into. 0 <= aInstrumentId <= 127.
1.713 +*/
1.714 +EXPORT_C void CMidiClientUtility::LoadCustomInstrumentL(const TDesC& aFileName,TInt aFileBankId,TInt aFileInstrumentId,TInt aMemoryBankId,TInt aMemoryInstrumentId)
1.715 + {
1.716 + iBody->LoadCustomInstrumentL(aFileName, aFileBankId, aFileInstrumentId, aMemoryBankId, aMemoryInstrumentId);
1.717 + }
1.718 +
1.719 +/**
1.720 +Removes an instrument from custom sound bank memory.
1.721 +Only valid for instruments previously loaded from file.
1.722 +Once unloaded the instrument is no longer available for use
1.723 +
1.724 +@param aCustomBankId
1.725 + Identifier of the custom sound bank containing
1.726 + the instrument to unload, occupying no more than 14 bits.
1.727 +@param aInstrumentId
1.728 + Identifier of the instrument to unload. 0 <= aInstrumentId <= 127
1.729 +*/
1.730 +EXPORT_C void CMidiClientUtility::UnloadCustomInstrumentL(TInt aCustomBankId,TInt aInstrumentId)
1.731 + {
1.732 + iBody->UnloadCustomInstrumentL(aCustomBankId, aInstrumentId);
1.733 + }
1.734 +
1.735 +/**
1.736 +Gets the name of a particular percussion key corresponding to a given note.
1.737 +
1.738 +@param aNote
1.739 + Note to query. 0 <= aNote <= 127
1.740 +@param aBankId
1.741 + Identifier of the bank that the instrument belongs to, occupying no more than 14 bits.
1.742 + The bank ID is a concatenation of MIDI bank MSB and LSB values.
1.743 +@param aCustom
1.744 + Specifies whether to reference a custom or standard sound bank
1.745 +@param aInstrumentId
1.746 + Identifier of an instrument
1.747 +@return Descriptor containing the name of the percussion key.
1.748 + If the key does not have a name then an empty descriptor is returned
1.749 +*/
1.750 +EXPORT_C HBufC* CMidiClientUtility::PercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) const
1.751 + {
1.752 + return iBody->PercussionKeyNameL(aNote, aBankId, aCustom, aInstrumentId);
1.753 + }
1.754 +
1.755 +/**
1.756 +Get the stop time currently set for the MIDI resource
1.757 +
1.758 +@param aStopTime
1.759 + Time at which playback will stop, relative to the start of the resource
1.760 +*/
1.761 +EXPORT_C void CMidiClientUtility::StopTimeL(TTimeIntervalMicroSeconds& aStopTime) const
1.762 + {
1.763 + iBody->StopTimeL(aStopTime);
1.764 + }
1.765 +
1.766 +/**
1.767 +Sets the stop time to use for the currently open MIDI resource
1.768 +
1.769 +@param aStopTime
1.770 + Time at which playback will stop, relative to the start of the resource.
1.771 + Clamped to 0 and the duration of the resource
1.772 +*/
1.773 +EXPORT_C void CMidiClientUtility::SetStopTimeL(const TTimeIntervalMicroSeconds& aStopTime)
1.774 + {
1.775 + iBody->SetStopTimeL(aStopTime);
1.776 + }
1.777 +
1.778 +/**
1.779 +Set the number of times to repeat the current MIDI resource.
1.780 +After Stop() has been called, repeat number of times and the trailing silence are reset
1.781 +
1.782 +@param aRepeatNumberOfTimes
1.783 + Number of time to repeat the resource during playback.
1.784 + This includes the first playing
1.785 +@param aTrailingSilence
1.786 + Time in microseconds to pause between repeats
1.787 +*/
1.788 +EXPORT_C void CMidiClientUtility::SetRepeatsL(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
1.789 + {
1.790 + iBody->SetRepeatsL(aRepeatNumberOfTimes, aTrailingSilence);
1.791 + }
1.792 +
1.793 +/**
1.794 +Gets the number of currently active voices.
1.795 +
1.796 +@return The number of currently active voices
1.797 +*/
1.798 +EXPORT_C TInt CMidiClientUtility::PolyphonyL() const
1.799 + {
1.800 + return iBody->PolyphonyL();
1.801 + }
1.802 +
1.803 +/**
1.804 +Gets the maximum number of logical channels supported by the MIDI engine.
1.805 +
1.806 +@return The maximum number of logical channels that the MIDI engine supports, 0 <= aChannels <=15.
1.807 +*/
1.808 +EXPORT_C TInt CMidiClientUtility::ChannelsSupportedL() const
1.809 + {
1.810 + return iBody->ChannelsSupportedL();
1.811 + }
1.812 +
1.813 +/**
1.814 +Get the current volume setting of a logical channel
1.815 +
1.816 +@param aChannel
1.817 + Logical channel to query. 0 <= aChannel <= 15.
1.818 +@return Volume currently set on the specified channel in decibels
1.819 +*/
1.820 +EXPORT_C TReal32 CMidiClientUtility::ChannelVolumeL(TInt aChannel) const
1.821 + {
1.822 + return iBody->ChannelVolumeL(aChannel);
1.823 + }
1.824 +
1.825 +/**
1.826 +Gets the Maximum volume setting that may be applied to a logical channel
1.827 +
1.828 +@return Maximum volume setting. Minimum value is -infinity dB, which is the
1.829 + smallest possible value that TReal32 supports.
1.830 +*/
1.831 +EXPORT_C TReal32 CMidiClientUtility::MaxChannelVolumeL() const
1.832 + {
1.833 + return iBody->MaxChannelVolumeL();
1.834 + }
1.835 +
1.836 +/**
1.837 +Set the volume of a channel.
1.838 +
1.839 +@param aChannel
1.840 + Logical channel to set the volume on. 0 <= aChannel <= 15
1.841 +@param aVolume
1.842 + Volume currently set on the specified channel in decibels. The minimum
1.843 + channel volume supported value is -infinity dB, which is the smallest
1.844 + possible value that TReal32 supports.
1.845 + The maximum channel volume can be set via MaxChannelVolumeL()
1.846 +*/
1.847 +EXPORT_C void CMidiClientUtility::SetChannelVolumeL(TInt aChannel,TReal32 aVolume)
1.848 + {
1.849 + iBody->SetChannelVolumeL(aChannel, aVolume);
1.850 + }
1.851 +
1.852 +/**
1.853 +Set the muting state of a channel without changing its volume setting.
1.854 +When unmuted the channel goes back to its previous volume setting
1.855 +
1.856 +@param aChannel
1.857 + Logical channel to set the mute state of. 0 <= aChannel <= 15.
1.858 +@param aMuted
1.859 + ETrue to mute the channel, EFalse to unmute it.
1.860 +*/
1.861 +EXPORT_C void CMidiClientUtility::SetChannelMuteL(TInt aChannel,TBool aMuted)
1.862 + {
1.863 + iBody->SetChannelMuteL(aChannel, aMuted);
1.864 + }
1.865 +
1.866 +/**
1.867 +Gets the overall volume of the MIDI client.
1.868 +
1.869 +@return The current overall volume setting
1.870 +*/
1.871 +EXPORT_C TInt CMidiClientUtility::VolumeL() const
1.872 + {
1.873 + return iBody->VolumeL();
1.874 + }
1.875 +
1.876 +/**
1.877 +Maximum volume setting that may be applied overall.
1.878 +
1.879 +@return Maximum volume setting. Minimum value is always zero which is silent
1.880 +*/
1.881 +EXPORT_C TInt CMidiClientUtility::MaxVolumeL() const
1.882 + {
1.883 + return iBody->MaxVolumeL();
1.884 + }
1.885 +
1.886 +/**
1.887 +Set the overall volume of the MIDI client.
1.888 +This setting scales all channel volumes respectively so the actual volume
1.889 +that a channel is played at is (overall volume * channel volume / max volume).
1.890 +
1.891 +@param aVolume
1.892 + Overall volume setting to use
1.893 +*/
1.894 +EXPORT_C void CMidiClientUtility::SetVolumeL(TInt aVolume)
1.895 + {
1.896 + iBody->SetVolumeL(aVolume);
1.897 + }
1.898 +
1.899 +/**
1.900 +Length of time over which the volume is faded up from zero to the current settings
1.901 +when playback is started.
1.902 +
1.903 +@param aRampDuration
1.904 + Duration of the ramping period.
1.905 +*/
1.906 +EXPORT_C void CMidiClientUtility::SetVolumeRampL(const TTimeIntervalMicroSeconds& aRampDuration)
1.907 + {
1.908 + iBody->SetVolumeRampL(aRampDuration);
1.909 + }
1.910 +
1.911 +/**
1.912 +Get the current stereo balance value
1.913 +
1.914 +@return Balance value ranging from KMMFBalanceMaxLeft to KMMFBalanceMaxRight
1.915 +*/
1.916 +EXPORT_C TInt CMidiClientUtility::GetBalanceL() const
1.917 + {
1.918 + return iBody->GetBalanceL();
1.919 + }
1.920 +
1.921 +/**
1.922 +Set the current stereo balance value
1.923 +
1.924 +@param aBalance
1.925 + Balance value to set. Defaults to KMMFBalanceCenter to restore equal left-right balance
1.926 +*/
1.927 +EXPORT_C void CMidiClientUtility::SetBalanceL(TInt aBalance)
1.928 + {
1.929 + iBody->SetBalanceL(aBalance);
1.930 + }
1.931 +
1.932 +/**
1.933 +Set the priority with which this client plays MIDI data
1.934 +
1.935 +@param aPriority
1.936 + The Priority Value.
1.937 +@param aPref
1.938 + The Priority Preference.
1.939 +
1.940 +@see CMidiClientUtility::NewL()
1.941 +*/
1.942 +EXPORT_C void CMidiClientUtility::SetPriorityL(TInt aPriority, TInt aPref)
1.943 + {
1.944 + iBody->SetPriorityL(aPriority, aPref);
1.945 + }
1.946 +
1.947 +/**
1.948 +Get the number of meta data entries currently known about in the currently open
1.949 +resource. XMF,SMF meta data are part of the XMF,SMF file header and can thus be examined
1.950 +before playback. If there is no XMF,SMF resource open, will return zero.
1.951 +Standard MIDI file meta data entries encountered during playback will be passed back
1.952 +via MMIDIClientUtilityObserver::MmcuoMetaDataEntryFound()
1.953 +
1.954 +@return Number of XMF meta data entries currently known about
1.955 +*/
1.956 +EXPORT_C TInt CMidiClientUtility::NumberOfMetaDataEntriesL() const
1.957 + {
1.958 + return iBody->NumberOfMetaDataEntriesL();
1.959 + }
1.960 +
1.961 +/**
1.962 +Retrieve the specified XMF,SMF meta data entry.
1.963 +
1.964 +@param aMetaDataIndex
1.965 + Index of the meta data entry to retrieve
1.966 +@return Meta data entry. Ownership is passed to the client.
1.967 +*/
1.968 +EXPORT_C CMMFMetaDataEntry* CMidiClientUtility::GetMetaDataEntryL(TInt aMetaDataIndex) const
1.969 + {
1.970 + return iBody->GetMetaDataEntryL(aMetaDataIndex);
1.971 + }
1.972 +
1.973 +/**
1.974 +Synchronously pass implementation-specific commands to the MIDI engine
1.975 +and receive a response
1.976 +
1.977 +@param aDestination
1.978 + Recipient of the message. Should be initialised with KUidInterfaceMIDI
1.979 + and a TInt describing the server-side object to which the command should be delivered.
1.980 + The TInt will usually be KMMFObjectHandleController, to deliver the message to the
1.981 + controller plugin, which is the default value.
1.982 +@param aFunction
1.983 + Index of the function to perform
1.984 +@param aDataTo1
1.985 + First command data buffer to send, eg command parameters
1.986 +@param aDataTo2
1.987 + Second command data buffer to send, eg data parameters
1.988 +@param aDataFrom
1.989 + Buffer to receive data in response to the command.
1.990 + The user must ensure that it is large enough to hold all the data returned.
1.991 +*/
1.992 +EXPORT_C void CMidiClientUtility::CustomCommandSyncL(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
1.993 + {
1.994 + iBody->CustomCommandSyncL(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
1.995 + }
1.996 +
1.997 +/**
1.998 +Synchronously pass implementation-specific commands to the MIDI engine.
1.999 +
1.1000 +@param aDestination
1.1001 + Recipient of the message. Should be initialised with KUidInterfaceMIDI
1.1002 + and a TInt describing the server-side object to which the command should be delivered.
1.1003 + The TInt will usually be KMMFObjectHandleController, to deliver the message to the
1.1004 + controller plugin, which is the default value.
1.1005 +@param aFunction
1.1006 + Index of the function to perform
1.1007 +@param aDataTo1
1.1008 + First command data buffer to send, eg command parameters
1.1009 +@param aDataTo2
1.1010 + Second command data buffer to send, eg data parameters
1.1011 +*/
1.1012 +EXPORT_C void CMidiClientUtility::CustomCommandSyncL(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
1.1013 + {
1.1014 + iBody->CustomCommandSyncL(aDestination, aFunction, aDataTo1, aDataTo2);
1.1015 + }
1.1016 +
1.1017 +/**
1.1018 +Asynchronously pass implementation-specific commands to the MIDI engine
1.1019 +and receive a response
1.1020 +
1.1021 +@param aDestination
1.1022 + aDestination Recipient of the message. Should be initialised with KUidInterfaceMIDI
1.1023 + and a TInt describing the server-side object to which the command should be delivered.
1.1024 + The TInt will usually be KMMFObjectHandleController, to deliver the message to the
1.1025 + controller plugin, which is the default value.
1.1026 +@param aFunction
1.1027 + Index of the function to perform
1.1028 +@param aDataTo1
1.1029 + First command data buffer to send, eg command parameters
1.1030 +@param aDataTo2
1.1031 + Second command data buffer to send, eg data parameters
1.1032 +@param aDataFrom
1.1033 + Buffer to receive data in response to the command.
1.1034 + The user must ensure that it is large enough to hold all the data returned.
1.1035 +@param aStatus
1.1036 + Status flag belonging to an active object that will have it's RunL() called
1.1037 + when this request complete
1.1038 +*/
1.1039 +EXPORT_C void CMidiClientUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
1.1040 + {
1.1041 + iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
1.1042 + }
1.1043 +
1.1044 +/**
1.1045 +Asynchronously pass implementation-specific commands to the MIDI engine
1.1046 +
1.1047 +@param aDestination
1.1048 + aDestination Recipient of the message. Should be initialised with KUidInterfaceMIDI
1.1049 + and a TInt describing the server-side object to which the command should be delivered.
1.1050 + The TInt will usually be KMMFObjectHandleController, to deliver the message to the
1.1051 + controller plugin, which is the default value.
1.1052 +@param aFunction
1.1053 + Index of the function to perform
1.1054 +@param aDataTo1
1.1055 + First command data buffer to send, eg command parameters
1.1056 +@param aDataTo2
1.1057 + Second command data buffer to send, eg data parameters
1.1058 +@param aStatus
1.1059 + Status flag belonging to an active object that will have it's RunL() called
1.1060 + when this request complete
1.1061 +*/
1.1062 +EXPORT_C void CMidiClientUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
1.1063 + {
1.1064 + iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
1.1065 + }
1.1066 +
1.1067 +/**
1.1068 +Gets a controller's DRM custom command implementation.
1.1069 +
1.1070 +@return A pointer to a controller's DRM custom command implementation or NULL
1.1071 + if the interface can not be obtained
1.1072 +*/
1.1073 +EXPORT_C MMMFDRMCustomCommand* CMidiClientUtility::GetDRMCustomCommand()
1.1074 + {
1.1075 + return iBody->GetDRMCustomCommand();
1.1076 + }
1.1077 +
1.1078 +/**
1.1079 +Set the max polyphony the engine can handle
1.1080 +
1.1081 +@param aMaxNotes
1.1082 + Max polyphony level, 0 <= PolyphonyL() <= aMaxNotes
1.1083 +*/
1.1084 +EXPORT_C void CMidiClientUtility::SetMaxPolyphonyL(TInt aMaxNotes)
1.1085 + {
1.1086 + iBody->SetMaxPolyphonyL(aMaxNotes);
1.1087 + }
1.1088 +
1.1089 +/**
1.1090 +Gets the number of times the current opened resources has to be repeated
1.1091 +
1.1092 +@return The number of time the current opened resources has to be repeated
1.1093 +*/
1.1094 +EXPORT_C TInt CMidiClientUtility::GetRepeats() const
1.1095 + {
1.1096 + return iBody->GetRepeats();
1.1097 + }
1.1098 +
1.1099 +/**
1.1100 +Loads one or more custom sound banks from a descriptor into memory for use.
1.1101 +If several banks are loaded with consequent LoadCustomBanksL() function calls,
1.1102 +the banks are combined if the bank sets have colliding bank numbers
1.1103 +
1.1104 +@param aBankData
1.1105 + Descriptor containing the custom sound bank
1.1106 +@param aBankId
1.1107 + Identifier of the custom sound bank loaded, occupying no more than 14 bits.
1.1108 +*/
1.1109 +EXPORT_C void CMidiClientUtility::LoadCustomBankDataL(const TDesC8& aBankData,TInt& aBankId)
1.1110 + {
1.1111 + iBody->LoadCustomBankDataL(aBankData, aBankId);
1.1112 + }
1.1113 +
1.1114 +/**
1.1115 +Loads an individual instrument from descriptor into custom sound bank memory for use.
1.1116 +The bank and instrument ids given in the descriptor can be mapped into different bank
1.1117 +and instrument ids in memory
1.1118 +
1.1119 +@param aInstrumentData
1.1120 + Descriptor containing the instrument
1.1121 +@param aBankDataId
1.1122 + Identifier of the bank in the descriptor from which to load the instrument,
1.1123 + occupying no more than 14 bits
1.1124 +@param aInstrumentDataId
1.1125 + Identifier of the instrument to load. 0 <= aInstrumentId <= 127
1.1126 +@param aMemoryBankId
1.1127 + Identifier of the custom bank in memory to load the instrument into,
1.1128 + occupying no more than 14 bits
1.1129 +@param aMemoryInstrumentId
1.1130 + Identifier of the instrument in memory to load the new
1.1131 + instrument into. 0 <= aInstrumentId <= 127.
1.1132 +*/
1.1133 +EXPORT_C void CMidiClientUtility::LoadCustomInstrumentDataL(const TDesC8& aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId)
1.1134 + {
1.1135 + iBody->LoadCustomInstrumentDataL(aInstrumentData, aBankDataId, aInstrumentDataId, aMemoryBankId, aMemoryInstrumentId);
1.1136 + }
1.1137 +
1.1138 +/**
1.1139 +Tell the MIDI engine to use a custom bank or a standard bank
1.1140 +
1.1141 +@param aCustom
1.1142 + If Etrue the custom bank in memory is used otherwise the standard bank
1.1143 + is used leaving the custom bank in memory
1.1144 +*/
1.1145 +EXPORT_C void CMidiClientUtility::SetBankL(TBool aCustom)
1.1146 + {
1.1147 + iBody->SetBankL(aCustom);
1.1148 + }
1.1149 +
1.1150 +/**
1.1151 +Gets the muting status of a specific track
1.1152 +
1.1153 +@param aTrack
1.1154 + The track to query
1.1155 +@return The mute status of the track.
1.1156 +*/
1.1157 +EXPORT_C TBool CMidiClientUtility::IsTrackMuteL(TInt aTrack) const
1.1158 + {
1.1159 + return iBody->IsTrackMuteL(aTrack);
1.1160 + }
1.1161 +
1.1162 +/**
1.1163 +Gets the muting status of a specific channel
1.1164 +
1.1165 +@param aChannel
1.1166 + The channel to query
1.1167 +@return The mute status of the channel
1.1168 +*/
1.1169 +EXPORT_C TBool CMidiClientUtility::IsChannelMuteL(TInt aChannel) const
1.1170 + {
1.1171 + return iBody->IsChannelMuteL(aChannel);
1.1172 + }
1.1173 +
1.1174 +/**
1.1175 +Gets the instrument assigned to a specified channel
1.1176 +
1.1177 +@param aChannel
1.1178 + Logical channel, 0 <= aChannel <= 15.
1.1179 +@param aInstrumentId
1.1180 + Identifier of the instrument assigned to aChannel. 0 <= iInstrumentId <= 127
1.1181 +@param aBankId
1.1182 + Identifier of the bank that the instrument belongs to, occupying no more than 14 bits
1.1183 +*/
1.1184 +EXPORT_C void CMidiClientUtility::GetInstrumentL(TInt aChannel, TInt& aInstrumentId, TInt& aBankId)
1.1185 + {
1.1186 + iBody->GetInstrumentL(aChannel, aInstrumentId, aBankId);
1.1187 + }
1.1188 +
1.1189 +/**
1.1190 +Get the maximum polyphony level that the engine can handle
1.1191 +
1.1192 +@return The maximum number of simultaneous notes the engine can handle.
1.1193 + 0 <= PolyphonyL() <= MaxPolyphonyL()
1.1194 +*/
1.1195 +EXPORT_C TInt CMidiClientUtility::MaxPolyphonyL() const
1.1196 + {
1.1197 + return iBody->MaxPolyphonyL();
1.1198 + }
1.1199 +