epoc32/include/mmf/common/mmfbase.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // 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
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __MMFBASE_H__
    17 #define __MMFBASE_H__
    18 
    19 // Standard EPOC32 includes
    20 #include <e32base.h>
    21 
    22 
    23 /** 
    24 @publishedAll
    25 @released
    26 
    27 The priority for clients accessing a sound output device for audio playback or audio streaming.
    28 
    29 This is a value between EMdaPriorityMin and EMdaPriorityMax. The higher value indicates a more 
    30 important request. It is used to resolve conflicts when more than one client tries to access the
    31 same hardware resource simultaneously.
    32 
    33 One of these values is passed in the first parameter to CMdaAudioOutputStream::SetPriority().
    34 
    35 @see CMdaAudioOutputStream::SetPriority()
    36 */
    37 enum TMdaPriority
    38 	{
    39   	/**
    40 	The lowest priority (= – 100). This indicates that the client can be interrupted 
    41 	by any other client.
    42 	*/
    43     EMdaPriorityMin = -100,
    44 	/**
    45 	Normal priority. This indicates that the client can be interrupted but only by higher priority clients.
    46 	*/
    47     EMdaPriorityNormal = 0,
    48 	/**
    49     The highest priority (= 100). This indicates that the client cannot be interrupted by other clients.
    50 	*/
    51     EMdaPriorityMax = 100
    52 	};
    53 
    54 /**
    55 @publishedAll
    56 @released
    57 
    58 A set of priority values which define the behaviour to be adopted by an
    59 audio client if a higher priority client takes over the device.
    60 */
    61 enum TMdaPriorityPreference
    62 	{
    63 	/**
    64 	No priority.
    65 	*/
    66     EMdaPriorityPreferenceNone =	0x00000000,
    67 	/**
    68 	The audio data is time sensitive. The playback operation fails if it cannot happen when 
    69 	requested but degraded output such as mixing or muting is allowed.
    70 	*/
    71     EMdaPriorityPreferenceTime =	0x00000001,
    72 	/**
    73     The audio data must be played at the best possible quality (for example, it must not be degraded by 
    74 	muting or mixing). The playback operation is delayed until the sound device is available for exclusive use.
    75 	*/
    76     EMdaPriorityPreferenceQuality = 0x00000002,
    77 	/**
    78     The audio data is both time and quality sensitive. The playback operation fails if it cannot 
    79 	happen immediately at the highest quality.
    80 	*/
    81     EMdaPriorityPreferenceTimeAndQuality = EMdaPriorityPreferenceTime|EMdaPriorityPreferenceQuality
    82 	};
    83 
    84 /**
    85 @publishedAll
    86 @released
    87 
    88 Holds the current state of DevSound.
    89 */
    90 enum TMMFState
    91 {
    92 	/** Idle state.
    93 	*/
    94 	EMMFStateIdle,
    95 	/** The MMF is currently playing.
    96 	*/
    97 	EMMFStatePlaying,
    98 	/** The MMF is playing a tone.
    99 	*/
   100 	EMMFStateTonePlaying,
   101 	/** The MMF is currently recording.
   102 	*/
   103 	EMMFStateRecording,
   104 	/** The MMF is playing and recording.
   105 	*/
   106 	EMMFStatePlayingRecording,
   107 	/** The MMF is converting data.
   108 	*/
   109 	EMMFStateConverting
   110 };
   111 
   112 /**
   113 @publishedAll
   114 @released
   115 
   116 A class type representing the audio client's priority,
   117 priority preference and state settings.
   118 */
   119 class TMMFPrioritySettings
   120 	{
   121 public:
   122 	TMMFPrioritySettings();
   123 	/**
   124 	Absolute priority of a client of the MMF Server.
   125 
   126 	Used by the policy server to determine which client should gain access to the sound device.
   127 
   128 	The priority which should be an integer in the range -100 to +100.
   129 	*/
   130 	TInt iPriority;
   131 
   132 	/**
   133     The priority preference that expresses the nature of the priority that can be none, 
   134 	time (or speed), quality or both time and quality.
   135 
   136 	If this is set to EMdaPriorityPreferenceTime then the audio data is time sensitive. The playback 
   137 	operation fails if it cannot happen when requested but degraded output such as mixing or muting 
   138 	is allowed.
   139 
   140 	If this is set to EMdaPriorityPreferenceQuality then the audio data must be played at the best possible 
   141 	quality (for example, it must not be degraded by muting or mixing). The playback operation is delayed
   142 	until the sound device is available for exclusive use.
   143 
   144 	If this is set to EMdaPriorityPreferenceTimeAndQuality then the audio data is both time and quality 
   145 	sensitive. The playback operation fails if it cannot happen immediately at the highest quality.
   146 	*/
   147 	TMdaPriorityPreference iPref;
   148 
   149 	/**
   150     The state of the MMF player such as idle, playing, recording and so on. See the TMMFState enum for possible states.
   151 	*/
   152 	TMMFState iState;
   153 private:
   154 	/**
   155 	This member is internal and not intended for use.
   156 	*/
   157 	TInt iReserved1;
   158 	};
   159 
   160 /**
   161 @publishedAll
   162 @released
   163 
   164 This is a TPckgBuf package of a TMMFPrioritySettings.
   165 */
   166 typedef TPckgBuf<TMMFPrioritySettings> TMMFPrioritySettingsPckg;
   167 
   168 /**
   169 Initializes the object with arbitrary values.
   170 */
   171 inline TMMFPrioritySettings::TMMFPrioritySettings() : iPriority(EMdaPriorityNormal), iPref(EMdaPriorityPreferenceNone), iState(EMMFStateIdle), iReserved1(0)
   172 	{
   173 	}
   174 
   175 #endif