breakdeps/mmfclientaudioplayer.cpp
author markw <markw@symbian.org>
Fri, 12 Nov 2010 11:56:07 +0000
changeset 127 a2070821d450
child 128 8338c5c25b5b
permissions -rw-r--r--
Add William's draft of mediaclientaudio stub.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
127
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     7
//
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    10
//
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    11
// Contributors:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    12
//
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    13
// Description:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    14
//
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    15
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    16
#include <bautils.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    17
#include <utf.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    18
#include <mmf/common/mmfpaniccodes.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    19
#include "mmfclientaudioplayer.h"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    20
#include "mmfclientutility.h"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    21
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    22
#include <mmf/common/mmfdurationinfocustomcommandsimpl.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    23
#include <mmf/common/mmfdurationinfocustomcommandsenums.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    24
#endif
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    25
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    26
using namespace ContentAccess;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    27
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    28
// declared in the recorder module
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    29
void Panic(TInt aPanicCode);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    30
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    31
void TMMFMessage::Complete(TInt aReason)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    32
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    33
	iMessage.Complete(aReason);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    34
	iAmCompleted = ETrue;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    35
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    36
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    37
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    38
Constructs and initialises a new instance of the audio player utility.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    39
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    40
The function leaves if the audio player utility object cannot be created.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    41
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    42
No callback notification is made upon completion of NewL().
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    43
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    44
@param  aCallback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    45
        The audio player observer interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    46
@param  aPriority
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    47
        The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    48
        EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    49
