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