sl@0: // Copyright (c) 2002-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: // Mda\Common\MmfAudio.h sl@0: // sl@0: // sl@0: sl@0: #ifndef __MMF_COMMON_AUDIO_H__ sl@0: #define __MMF_COMMON_AUDIO_H__ sl@0: sl@0: // Standard EPOC32 includes sl@0: #include sl@0: sl@0: // Public Media Server includes sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Audio Loading started event. Use by a controller to signal to a sl@0: client that audio loading has begun. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: const TUid KMMFEventCategoryAudioLoadingStarted = {0x101F8002}; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Audio Loading completed event. Use by a controller to signal to a sl@0: client that audio loading has completed. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: const TUid KMMFEventCategoryAudioLoadingComplete = {0x101F8003}; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: The class defining a callback interface for receiving loading notifications. sl@0: sl@0: since 7.0s sl@0: */ sl@0: class MAudioLoadingObserver sl@0: { sl@0: public: sl@0: sl@0: /* sl@0: Audio Loading/rebuffering has begun sl@0: sl@0: @since 7.0s sl@0: */ sl@0: virtual void MaloLoadingStarted() = 0; sl@0: /* sl@0: Audio Loading/rebuffering has completed sl@0: sl@0: @since 7.0s sl@0: */ sl@0: virtual void MaloLoadingComplete() = 0; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: An interface to a set of audio player callback functions. sl@0: sl@0: The class is a mixin and is intended to be inherited by the client sl@0: class which is waiting for the audio resource. The functions sl@0: encapsulated by this class are called when specific events occur in sl@0: the process of resource availablity. A reference to this object is sl@0: passed as a parameter when registering for notification by sl@0: the audio player. sl@0: sl@0: */ sl@0: class MMMFAudioResourceNotificationCallback sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Called when the audio resource becomes available but sl@0: only if the resource was previously unavailable (e.g. if sl@0: the audio resource is available when the client registers, sl@0: then this callback is not received). sl@0: sl@0: @param aNotificationEventId sl@0: The UID of the event that is being handled. sl@0: @param aNotificationData sl@0: The data that corresponds to the notification event. sl@0: */ sl@0: virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData) = 0; sl@0: sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: A class used when sending custom commands from the client API sl@0: to the audio controller to get or set the audio configuration sl@0: */ sl@0: class TMMFAudioConfig sl@0: { sl@0: public: sl@0: inline TMMFAudioConfig(); sl@0: sl@0: /** sl@0: Not implemented. sl@0: */ sl@0: inline void SetReturnSize(TInt aReturnSize); sl@0: public: sl@0: // Audio device command parameters sl@0: sl@0: /** sl@0: The volume setting. This can be any value from zero to iMaxVolume sl@0: */ sl@0: TInt iVolume; sl@0: /** sl@0: The maximum volume setting of the audio device. sl@0: sl@0: This value is platform dependent but is always greater than or equal to one. This is the sl@0: maximum value that should be passed to iVolume. sl@0: */ sl@0: TInt iMaxVolume; sl@0: sl@0: /** sl@0: The balance between left and right stereo channels. Must be between -100 and 100 sl@0: */ sl@0: TInt iBalance; sl@0: sl@0: /** sl@0: The gain of the audio device. This can be any value from zero to iMaxGain sl@0: */ sl@0: TInt iGain; sl@0: sl@0: /** sl@0: The maximum gain of the audio device. sl@0: */ sl@0: TInt iMaxGain; sl@0: sl@0: /** sl@0: If true, the audio clip is cropped from the current position to the end and the remainder of the clip sl@0: is discarded. If false, the audio clip is cropped from the start of the file to the current position. sl@0: The audio data prior to the current position is discarded. sl@0: */ sl@0: TBool iCropToEnd ; sl@0: sl@0: /** sl@0: The number of channels of the audio device (signifying mono/stereo). sl@0: */ sl@0: TUint iChannels; sl@0: sl@0: /** sl@0: The sample rate of the audio device. sl@0: */ sl@0: TUint iSampleRate; sl@0: sl@0: /** sl@0: The format UID to be used. sl@0: */ sl@0: TUid iFormatUid; sl@0: sl@0: /** sl@0: The source data codec type. sl@0: */ sl@0: TFourCC iSourceDataTypeCode; sl@0: sl@0: /** sl@0: The sink data codec type. sl@0: */ sl@0: TFourCC iSinkDataTypeCode; sl@0: sl@0: /** sl@0: The start position for audio playback in micro seconds. sl@0: */ sl@0: TTimeIntervalMicroSeconds iStartPosition ; sl@0: sl@0: /** sl@0: The end position for audio playback in micro seconds. sl@0: */ sl@0: TTimeIntervalMicroSeconds iEndPosition ; sl@0: sl@0: /** sl@0: The period over which the volume is to rise. sl@0: sl@0: A zero value causes the tone sample to be played at the normal level for the full sl@0: duration of the playback. A value which is longer than the duration sl@0: of the audio sample means that the sample never reaches its normal volume level. sl@0: sl@0: Supported only during tone playing. sl@0: */ sl@0: TTimeIntervalMicroSeconds iRampDuration ; sl@0: sl@0: /** sl@0: The recordable time available to the audio device. sl@0: sl@0: This value may be the estimated time available. sl@0: */ sl@0: TTimeIntervalMicroSeconds iRecordTimeAvailable ; sl@0: sl@0: /** sl@0: The maximum duration of the recorded clip, in microseconds sl@0: */ sl@0: TTimeIntervalMicroSeconds iMaxDuration ; sl@0: sl@0: /** sl@0: The maximum size of the recorded clip, in bytes. sl@0: */ sl@0: TInt iMaxFileSize ; sl@0: sl@0: /** sl@0: The current state of the audio device. sl@0: */ sl@0: TInt iState ; sl@0: sl@0: /** sl@0: The current completion status of loading/rebuffering. sl@0: */ sl@0: TInt iLoadingCompletePercentage; sl@0: sl@0: enum sl@0: { sl@0: /** sl@0: Specifies the maximum buffer length that can be passed with notification request sl@0: */ sl@0: KNotificationDataBufferSize=256 sl@0: }; sl@0: /** sl@0: The notification event to register for the client. sl@0: */ sl@0: TUid iEventType; sl@0: /** sl@0: The notification data from the client. sl@0: */ sl@0: TBufC8 iNotificationRegistrationData; sl@0: /** sl@0: The notification data for the client. sl@0: */ sl@0: TBuf8 iNotificationData; sl@0: private: sl@0: /** sl@0: This member is internal and not intended for use. sl@0: */ sl@0: TInt iReserved1; sl@0: TInt iReserved2; sl@0: TInt iReserved3; sl@0: }; sl@0: sl@0: /** sl@0: Initialises the object with arbitrary values. sl@0: */ sl@0: inline TMMFAudioConfig::TMMFAudioConfig() {}; sl@0: sl@0: sl@0: /* sl@0: @publishedAll sl@0: @released sl@0: sl@0: A class used when sending custom commands from the client API sl@0: to the audio controller to set repeats sl@0: */ sl@0: class TMMFAudioSetRepeatsConfig sl@0: { sl@0: public: sl@0: IMPORT_C TMMFAudioSetRepeatsConfig(); sl@0: sl@0: public: sl@0: sl@0: /** sl@0: The number of times the audio sample, together with the trailing silence, is to be repeated. sl@0: If this is set to KMdaRepeatForever, then the audio sample, together with the trailing silence, is sl@0: repeated indefinitely or until Stop() is called. If this is set to zero, then the audio sample sl@0: is not repeated. The behaviour is undefined for negative values (other than KMdaRepeatForever). sl@0: */ sl@0: TInt iRepeatNumberOfTimes; sl@0: sl@0: /** sl@0: The time interval of the training silence. sl@0: */ sl@0: TTimeIntervalMicroSeconds iTrailingSilence; sl@0: sl@0: private: sl@0: /** sl@0: This member is internal and not intended for use. sl@0: */ sl@0: TInt iReserved1; sl@0: }; sl@0: sl@0: #endif