os/mm/mmlibs/mmfw/inc/mmf/common/MmfBase.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.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 Audio priority preference values. These are to be interpreted as discrete values and not separate flags.
    59 */
    60 enum TMdaPriorityPreference
    61 	{
    62 	/**
    63 	Default value - no specific meaning.
    64 	*/
    65     EMdaPriorityPreferenceNone =	0,
    66 	/**
    67 	The audio data is time sensitive. The playback operation may fail if it cannot happen when 
    68 	requested but degraded output such as mixing or muting is allowed. Note that this is the
    69 	default behaviour anyway, but this declaration is maintained for compatability.	*/
    70     EMdaPriorityPreferenceTime =	1,
    71 	/**
    72     The audio data should be played at the best possible quality (for example, it should not be degraded by 
    73 	muting or mixing). This is an advisory to the adaptation and can be ignored.
    74 	*/
    75     EMdaPriorityPreferenceQuality = 2,
    76 	/**
    77     The audio data is both time and quality sensitive. Identical in behaviour to EMdaPriorityPreferenceQuality.
    78 	*/
    79     EMdaPriorityPreferenceTimeAndQuality = 3
    80 	};
    81 
    82 /**
    83 @publishedAll
    84 @released
    85 
    86 Holds the current state of DevSound.
    87 */
    88 enum TMMFState
    89 {
    90 	/** Idle state.
    91 	*/
    92 	EMMFStateIdle,
    93 	/** The MMF is currently playing.
    94 	*/
    95 	EMMFStatePlaying,
    96 	/** The MMF is playing a tone.
    97 	*/
    98 	EMMFStateTonePlaying,
    99 	/** The MMF is currently recording.
   100 	*/
   101 	EMMFStateRecording,
   102 	/** The MMF is playing and recording.
   103 	*/
   104 	EMMFStatePlayingRecording,
   105 	/** The MMF is converting data.
   106 	*/
   107 	EMMFStateConverting
   108 };
   109 
   110 /**
   111 @publishedAll
   112 @released
   113 
   114 A class type representing the audio client's priority,
   115 priority preference and state settings.
   116 
   117 Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
   118 several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
   119 the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
   120 Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
   121 vary between different phones. Portable applications are advised not to assume any specific behaviour. 
   122 
   123 */
   124 class TMMFPrioritySettings
   125 	{
   126 public:
   127 	TMMFPrioritySettings();
   128 	/**
   129     The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
   130     EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
   131 	*/
   132 	TInt iPriority;
   133 
   134 	/**
   135     The Priority Preference - an additional audio policy parameter. The suggested default is 
   136     EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
   137     values may be supported by given phones and/or platforms, but should not be depended upon by 
   138     portable code.
   139 	*/
   140 	TInt iPref;
   141 
   142 	/**
   143     The state of the MMF player such as idle, playing, recording and so on. See the TMMFState enum for possible states.
   144 	*/
   145 	TMMFState iState;
   146 private:
   147 	/**
   148 	This member is internal and not intended for use.
   149 	*/
   150 	TInt iReserved1;
   151 	};
   152 
   153 /**
   154 @publishedAll
   155 @released
   156 
   157 This is a TPckgBuf package of a TMMFPrioritySettings.
   158 */
   159 typedef TPckgBuf<TMMFPrioritySettings> TMMFPrioritySettingsPckg;
   160 
   161 /**
   162 Initializes the object with arbitrary values.
   163 */
   164 inline TMMFPrioritySettings::TMMFPrioritySettings() : iPriority(EMdaPriorityNormal), iPref(EMdaPriorityPreferenceNone), iState(EMMFStateIdle), iReserved1(0)
   165 	{
   166 	}
   167 
   168 #endif