os/mm/mmlibs/mmfw/inc/mmf/common/MmfBase.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/inc/mmf/common/MmfBase.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,168 @@
     1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __MMFBASE_H__
    1.20 +#define __MMFBASE_H__
    1.21 +
    1.22 +// Standard EPOC32 includes
    1.23 +#include <e32base.h>
    1.24 +
    1.25 +
    1.26 +/** 
    1.27 +@publishedAll
    1.28 +@released
    1.29 +
    1.30 +The priority for clients accessing a sound output device for audio playback or audio streaming.
    1.31 +
    1.32 +This is a value between EMdaPriorityMin and EMdaPriorityMax. The higher value indicates a more 
    1.33 +important request. It is used to resolve conflicts when more than one client tries to access the
    1.34 +same hardware resource simultaneously.
    1.35 +
    1.36 +One of these values is passed in the first parameter to CMdaAudioOutputStream::SetPriority().
    1.37 +
    1.38 +@see CMdaAudioOutputStream::SetPriority()
    1.39 +*/
    1.40 +enum TMdaPriority
    1.41 +	{
    1.42 +  	/**
    1.43 +	The lowest priority (= – 100). This indicates that the client can be interrupted 
    1.44 +	by any other client.
    1.45 +	*/
    1.46 +    EMdaPriorityMin = -100,
    1.47 +	/**
    1.48 +	Normal priority. This indicates that the client can be interrupted but only by higher priority clients.
    1.49 +	*/
    1.50 +    EMdaPriorityNormal = 0,
    1.51 +	/**
    1.52 +    The highest priority (= 100). This indicates that the client cannot be interrupted by other clients.
    1.53 +	*/
    1.54 +    EMdaPriorityMax = 100
    1.55 +	};
    1.56 +
    1.57 +/**
    1.58 +@publishedAll
    1.59 +@released
    1.60 +
    1.61 +Audio priority preference values. These are to be interpreted as discrete values and not separate flags.
    1.62 +*/
    1.63 +enum TMdaPriorityPreference
    1.64 +	{
    1.65 +	/**
    1.66 +	Default value - no specific meaning.
    1.67 +	*/
    1.68 +    EMdaPriorityPreferenceNone =	0,
    1.69 +	/**
    1.70 +	The audio data is time sensitive. The playback operation may fail if it cannot happen when 
    1.71 +	requested but degraded output such as mixing or muting is allowed. Note that this is the
    1.72 +	default behaviour anyway, but this declaration is maintained for compatability.	*/
    1.73 +    EMdaPriorityPreferenceTime =	1,
    1.74 +	/**
    1.75 +    The audio data should be played at the best possible quality (for example, it should not be degraded by 
    1.76 +	muting or mixing). This is an advisory to the adaptation and can be ignored.
    1.77 +	*/
    1.78 +    EMdaPriorityPreferenceQuality = 2,
    1.79 +	/**
    1.80 +    The audio data is both time and quality sensitive. Identical in behaviour to EMdaPriorityPreferenceQuality.
    1.81 +	*/
    1.82 +    EMdaPriorityPreferenceTimeAndQuality = 3
    1.83 +	};
    1.84 +
    1.85 +/**
    1.86 +@publishedAll
    1.87 +@released
    1.88 +
    1.89 +Holds the current state of DevSound.
    1.90 +*/
    1.91 +enum TMMFState
    1.92 +{
    1.93 +	/** Idle state.
    1.94 +	*/
    1.95 +	EMMFStateIdle,
    1.96 +	/** The MMF is currently playing.
    1.97 +	*/
    1.98 +	EMMFStatePlaying,
    1.99 +	/** The MMF is playing a tone.
   1.100 +	*/
   1.101 +	EMMFStateTonePlaying,
   1.102 +	/** The MMF is currently recording.
   1.103 +	*/
   1.104 +	EMMFStateRecording,
   1.105 +	/** The MMF is playing and recording.
   1.106 +	*/
   1.107 +	EMMFStatePlayingRecording,
   1.108 +	/** The MMF is converting data.
   1.109 +	*/
   1.110 +	EMMFStateConverting
   1.111 +};
   1.112 +
   1.113 +/**
   1.114 +@publishedAll
   1.115 +@released
   1.116 +
   1.117 +A class type representing the audio client's priority,
   1.118 +priority preference and state settings.
   1.119 +
   1.120 +Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
   1.121 +several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
   1.122 +the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
   1.123 +Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
   1.124 +vary between different phones. Portable applications are advised not to assume any specific behaviour. 
   1.125 +
   1.126 +*/
   1.127 +class TMMFPrioritySettings
   1.128 +	{
   1.129 +public:
   1.130 +	TMMFPrioritySettings();
   1.131 +	/**
   1.132 +    The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
   1.133 +    EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
   1.134 +	*/
   1.135 +	TInt iPriority;
   1.136 +
   1.137 +	/**
   1.138 +    The Priority Preference - an additional audio policy parameter. The suggested default is 
   1.139 +    EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
   1.140 +    values may be supported by given phones and/or platforms, but should not be depended upon by 
   1.141 +    portable code.
   1.142 +	*/
   1.143 +	TInt iPref;
   1.144 +
   1.145 +	/**
   1.146 +    The state of the MMF player such as idle, playing, recording and so on. See the TMMFState enum for possible states.
   1.147 +	*/
   1.148 +	TMMFState iState;
   1.149 +private:
   1.150 +	/**
   1.151 +	This member is internal and not intended for use.
   1.152 +	*/
   1.153 +	TInt iReserved1;
   1.154 +	};
   1.155 +
   1.156 +/**
   1.157 +@publishedAll
   1.158 +@released
   1.159 +
   1.160 +This is a TPckgBuf package of a TMMFPrioritySettings.
   1.161 +*/
   1.162 +typedef TPckgBuf<TMMFPrioritySettings> TMMFPrioritySettingsPckg;
   1.163 +
   1.164 +/**
   1.165 +Initializes the object with arbitrary values.
   1.166 +*/
   1.167 +inline TMMFPrioritySettings::TMMFPrioritySettings() : iPriority(EMdaPriorityNormal), iPref(EMdaPriorityPreferenceNone), iState(EMMFStateIdle), iReserved1(0)
   1.168 +	{
   1.169 +	}
   1.170 +
   1.171 +#endif