@param  aPref
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    50
        The Priority Preference - an additional audio policy parameter. The suggested default is 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    51
        EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    52
        values may be supported by given phones and/or platforms, but should not be depended upon by 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    53
        portable code.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    54
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    55
@return A pointer to the new audio player utility object.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    56
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    57
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    58
several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    59
the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    60
Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    61
vary between different phones. Portable applications are advised not to assume any specific behaviour. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    62
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    63
EXPORT_C CMdaAudioPlayerUtility* CMdaAudioPlayerUtility::NewL(MMdaAudioPlayerCallback& aCallback,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    64
															  TInt aPriority,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    65
															  TInt aPref)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    66
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    67
	CMdaAudioPlayerUtility* self = new(ELeave) CMdaAudioPlayerUtility();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    68
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    69
	self->iProperties = CMMFMdaAudioPlayerUtility::NewL(aCallback, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    70
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    71
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    72
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    73
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    74
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    75
Constructs and initialises a new instance of the audio player utility for playing sampled audio data 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    76
from a file. The audio data must be in a supported format (e.g. WAV and AU).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    77
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    78
The function leaves if the audio player utility object cannot be created.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    79
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    80
When initialisation of the audio player utility is complete, successfully or otherwise, the callback 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    81
function MMdaAudioPlayerCallback::MapcInitComplete() is called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    82
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    83
@param  aFileName 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    84
        The full path name of the file containing the audio data.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    85
@param  aCallback 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    86
        The audio player observer interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    87
@param  aPriority
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    88
        The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    89
        EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    90
@param  aPref
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    91
        The Priority Preference - an additional audio policy parameter. The suggested default is 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    92
        EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    93
        values may be supported by given phones and/or platforms, but should not be depended upon by 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    94
        portable code.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    95
@param  aServer
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    96
        Not used in 7.0s. This parameter is provided for binary compatibility with previous versions.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    97
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    98
@return A pointer to the new audio player utility object.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    99
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   100
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   101
several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   102
the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   103
Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   104
vary between different phones. Portable applications are advised not to assume any specific behaviour. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   105
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   106
EXPORT_C CMdaAudioPlayerUtility* CMdaAudioPlayerUtility::NewFilePlayerL(const TDesC& aFileName,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   107
																		MMdaAudioPlayerCallback& aCallback,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   108
																		TInt aPriority,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   109
																		TInt aPref,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   110
																		CMdaServer* /*aServer*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   111
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   112
	CMdaAudioPlayerUtility* self = new(ELeave) CMdaAudioPlayerUtility();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   113
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   114
	self->iProperties = CMMFMdaAudioPlayerUtility::NewFilePlayerL(aFileName, aCallback, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   115
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   116
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   117
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   118
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   119
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   120
Constructs and initialises a new instance of the audio player utility for playing sampled audio data 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   121
from a descriptor.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   122
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   123
The audio data must be in a supported format (e.g. WAV and AU).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   124
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   125
The function leaves if the audio player utility object cannot be created. When initialisation of the 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   126
audio player utility is complete, successfully or otherwise, the callback function 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   127
MMdaAudioPlayerCallback::MapcInitComplete() is called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   128
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   129
@param  aData 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   130
        A descriptor containing the audio data. This descriptor must remain in existence for the 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   131
        lifetime of this audio player utility object.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   132
@param  aCallback 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   133
        The audio player observer interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   134
@param  aPriority
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   135
        The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   136
        EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   137
@param  aPref
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   138
        The Priority Preference - an additional audio policy parameter. The suggested default is 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   139
        EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   140
        values may be supported by given phones and/or platforms, but should not be depended upon by 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   141
        portable code.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   142
@param  aServer
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   143
        Not used in 7.0s. This parameter is provided for binary compatibility with previous versions.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   144
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   145
@return A pointer to the new audio player utility object.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   146
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   147
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   148
several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   149
the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   150
Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   151
vary between different phones. Portable applications are advised not to assume any specific behaviour. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   152
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   153
EXPORT_C CMdaAudioPlayerUtility* CMdaAudioPlayerUtility::NewDesPlayerL(const TDesC8& aData, MMdaAudioPlayerCallback& aCallback, TInt aPriority, TInt aPref, CMdaServer* /*aServer*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   154
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   155
	CMdaAudioPlayerUtility* self = new(ELeave) CMdaAudioPlayerUtility();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   156
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   157
	self->iProperties = CMMFMdaAudioPlayerUtility::NewDesPlayerL(aData, aCallback, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   158
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   159
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   160
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   161
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   162
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   163
Constructs and initialises a new instance of the audio player utility for playing sampled audio data 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   164
from a read only descriptor.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   165
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   166
The audio data must be in a supported format (e.g. WAV and AU).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   167
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   168
The function leaves if the audio player utility object cannot be created. When initialisation of 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   169
the audio player utility is complete, successfully or otherwise, the callback function 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   170
MMdaAudioPlayerCallback::MapcInitComplete() is called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   171
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   172
@param  aData 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   173
        A read only descriptor containing the audio data. This descriptor must remain in existence 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   174
        for the lifetime of this audio player utility object.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   175
@param  aCallback 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   176
        The audio player observer interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   177
@param  aPriority
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   178
        The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   179
        EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   180
@param  aPref
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   181
        The Priority Preference - an additional audio policy parameter. The suggested default is 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   182
        EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   183
        values may be supported by given phones and/or platforms, but should not be depended upon by 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   184
        portable code.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   185
@param  aServer
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   186
        Not used in 7.0s. This parameter is provided for binary compatibility with previous versions.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   187
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   188
@return A pointer to a new audio player utility.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   189
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   190
Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   191
several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   192
the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   193
Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   194
vary between different phones. Portable applications are advised not to assume any specific behaviour. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   195
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   196
EXPORT_C CMdaAudioPlayerUtility* CMdaAudioPlayerUtility::NewDesPlayerReadOnlyL(const TDesC8& aData, MMdaAudioPlayerCallback& aCallback, TInt aPriority, TInt aPref, CMdaServer* /*aServer*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   197
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   198
	CMdaAudioPlayerUtility* self = new(ELeave) CMdaAudioPlayerUtility();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   199
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   200
	self->iProperties = CMMFMdaAudioPlayerUtility::NewDesPlayerReadOnlyL(aData, aCallback, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   201
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   202
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   203
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   204
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   205
CMdaAudioPlayerUtility::CMdaAudioPlayerUtility()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   206
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   207
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   208
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   209
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   210
Destructor.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   211
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   212
Frees all resources owned by the object prior to its destruction.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   213
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   214
CMdaAudioPlayerUtility::~CMdaAudioPlayerUtility()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   215
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   216
	delete iProperties;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   217
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   218
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   219
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   220
Ensures that any subsequent calls to OpenXYZ() will create controllers that
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   221
share a heap.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   222
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   223
The default behaviour is that for each player utility a controller with its own heap
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   224
is created. Each heap uses a chunk, so using this function avoids situations where 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   225
the number of chunks per process is limited.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   226
The default behaviour is generally to be preferred, and should give lower overall
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   227
memory usage. However, if many controllers are to be created for a particular thread,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   228
then this function should be used to prevent running out of heaps or chunks.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   229
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   230
@since	9.1
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   231
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   232
EXPORT_C void CMdaAudioPlayerUtility::UseSharedHeap()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   233
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   234
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   235
	iProperties->UseSharedHeap();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   236
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   237
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   238
// 5.0 functions
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   239
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   240
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   241
Begins playback of audio sample data at the current playback position using the current volume,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   242
gain and priority settings.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   243
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   244
When playing of the audio sample is complete, successfully or
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   245
otherwise, the callback function
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   246
MMdaAudioPlayerCallback::MapcPlayComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   247
called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   248
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   249
If this function is called whilst already playing then 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   250
MMdaAudioPlayerCallback::MapcPlayComplete will return with the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   251
error code KErrNotReady.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   252
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   253
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   254
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   255
void CMdaAudioPlayerUtility::Play()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   256
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   257
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   258
	iProperties->Play();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   259
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   260
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   261
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   262
Stops playback of the audio sample as soon as possible.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   263
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   264
If the audio sample is playing, playback is stopped as soon as
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   265
possible. If playback is already complete, nothing further happens as
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   266
a result of calling this function. The callback function
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   267
MMdaAudioPlayerCallback::MapcPlayComplete() is not
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   268
called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   269
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   270
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   271
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   272
void CMdaAudioPlayerUtility::Stop()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   273
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   274
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   275
	iProperties->Stop();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   276
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   277
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   278
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   279
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   280
Changes the current playback volume to a specified value.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   281
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   282
The volume can be changed before or during playback and is effective
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   283
immediately. The volume can be set to any value between zero (mute) and 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   284
the maximum permissible volume (determined using MaxVolume()).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   285
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   286
@param  aVolume
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   287
        The volume setting. This can be any value from zero to
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   288
        the value returned by a call to
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   289
        CMdaAudioPlayerUtility::MaxVolume().
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   290
        Setting a zero value mutes the sound. Setting the maximum
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   291
        value results in the loudest possible sound. Values less 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   292
        than zero would be set to zero and the values greater than 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   293
        the maximum permitted volume would be set to the maximum volume.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   294
@return An error code indicating if the function call was successful. KErrNone on success, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   295
		otherwise another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   296
@panic  EMMFMediaClientBadArgument is raised when the audio player utility is not initialised.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   297
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   298
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   299
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   300
TInt CMdaAudioPlayerUtility::SetVolume(TInt aVolume)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   301
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   302
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   303
	return iProperties->SetVolume(aVolume);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   304
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   305
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   306
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   307
Sets the number of times the audio sample is to be repeated during the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   308
playback operation.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   309
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   310
A period of silence can follow each playing of the sample. The audio
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   311
sample can be repeated indefinitely.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   312
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   313
@param   aRepeatNumberOfTimes
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   314
         The number of times the audio sample, together with
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   315
         the trailing silence, is to be repeated. If this is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   316
         set to KMdaRepeatForever, then the audio
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   317
         sample, together with the trailing silence, is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   318
         repeated indefinitely or until Stop() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   319
         called. If this is set to zero, then the audio sample
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   320
         is not repeated.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   321
@param   aTrailingSilence
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   322
         The time interval of the trailing silence in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   323
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   324
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   325
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   326
void CMdaAudioPlayerUtility::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   327
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   328
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   329
	iProperties->SetRepeats(aRepeatNumberOfTimes, aTrailingSilence);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   330
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   331
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   332
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   333
Defines the period over which the volume level is to rise smoothly
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   334
from nothing to the normal volume level.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   335
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   336
@param  aRampDuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   337
        The period over which the volume is to rise. A zero
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   338
        value causes the audio sample to be played at the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   339
        normal level for the full duration of the playback. A
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   340
        value which is longer than the duration of the audio
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   341
        sample means that the sample never reaches its normal
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   342
        volume level.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   343
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   344
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   345
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   346
void CMdaAudioPlayerUtility::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   347
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   348
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   349
	iProperties->SetVolumeRamp(aRampDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   350
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   351
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   352
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   353
Returns the duration of the audio sample in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   354
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   355
@return The duration of the sample in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   356
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   357
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   358
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   359
const TTimeIntervalMicroSeconds& CMdaAudioPlayerUtility::Duration()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   360
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   361
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   362
	return iProperties->Duration();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   363
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   364
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   365
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   366
Returns the duration of the audio sample in microseconds, and the duration state.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   367
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   368
@param aDuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   369
	   The duration of the sample in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   370
@return The duration state
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   371
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   372
@since	9.1
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   373
*/	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   374
EXPORT_C TMMFDurationInfo CMdaAudioPlayerUtility::Duration(TTimeIntervalMicroSeconds& aDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   375
{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   376
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   377
	return iProperties->Duration(aDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   378
}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   379
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   380
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   381
Returns an integer representing the maximum volume.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   382
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   383
This is the maximum value which can be passed to
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   384
CMdaAudioPlayerUtility::SetVolume(). This value is platform 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   385
independent, but is always greater than or equal to one.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   386
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   387
@return The maximum volume setting.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   388
@panic  EMMFMediaClientPanicServerCommunicationProblem is raised when the audio player utility is not initialised. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   389
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   390
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   391
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   392
TInt CMdaAudioPlayerUtility::MaxVolume()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   393
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   394
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   395
	return iProperties->MaxVolume();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   396
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   397
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   398
// 7.0s functions
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   399
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   400
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   401
Opens an audio clip from a file.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   402
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   403
The audio data must be in a supported format (for example, WAV or AU).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   404
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   405
This function leaves with KErrNotReady if there is a previous open statement awaiting notification of completion.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   406
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   407
@param  aFileName
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   408
        The file to open.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   409
@leave  KErrNotReady
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   410
        If a previous open statement is awaiting notification of completion.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   411
		opening the file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   412
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   413
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   414
EXPORT_C void CMdaAudioPlayerUtility::OpenFileL(const TDesC& aFileName)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   415
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   416
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   417
	iProperties->OpenFileL(aFileName);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   418
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   419
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   420
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   421
Opens an audio clip from a file.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   422
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   423
The audio data must be in a supported format (for example, WAV or AU).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   424
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   425
This function leaves with KErrNotReady if there is a previous open statement awaiting notification of completion.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   426
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   427
Note: it is generally advisable that the RFile is shared through the call RFs::ShareProtected().
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   428
This allows the adaptation to pass it to another process, if that is required. This is particularly
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   429
true of playing DRM encrypted files.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   430
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   431
@param  aFile
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   432
        The open shared session file handle to use
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   433
@leave 	KErrBadHandle
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   434
		If the file handle is not shared through the call RFs::ShareProtected(), and the adaptation needs it to be.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   435
@leave  KErrNotReady
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   436
        If a previous open statement is awaiting notification of completion.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   437
		opening the file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   438
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   439
EXPORT_C void CMdaAudioPlayerUtility::OpenFileL(const RFile& aFile)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   440
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   441
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   442
	RFile& file = const_cast<RFile&>(aFile);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   443
	TMMFileHandleSource tfs(file, KDefaultContentObject, EPlay);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   444
	iProperties->OpenFileL(tfs);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   445
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   446
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   447
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   448
Opens an audio clip from a file.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   449
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   450
The audio data must be in a supported format (for example, WAV or AU).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   451
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   452
This function leaves with KErrNotReady if there is a previous open statement awaiting notification of completion.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   453
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   454
@param  aSource
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   455
        The file to open or an open file handle to use
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   456
@leave  KErrNotReady
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   457
        If a previous open statement is awaiting notification of completion.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   458
		opening the file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   459
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   460
EXPORT_C void CMdaAudioPlayerUtility::OpenFileL(const TMMSource& aSource)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   461
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   462
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   463
	iProperties->OpenFileL(aSource);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   464
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   465
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   466
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   467
Opens an audio clip from a descriptor.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   468
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   469
The audio data must be in a supported format (for example, WAV or AU).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   470
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   471
@param  aDescriptor
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   472
        A descriptor containing the audio clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   473
@leave  KErrInUse
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   474
        If a previous open statement is awaiting notification of completion.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   475
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   476
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   477
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   478
EXPORT_C void CMdaAudioPlayerUtility::OpenDesL(const TDesC8& aDescriptor)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   479
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   480
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   481
	iProperties->OpenDesL(aDescriptor);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   482
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   483
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   484
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   485
Opens an audio clip from a URL.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   486
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   487
The audio data must be in a supported format (for example, WAV or AU).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   488
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   489
@param	aUrl
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   490
		The URL to open.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   491
@param 	aIapId
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   492
		Internet access point(IAP) ID to use. KUseDefaultIap selects the default IAP.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   493
@param  aMimeType
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   494
		MIME type of the URL source.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   495
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   496
@leave  KErrInUse 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   497
        If a previous open statement is awaiting notification of completion.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   498
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   499
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   500
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   501
EXPORT_C void CMdaAudioPlayerUtility::OpenUrlL(const TDesC& aUrl, const TInt aIapId /*=KUseDefaultIap*/, const TDesC8& aMimeType /*=KNullDesC8*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   502
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   503
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   504
	iProperties->OpenUrlL(aUrl, aIapId, aMimeType);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   505
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   506
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   507
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   508
Pauses the playback of the audio clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   509
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   510
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   511
        another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   512
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   513
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   514
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   515
EXPORT_C TInt CMdaAudioPlayerUtility::Pause()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   516
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   517
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   518
	return iProperties->Pause();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   519
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   520
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   521
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   522
Closes the current audio clip (allowing another clip to be opened).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   523
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   524
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   525
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   526
EXPORT_C void CMdaAudioPlayerUtility::Close()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   527
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   528
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   529
	iProperties->Close();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   530
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   531
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   532
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   533
Returns the current playback position in microseconds from the start of the clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   534
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   535
@param   aPosition
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   536
         The current time position in microseconds from the start of the clip to the current
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   537
         play position.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   538
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   539
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   540
        another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   541
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   542
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   543
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   544
EXPORT_C TInt CMdaAudioPlayerUtility::GetPosition(TTimeIntervalMicroSeconds& aPosition)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   545
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   546
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   547
	return iProperties->GetPosition(aPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   548
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   549
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   550
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   551
Sets the current playback position in microseconds from the start of the clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   552
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   553
@param  aPosition
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   554
        The position to move to in microseconds from the start of the clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   555
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   556
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   557
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   558
EXPORT_C void CMdaAudioPlayerUtility::SetPosition(const TTimeIntervalMicroSeconds& aPosition)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   559
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   560
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   561
	iProperties->SetPosition(aPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   562
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   563
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   564
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   565
Sets the priority for playback. This is used to arbitrate between multiple
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   566
objects trying to access a single sound device.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   567
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   568
@param  aPriority
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   569
        The Priority Value.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   570
@param  aPref
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   571
        The Priority Preference.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   572
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   573
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   574
        another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   575
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   576
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   577
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   578
@see CMdaAudioPlayerUtility::NewL()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   579
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   580
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   581
EXPORT_C TInt CMdaAudioPlayerUtility::SetPriority(TInt aPriority, TInt aPref)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   582
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   583
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   584
	return iProperties->SetPriority(aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   585
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   586
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   587
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   588
Returns the current playback volume.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   589
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   590
@param  aVolume
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   591
        A value between 0 and the maximum volume settings returned by MaxVolume().
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   592
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   593
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   594
        another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   595
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   596
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   597
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   598
EXPORT_C TInt CMdaAudioPlayerUtility::GetVolume(TInt& aVolume)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   599
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   600
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   601
	return iProperties->GetVolume(aVolume);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   602
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   603
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   604
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   605
Returns the number of meta data entries in the current audio clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   606
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   607
@param  aNumEntries
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   608
        The number of meta data entries in the header of the current clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   609
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   610
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   611
        another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   612
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   613
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   614
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   615
EXPORT_C TInt CMdaAudioPlayerUtility::GetNumberOfMetaDataEntries(TInt& aNumEntries)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   616
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   617
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   618
	return iProperties->GetNumberOfMetaDataEntries(aNumEntries);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   619
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   620
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   621
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   622
Returns the requested meta data entry.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   623
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   624
@param  aMetaDataIndex
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   625
        The index number of the meta data to retrieve.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   626
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   627
@return The requested meta data entry.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   628
@leave  KErrNotFound
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   629
        The meta data entry does not exist.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   630
@leave  KErrNotImplemented
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   631
        The controller does not support meta data information for this format.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   632
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   633
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   634
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   635
EXPORT_C CMMFMetaDataEntry* CMdaAudioPlayerUtility::GetMetaDataEntryL(TInt aMetaDataIndex)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   636
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   637
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   638
	return iProperties->GetMetaDataEntryL(aMetaDataIndex);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   639
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   640
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   641
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   642
Defines a window on the audio sample data.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   643
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   644
The window is defined in terms of a start and end position.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   645
When the current playback position reaches the window end position, or Stop() is called, the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   646
current playback position is set to the window start position and playback stops.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   647
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   648
The current playback position is not affected by a call to SetPlayWindow() unless it is outside
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   649
the new playback window, in which case it is set to the window start or end position depending
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   650
on which one is closer.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   651
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   652
The window persists until ClearPlayWindow() is called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   653
Loading new audio sample data without adjusting or clearing the window will result in
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   654
playback errors if the window is outside the new data.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   655
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   656
@param  aStart
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   657
        The position defining the start of the window, measured in microseconds. If this value is less
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   658
        than zero, it is set to zero. If this value is greater than aEnd, then it is swapped with aEnd.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   659
@param  aEnd
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   660
        The position defining the end of the window, measured in microseconds. If this value is greater
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   661
        than the value returned by Duration(), it is set to the value of Duration(). If this value is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   662
        less than aStart, then it is swapped with aStart.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   663
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   664
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   665
        another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   666
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   667
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   668
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   669
EXPORT_C TInt CMdaAudioPlayerUtility::SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   670
													const TTimeIntervalMicroSeconds& aEnd)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   671
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   672
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   673
	return iProperties->SetPlayWindow(aStart, aEnd);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   674
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   675
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   676
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   677
Clears the current playback window.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   678
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   679
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   680
        another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   681
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   682
@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   683
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   684
EXPORT_C TInt CMdaAudioPlayerUtility::ClearPlayWindow()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   685
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   686
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   687
	return iProperties->ClearPlayWindow();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   688
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   689
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   690
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   691
Sets the current playback balance.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   692
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   693
@param  aBalance
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   694
        A value between KMMFBalanceMaxLeft
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   695
        and KMMFBalanceMaxRight. The default value is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   696
        KMMFBalanceCenter.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   697
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   698
@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   699
        another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   700
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   701
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   702
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   703
EXPORT_C TInt CMdaAudioPlayerUtility::SetBalance(TInt aBalance /*= KMMFBalanceCenter*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   704
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   705
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   706
	return iProperties->SetBalance(aBalance);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   707
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   708
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   709
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   710
 *	Returns The current playback balance. This function may not return the same value 	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   711
 *			as passed to SetBalance depending on the internal implementation in 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   712
 *			the underlying components.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   713
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   714
 *	@param  aBalance
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   715
 *        	A value between KMMFBalanceMaxLeft
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   716
 *       	and KMMFBalanceMaxRight.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   717
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   718
 *	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   719
 *        	another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   720
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   721
 *	@since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   722
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   723
EXPORT_C TInt CMdaAudioPlayerUtility::GetBalance(TInt& aBalance)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   724
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   725
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   726
	return iProperties->GetBalance(aBalance);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   727
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   728
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   729
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   730
Returns the controller implementation information associated with the current controller.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   731
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   732
@return The controller implementation structure
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   733
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   734
@since 7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   735
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   736
EXPORT_C const CMMFControllerImplementationInformation& CMdaAudioPlayerUtility::ControllerImplementationInformationL()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   737
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   738
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   739
	return iProperties->ControllerImplementationInformationL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   740
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   741
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   742
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   743
Registers callback object to receive notifications of audio loading/rebuffering.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   744
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   745
@param  aCallback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   746
        The object to receive audio loading notifications.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   747
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   748
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   749
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   750
EXPORT_C void CMdaAudioPlayerUtility::RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   751
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   752
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   753
	iProperties->RegisterForAudioLoadingNotification(aCallback);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   754
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   755
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   756
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   757
Returns the current progress of audio loading.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   758
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   759
@param  aPercentageProgress
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   760
        The percentage of the audio clip loaded.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   761
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   762
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   763
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   764
EXPORT_C void CMdaAudioPlayerUtility::GetAudioLoadingProgressL(TInt& aPercentageProgress)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   765
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   766
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   767
	iProperties->GetAudioLoadingProgressL(aPercentageProgress);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   768
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   769
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   770
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   771
Sends a synchronous custom command to the controller.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   772
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   773
@param  aDestination
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   774
        The destination of the message, consisting of the UID of
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   775
        the interface of this message.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   776
@param  aFunction
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   777
        The function number to indicate which function is to be called
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   778
        on the interface defined in the aDestination parameter.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   779
@param  aDataTo1
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   780
        A reference to the first chunk of data to be copied to the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   781
        framework. The exact contents of the data are dependent on the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   782
        interface being called.  Can be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   783
@param  aDataTo2
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   784
        A reference to the second chunk of data to be copied to the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   785
        framework. The exact contents of the data are dependent on the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   786
        interface being called.  Can be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   787
@param  aDataFrom
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   788
        A reference to an area of memory to which the controller framework will
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   789
        write any data to be passed back to the client.  Can't be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   790
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   791
@return The result of the request.  Exact range of values is dependent on the interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   792
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   793
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   794
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   795
EXPORT_C TInt CMdaAudioPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   796
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   797
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   798
	return iProperties->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   799
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   800
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   801
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   802
Sends a synchronous custom command to the controller.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   803
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   804
@param  aDestination
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   805
        The destination of the message, consisting of the UID of
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   806
        the interface of this message.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   807
@param  aFunction
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   808
        The function number to indicate which function is to be called
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   809
        on the interface defined in the aDestination parameter.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   810
@param  aDataTo1
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   811
        A reference to the first chunk of data to be copied to the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   812
        framework. The exact contents of the data are dependent on the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   813
        interface being called.  Can be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   814
@param  aDataTo2
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   815
        A reference to the second chunk of data to be copied to the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   816
        framework. The exact contents of the data are dependent on the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   817
        interface being called.  Can be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   818
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   819
@return The result of the request.  Exact range of values is dependent on the interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   820
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   821
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   822
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   823
EXPORT_C TInt CMdaAudioPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   824
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   825
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   826
	return iProperties->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   827
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   828
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   829
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   830
Sends an asynchronous custom command to the controller.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   831
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   832
Note: 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   833
This method will return immediately.  The RunL of the active object owning the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   834
aStatus parameter will be called when the command is completed by the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   835
controller framework.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   836
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   837
@param  aDestination
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   838
        The destination of the message, consisting of the uid of
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   839
        the interface of this message.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   840
@param  aFunction
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   841
        The function number to indicate which function is to be called
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   842
        on the interface defined in the aDestination parameter.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   843
@param  aDataTo1
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   844
        A reference to the first chunk of data to be copied to the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   845
        framework. The exact contents of the data are dependent on the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   846
        interface being called.  Can be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   847
@param  aDataTo2
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   848
        A reference to the second chunk of data to be copied to the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   849
        framework. The exact contents of the data are dependent on the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   850
        interface being called.  Can be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   851
@param  aDataFrom
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   852
        A reference to an area of memory to which the controller framework will
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   853
        write any data to be passed back to the client.  Can't be KNullDesC8."
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   854
@param  aStatus
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   855
        The TRequestStatus of an active object.  This will contain the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   856
        result of the request on completion.  The exact range of
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   857
        result values is dependent on the interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   858
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   859
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   860
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   861
EXPORT_C void CMdaAudioPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   862
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   863
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   864
	iProperties->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   865
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   866
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   867
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   868
Sends an asynchronous custom command to the controller.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   869
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   870
Note: 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   871
This method will return immediately.  The RunL of the active object owning the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   872
aStatus parameter will be called when the command is completed by the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   873
controller framework.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   874
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   875
@param  aDestination
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   876
        The destination of the message, consisting of the uid of
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   877
        the interface of this message.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   878
@param  aFunction
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   879
        The function number to indicate which function is to be called
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   880
        on the interface defined in the aDestination parameter.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   881
@param  aDataTo1
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   882
        A reference to the first chunk of data to be copied to the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   883
        framework. The exact contents of the data are dependent on the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   884
        interface being called.  Can be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   885
@param  aDataTo2
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   886
        A reference to the second chunk of data to be copied to the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   887
        framework. The exact contents of the data are dependent on the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   888
        interface being called.  Can be KNullDesC8.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   889
@param  aStatus
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   890
        The TRequestStatus of an active object.  This will contain the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   891
        result of the request on completion.  The exact range of
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   892
        result values is dependent on the interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   893
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   894
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   895
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   896
EXPORT_C void CMdaAudioPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   897
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   898
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   899
	iProperties->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   900
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   901
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   902
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   903
Returns the bit rate of the audio clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   904
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   905
@param  aBitRate
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   906
		The bit rate of the audio clip
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   907
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   908
@return An error code indicating if the function call was successful. KErrNone on success, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   909
		otherwise another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   910
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   911
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   912
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   913
EXPORT_C TInt CMdaAudioPlayerUtility::GetBitRate(TUint& aBitRate)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   914
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   915
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   916
	return iProperties->GetBitRate(aBitRate);	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   917
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   918
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   919
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   920
Gets a controller's DRM custom command implementation.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   921
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   922
@return A pointer to a controller's DRM custom command implementation, or NULL if the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   923
controller does not support it.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   924
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   925
EXPORT_C MMMFDRMCustomCommand* CMdaAudioPlayerUtility::GetDRMCustomCommand()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   926
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   927
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   928
	return iProperties->GetDRMCustomCommand();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   929
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   930
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   931
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   932
Registers the Event for Notification when resource is avaliable.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   933
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   934
@param	aCallback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   935
      	The audio outputstream observer interface..
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   936
      	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   937
@param 	aNotificationEventUid
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   938
 	The Event for which the client is registered.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   939
 	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   940
@param 	aNotificationRegistrationData
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   941
	Notification registration specific data.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   942
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   943
@return An error code indicating if the registration was successful. KErrNone on success, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   944
	otherwise another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   945
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   946
EXPORT_C TInt CMdaAudioPlayerUtility::RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback,TUid aNotificationEventUid,const TDesC8& aNotificationRegistrationData)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   947
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   948
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   949
	return iProperties->RegisterAudioResourceNotification(aCallback,aNotificationEventUid,aNotificationRegistrationData);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   950
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   951
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   952
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   953
Cancels the registered notification event.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   954
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   955
@param  aNotificationEventUid
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   956
	The Event to notify the client.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   957
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   958
@return An error code indicating if the registration was successful. KErrNone on success, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   959
	otherwise another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   960
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   961
EXPORT_C TInt CMdaAudioPlayerUtility::CancelRegisterAudioResourceNotification(TUid aNotificationEventUid)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   962
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   963
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   964
	return iProperties->CancelRegisterAudioResourceNotification(aNotificationEventUid);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   965
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   966
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   967
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   968
Waits for the client to resume the play even after the default timer expires.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   969
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   970
@return An error code indicating if the registration was successful. KErrNone on success, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   971
		otherwise another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   972
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   973
EXPORT_C TInt CMdaAudioPlayerUtility::WillResumePlay()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   974
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   975
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   976
	return iProperties->WillResumePlay();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   977
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   978
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   979
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   980
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   981
Set the priority of the controller's sub thread.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   982
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   983
This can be used to increase the responsiveness of the audio plugin to minimise
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   984
any lag in processing. This function should be used with care as it may have knock-on
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   985
effects elsewhere in the system.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   986
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   987
@param	aPriority
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   988
		The TThreadPriority that the thread should run under.  The default is EPriorityNormal.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   989
@return	TInt
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   990
		A standard error code: KErrNone if successful, KErrNotReady if the thread does not have a
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   991
		valid handle.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   992
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   993
EXPORT_C TInt CMdaAudioPlayerUtility::SetThreadPriority(const TThreadPriority& aPriority) const
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   994
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   995
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   996
	return iProperties->SetThreadPriority(aPriority);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   997
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   998
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   999
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1000
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1001
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1002
CMMFMdaAudioPlayerUtility* CMMFMdaAudioPlayerUtility::NewL(MMdaAudioPlayerCallback& aCallback,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1003
															  TInt aPriority,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1004
															  TInt aPref)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1005
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1006
	CMMFMdaAudioPlayerUtility* self = new(ELeave) CMMFMdaAudioPlayerUtility(aCallback, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1007
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1008
	self->ConstructL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1009
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1010
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1011
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1012
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1013
CMMFMdaAudioPlayerUtility* CMMFMdaAudioPlayerUtility::NewFilePlayerL(const TDesC& aFileName,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1014
																		MMdaAudioPlayerCallback& aCallback,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1015
																		TInt aPriority,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1016
																		TInt aPref,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1017
																		CMdaServer* /*aServer*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1018
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1019
	CMMFMdaAudioPlayerUtility* self = new(ELeave) CMMFMdaAudioPlayerUtility(aCallback, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1020
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1021
	self->ConstructL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1022
	TMMFileSource filesource(aFileName, KDefaultContentObject, EPlay);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1023
	self->OpenFileL(filesource);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1024
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1025
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1026
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1027
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1028
CMMFMdaAudioPlayerUtility* CMMFMdaAudioPlayerUtility::NewDesPlayerL(const TDesC8& aData, MMdaAudioPlayerCallback& aCallback, TInt aPriority, TInt aPref, CMdaServer* /*aServer*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1029
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1030
	CMMFMdaAudioPlayerUtility* self = new(ELeave) CMMFMdaAudioPlayerUtility(aCallback, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1031
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1032
	self->ConstructL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1033
	self->OpenDesL(aData);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1034
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1035
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1036
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1037
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1038
CMMFMdaAudioPlayerUtility* CMMFMdaAudioPlayerUtility::NewDesPlayerReadOnlyL(const TDesC8& aData, MMdaAudioPlayerCallback& aCallback, TInt aPriority, TInt aPref, CMdaServer* /*aServer*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1039
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1040
	CMMFMdaAudioPlayerUtility* self = new(ELeave) CMMFMdaAudioPlayerUtility(aCallback, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1041
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1042
	self->ConstructL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1043
	self->OpenDesL(aData);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1044
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1045
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1046
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1047
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1048
void CMMFMdaAudioPlayerUtility::UseSharedHeap()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1049
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1050
	iFindAndOpenController->UseSharedHeap();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1051
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1052
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1053
// CMMFMdaAudioPlayerUtility
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1054
CMMFMdaAudioPlayerUtility::~CMMFMdaAudioPlayerUtility()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1055
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1056
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1057
	delete iControllerImplementationInformation;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1058
	delete iAsyncCallBack;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1059
	delete iRepeatTrailingSilenceTimer;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1060
	delete iFindAndOpenController;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1061
	delete iControllerEventMonitor;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1062
	iMediaIds.Close();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1063
	iController.Close();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1064
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1065
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1066
CMMFMdaAudioPlayerUtility::CMMFMdaAudioPlayerUtility(MMdaAudioPlayerCallback& aCallback, TInt aPriority, TInt aPref) :
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1067
	iCallback(aCallback),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1068
	iAudioPlayDeviceCommands(iController),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1069
	iAudioPlayControllerCommands(iController),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1070
	iNotificationRegistrationCommands(iController),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1071
	iDRMCustomCommands(iController),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1072
	iAudioPlayControllerSetRepeatsCommands(iController)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1073
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1074
	iState = EStopped;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1075
	iPrioritySettings.iPriority = aPriority;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1076
	iPrioritySettings.iPref = aPref;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1077
	iPlayStart = TTimeIntervalMicroSeconds(0);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1078
	iPlayEnd = TTimeIntervalMicroSeconds(0);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1079
	iPlayWindowSet = ENone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1080
	iEventHolder = KNullUid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1081
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1082
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1083
void CMMFMdaAudioPlayerUtility::ConstructL()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1084
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1085
	iControllerEventMonitor = CMMFControllerEventMonitor::NewL(*this, iController);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1086
	iRepeatTrailingSilenceTimer = CRepeatTrailingSilenceTimer::NewL(*this);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1087
	iAsyncCallBack = CMMFMdaAudioPlayerCallBack::NewL(iCallback);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1088
	User::LeaveIfError(iMediaIds.Append(KUidMediaTypeAudio));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1089
	iFindAndOpenController = CMMFFindAndOpenController::NewL(*this);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1090
	iFindAndOpenController->Configure(iMediaIds[0], iPrioritySettings);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1091
	iFindAndOpenController->ConfigureController(iController, *iControllerEventMonitor, CMMFFindAndOpenController::EPlayback);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1092
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1093
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1094
void CMMFMdaAudioPlayerUtility::MfaocComplete(		
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1095
		TInt& aError, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1096
		RMMFController* /*aController*/,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1097
		TUid aControllerUid, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1098
		TMMFMessageDestination* /*aSourceHandle*/, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1099
		TMMFMessageDestination* /*aSinkHandle*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1100
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1101
	if (aError == KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1102
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1103
		iControllerUid = aControllerUid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1104
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1105
		// Get the clip duration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1106
		iDuration = TTimeIntervalMicroSeconds(0);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1107
		aError = iController.GetDuration(iDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1108
				
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1109
		// If an error occurred during GetDuration, may try for next controller, if present.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1110
		if (aError != KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1111
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1112
			iControllerEventMonitor->Cancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1113
			
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1114
			if (iFindAndOpenController)	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1115
				{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1116
				if(iFindAndOpenController-> ControllerIndex() < (iFindAndOpenController->ControllerCount())-1)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1117
					{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1118
					return;   //actually tries to load next controllers, if there are other controllers selected in the controller list
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1119
					}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1120
				}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1121
			
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1122
			iController.Close(); // otherwise close the controller
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1123
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1124
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1125
		if (iFindAndOpenController)	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1126
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1127
			iFindAndOpenController->Close();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1128
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1129
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1130
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1131
	iAsyncCallBack->InitComplete(aError, iDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1132
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1133
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1134
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1135
	Open an audio clip from a file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1136
	@param "const TFileSource& aFileSource" "the file to open"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1137
	@leave "" "Leaves on an error opening the file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1138
	@since version 5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1139
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1140
void CMMFMdaAudioPlayerUtility::OpenFileL(const TDesC& aFileName)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1141
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1142
	TMMFileSource filesource(aFileName, KDefaultContentObject, EPlay);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1143
	OpenFileL(filesource);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1144
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1145
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1146
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1147
	Open an audio clip from a file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1148
	@param "const RFile& aFile" "the shared session file handle to open"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1149
	@leave "" "KErrBadHandle if the file handle is not shared through the call RFs::ShareProtected(), and the underlying CAF layer needs it to be.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1150
	@leave "" "Leaves on an error opening the file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1151
	@since version 5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1152
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1153
void CMMFMdaAudioPlayerUtility::OpenFileL(const RFile& aFile)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1154
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1155
	RFile& file = const_cast<RFile&>(aFile);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1156
	TMMFileHandleSource filesource(file, KDefaultContentObject, EPlay);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1157
	OpenFileL(filesource);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1158
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1159
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1160
void CMMFMdaAudioPlayerUtility::OpenFileL(const TMMSource& aSource)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1161
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1162
	// If iAsyncCallBack is already active, we're still in the process of notifying the client
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1163
	// that a previous request to Open...(...) has completed.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1164
	if (iAsyncCallBack->IsActive())
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1165
		User::Leave(KErrNotReady);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1166
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1167
	if (aSource.SourceType()==KUidMMFileHandleSource)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1168
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1169
		RFile& fileHandle = static_cast<const TMMFileHandleSource&>(aSource).Handle();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1170
		iFindAndOpenController->ConfigureSourceSink(
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1171
			TMMFileHandleSource(fileHandle, aSource.UniqueId(), aSource.Intent(), aSource.IsUIEnabled()),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1172
			CMMFFindAndOpenController::TSourceSink(KUidMmfAudioOutput));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1173
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1174
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1175
	if (aSource.SourceType()==KUidMMFileSource)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1176
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1177
		const TDesC& fileName = static_cast<const TMMFileSource&>(aSource).Name();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1178
		iFindAndOpenController->ConfigureSourceSink(
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1179
			TMMFileSource(fileName, aSource.UniqueId(), aSource.Intent(), aSource.IsUIEnabled()),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1180
			CMMFFindAndOpenController::TSourceSink(KUidMmfAudioOutput));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1181
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1182
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1183
	iFindAndOpenController->OpenByFileSource(aSource);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1184
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1185
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1186
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1187
	Open an audio clip from a descriptor
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1188
	@param "const TDesC8& aDescriptor" "the descriptor containing the clip"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1189
	@leave "" "Leaves on an error opening the descriptor"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1190
	@since version 5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1191
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1192
void CMMFMdaAudioPlayerUtility::OpenDesL(const TDesC8& aDescriptor)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1193
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1194
	// If iAsyncCallBack is already active, we're still in the process of notifying the client
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1195
	// that a previous request to Open...(...) has completed.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1196
	if (iAsyncCallBack->IsActive())
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1197
		User::Leave(KErrInUse);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1198
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1199
	iFindAndOpenController->ConfigureSourceSink(
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1200
		CMMFFindAndOpenController::TSourceSink(KUidMmfDescriptorSource,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1201
													CMMFFindAndOpenController::GetConfigDescriptor(aDescriptor)),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1202
		CMMFFindAndOpenController::TSourceSink(KUidMmfAudioOutput));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1203
	iFindAndOpenController->OpenByDescriptor(aDescriptor);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1204
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1205
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1206
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1207
	Open an audio clip from a Url
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1208
	@param "const TDesC& aUrl" "the url reference to the clip"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1209
	@leave "" "Leaves on an error opening the url"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1210
	@since version 7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1211
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1212
void CMMFMdaAudioPlayerUtility::OpenUrlL(const TDesC& aUrl, const TInt aIapId, const TDesC8& aMimeType)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1213
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1214
	// If iAsyncCallBack is already active, we're still in the process of notifying the client
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1215
	// that a previous request to Open...(...) has completed.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1216
	if (iAsyncCallBack->IsActive())
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1217
		User::Leave(KErrInUse);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1218
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1219
	CBufFlat* urlCfgBuffer = NULL;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1220
	CMMFFindAndOpenController::GetConfigUrlL(urlCfgBuffer, aUrl, aIapId);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1221
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1222
	iFindAndOpenController->ConfigureSourceSink(
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1223
		CMMFFindAndOpenController::TSourceSink(KUidMmfUrlSource, urlCfgBuffer->Ptr(0)), 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1224
		CMMFFindAndOpenController::TSourceSink(KUidMmfAudioOutput));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1225
	iFindAndOpenController->OpenByUrl(aUrl, aIapId, aMimeType);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1226
	delete urlCfgBuffer;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1227
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1228
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1229
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1230
Begins playback of the initialised audio sample at the current volume
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1231
and priority levels.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1232
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1233
When playing of the audio sample is complete, successfully or
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1234
otherwise, the callback function
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1235
MMdaAudioPlayerCallback::MapcPlayComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1236
called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1237
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1238
If this function is called whilst already playing then 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1239
MMdaAudioPlayerCallback::MapcPlayComplete will return with the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1240
error code KErrNotReady.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1241
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1242
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1243
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1244
void CMMFMdaAudioPlayerUtility::Play()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1245
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1246
	// if we're already playing, call the client's callback with KErrNotReady.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1247
	// This is what the controller would do if we allowed the Play()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1248
	// to propagate down. Need to do it here too (for consistency)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1249
	// in case we're in a trailing silence period.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1250
    if (iState == EPlaying)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1251
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1252
		iAsyncCallBack->PlayComplete(KErrNotReady);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1253
		return;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1254
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1255
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1256
	// cancel the repeat timer in case the client has called Play()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1257
	// without waiting for the previous play to complete
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1258
	iRepeatTrailingSilenceTimer->Cancel();	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1259
	// Reset played count
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1260
	if(iState != EPaused)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1261
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1262
		iNumberOfTimesPlayed = 0;	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1263
		if(iNumberOfTimesToRepeat>0 || iNumberOfTimesToRepeat == KMdaRepeatForever)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1264
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1265
			TInt err = iAudioPlayControllerSetRepeatsCommands.SetRepeats(iNumberOfTimesToRepeat, iTrailingSilence);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1266
			if(err==KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1267
				{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1268
				iNumberOfTimesToRepeat = 0;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1269
				iTrailingSilence = 0;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1270
				}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1271
			//Controller not supporting setrepeats custom command is not a real error
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1272
			//we revert back to playerutility's loop play implementation in that case
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1273
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1274
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1275
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1276
	DoPlay();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1277
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1278
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1279
void CMMFMdaAudioPlayerUtility::DoPlay()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1280
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1281
#if defined(__AUDIO_PROFILING)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1282
	RDebug::ProfileStart(4);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1283
#endif  // defined(__AUDIO_PROFILING)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1284
    TInt err = KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1285
    if (iState != EPaused || iRepeatCancelled)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1286
        {
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1287
		err = iController.Prime();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1288
		iRepeatCancelled = EFalse;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1289
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1290
#if defined(__AUDIO_PROFILING)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1291
	RDebug::ProfileEnd(4);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1292
#endif  // defined(__AUDIO_PROFILING)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1293
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1294
		// make sure we don't set the position outside the play window -
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1295
		// but allow it to remain unchanged if it's within the window
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1296
		if (iPlayWindowSet == ESet &&
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1297
			(iPosition < iPlayStart || iPosition >= iPlayEnd))
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1298
			iPosition = iPlayStart;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1299
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1300
		if (err==KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1301
			err = iController.SetPosition(iPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1302
        }
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1303
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1304
	if (err==KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1305
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1306
		if (iPlayWindowSet == ESet)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1307
			err = iAudioPlayControllerCommands.SetPlaybackWindow(iPlayStart, iPlayEnd);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1308
		else if (iPlayWindowSet == EClear)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1309
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1310
			err = iAudioPlayControllerCommands.DeletePlaybackWindow();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1311
			iPlayWindowSet = ENone;	// assume window will stay cleared
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1312
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1313
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1314
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1315
	if (err==KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1316
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1317
#if defined(__AUDIO_PROFILING)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1318
		RDebug::ProfileStart(5);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1319
#endif  // defined(__AUDIO_PROFILING)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1320
		
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1321
		err = iController.Play();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1322
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1323
#if defined(__AUDIO_PROFILING)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1324
		RDebug::ProfileEnd(5);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1325
#endif  // defined(__AUDIO_PROFILING)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1326
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1327
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1328
	if (err!=KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1329
		iAsyncCallBack->PlayComplete(err);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1330
	else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1331
		iState = EPlaying;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1332
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1333
	if(iEventHolder != KNullUid)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1334
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1335
		err = iNotificationRegistrationCommands.RegisterAsClient(iEventHolder,iNotificationDataHolder);			
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1336
		iEventHolder = KNullUid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1337
		iNotificationDataHolder = KNullDesC8;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1338
		if(err == KErrNotSupported)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1339
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1340
			return;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1341
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1342
		if(err != KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1343
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1344
			iController.Stop();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1345
			iAsyncCallBack->PlayComplete(err);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1346
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1347
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1348
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1349
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1350
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1351
Stops playback of the audio sample as soon as possible.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1352
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1353
If the audio sample is playing, playback is stopped as soon as
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1354
possible. If playback is already complete, nothing further happens as
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1355
a result of calling this function. The callback function
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1356
MMdaAudioPlayerCallback::MapcPlayComplete() is not
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1357
called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1358
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1359
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1360
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1361
void CMMFMdaAudioPlayerUtility::Stop()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1362
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1363
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1364
	if (iState==EStopped)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1365
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1366
		// resetting the position to the start.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1367
		//if any position change in stoped state
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1368
		iPosition = iPlayStart;	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1369
		return;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1370
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1371
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1372
	if (iState==EPlaying || iState==EPaused)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1373
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1374
		// cancel the repeat timer in case the client has called Stop()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1375
		// during the trailing silence period
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1376
		iRepeatTrailingSilenceTimer->Cancel();	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1377
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1378
		iController.Stop();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1379
		iPosition = iPlayStart;	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1380
		iState = EStopped;	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1381
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1382
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1383
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1384
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1385
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1386
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1387
 * Pauses playback of the audio clip
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1388
 * @return One of the system-wide error codes
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1389
 * @since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1390
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1391
TInt CMMFMdaAudioPlayerUtility::Pause()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1392
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1393
	TInt err = KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1394
	if(iRepeatTrailingSilenceTimer->IsActive())
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1395
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1396
		iRepeatTrailingSilenceTimer->Cancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1397
		iRepeatCancelled = ETrue;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1398
		iState = EPaused;	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1399
		return KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1400
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1401
	if (iState==EPlaying)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1402
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1403
		err = iController.Pause();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1404
		if (!err || err==KErrNotReady)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1405
			err = iController.GetPosition(iPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1406
		iState = EPaused;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1407
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1408
	return err;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1409
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1410
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1411
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1412
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1413
 * Closes the current audio clip (allowing another clip to be opened)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1414
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1415
 * @since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1416
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1417
void CMMFMdaAudioPlayerUtility::Close()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1418
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1419
	// Reset the audio player state.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1420
	Stop();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1421
	iControllerEventMonitor->Cancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1422
	iController.Close();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1423
	if (iFindAndOpenController)	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1424
		iFindAndOpenController->Close();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1425
	if(iControllerImplementationInformation)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1426
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1427
		delete iControllerImplementationInformation;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1428
		iControllerImplementationInformation = NULL;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1429
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1430
	iControllerUid = KNullUid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1431
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1432
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1433
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1434
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1435
Changes the current playback volume to a specified value.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1436
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1437
The volume can be changed before or during playback and is effective
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1438
immediately.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1439
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1440
@param  aVolume
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1441
        The volume setting. This can be any value from zero to
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1442
        the value returned by a call to
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1443
        CMdaAudioPlayerUtility::MaxVolume().
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1444
        Setting a zero value mutes the sound. Setting the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1445
        maximum value results in the loudest possible sound.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1446
@return An error code indicating if the function call was successful. KErrNone on success, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1447
		otherwise another of the system-wide error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1448
@panic  EMMFMediaClientBadArgument is raised when the audio player utility is not initialised.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1449
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1450
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1451
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1452
TInt CMMFMdaAudioPlayerUtility::SetVolume(TInt aVolume)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1453
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1454
	TInt err = iAudioPlayDeviceCommands.SetVolume(aVolume);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1455
	if (err == KErrArgument)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1456
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1457
		TInt maxVolume = MaxVolume();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1458
		if (aVolume < 0)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1459
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1460
			aVolume = 0;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1461
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1462
		else if (aVolume > maxVolume)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1463
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1464
			aVolume = maxVolume;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1465
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1466
		err = iAudioPlayDeviceCommands.SetVolume(aVolume);			
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1467
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1468
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1469
	return err;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1470
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1471
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1472
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1473
Sets the number of times the audio sample is to be repeated during the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1474
playback operation.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1475
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1476
A period of silence can follow each playing of the sample. The audio
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1477
sample can be repeated indefinitely.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1478
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1479
@param  aRepeatNumberOfTimes
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1480
        The number of times the audio sample, together with
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1481
        the trailing silence, is to be repeated. If this is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1482
        set to KMdaRepeatForever, then the audio
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1483
        sample, together with the trailing silence, is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1484
        repeated indefinitely or until Stop() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1485
        called. If this is set to zero, then the audio sample
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1486
        is not repeated. The behaviour is undefined for
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1487
		negative values (other than KMdaRepeatForever).
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1488
@param  aTrailingSilence
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1489
        The time interval of the training silence.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1490
		Negative values will produce a panic USER 87.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1491
@since	5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1492
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1493
void CMMFMdaAudioPlayerUtility::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1494
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1495
	TInt err = iAudioPlayControllerSetRepeatsCommands.SetRepeats(aRepeatNumberOfTimes, aTrailingSilence);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1496
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1497
	if(err!=KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1498
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1499
		iNumberOfTimesToRepeat = aRepeatNumberOfTimes;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1500
		iTrailingSilence = aTrailingSilence;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1501
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1502
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1503
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1504
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1505
Defines the period over which the volume level is to rise smoothly
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1506
from nothing to the normal volume level.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1507
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1508
@param  aRampDuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1509
        The period over which the volume is to rise. A zero
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1510
        value causes the audio sample to be played at the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1511
        normal level for the full duration of the playback. A
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1512
        value which is longer than the duration of the audio
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1513
        sample means that the sample never reaches its normal
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1514
        volume level.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1515
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1516
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1517
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1518
void CMMFMdaAudioPlayerUtility::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1519
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1520
	iAudioPlayDeviceCommands.SetVolumeRamp(aRampDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1521
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1522
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1523
TInt CMMFMdaAudioPlayerUtility::SetPriority(TInt aPriority, TInt aPref)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1524
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1525
	iPrioritySettings.iPref = aPref;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1526
	iPrioritySettings.iPriority = aPriority;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1527
	iFindAndOpenController->Configure(iMediaIds[0], iPrioritySettings);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1528
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1529
	return iController.SetPrioritySettings(iPrioritySettings);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1530
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1531
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1532
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1533
Returns the duration of the audio sample.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1534
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1535
@return The duration in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1536
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1537
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1538
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1539
const TTimeIntervalMicroSeconds& CMMFMdaAudioPlayerUtility::Duration()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1540
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1541
	TInt err = iController.GetDuration(iDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1542
	if (err)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1543
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1544
		iDuration = 0;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1545
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1546
	return iDuration;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1547
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1548
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1549
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1550
Returns the duration of the audio sample in microseconds, and the duration state.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1551
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1552
@param aDuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1553
	   The duration of the sample in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1554
@return The duration state
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1555
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1556
@since	9.1
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1557
*/	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1558
TMMFDurationInfo CMMFMdaAudioPlayerUtility::Duration(TTimeIntervalMicroSeconds& aDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1559
{	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1560
	TPckgBuf<TMMFDurationInfo> pckg;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1561
	TMMFDurationInfo result = EMMFDurationInfoValid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1562
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1563
	TMMFMessageDestinationPckg iDestinationPckg(TMMFMessageDestination(KUidInterfaceMMFDurationInfoControl, KMMFObjectHandleController));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1564
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1565
	TInt err = iController.CustomCommandSync(iDestinationPckg,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1566
										 	 EMMFGetDurationInfo,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1567
										 	 KNullDesC8,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1568
										 	 KNullDesC8,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1569
										     pckg );
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1570
																 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1571
	switch ( err )
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1572
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1573
		case KErrNone:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1574
			result = pckg();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1575
			break;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1576
		
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1577
		case KErrNotSupported:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1578
			// Custom command not implemented return EMMFDurationInfoValid as the default value
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1579
			break;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1580
		
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1581
		default:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1582
			// Unknown error
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1583
			result = EMMFDurationInfoUnknown;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1584
			break;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1585
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1586
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1587
	// Get the duration information to return in aDuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1588
	// This is the intended behaviour regardless of what value err has
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1589
	aDuration = Duration();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1590
	return result;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1591
}	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1592
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1593
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1594
Returns an integer representing the maximum volume.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1595
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1596
This is the maximum value which can be passed to
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1597
CMdaAudioPlayerUtility::SetVolume().
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1598
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1599
@return The maximum volume. This value is platform dependent but is always greater than or equal 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1600
        to one.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1601
@panic  EMMFMediaClientPanicServerCommunicationProblem is raised when the audio player utility is not initialised.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1602
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1603
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1604
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1605
TInt CMMFMdaAudioPlayerUtility::MaxVolume()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1606
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1607
	TInt maxVolume = 0;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1608
#ifdef _DEBUG
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1609
	TInt error = 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1610
#endif
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1611
		iAudioPlayDeviceCommands.GetMaxVolume(maxVolume);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1612
	__ASSERT_DEBUG(error==KErrNone, Panic(EMMFMediaClientPanicServerCommunicationProblem));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1613
	return maxVolume;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1614
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1615
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1616
void CMMFMdaAudioPlayerUtility::HandleEvent(const TMMFEvent& aEvent)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1617
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1618
	// handle loading started/complete messages first, as the later code does not explicitly check the event type
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1619
	if (aEvent.iEventType == KMMFEventCategoryAudioLoadingStarted)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1620
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1621
		if (iLoadingObserver)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1622
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1623
			iLoadingObserver->MaloLoadingStarted();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1624
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1625
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1626
	else if (aEvent.iEventType == KMMFEventCategoryAudioLoadingComplete)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1627
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1628
		if (iLoadingObserver)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1629
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1630
			iLoadingObserver->MaloLoadingComplete();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1631
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1632
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1633
	else if (aEvent.iEventType == KMMFEventCategoryAudioResourceAvailable)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1634
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1635
		if (iAudioResourceNotificationCallBack != NULL)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1636
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1637
			TBuf8<TMMFAudioConfig::KNotificationDataBufferSize> notificationData;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1638
			if (KErrNone != iNotificationRegistrationCommands.GetResourceNotificationData(aEvent.iEventType, notificationData))
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1639
				{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1640
				notificationData.SetLength(0);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1641
				}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1642
			iAudioResourceNotificationCallBack->MarncResourceAvailable(aEvent.iEventType, notificationData);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1643
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1644
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1645
	else if (aEvent.iEventType == KMMFEventCategoryPlaybackComplete)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1646
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1647
		TInt oldState = iState;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1648
		//DevCR KEVN-7T5EHA: In case of pre-emption, we need to get the position from Controller, if that fails we reset the position to keep the original behaviour.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1649
		if(aEvent.iErrorCode == KErrInUse ||aEvent.iErrorCode == KErrDied ||aEvent.iErrorCode == KErrAccessDenied )
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1650
		    {
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1651
		    TInt err= iController.GetPosition(iPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1652
		    if(err != KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1653
		        {
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1654
		        iPosition = iPlayStart;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1655
		        }
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1656
		    }
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1657
		else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1658
		    {
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1659
		    iPosition = iPlayStart;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1660
		    }
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1661
		if (aEvent.iErrorCode == KErrNone)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1662
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1663
			//If we weren't playing, ignore the event.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1664
			if (oldState == EPlaying)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1665
				{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1666
				//we finished playing the clip so repeat if required
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1667
				iNumberOfTimesPlayed++;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1668
				if ((iNumberOfTimesPlayed > iNumberOfTimesToRepeat) && (iNumberOfTimesToRepeat != KMdaRepeatForever))
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1669
					{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1670
					//we've repeated enough times now
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1671
					iNumberOfTimesPlayed = 0;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1672
					iState = EStopped;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1673
					iCallback.MapcPlayComplete(KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1674
					}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1675
				else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1676
					{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1677
					// We need to play silence, then repeat the clip
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1678
					iTrailingSilenceLeftToPlay = iTrailingSilence;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1679
					PlaySilence();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1680
					}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1681
				}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1682
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1683
		else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1684
			{ //aEvent.iErrorCode != KErrNone
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1685
			//if we weren't playing, don't advise Client.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1686
			iState = EStopped;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1687
			if (oldState == EPlaying)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1688
				{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1689
				iCallback.MapcPlayComplete(aEvent.iErrorCode);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1690
				}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1691
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1692
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1693
	else if(aEvent.iEventType == KMMFErrorCategoryControllerGeneralError)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1694
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1695
		TInt oldState = iState;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1696
		iPosition = iPlayStart;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1697
		iState = EStopped;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1698
		if (oldState == EPlaying)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1699
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1700
			iCallback.MapcPlayComplete(aEvent.iErrorCode);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1701
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1702
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1703
	// else we have an unexpected event that cannot be dealt with by the client.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1704
	// We will simply ignore this.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1705
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1706
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1707
void CMMFMdaAudioPlayerUtility::PlaySilence()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1708
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1709
	// iRepeatTrailingSilenceTimer->After() takes a TTimeIntervalMicroSeconds32
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1710
	// so for longer periods of silence call it repeatedly with KMaxTInt lengths
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1711
	TTimeIntervalMicroSeconds32 silence;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1712
	if (iTrailingSilenceLeftToPlay.Int64() > KMaxTInt)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1713
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1714
		silence = KMaxTInt;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1715
		iTrailingSilenceLeftToPlay = iTrailingSilenceLeftToPlay.Int64() - KMaxTInt;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1716
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1717
	else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1718
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1719
		silence = I64INT(iTrailingSilenceLeftToPlay.Int64());
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1720
		iTrailingSilenceLeftToPlay = 0;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1721
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1722
	iRepeatTrailingSilenceTimer->After(silence);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1723
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1724
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1725
void CMMFMdaAudioPlayerUtility::RepeatTrailingSilenceTimerComplete()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1726
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1727
	if (iTrailingSilenceLeftToPlay.Int64() > 0)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1728
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1729
		PlaySilence();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1730
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1731
	else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1732
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1733
		// reset the position for subsequent plays
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1734
		iPosition = iPlayStart;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1735
		DoPlay();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1736
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1737
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1738
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1739
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1740
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1741
 * Returns the current playback position in microseconds
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1742
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1743
 * @param "TTimeIntervalMicroSeconds& aPosition"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1744
 *          The current time position in microseconds from the start of the file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1745
 * @return "TInt" One of the global error codes
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1746
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1747
 * @since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1748
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1749
TInt CMMFMdaAudioPlayerUtility::GetPosition(TTimeIntervalMicroSeconds& aPosition)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1750
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1751
	TInt error = KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1752
	if (iState==EPlaying)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1753
		error = iController.GetPosition(iPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1754
	aPosition = iPosition;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1755
	return error;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1756
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1757
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1758
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1759
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1760
 * Set the current playback position in microseconds from the start of the file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1761
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1762
 * @param "TTimeIntervalMicroSeconds& aPosition"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1763
 *         The position to move to in microseconds from the start of the file.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1764
 *         If aPosition is negative, the position is set to the start of the file.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1765
 *         If aPosition is greater than the file duration, the position is set to the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1766
 *         end of the file.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1767
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1768
 * @since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1769
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1770
void CMMFMdaAudioPlayerUtility::SetPosition(const TTimeIntervalMicroSeconds& aPosition)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1771
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1772
	// Clip the position if aPosition is greater than the duration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1773
	// or if aPosition is negative.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1774
	const TTimeIntervalMicroSeconds maxPosition(Duration());
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1775
	const TTimeIntervalMicroSeconds minPosition(0);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1776
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1777
	if (aPosition > maxPosition)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1778
		iPosition = maxPosition;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1779
	else if (aPosition < minPosition)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1780
		iPosition = minPosition;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1781
	else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1782
		iPosition = aPosition;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1783
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1784
    if (iState==EPlaying || iState==EPaused)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1785
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1786
		iController.SetPosition(iPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1787
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1788
//	else if (iState == EPaused)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1789
//		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1790
//		Stop();	// We call stop so that DevSound's internal buffers are reset
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1791
//		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1792
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1793
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1794
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1795
Returns the current playback volume
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1796
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1797
@param aVolume
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1798
       A volume value between 0 and the value returned by MaxVolume().
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1799
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1800
@return One of the global error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1801
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1802
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1803
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1804
TInt CMMFMdaAudioPlayerUtility::GetVolume(TInt& aVolume)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1805
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1806
	TInt error = iAudioPlayDeviceCommands.GetVolume(aVolume);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1807
	return error;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1808
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1809
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1810
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1811
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1812
 * Returns the number of meta data entries in the current clip
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1813
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1814
 * @param "TInt& aNumEntries"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1815
 *          The number of meta data entries in the header of the current clip
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1816
 * @return "TInt" One of the global error codes
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1817
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1818
 * @since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1819
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1820
TInt CMMFMdaAudioPlayerUtility::GetNumberOfMetaDataEntries(TInt& aNumEntries) 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1821
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1822
	TInt error = iController.GetNumberOfMetaDataEntries(aNumEntries);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1823
	return error;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1824
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1825
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1826
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1827
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1828
 * Returns the requested meta data entry
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1829
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1830
 * @param "TInt aMetaDataIndex"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1831
 *          The index number of the meta data to retrieve
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1832
 * @return "CMMFMetaDataEntry*" The meta data entry to return
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1833
 * @leave	Leaves with KErrNotFound if the meta data entry does not exist or
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1834
 *			KErrNotImplemented if the controller does not support meta data 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1835
 *			information for this format. Other errors indicate more general system
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1836
 *			failure.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1837
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1838
 * @since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1839
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1840
CMMFMetaDataEntry* CMMFMdaAudioPlayerUtility::GetMetaDataEntryL(TInt aMetaDataIndex)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1841
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1842
	return iController.GetMetaDataEntryL(aMetaDataIndex);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1843
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1844
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1845
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1846
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1847
 * Set the current playback window
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1848
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1849
 * @param	"const TTimeIntervalMicroSeconds& aStart"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1850
 *			Start time of playback window relative to start of file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1851
 * @param	"const TTimeIntervalMicroSeconds& aEnd"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1852
 *			End time of playback window relative to start of file
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1853
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1854
 * @return "TInt" One of the global error codes
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1855
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1856
 * @since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1857
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1858
TInt CMMFMdaAudioPlayerUtility::SetPlayWindow(const TTimeIntervalMicroSeconds& aPlayStart,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1859
											  const TTimeIntervalMicroSeconds& aPlayEnd)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1860
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1861
	TInt error = KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1862
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1863
	if (aPlayStart >= TTimeIntervalMicroSeconds(0) &&
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1864
		aPlayStart < iDuration &&
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1865
			aPlayStart < aPlayEnd &&
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1866
			aPlayEnd <= iDuration )
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1867
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1868
		iPlayStart = aPlayStart;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1869
		iPlayEnd = aPlayEnd;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1870
		iPlayWindowSet = ESet;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1871
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1872
		if (iState==EPlaying)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1873
			error = iAudioPlayControllerCommands.SetPlaybackWindow(aPlayStart, aPlayEnd);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1874
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1875
	else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1876
		error = KErrArgument;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1877
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1878
	return error;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1879
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1880
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1881
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1882
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1883
 * Clear the current playback window
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1884
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1885
 * @return "TInt" One of the global error codes
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1886
 *
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1887
 * @since	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1888
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1889
TInt CMMFMdaAudioPlayerUtility::ClearPlayWindow()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1890
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1891
	// clear play window start - very important because this is assigned 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1892
	// to iPosition when we stop & is used to set the position on the next Play()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1893
	iPosition = iPlayStart = iPlayEnd = TTimeIntervalMicroSeconds(0);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1894
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1895
	iPlayWindowSet = EClear;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1896
	TInt err = KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1897
	if (iState==EPlaying)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1898
		err = iAudioPlayControllerCommands.DeletePlaybackWindow();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1899
	return err;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1900
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1901
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1902
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1903
Sets the current playback balance
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1904
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1905
@param  aBalance
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1906
        A value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight. The default value is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1907
        KMMFBalanceCenter.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1908
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1909
@return One of the global error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1910
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1911
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1912
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1913
TInt CMMFMdaAudioPlayerUtility::SetBalance(TInt aBalance)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1914
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1915
	TInt err = iAudioPlayDeviceCommands.SetBalance(aBalance);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1916
	return err;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1917
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1918
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1919
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1920
Returns the bit rate of the audio clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1921
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1922
@param  aBitRate
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1923
        Bit rate of the audio clip.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1924
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1925
@return One of the global error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1926
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1927
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1928
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1929
TInt CMMFMdaAudioPlayerUtility::GetBitRate(TUint& aBitRate)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1930
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1931
	RMMFAudioControllerCustomCommands controller(iController);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1932
	TInt err = controller.GetSourceBitRate(aBitRate);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1933
	return err;	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1934
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1935
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1936
const CMMFControllerImplementationInformation& CMMFMdaAudioPlayerUtility::ControllerImplementationInformationL()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1937
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1938
	if (!iControllerImplementationInformation)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1939
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1940
		if (iControllerUid==KNullUid)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1941
			User::Leave(KErrNotReady);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1942
		iControllerImplementationInformation = CMMFControllerImplementationInformation::NewL(iControllerUid);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1943
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1944
	return *iControllerImplementationInformation;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1945
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1946
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1947
void CMMFMdaAudioPlayerUtility::GetAudioLoadingProgressL(TInt& aPercentageProgress)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1948
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1949
	User::LeaveIfError(iAudioPlayControllerCommands.GetLoadingProgress(aPercentageProgress));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1950
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1951
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1952
TInt CMMFMdaAudioPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1953
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1954
	return iController.CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1955
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1956
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1957
TInt CMMFMdaAudioPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1958
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1959
	return iController.CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1960
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1961
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1962
void CMMFMdaAudioPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1963
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1964
	iController.CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1965
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1966
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1967
void CMMFMdaAudioPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1968
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1969
	iController.CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1970
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1971
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1972
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1973
Returns the current playback balance
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1974
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1975
@param  aBalance
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1976
        A value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1977
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1978
@return One of the global error codes.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1979
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1980
@since  7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1981
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1982
TInt CMMFMdaAudioPlayerUtility::GetBalance(TInt& aBalance)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1983
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1984
	TInt err = iAudioPlayDeviceCommands.GetBalance(aBalance);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1985
	return err;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1986
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1987
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1988
MMMFDRMCustomCommand* CMMFMdaAudioPlayerUtility::GetDRMCustomCommand()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1989
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1990
	// TODO: check controller supports MMMFDRMCustomCommandImplementor
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1991
	if (iDRMCustomCommands.IsSupported())
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1992
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1993
		return static_cast<MMMFDRMCustomCommand*>(&iDRMCustomCommands);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1994
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1995
	else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1996
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1997
		return NULL;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1998
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1999
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2000
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2001
void CMMFMdaAudioPlayerUtility::RegisterForAudioLoadingNotification(MAudioLoadingObserver& aLoadingObserver)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2002
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2003
	iLoadingObserver = &aLoadingObserver;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2004
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2005
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2006
TInt CMMFMdaAudioPlayerUtility::RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2007
																	TUid aNotificationEventUid,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2008
																	const TDesC8& aNotificationRegistrationData)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2009
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2010
	iAudioResourceNotificationCallBack = &aCallback;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2011
	TInt err = iNotificationRegistrationCommands.RegisterAsClient(aNotificationEventUid, aNotificationRegistrationData);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2012
	if(err == KErrNotReady)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2013
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2014
		iEventHolder = 	aNotificationEventUid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2015
		iNotificationDataHolder = aNotificationRegistrationData;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2016
		return KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2017
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2018
	iNotificationDataHolder = KNullDesC8;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2019
	iEventHolder = KNullUid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2020
	return err;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2021
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2022
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2023
TInt CMMFMdaAudioPlayerUtility::CancelRegisterAudioResourceNotification(TUid aNotificationEventId)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2024
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2025
	TInt err = iNotificationRegistrationCommands.CancelRegisterAsClient(aNotificationEventId);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2026
	if(err == KErrNotReady)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2027
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2028
		if(aNotificationEventId != KMMFEventCategoryAudioResourceAvailable)	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2029
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2030
			return KErrNotSupported;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2031
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2032
		if(iEventHolder == KNullUid)	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2033
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2034
			return KErrCancel;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2035
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2036
		iEventHolder = KNullUid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2037
		iNotificationDataHolder = KNullDesC8;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2038
		return KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2039
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2040
	return err;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2041
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2042
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2043
TInt CMMFMdaAudioPlayerUtility::WillResumePlay()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2044
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2045
	return iNotificationRegistrationCommands.WillResumePlay();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2046
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2047
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2048
TInt CMMFMdaAudioPlayerUtility::SetThreadPriority(const TThreadPriority& aThreadPriority) const
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2049
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2050
	return iController.SetThreadPriority(aThreadPriority);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2051
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2052
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2053
CRepeatTrailingSilenceTimer* CRepeatTrailingSilenceTimer::NewL(MRepeatTrailingSilenceTimerObs& aObs)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2054
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2055
	CRepeatTrailingSilenceTimer* s = new(ELeave) CRepeatTrailingSilenceTimer(aObs);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2056
	CleanupStack::PushL(s);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2057
	s->ConstructL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2058
	CleanupStack::Pop();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2059
	return s;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2060
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2061
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2062
void CRepeatTrailingSilenceTimer::RunL()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2063
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2064
	iObs.RepeatTrailingSilenceTimerComplete();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2065
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2066
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2067
CRepeatTrailingSilenceTimer::CRepeatTrailingSilenceTimer(MRepeatTrailingSilenceTimerObs& aObs) :
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2068
	CTimer(EPriorityHigh),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2069
	iObs(aObs)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2070
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2071
	CActiveScheduler::Add(this);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2072
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2073
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2074
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2075
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2076
CMMFMdaAudioPlayerCallBack* CMMFMdaAudioPlayerCallBack::NewL(MMdaAudioPlayerCallback& aCallback)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2077
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2078
	return new(ELeave) CMMFMdaAudioPlayerCallBack(aCallback);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2079
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2080
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2081
CMMFMdaAudioPlayerCallBack::CMMFMdaAudioPlayerCallBack(MMdaAudioPlayerCallback& aCallback) :
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2082
	CActive(CActive::EPriorityHigh), iCallback(aCallback)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2083
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2084
	CActiveScheduler::Add(this);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2085
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2086
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2087
CMMFMdaAudioPlayerCallBack::~CMMFMdaAudioPlayerCallBack()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2088
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2089
	Cancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2090
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2091
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2092
void CMMFMdaAudioPlayerCallBack::InitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2093
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2094
	iError = aError;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2095
	iDuration = aDuration;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2096
	iState = ECallbackInitComplete;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2097
	if (!IsActive())
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2098
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2099
		TRequestStatus* s = &iStatus;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2100
		SetActive();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2101
		User::RequestComplete(s, KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2102
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2103
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2104
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2105
void CMMFMdaAudioPlayerCallBack::PlayComplete(TInt aError)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2106
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2107
	iError = aError;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2108
	iState = ECallbackPlayComplete;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2109
	if (!IsActive())
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2110
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2111
		TRequestStatus* s = &iStatus;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2112
		SetActive();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2113
		User::RequestComplete(s, KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2114
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2115
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2116
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2117
void CMMFMdaAudioPlayerCallBack::RunL()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2118
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2119
	switch (iState)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2120
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2121
		case ECallbackInitComplete: 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2122
			iCallback.MapcInitComplete(iError, iDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2123
			break;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2124
		case ECallbackPlayComplete:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2125
			iCallback.MapcPlayComplete(iError);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2126
			break;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2127
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2128
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2129
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2130
void CMMFMdaAudioPlayerCallBack::DoCancel()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2131
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2132
	// Nothing to cancel
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  2133
	}