sl@0: // Copyright (c) 2001-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: #ifndef __MMFBASE_H__ sl@0: #define __MMFBASE_H__ sl@0: sl@0: // Standard EPOC32 includes sl@0: #include sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: The priority for clients accessing a sound output device for audio playback or audio streaming. sl@0: sl@0: This is a value between EMdaPriorityMin and EMdaPriorityMax. The higher value indicates a more sl@0: important request. It is used to resolve conflicts when more than one client tries to access the sl@0: same hardware resource simultaneously. sl@0: sl@0: One of these values is passed in the first parameter to CMdaAudioOutputStream::SetPriority(). sl@0: sl@0: @see CMdaAudioOutputStream::SetPriority() sl@0: */ sl@0: enum TMdaPriority sl@0: { sl@0: /** sl@0: The lowest priority (= – 100). This indicates that the client can be interrupted sl@0: by any other client. sl@0: */ sl@0: EMdaPriorityMin = -100, sl@0: /** sl@0: Normal priority. This indicates that the client can be interrupted but only by higher priority clients. sl@0: */ sl@0: EMdaPriorityNormal = 0, sl@0: /** sl@0: The highest priority (= 100). This indicates that the client cannot be interrupted by other clients. sl@0: */ sl@0: EMdaPriorityMax = 100 sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Audio priority preference values. These are to be interpreted as discrete values and not separate flags. sl@0: */ sl@0: enum TMdaPriorityPreference sl@0: { sl@0: /** sl@0: Default value - no specific meaning. sl@0: */ sl@0: EMdaPriorityPreferenceNone = 0, sl@0: /** sl@0: The audio data is time sensitive. The playback operation may fail if it cannot happen when sl@0: requested but degraded output such as mixing or muting is allowed. Note that this is the sl@0: default behaviour anyway, but this declaration is maintained for compatability. */ sl@0: EMdaPriorityPreferenceTime = 1, sl@0: /** sl@0: The audio data should be played at the best possible quality (for example, it should not be degraded by sl@0: muting or mixing). This is an advisory to the adaptation and can be ignored. sl@0: */ sl@0: EMdaPriorityPreferenceQuality = 2, sl@0: /** sl@0: The audio data is both time and quality sensitive. Identical in behaviour to EMdaPriorityPreferenceQuality. sl@0: */ sl@0: EMdaPriorityPreferenceTimeAndQuality = 3 sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Holds the current state of DevSound. sl@0: */ sl@0: enum TMMFState sl@0: { sl@0: /** Idle state. sl@0: */ sl@0: EMMFStateIdle, sl@0: /** The MMF is currently playing. sl@0: */ sl@0: EMMFStatePlaying, sl@0: /** The MMF is playing a tone. sl@0: */ sl@0: EMMFStateTonePlaying, sl@0: /** The MMF is currently recording. sl@0: */ sl@0: EMMFStateRecording, sl@0: /** The MMF is playing and recording. sl@0: */ sl@0: EMMFStatePlayingRecording, sl@0: /** The MMF is converting data. sl@0: */ sl@0: EMMFStateConverting sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: A class type representing the audio client's priority, sl@0: priority preference and state settings. 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: */ sl@0: class TMMFPrioritySettings sl@0: { sl@0: public: sl@0: TMMFPrioritySettings(); sl@0: /** 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: */ sl@0: TInt iPriority; sl@0: sl@0: /** 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: */ sl@0: TInt iPref; sl@0: sl@0: /** sl@0: The state of the MMF player such as idle, playing, recording and so on. See the TMMFState enum for possible states. sl@0: */ sl@0: TMMFState iState; 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: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: This is a TPckgBuf package of a TMMFPrioritySettings. sl@0: */ sl@0: typedef TPckgBuf TMMFPrioritySettingsPckg; sl@0: sl@0: /** sl@0: Initializes the object with arbitrary values. sl@0: */ sl@0: inline TMMFPrioritySettings::TMMFPrioritySettings() : iPriority(EMdaPriorityNormal), iPref(EMdaPriorityPreferenceNone), iState(EMMFStateIdle), iReserved1(0) sl@0: { sl@0: } sl@0: sl@0: #endif