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