sl@0: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include "midiclientutilitybody.h" sl@0: sl@0: sl@0: /** sl@0: Static factory function for creating a MIDI client utility object. sl@0: This function is synchronous, unlike the other factory functions, sl@0: because it doesn't need to perform any MIDI resource initialisation. sl@0: sl@0: @param aObserver sl@0: Reference to an object to receive callbacks on completion of asynchronous functions. sl@0: @param aPriority sl@0: The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and sl@0: EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request. sl@0: @param aPref sl@0: The Priority Preference - an additional audio policy parameter. The suggested default is sl@0: EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional sl@0: values may be supported by given phones and/or platforms, but should not be depended upon by sl@0: portable code. sl@0: @param aUseSharedHeap sl@0: Select if the underlying controller will have its own heap or share a single heap with other sl@0: controller instances. sl@0: The default behaviour, or if this value is EFalse, is that each controller is created with sl@0: its own heap. The alternative, if the value is ETrue, is that controllers share a special sl@0: heap with other controllers created the same way. Each heap uses a chunk, so this avoids sl@0: situations where the number of chunks per process is limited. The default behaviour is sl@0: generally to be preferred, and should give lower overall memory usage. However, if many sl@0: controllers are to be created for a particular thread, then ETrue should be provided to sl@0: prevent running out of heaps or chunks. sl@0: @return Fully constructed utility object ready to have an OpenXxxx() function called. sl@0: sl@0: Note: The Priority Value and Priority Preference are used primarily when deciding what to do when sl@0: several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, sl@0: the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. sl@0: Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may sl@0: vary between different phones. Portable applications are advised not to assume any specific behaviour. sl@0: */ sl@0: EXPORT_C CMidiClientUtility* CMidiClientUtility::NewL(MMidiClientUtilityObserver& aObserver, TInt aPriority, TInt aPref, TBool aUseSharedHeap) sl@0: { sl@0: CMidiClientUtility* self = new(ELeave) CMidiClientUtility(); sl@0: CleanupStack::PushL(self); sl@0: self->iBody = CMidiClientUtility::CBody::NewL(self, aObserver, aPriority, aPref, aUseSharedHeap ); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: Static factory function for creating a MIDI client utility object. sl@0: This function is synchronous, unlike the other factory functions, sl@0: because it doesn't need to perform any MIDI resource initialisation sl@0: The underlying controller that is created will be given its own heap. sl@0: sl@0: @param aObserver sl@0: Reference to an object to receive callbacks on completion of asynchronous functions. sl@0: @param aPriority sl@0: The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and sl@0: EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request. sl@0: @param aPref sl@0: The Priority Preference - an additional audio policy parameter. The suggested default is sl@0: EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional sl@0: values may be supported by given phones and/or platforms, but should not be depended upon by sl@0: portable code. sl@0: @return Fully constructed utility object ready to have an OpenXxxx() function called. sl@0: sl@0: Note: The Priority Value and Priority Preference are used primarily when deciding what to do when sl@0: several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, sl@0: the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. sl@0: Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may sl@0: vary between different phones. Portable applications are advised not to assume any specific behaviour. sl@0: */ sl@0: EXPORT_C CMidiClientUtility* CMidiClientUtility::NewL(MMidiClientUtilityObserver& aObserver, TInt aPriority, TInt aPref) sl@0: { sl@0: return NewL( aObserver, aPriority, aPref, EFalse ); sl@0: } sl@0: sl@0: CMidiClientUtility::~CMidiClientUtility() sl@0: { sl@0: delete iBody; sl@0: } sl@0: sl@0: /** sl@0: Asynchronous function to open a file containing MIDI data and perform sl@0: initialisation ready for playback sl@0: sl@0: @param aFileName Name of the MIDI file to open sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::OpenFile(const TDesC& aFileName) sl@0: { sl@0: iBody->OpenFile(aFileName); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous function to open a file containing MIDI data and perform sl@0: initialisation ready for playback sl@0: sl@0: @param aFile Open shared protected session handle to the midi file to read sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::OpenFile(const RFile& aFile) sl@0: { sl@0: iBody->OpenFile(const_cast(aFile)); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous function to open a file containing MIDI data and perform sl@0: initialisation ready for playback sl@0: sl@0: @param aFileSource TFileSource object which references either a filename or a sl@0: file handle to the midi file to read sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::OpenFile(const TMMSource& aSource) sl@0: { sl@0: iBody->OpenFile(aSource); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous function to open a descriptor containing MIDI data and perform sl@0: initialisation ready for playback sl@0: sl@0: @param aDescriptor descriptor containing MIDI data sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::OpenDes(const TDesC8& aDescriptor) sl@0: { sl@0: iBody->OpenDes(aDescriptor); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous function to open a URL containing MIDI data and perform sl@0: initialisation ready for playback sl@0: sl@0: @param aUrl sl@0: Uniform Resource Locator for a MIDI data stream sl@0: @param aIapId sl@0: Identifier of the Internet Access Point to use - sl@0: available from CommDB, the comms connections database. sl@0: Defaults to using the default access point, as defined by CommDB sl@0: @param aMimeType sl@0: Mime type of the MIDI data stream to be played. sl@0: Defaults to nothing in which case the an attempt will be made to recognise the type of the MIDI data automatically. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::OpenUrl(const TDesC& aUrl,TInt aIapId,const TDesC8& aMimeType) sl@0: { sl@0: iBody->OpenUrl(aUrl, aIapId, aMimeType); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous function to initiate or resume playback of a previously opened resource. sl@0: Also used to start an internal timer to establish a zero-time for the media stream sl@0: time relative to which commands with timestamps are timed against sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::Play() sl@0: { sl@0: iBody->Play(); sl@0: } sl@0: sl@0: /** sl@0: Stops playback of a resource but does not change the current position or release any resources. sl@0: Pauses the internal timer if no resource is open sl@0: sl@0: @param aFadeOutDuration sl@0: Length of time over which the volume is faded out from the current settings to zero. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::Stop(const TTimeIntervalMicroSeconds& aFadeOutDuration) sl@0: { sl@0: iBody->Stop(aFadeOutDuration); sl@0: } sl@0: sl@0: /** sl@0: Asynchronous function which closes any currently open resources, such as files, descriptors or URLs in use. sl@0: Does nothing if there is nothing currently open. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::Close() sl@0: { sl@0: iBody->Close(); sl@0: } sl@0: sl@0: /** sl@0: Gets the current state of the MIDI client utility with regard to MIDI resources sl@0: sl@0: @return The current state of the utility sl@0: */ sl@0: EXPORT_C TMidiState CMidiClientUtility::State() const sl@0: { sl@0: return iBody->State(); sl@0: } sl@0: sl@0: /** sl@0: Synchronous function to play a single note. sl@0: Multiple calls to this function will be accommodated as far as the MIDI engine can sl@0: manage. The same functionality could be implemented using the SendMessage function sl@0: sl@0: @param aChannel sl@0: Logical channel to play note on. 0 <= aChannel <= 15. sl@0: @param aNote sl@0: Note to play. 0 <= aNote <= 127 sl@0: @param aDuration sl@0: Length of time to play note for. sl@0: @param aNoteOnVelocity sl@0: Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127. sl@0: @param aNoteOffVelocity sl@0: Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::PlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity) sl@0: { sl@0: iBody->PlayNoteL(aChannel, aNote, aDuration, aNoteOnVelocity, aNoteOffVelocity); sl@0: } sl@0: sl@0: /** sl@0: Synchronous function to play a single note at a specified time. sl@0: Multiple calls to this function will be accommodated as far as the MIDI engine can sl@0: manage. The same functionality could be implemented using the SendMessage function sl@0: sl@0: @param aChannel sl@0: Logical channel to play note on. 0 <= aChannel <= 15. sl@0: @param aNote sl@0: Note to play. 0 <= aNote <= 127 sl@0: @param aStartTime sl@0: specifies the time at which to start playing the note, sl@0: relative to the MIDI resource playing time or the time elapsed since Play() was called if no resource is present sl@0: @param aDuration sl@0: Length of time to play note for. sl@0: @param aNoteOnVelocity sl@0: Velocity with which to start the note. 0 <= aNoteOnVelocity <= 127. sl@0: @param aNoteOffVelocity sl@0: Velocity with which to stop the note. 0 <= aNoteOffVelocity <= 127. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::PlayNoteL(TInt aChannel,TInt aNote,const TTimeIntervalMicroSeconds& aStartTime,const TTimeIntervalMicroSeconds& aDuration,TInt aNoteOnVelocity,TInt aNoteOffVelocity) sl@0: { sl@0: iBody->PlayNoteL(aChannel, aNote, aStartTime, aDuration, aNoteOnVelocity, aNoteOffVelocity); sl@0: } sl@0: sl@0: /** sl@0: Stops the playback of all notes on the given channel, sl@0: by means of an All Notes Off MIDI message sl@0: sl@0: @param aChannel sl@0: Logical channel to stop notes on. 0 <= aChannel <= 15 sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::StopNotes(TInt aChannel) sl@0: { sl@0: iBody->StopNotes(aChannel); sl@0: } sl@0: sl@0: /** sl@0: Synchronous function to commence playback of a note. sl@0: Multiple calls to this function will be accommodated as far as the MIDI engine can manage sl@0: sl@0: @param aChannel sl@0: Logical channel to play note on. 0 <= aChannel <= 15 sl@0: @param aNote sl@0: Note to play. 0 <= aNote <= 127 sl@0: @param aVelocity sl@0: Velocity with which to start the note. sl@0: The legal integer range is 0 <= aVelocity <= 127, but the value zero sl@0: actually causes the message to be interpreted as a Note Off message sl@0: instead of a Note On. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::NoteOnL(TInt aChannel,TInt aNote,TInt aVelocity) sl@0: { sl@0: iBody->NoteOnL(aChannel, aNote, aVelocity); sl@0: } sl@0: sl@0: /** sl@0: Synchronous function to terminate playback of a note. If no corresponding note sl@0: is found then no error is raised. sl@0: sl@0: @param aChannel sl@0: Logical channel on which the note is playing. 0 <= aChannel <= 15. sl@0: @param aNote sl@0: Note to terminate. 0 <= aNote <= 127. sl@0: @param aVelocity sl@0: Velocity with which to stop the note. 0 <= aVelocity <= 127. There is no sl@0: standard behaviour corresponding with note off velocity. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::NoteOffL(TInt aChannel,TInt aNote,TInt aVelocity) sl@0: { sl@0: iBody->NoteOffL(aChannel, aNote, aVelocity); sl@0: } sl@0: sl@0: /** sl@0: Gets the current playback rate factor of the currently open MIDI resource. sl@0: The playback rate is independent from tempo, sl@0: i.e., it can be used to give an overall speed factor for playback sl@0: sl@0: @return Current playback rate in percent times 1000, sl@0: i.e., 100000 means original playback speed, 200000 means double speed, sl@0: and 50000 means half speed playback sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::PlaybackRateL() const sl@0: { sl@0: return iBody->PlaybackRateL(); sl@0: } sl@0: sl@0: /** sl@0: Sets the playback rate for the playback of the current MIDI resource. sl@0: The playback rate is independent from tempo, sl@0: i.e., it can be used to give an overall speed factor for playback. sl@0: May be called whether playback is in progress or not. sl@0: sl@0: @param aRate sl@0: Playback rate in percent times 1000, sl@0: i.e., 100000 means original playback speed, 200000 means double speed, sl@0: and 50000 means half speed playback sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetPlaybackRateL(TInt aRate) sl@0: { sl@0: iBody->SetPlaybackRateL(aRate); sl@0: } sl@0: sl@0: /** sl@0: Gets the maximum playback rate in milli-percentage from the MIDI engine. sl@0: @see SetPlaybackRate() for milli-percentage details sl@0: sl@0: @return Maximum playback rate supported by MIDI player sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::MaxPlaybackRateL() const sl@0: { sl@0: return iBody->MaxPlaybackRateL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the minimum playback rate in milli-percentage from the MIDI engine. sl@0: @see SetPlaybackRate() for milli-percentage details. sl@0: sl@0: @return Minimum playback rate supported by MIDI player. sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::MinPlaybackRateL() const sl@0: { sl@0: return iBody->MinPlaybackRateL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the current tempo of the currently open MIDI resource. The tempo is independent sl@0: from the playback rate, i.e., the resulting playback speed will be affected by both. sl@0: sl@0: @return Tempo at the current position of the currently open resource in microbeats per minute, sl@0: i.e. BPM * 1000000. Filled in by the controller framework sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::TempoMicroBeatsPerMinuteL() const sl@0: { sl@0: return iBody->TempoMicroBeatsPerMinuteL(); sl@0: } sl@0: sl@0: /** sl@0: Sets the tempo at which the current MIDI resource should be played. sl@0: May be called whether playback is in progress or not. sl@0: The tempo is independent from the playback rate, sl@0: i.e., the resulting playback speed will be affected by both sl@0: sl@0: @param aMicroBeatsPerMinute sl@0: Tempo in microbeats per minute (BPM*1000000) to set sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetTempoL(TInt aMicroBeatsPerMinute) sl@0: { sl@0: iBody->SetTempoL(aMicroBeatsPerMinute); sl@0: } sl@0: sl@0: /** sl@0: Gets the pitch shift in use for the currently open MIDI resource sl@0: sl@0: @return Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::PitchTranspositionCentsL() const sl@0: { sl@0: return iBody->PitchTranspositionCentsL(); sl@0: } sl@0: sl@0: /** sl@0: Sets the pitch shift to apply to the currently open MIDI resource. sl@0: May be called during playback sl@0: aCents parameter is not checked - if the value is out of range, it is expected KErrArgument is return by MIDI engine. sl@0: sl@0: @param aCents sl@0: Pitch shift in cents, i.e. semitones * 100. One octave equals 1200 cents sl@0: @return Actual pitch shift applied - sl@0: may differ from the requested value due to limitations of the MIDI engine sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::SetPitchTranspositionL(TInt aCents) sl@0: { sl@0: return iBody->SetPitchTranspositionL(aCents); sl@0: } sl@0: sl@0: /** sl@0: Gets the length of the currently open MIDI resource in micro-seconds sl@0: sl@0: @return Duration in microseconds (seconds * 1000000). sl@0: */ sl@0: EXPORT_C TTimeIntervalMicroSeconds CMidiClientUtility::DurationMicroSecondsL() const sl@0: { sl@0: return iBody->DurationMicroSecondsL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the length of the currently open MIDI resource in micro-beats sl@0: sl@0: @return Duration in microbeats (beats * 1000000). sl@0: */ sl@0: EXPORT_C TInt64 CMidiClientUtility::DurationMicroBeatsL() const sl@0: { sl@0: return iBody->DurationMicroBeatsL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the number of tracks present in the currently open MIDI resource sl@0: sl@0: @return Number of tracks sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::NumTracksL() const sl@0: { sl@0: return iBody->NumTracksL(); sl@0: } sl@0: sl@0: /** sl@0: Mutes or unmutes a particular track sl@0: sl@0: @param aTrack sl@0: Index of the track to mute - 0 <= aTrack < NumTracksL(). sl@0: @param aMuted sl@0: ETrue to mute the track, EFalse to unmute it. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetTrackMuteL(TInt aTrack,TBool aMuted) const sl@0: { sl@0: iBody->SetTrackMuteL(aTrack, aMuted); sl@0: } sl@0: sl@0: sl@0: /** sl@0: Gets the MIME type of the MIDI resource currently open sl@0: sl@0: @return Descriptor containing the MIDI mime type sl@0: */ sl@0: EXPORT_C const TDesC8& CMidiClientUtility::MimeTypeL() sl@0: { sl@0: return iBody->MimeTypeL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the current temporal position of the MIDI resource being played. sl@0: sl@0: @return Microseconds relative to the start of the resource sl@0: */ sl@0: EXPORT_C TTimeIntervalMicroSeconds CMidiClientUtility::PositionMicroSecondsL() const sl@0: { sl@0: return iBody->PositionMicroSecondsL(); sl@0: } sl@0: sl@0: /** sl@0: Change the position of the currently playing MIDI resource to the given position. sl@0: May be called whenever a MIDI resource is open sl@0: sl@0: @param aPosition sl@0: Temporal position to move to. Clamped to (0, DurationMicroSecondsL()). sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetPositionMicroSecondsL(const TTimeIntervalMicroSeconds& aPosition) sl@0: { sl@0: iBody->SetPositionMicroSecondsL(aPosition); sl@0: } sl@0: sl@0: /** sl@0: Gets the current metrical position of the MIDI resource being played sl@0: sl@0: @return Microbeats (BPM*1000000) relative to the start of the resource sl@0: */ sl@0: EXPORT_C TInt64 CMidiClientUtility::PositionMicroBeatsL() const sl@0: { sl@0: return iBody->PositionMicroBeatsL(); sl@0: } sl@0: sl@0: /** sl@0: Change the position of the currently playing MIDI resource to the given position. sl@0: May be called whenever a MIDI resource is open. sl@0: sl@0: @param aMicroBeats sl@0: Metrical position to move to. Clamped to (0, DurationMicroBeatsL()). sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetPositionMicroBeatsL(TInt64 aMicroBeats) sl@0: { sl@0: iBody->SetPositionMicroBeatsL(aMicroBeats); sl@0: } sl@0: sl@0: /** sl@0: Sets the frequency at which MMIDIClientUtilityObserver::MmcuoSyncUpdateL(…) is called sl@0: to allow other components to synchronise with playback of this MIDI resource sl@0: sl@0: @param aMicroSeconds sl@0: Temporal interval to callback at. Used in preference to aMicroBeats if both are set sl@0: @param aMicroBeats sl@0: Metrical interval to callback at. Set both parameters to zero to cancel. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetSyncUpdateCallbackIntervalL(const TTimeIntervalMicroSeconds& aMicroSeconds,TInt64 aMicroBeats) sl@0: { sl@0: iBody->SetSyncUpdateCallbackIntervalL(aMicroSeconds, aMicroBeats); sl@0: } sl@0: sl@0: /** sl@0: Sends a single MIDI message to the MIDI engine sl@0: sl@0: @param aMidiMessage sl@0: Descriptor containing the MIDI message data. sl@0: If there are several MIDI messages in the buffer, only the first one is processed sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::SendMessageL(const TDesC8& aMidiMessage) sl@0: { sl@0: return iBody->SendMessageL(aMidiMessage); sl@0: } sl@0: sl@0: /** sl@0: Sends a single MIDI message, with time stamp, to the MIDI engine sl@0: sl@0: @param aMidiMessage sl@0: Descriptor containing the MIDI message data. sl@0: If there are several MIDI messages in the buffer, only the first one is processed sl@0: @param aTime sl@0: The time at which to execute the message, relative to the MIDI resource playing sl@0: time or the time elapsed since Play() was called if no resource is present sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::SendMessageL(const TDesC8& aMidiMessage,const TTimeIntervalMicroSeconds& aTime) sl@0: { sl@0: return iBody->SendMessageL(aMidiMessage, aTime); sl@0: } sl@0: sl@0: /** sl@0: Sends a mip message to the MIDI engine. This is a convenience function, sl@0: because the same functionality could be achieved with the SendMessage() function sl@0: sl@0: @param aEntry sl@0: Array of logical {channel, MIP} value pairs to send, highest priority first sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SendMipMessageL(const RArray& aEntry) sl@0: { sl@0: iBody->SendMipMessageL(aEntry); sl@0: } sl@0: sl@0: /** sl@0: Gets the number of standard or custom sound banks currently available sl@0: sl@0: @param aCustom sl@0: Specifies whether to reference a custom or standard sound bank sl@0: @return Number of custom or standard sound banks available sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::NumberOfBanksL(TBool aCustom) const sl@0: { sl@0: return iBody->NumberOfBanksL(aCustom); sl@0: } sl@0: sl@0: /** sl@0: Gets the identifier of a sound bank. Bank identifier (aka bank number) is a sl@0: 14-bit value consisting of MIDI bank MSB and LSB values sl@0: sl@0: @param aCustom sl@0: Specifies whether to reference a custom or standard sound bank sl@0: @param aBankIndex sl@0: Index of sound bank where 0 <= aBankIndex < NumberOfBanksL(…) sl@0: @return Identifier of the specified bank occupying, at most, 14 bits sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::GetBankIdL(TBool aCustom, TInt aBankIndex) const sl@0: { sl@0: return iBody->GetBankIdL(aCustom, aBankIndex); sl@0: } sl@0: sl@0: /** sl@0: Loads one or more custom sound banks from a file into memory for use. sl@0: If several banks are loaded with consequent LoadCustomBanksL() function calls, sl@0: the banks are combined if the bank sets have colliding bank numbers sl@0: sl@0: @param aFileName sl@0: Name of the file containing the custom sound bank sl@0: @param aBankCollectionIndex sl@0: Identifier of the custom sound bank loaded, occupying no more than 14 bits sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::LoadCustomBankL(const TDesC& aFileName, TInt& aBankCollectionIndex) sl@0: { sl@0: iBody->LoadCustomBankL(aFileName, aBankCollectionIndex); sl@0: } sl@0: sl@0: /** sl@0: Removes a custom sound bank from memory. sl@0: Only valid for sound banks previously loaded from file. sl@0: Once unloaded the custom sound bank is no longer available for use. sl@0: sl@0: @param aBankCollectionIndex sl@0: Identifier of the custom sound bank to unload, sl@0: occupying no more than 14 bits sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::UnloadCustomBankL(TInt aBankCollectionIndex) sl@0: { sl@0: iBody->UnloadCustomBankL(aBankCollectionIndex); sl@0: } sl@0: sl@0: /** sl@0: Query if a bank has been loaded to the memory sl@0: sl@0: @param aBankCollectionIndex sl@0: Identifier of the custom sound bank to check if it's in memory or not sl@0: @return ETrue if the specified bank is in memory, EFalse otherwise sl@0: */ sl@0: EXPORT_C TBool CMidiClientUtility::CustomBankLoadedL(TInt aBankCollectionIndex) const sl@0: { sl@0: return iBody->CustomBankLoadedL(aBankCollectionIndex); sl@0: } sl@0: sl@0: /** sl@0: Removes all custom sound banks from memory. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::UnloadAllCustomBanksL() sl@0: { sl@0: iBody->UnloadAllCustomBanksL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the number of instruments available in a given sound bank sl@0: sl@0: @param aBankId sl@0: Identifier of sound bank to reference, occupying no more than 14 bits sl@0: @param aCustom sl@0: Specifies whether to reference a custom or standard sound bank sl@0: @return Count of the number of instruments available for the specified sound bank sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::NumberOfInstrumentsL(TInt aBankId,TBool aCustom) const sl@0: { sl@0: return iBody->NumberOfInstrumentsL(aBankId, aCustom); sl@0: } sl@0: sl@0: /** sl@0: Gets the identifier of an instrument. sl@0: sl@0: @param aBankId sl@0: Identifier of the sound bank to reference, occupying no more than 14 bits. sl@0: @param aCustom sl@0: Specifies whether to reference a custom or standard sound bank. sl@0: @param aInstrumentIndex sl@0: Index of the instrument to reference where 0 <= aInstrumentIndex < NumberOfInstrumentsL(). sl@0: @return Identifier of specified instrument. sl@0: This may differ from the index since the index simply enumerates the instruments, sl@0: whereas identifiers may not be contiguous, especially where certain instruments sl@0: correspond to General MIDI-defined instruments but not all instruments are sl@0: present. Instrument identifiers are between 0 and 127 inclusive. sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::GetInstrumentIdL(TInt aBankId,TBool aCustom,TInt aInstrumentIndex) const sl@0: { sl@0: return iBody->GetInstrumentIdL(aBankId, aCustom, aInstrumentIndex); sl@0: } sl@0: sl@0: /** sl@0: Gets the name of the given instrument. sl@0: sl@0: @param aBankId sl@0: Identifier of the bank that the instrument belongs to, occupying no more than 14 bits sl@0: @param aCustom sl@0: Specifies whether to reference a custom or standard sound bank sl@0: @param aInstrumentId sl@0: Identifier of the instrument under scrutiny. 0 <= iInstrumentId <= 127. sl@0: @return Buffer containing the name of the specified instrument. sl@0: If it has no name then an empty descriptor is returned sl@0: */ sl@0: EXPORT_C HBufC* CMidiClientUtility::InstrumentNameL(TInt aBankId, TBool aCustom, TInt aInstrumentId) const sl@0: { sl@0: return iBody->InstrumentNameL(aBankId, aCustom, aInstrumentId); sl@0: } sl@0: sl@0: /** sl@0: Sets a logical channel to use the given instrument. sl@0: sl@0: @param aChannel sl@0: Logical channel to set the instrument for. 0 <= aChannel <= 15 sl@0: @param aBankId sl@0: Identifier of the bank that the instrument belongs to, sl@0: occupying no more than 14 bits. sl@0: The bank ID is a concatenation of MIDI bank MSB and LSB values sl@0: @param aInstrumentId sl@0: Identifier of the instrument under scrutiny. 0 <= iInstrumentId <= 127. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetInstrumentL(TInt aChannel,TInt aBankId,TInt aInstrumentId) sl@0: { sl@0: iBody->SetInstrumentL(aChannel, aBankId, aInstrumentId); sl@0: } sl@0: sl@0: /** sl@0: Loads an individual instrument from file into custom sound bank memory for use. sl@0: The bank and instrument ids given in the file can be mapped into different bank sl@0: and instrument ids in memory sl@0: sl@0: @param aFileName sl@0: Name of the file containing the instrument sl@0: @param aFileBankId sl@0: Identifier of the bank in the file from which to load the instrument, sl@0: occupying no more than 14 bits sl@0: @param aFileInstrumentId sl@0: Identifier of the instrument to load. 0 <= aInstrumentId <= 127 sl@0: @param aMemoryBankId sl@0: Identifier of the custom bank in memory to load the instrument into, sl@0: occupying no more than 14 bits. sl@0: @param aMemoryInstrumentId sl@0: Identifier of the instrument in memory to load the new sl@0: instrument into. 0 <= aInstrumentId <= 127. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::LoadCustomInstrumentL(const TDesC& aFileName,TInt aFileBankId,TInt aFileInstrumentId,TInt aMemoryBankId,TInt aMemoryInstrumentId) sl@0: { sl@0: iBody->LoadCustomInstrumentL(aFileName, aFileBankId, aFileInstrumentId, aMemoryBankId, aMemoryInstrumentId); sl@0: } sl@0: sl@0: /** sl@0: Removes an instrument from custom sound bank memory. sl@0: Only valid for instruments previously loaded from file. sl@0: Once unloaded the instrument is no longer available for use sl@0: sl@0: @param aCustomBankId sl@0: Identifier of the custom sound bank containing sl@0: the instrument to unload, occupying no more than 14 bits. sl@0: @param aInstrumentId sl@0: Identifier of the instrument to unload. 0 <= aInstrumentId <= 127 sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::UnloadCustomInstrumentL(TInt aCustomBankId,TInt aInstrumentId) sl@0: { sl@0: iBody->UnloadCustomInstrumentL(aCustomBankId, aInstrumentId); sl@0: } sl@0: sl@0: /** sl@0: Gets the name of a particular percussion key corresponding to a given note. sl@0: sl@0: @param aNote sl@0: Note to query. 0 <= aNote <= 127 sl@0: @param aBankId sl@0: Identifier of the bank that the instrument belongs to, occupying no more than 14 bits. sl@0: The bank ID is a concatenation of MIDI bank MSB and LSB values. sl@0: @param aCustom sl@0: Specifies whether to reference a custom or standard sound bank sl@0: @param aInstrumentId sl@0: Identifier of an instrument sl@0: @return Descriptor containing the name of the percussion key. sl@0: If the key does not have a name then an empty descriptor is returned sl@0: */ sl@0: EXPORT_C HBufC* CMidiClientUtility::PercussionKeyNameL(TInt aNote, TInt aBankId, TBool aCustom, TInt aInstrumentId) const sl@0: { sl@0: return iBody->PercussionKeyNameL(aNote, aBankId, aCustom, aInstrumentId); sl@0: } sl@0: sl@0: /** sl@0: Get the stop time currently set for the MIDI resource sl@0: sl@0: @param aStopTime sl@0: Time at which playback will stop, relative to the start of the resource sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::StopTimeL(TTimeIntervalMicroSeconds& aStopTime) const sl@0: { sl@0: iBody->StopTimeL(aStopTime); sl@0: } sl@0: sl@0: /** sl@0: Sets the stop time to use for the currently open MIDI resource sl@0: sl@0: @param aStopTime sl@0: Time at which playback will stop, relative to the start of the resource. sl@0: Clamped to 0 and the duration of the resource sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetStopTimeL(const TTimeIntervalMicroSeconds& aStopTime) sl@0: { sl@0: iBody->SetStopTimeL(aStopTime); sl@0: } sl@0: sl@0: /** sl@0: Set the number of times to repeat the current MIDI resource. sl@0: After Stop() has been called, repeat number of times and the trailing silence are reset sl@0: sl@0: @param aRepeatNumberOfTimes sl@0: Number of time to repeat the resource during playback. sl@0: This includes the first playing sl@0: @param aTrailingSilence sl@0: Time in microseconds to pause between repeats sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetRepeatsL(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence) sl@0: { sl@0: iBody->SetRepeatsL(aRepeatNumberOfTimes, aTrailingSilence); sl@0: } sl@0: sl@0: /** sl@0: Gets the number of currently active voices. sl@0: sl@0: @return The number of currently active voices sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::PolyphonyL() const sl@0: { sl@0: return iBody->PolyphonyL(); sl@0: } sl@0: sl@0: /** sl@0: Gets the maximum number of logical channels supported by the MIDI engine. sl@0: sl@0: @return The maximum number of logical channels that the MIDI engine supports, 0 <= aChannels <=15. sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::ChannelsSupportedL() const sl@0: { sl@0: return iBody->ChannelsSupportedL(); sl@0: } sl@0: sl@0: /** sl@0: Get the current volume setting of a logical channel sl@0: sl@0: @param aChannel sl@0: Logical channel to query. 0 <= aChannel <= 15. sl@0: @return Volume currently set on the specified channel in decibels sl@0: */ sl@0: EXPORT_C TReal32 CMidiClientUtility::ChannelVolumeL(TInt aChannel) const sl@0: { sl@0: return iBody->ChannelVolumeL(aChannel); sl@0: } sl@0: sl@0: /** sl@0: Gets the Maximum volume setting that may be applied to a logical channel sl@0: sl@0: @return Maximum volume setting. Minimum value is -infinity dB, which is the sl@0: smallest possible value that TReal32 supports. sl@0: */ sl@0: EXPORT_C TReal32 CMidiClientUtility::MaxChannelVolumeL() const sl@0: { sl@0: return iBody->MaxChannelVolumeL(); sl@0: } sl@0: sl@0: /** sl@0: Set the volume of a channel. sl@0: sl@0: @param aChannel sl@0: Logical channel to set the volume on. 0 <= aChannel <= 15 sl@0: @param aVolume sl@0: Volume currently set on the specified channel in decibels. The minimum sl@0: channel volume supported value is -infinity dB, which is the smallest sl@0: possible value that TReal32 supports. sl@0: The maximum channel volume can be set via MaxChannelVolumeL() sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetChannelVolumeL(TInt aChannel,TReal32 aVolume) sl@0: { sl@0: iBody->SetChannelVolumeL(aChannel, aVolume); sl@0: } sl@0: sl@0: /** sl@0: Set the muting state of a channel without changing its volume setting. sl@0: When unmuted the channel goes back to its previous volume setting sl@0: sl@0: @param aChannel sl@0: Logical channel to set the mute state of. 0 <= aChannel <= 15. sl@0: @param aMuted sl@0: ETrue to mute the channel, EFalse to unmute it. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetChannelMuteL(TInt aChannel,TBool aMuted) sl@0: { sl@0: iBody->SetChannelMuteL(aChannel, aMuted); sl@0: } sl@0: sl@0: /** sl@0: Gets the overall volume of the MIDI client. sl@0: sl@0: @return The current overall volume setting sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::VolumeL() const sl@0: { sl@0: return iBody->VolumeL(); sl@0: } sl@0: sl@0: /** sl@0: Maximum volume setting that may be applied overall. sl@0: sl@0: @return Maximum volume setting. Minimum value is always zero which is silent sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::MaxVolumeL() const sl@0: { sl@0: return iBody->MaxVolumeL(); sl@0: } sl@0: sl@0: /** sl@0: Set the overall volume of the MIDI client. sl@0: This setting scales all channel volumes respectively so the actual volume sl@0: that a channel is played at is (overall volume * channel volume / max volume). sl@0: sl@0: @param aVolume sl@0: Overall volume setting to use sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetVolumeL(TInt aVolume) sl@0: { sl@0: iBody->SetVolumeL(aVolume); sl@0: } sl@0: sl@0: /** sl@0: Length of time over which the volume is faded up from zero to the current settings sl@0: when playback is started. sl@0: sl@0: @param aRampDuration sl@0: Duration of the ramping period. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetVolumeRampL(const TTimeIntervalMicroSeconds& aRampDuration) sl@0: { sl@0: iBody->SetVolumeRampL(aRampDuration); sl@0: } sl@0: sl@0: /** sl@0: Get the current stereo balance value sl@0: sl@0: @return Balance value ranging from KMMFBalanceMaxLeft to KMMFBalanceMaxRight sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::GetBalanceL() const sl@0: { sl@0: return iBody->GetBalanceL(); sl@0: } sl@0: sl@0: /** sl@0: Set the current stereo balance value sl@0: sl@0: @param aBalance sl@0: Balance value to set. Defaults to KMMFBalanceCenter to restore equal left-right balance sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetBalanceL(TInt aBalance) sl@0: { sl@0: iBody->SetBalanceL(aBalance); sl@0: } sl@0: sl@0: /** sl@0: Set the priority with which this client plays MIDI data sl@0: sl@0: @param aPriority sl@0: The Priority Value. sl@0: @param aPref sl@0: The Priority Preference. sl@0: sl@0: @see CMidiClientUtility::NewL() sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetPriorityL(TInt aPriority, TInt aPref) sl@0: { sl@0: iBody->SetPriorityL(aPriority, aPref); sl@0: } sl@0: sl@0: /** sl@0: Get the number of meta data entries currently known about in the currently open sl@0: resource. XMF,SMF meta data are part of the XMF,SMF file header and can thus be examined sl@0: before playback. If there is no XMF,SMF resource open, will return zero. sl@0: Standard MIDI file meta data entries encountered during playback will be passed back sl@0: via MMIDIClientUtilityObserver::MmcuoMetaDataEntryFound() sl@0: sl@0: @return Number of XMF meta data entries currently known about sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::NumberOfMetaDataEntriesL() const sl@0: { sl@0: return iBody->NumberOfMetaDataEntriesL(); sl@0: } sl@0: sl@0: /** sl@0: Retrieve the specified XMF,SMF meta data entry. sl@0: sl@0: @param aMetaDataIndex sl@0: Index of the meta data entry to retrieve sl@0: @return Meta data entry. Ownership is passed to the client. sl@0: */ sl@0: EXPORT_C CMMFMetaDataEntry* CMidiClientUtility::GetMetaDataEntryL(TInt aMetaDataIndex) const sl@0: { sl@0: return iBody->GetMetaDataEntryL(aMetaDataIndex); sl@0: } sl@0: sl@0: /** sl@0: Synchronously pass implementation-specific commands to the MIDI engine sl@0: and receive a response sl@0: sl@0: @param aDestination sl@0: Recipient of the message. Should be initialised with KUidInterfaceMIDI sl@0: and a TInt describing the server-side object to which the command should be delivered. sl@0: The TInt will usually be KMMFObjectHandleController, to deliver the message to the sl@0: controller plugin, which is the default value. sl@0: @param aFunction sl@0: Index of the function to perform sl@0: @param aDataTo1 sl@0: First command data buffer to send, eg command parameters sl@0: @param aDataTo2 sl@0: Second command data buffer to send, eg data parameters sl@0: @param aDataFrom sl@0: Buffer to receive data in response to the command. sl@0: The user must ensure that it is large enough to hold all the data returned. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::CustomCommandSyncL(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom) sl@0: { sl@0: iBody->CustomCommandSyncL(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom); sl@0: } sl@0: sl@0: /** sl@0: Synchronously pass implementation-specific commands to the MIDI engine. sl@0: sl@0: @param aDestination sl@0: Recipient of the message. Should be initialised with KUidInterfaceMIDI sl@0: and a TInt describing the server-side object to which the command should be delivered. sl@0: The TInt will usually be KMMFObjectHandleController, to deliver the message to the sl@0: controller plugin, which is the default value. sl@0: @param aFunction sl@0: Index of the function to perform sl@0: @param aDataTo1 sl@0: First command data buffer to send, eg command parameters sl@0: @param aDataTo2 sl@0: Second command data buffer to send, eg data parameters sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::CustomCommandSyncL(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2) sl@0: { sl@0: iBody->CustomCommandSyncL(aDestination, aFunction, aDataTo1, aDataTo2); sl@0: } sl@0: sl@0: /** sl@0: Asynchronously pass implementation-specific commands to the MIDI engine sl@0: and receive a response sl@0: sl@0: @param aDestination sl@0: aDestination Recipient of the message. Should be initialised with KUidInterfaceMIDI sl@0: and a TInt describing the server-side object to which the command should be delivered. sl@0: The TInt will usually be KMMFObjectHandleController, to deliver the message to the sl@0: controller plugin, which is the default value. sl@0: @param aFunction sl@0: Index of the function to perform sl@0: @param aDataTo1 sl@0: First command data buffer to send, eg command parameters sl@0: @param aDataTo2 sl@0: Second command data buffer to send, eg data parameters sl@0: @param aDataFrom sl@0: Buffer to receive data in response to the command. sl@0: The user must ensure that it is large enough to hold all the data returned. sl@0: @param aStatus sl@0: Status flag belonging to an active object that will have it's RunL() called sl@0: when this request complete sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus) sl@0: { sl@0: iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus); sl@0: } sl@0: sl@0: /** sl@0: Asynchronously pass implementation-specific commands to the MIDI engine sl@0: sl@0: @param aDestination sl@0: aDestination Recipient of the message. Should be initialised with KUidInterfaceMIDI sl@0: and a TInt describing the server-side object to which the command should be delivered. sl@0: The TInt will usually be KMMFObjectHandleController, to deliver the message to the sl@0: controller plugin, which is the default value. sl@0: @param aFunction sl@0: Index of the function to perform sl@0: @param aDataTo1 sl@0: First command data buffer to send, eg command parameters sl@0: @param aDataTo2 sl@0: Second command data buffer to send, eg data parameters sl@0: @param aStatus sl@0: Status flag belonging to an active object that will have it's RunL() called sl@0: when this request complete sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus) sl@0: { sl@0: iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus); sl@0: } sl@0: sl@0: /** sl@0: Gets a controller's DRM custom command implementation. sl@0: sl@0: @return A pointer to a controller's DRM custom command implementation or NULL sl@0: if the interface can not be obtained sl@0: */ sl@0: EXPORT_C MMMFDRMCustomCommand* CMidiClientUtility::GetDRMCustomCommand() sl@0: { sl@0: return iBody->GetDRMCustomCommand(); sl@0: } sl@0: sl@0: /** sl@0: Set the max polyphony the engine can handle sl@0: sl@0: @param aMaxNotes sl@0: Max polyphony level, 0 <= PolyphonyL() <= aMaxNotes sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetMaxPolyphonyL(TInt aMaxNotes) sl@0: { sl@0: iBody->SetMaxPolyphonyL(aMaxNotes); sl@0: } sl@0: sl@0: /** sl@0: Gets the number of times the current opened resources has to be repeated sl@0: sl@0: @return The number of time the current opened resources has to be repeated sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::GetRepeats() const sl@0: { sl@0: return iBody->GetRepeats(); sl@0: } sl@0: sl@0: /** sl@0: Loads one or more custom sound banks from a descriptor into memory for use. sl@0: If several banks are loaded with consequent LoadCustomBanksL() function calls, sl@0: the banks are combined if the bank sets have colliding bank numbers sl@0: sl@0: @param aBankData sl@0: Descriptor containing the custom sound bank sl@0: @param aBankId sl@0: Identifier of the custom sound bank loaded, occupying no more than 14 bits. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::LoadCustomBankDataL(const TDesC8& aBankData,TInt& aBankId) sl@0: { sl@0: iBody->LoadCustomBankDataL(aBankData, aBankId); sl@0: } sl@0: sl@0: /** sl@0: Loads an individual instrument from descriptor into custom sound bank memory for use. sl@0: The bank and instrument ids given in the descriptor can be mapped into different bank sl@0: and instrument ids in memory sl@0: sl@0: @param aInstrumentData sl@0: Descriptor containing the instrument sl@0: @param aBankDataId sl@0: Identifier of the bank in the descriptor from which to load the instrument, sl@0: occupying no more than 14 bits sl@0: @param aInstrumentDataId sl@0: Identifier of the instrument to load. 0 <= aInstrumentId <= 127 sl@0: @param aMemoryBankId sl@0: Identifier of the custom bank in memory to load the instrument into, sl@0: occupying no more than 14 bits sl@0: @param aMemoryInstrumentId sl@0: Identifier of the instrument in memory to load the new sl@0: instrument into. 0 <= aInstrumentId <= 127. sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::LoadCustomInstrumentDataL(const TDesC8& aInstrumentData, TInt aBankDataId, TInt aInstrumentDataId, TInt aMemoryBankId, TInt aMemoryInstrumentId) sl@0: { sl@0: iBody->LoadCustomInstrumentDataL(aInstrumentData, aBankDataId, aInstrumentDataId, aMemoryBankId, aMemoryInstrumentId); sl@0: } sl@0: sl@0: /** sl@0: Tell the MIDI engine to use a custom bank or a standard bank sl@0: sl@0: @param aCustom sl@0: If Etrue the custom bank in memory is used otherwise the standard bank sl@0: is used leaving the custom bank in memory sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::SetBankL(TBool aCustom) sl@0: { sl@0: iBody->SetBankL(aCustom); sl@0: } sl@0: sl@0: /** sl@0: Gets the muting status of a specific track sl@0: sl@0: @param aTrack sl@0: The track to query sl@0: @return The mute status of the track. sl@0: */ sl@0: EXPORT_C TBool CMidiClientUtility::IsTrackMuteL(TInt aTrack) const sl@0: { sl@0: return iBody->IsTrackMuteL(aTrack); sl@0: } sl@0: sl@0: /** sl@0: Gets the muting status of a specific channel sl@0: sl@0: @param aChannel sl@0: The channel to query sl@0: @return The mute status of the channel sl@0: */ sl@0: EXPORT_C TBool CMidiClientUtility::IsChannelMuteL(TInt aChannel) const sl@0: { sl@0: return iBody->IsChannelMuteL(aChannel); sl@0: } sl@0: sl@0: /** sl@0: Gets the instrument assigned to a specified channel sl@0: sl@0: @param aChannel sl@0: Logical channel, 0 <= aChannel <= 15. sl@0: @param aInstrumentId sl@0: Identifier of the instrument assigned to aChannel. 0 <= iInstrumentId <= 127 sl@0: @param aBankId sl@0: Identifier of the bank that the instrument belongs to, occupying no more than 14 bits sl@0: */ sl@0: EXPORT_C void CMidiClientUtility::GetInstrumentL(TInt aChannel, TInt& aInstrumentId, TInt& aBankId) sl@0: { sl@0: iBody->GetInstrumentL(aChannel, aInstrumentId, aBankId); sl@0: } sl@0: sl@0: /** sl@0: Get the maximum polyphony level that the engine can handle sl@0: sl@0: @return The maximum number of simultaneous notes the engine can handle. sl@0: 0 <= PolyphonyL() <= MaxPolyphonyL() sl@0: */ sl@0: EXPORT_C TInt CMidiClientUtility::MaxPolyphonyL() const sl@0: { sl@0: return iBody->MaxPolyphonyL(); sl@0: } sl@0: