williamr@2: // Copyright (c) 2001-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@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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: // williamr@2: williamr@2: #ifndef __MMFBASE_H__ williamr@2: #define __MMFBASE_H__ williamr@2: williamr@2: // Standard EPOC32 includes williamr@2: #include williamr@2: williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: The priority for clients accessing a sound output device for audio playback or audio streaming. williamr@2: williamr@2: This is a value between EMdaPriorityMin and EMdaPriorityMax. The higher value indicates a more williamr@2: important request. It is used to resolve conflicts when more than one client tries to access the williamr@2: same hardware resource simultaneously. williamr@2: williamr@2: One of these values is passed in the first parameter to CMdaAudioOutputStream::SetPriority(). williamr@2: williamr@2: @see CMdaAudioOutputStream::SetPriority() williamr@2: */ williamr@2: enum TMdaPriority williamr@2: { williamr@2: /** williamr@2: The lowest priority (= – 100). This indicates that the client can be interrupted williamr@2: by any other client. williamr@2: */ williamr@2: EMdaPriorityMin = -100, williamr@2: /** williamr@2: Normal priority. This indicates that the client can be interrupted but only by higher priority clients. williamr@2: */ williamr@2: EMdaPriorityNormal = 0, williamr@2: /** williamr@2: The highest priority (= 100). This indicates that the client cannot be interrupted by other clients. williamr@2: */ williamr@2: EMdaPriorityMax = 100 williamr@2: }; williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: A set of priority values which define the behaviour to be adopted by an williamr@2: audio client if a higher priority client takes over the device. williamr@2: */ williamr@2: enum TMdaPriorityPreference williamr@2: { williamr@2: /** williamr@2: No priority. williamr@2: */ williamr@2: EMdaPriorityPreferenceNone = 0x00000000, williamr@2: /** williamr@2: The audio data is time sensitive. The playback operation fails if it cannot happen when williamr@2: requested but degraded output such as mixing or muting is allowed. williamr@2: */ williamr@2: EMdaPriorityPreferenceTime = 0x00000001, williamr@2: /** williamr@2: The audio data must be played at the best possible quality (for example, it must not be degraded by williamr@2: muting or mixing). The playback operation is delayed until the sound device is available for exclusive use. williamr@2: */ williamr@2: EMdaPriorityPreferenceQuality = 0x00000002, williamr@2: /** williamr@2: The audio data is both time and quality sensitive. The playback operation fails if it cannot williamr@2: happen immediately at the highest quality. williamr@2: */ williamr@2: EMdaPriorityPreferenceTimeAndQuality = EMdaPriorityPreferenceTime|EMdaPriorityPreferenceQuality williamr@2: }; williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: Holds the current state of DevSound. williamr@2: */ williamr@2: enum TMMFState williamr@2: { williamr@2: /** Idle state. williamr@2: */ williamr@2: EMMFStateIdle, williamr@2: /** The MMF is currently playing. williamr@2: */ williamr@2: EMMFStatePlaying, williamr@2: /** The MMF is playing a tone. williamr@2: */ williamr@2: EMMFStateTonePlaying, williamr@2: /** The MMF is currently recording. williamr@2: */ williamr@2: EMMFStateRecording, williamr@2: /** The MMF is playing and recording. williamr@2: */ williamr@2: EMMFStatePlayingRecording, williamr@2: /** The MMF is converting data. williamr@2: */ williamr@2: EMMFStateConverting williamr@2: }; williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: A class type representing the audio client's priority, williamr@2: priority preference and state settings. williamr@2: */ williamr@2: class TMMFPrioritySettings williamr@2: { williamr@2: public: williamr@2: TMMFPrioritySettings(); williamr@2: /** williamr@2: Absolute priority of a client of the MMF Server. williamr@2: williamr@2: Used by the policy server to determine which client should gain access to the sound device. williamr@2: williamr@2: The priority which should be an integer in the range -100 to +100. williamr@2: */ williamr@2: TInt iPriority; williamr@2: williamr@2: /** williamr@2: The priority preference that expresses the nature of the priority that can be none, williamr@2: time (or speed), quality or both time and quality. williamr@2: williamr@2: If this is set to EMdaPriorityPreferenceTime then the audio data is time sensitive. The playback williamr@2: operation fails if it cannot happen when requested but degraded output such as mixing or muting williamr@2: is allowed. williamr@2: williamr@2: If this is set to EMdaPriorityPreferenceQuality then the audio data must be played at the best possible williamr@2: quality (for example, it must not be degraded by muting or mixing). The playback operation is delayed williamr@2: until the sound device is available for exclusive use. williamr@2: williamr@2: If this is set to EMdaPriorityPreferenceTimeAndQuality then the audio data is both time and quality williamr@2: sensitive. The playback operation fails if it cannot happen immediately at the highest quality. williamr@2: */ williamr@2: TMdaPriorityPreference iPref; williamr@2: williamr@2: /** williamr@2: The state of the MMF player such as idle, playing, recording and so on. See the TMMFState enum for possible states. williamr@2: */ williamr@2: TMMFState iState; 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: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: This is a TPckgBuf package of a TMMFPrioritySettings. williamr@2: */ williamr@2: typedef TPckgBuf TMMFPrioritySettingsPckg; williamr@2: williamr@2: /** williamr@2: Initializes the object with arbitrary values. williamr@2: */ williamr@2: inline TMMFPrioritySettings::TMMFPrioritySettings() : iPriority(EMdaPriorityNormal), iPref(EMdaPriorityPreferenceNone), iState(EMMFStateIdle), iReserved1(0) williamr@2: { williamr@2: } williamr@2: williamr@2: #endif