os/mm/mmlibs/mmfw/inc/mmf/common/MmfBase.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200 (2012-06-15)
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef __MMFBASE_H__
sl@0
    17
#define __MMFBASE_H__
sl@0
    18
sl@0
    19
// Standard EPOC32 includes
sl@0
    20
#include <e32base.h>
sl@0
    21
sl@0
    22
sl@0
    23
/** 
sl@0
    24
@publishedAll
sl@0
    25
@released
sl@0
    26
sl@0
    27
The priority for clients accessing a sound output device for audio playback or audio streaming.
sl@0
    28
sl@0
    29
This is a value between EMdaPriorityMin and EMdaPriorityMax. The higher value indicates a more 
sl@0
    30
important request. It is used to resolve conflicts when more than one client tries to access the
sl@0
    31
same hardware resource simultaneously.
sl@0
    32
sl@0
    33
One of these values is passed in the first parameter to CMdaAudioOutputStream::SetPriority().
sl@0
    34
sl@0
    35
@see CMdaAudioOutputStream::SetPriority()
sl@0
    36
*/
sl@0
    37
enum TMdaPriority
sl@0
    38
	{
sl@0
    39
  	/**
sl@0
    40
	The lowest priority (= – 100). This indicates that the client can be interrupted 
sl@0
    41
	by any other client.
sl@0
    42
	*/
sl@0
    43
    EMdaPriorityMin = -100,
sl@0
    44
	/**
sl@0
    45
	Normal priority. This indicates that the client can be interrupted but only by higher priority clients.
sl@0
    46
	*/
sl@0
    47
    EMdaPriorityNormal = 0,
sl@0
    48
	/**
sl@0
    49
    The highest priority (= 100). This indicates that the client cannot be interrupted by other clients.
sl@0
    50
	*/
sl@0
    51
    EMdaPriorityMax = 100
sl@0
    52
	};
sl@0
    53
sl@0
    54
/**
sl@0
    55
@publishedAll
sl@0
    56
@released
sl@0
    57
sl@0
    58
Audio priority preference values. These are to be interpreted as discrete values and not separate flags.
sl@0
    59
*/
sl@0
    60
enum TMdaPriorityPreference
sl@0
    61
	{
sl@0
    62
	/**
sl@0
    63
	Default value - no specific meaning.
sl@0
    64
	*/
sl@0
    65
    EMdaPriorityPreferenceNone =	0,
sl@0
    66
	/**
sl@0
    67
	The audio data is time sensitive. The playback operation may fail if it cannot happen when 
sl@0
    68
	requested but degraded output such as mixing or muting is allowed. Note that this is the
sl@0
    69
	default behaviour anyway, but this declaration is maintained for compatability.	*/
sl@0
    70
    EMdaPriorityPreferenceTime =	1,
sl@0
    71
	/**
sl@0
    72
    The audio data should be played at the best possible quality (for example, it should not be degraded by 
sl@0
    73
	muting or mixing). This is an advisory to the adaptation and can be ignored.
sl@0
    74
	*/
sl@0
    75
    EMdaPriorityPreferenceQuality = 2,
sl@0
    76
	/**
sl@0
    77
    The audio data is both time and quality sensitive. Identical in behaviour to EMdaPriorityPreferenceQuality.
sl@0
    78
	*/
sl@0
    79
    EMdaPriorityPreferenceTimeAndQuality = 3
sl@0
    80
	};
sl@0
    81
sl@0
    82
/**
sl@0
    83
@publishedAll
sl@0
    84
@released
sl@0
    85
sl@0
    86
Holds the current state of DevSound.
sl@0
    87
*/
sl@0
    88
enum TMMFState
sl@0
    89
{
sl@0
    90
	/** Idle state.
sl@0
    91
	*/
sl@0
    92
	EMMFStateIdle,
sl@0
    93
	/** The MMF is currently playing.
sl@0
    94
	*/
sl@0
    95
	EMMFStatePlaying,
sl@0
    96
	/** The MMF is playing a tone.
sl@0
    97
	*/
sl@0
    98
	EMMFStateTonePlaying,
sl@0
    99
	/** The MMF is currently recording.
sl@0
   100
	*/
sl@0
   101
	EMMFStateRecording,
sl@0
   102
	/** The MMF is playing and recording.
sl@0
   103
	*/
sl@0
   104
	EMMFStatePlayingRecording,
sl@0
   105
	/** The MMF is converting data.
sl@0
   106
	*/
sl@0
   107
	EMMFStateConverting
sl@0
   108
};
sl@0
   109
sl@0
   110
/**
sl@0
   111
@publishedAll
sl@0
   112
@released
sl@0
   113
sl@0
   114
A class type representing the audio client's priority,
sl@0
   115
priority preference and state settings.
sl@0
   116
sl@0
   117
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
sl@0
   118
several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
sl@0
   119
the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
sl@0
   120
Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
sl@0
   121
vary between different phones. Portable applications are advised not to assume any specific behaviour. 
sl@0
   122
sl@0
   123
*/
sl@0
   124
class TMMFPrioritySettings
sl@0
   125
	{
sl@0
   126
public:
sl@0
   127
	TMMFPrioritySettings();
sl@0
   128
	/**
sl@0
   129
    The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
sl@0
   130
    EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
sl@0
   131
	*/
sl@0
   132
	TInt iPriority;
sl@0
   133
sl@0
   134
	/**
sl@0
   135
    The Priority Preference - an additional audio policy parameter. The suggested default is 
sl@0
   136
    EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
sl@0
   137
    values may be supported by given phones and/or platforms, but should not be depended upon by 
sl@0
   138
    portable code.
sl@0
   139
	*/
sl@0
   140
	TInt iPref;
sl@0
   141
sl@0
   142
	/**
sl@0
   143
    The state of the MMF player such as idle, playing, recording and so on. See the TMMFState enum for possible states.
sl@0
   144
	*/
sl@0
   145
	TMMFState iState;
sl@0
   146
private:
sl@0
   147
	/**
sl@0
   148
	This member is internal and not intended for use.
sl@0
   149
	*/
sl@0
   150
	TInt iReserved1;
sl@0
   151
	};
sl@0
   152
sl@0
   153
/**
sl@0
   154
@publishedAll
sl@0
   155
@released
sl@0
   156
sl@0
   157
This is a TPckgBuf package of a TMMFPrioritySettings.
sl@0
   158
*/
sl@0
   159
typedef TPckgBuf<TMMFPrioritySettings> TMMFPrioritySettingsPckg;
sl@0
   160
sl@0
   161
/**
sl@0
   162
Initializes the object with arbitrary values.
sl@0
   163
*/
sl@0
   164
inline TMMFPrioritySettings::TMMFPrioritySettings() : iPriority(EMdaPriorityNormal), iPref(EMdaPriorityPreferenceNone), iState(EMMFStateIdle), iReserved1(0)
sl@0
   165
	{
sl@0
   166
	}
sl@0
   167
sl@0
   168
#endif