breakdeps/mmfclientaudioplayer.h
author markw <markw@symbian.org>
Fri, 12 Nov 2010 11:56:07 +0000
changeset 127 a2070821d450
child 129 4a58d534bdaa
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    17
#ifndef MMFCLIENTAUDIOPLAY_H
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    18
#define MMFCLIENTAUDIOPLAY_H
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    19
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    20
#include <e32std.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    21
#include <e32base.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    22
#include <mdaaudiosampleplayer.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    23
#include <mmf/common/mmfcontroller.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    24
#include <mmf/server/mmffile.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    25
#include <mmf/server/mmfdes.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    26
#include <mmfcontrollerimplementationuids.hrh>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    27
#include <mmf/common/mmfstandardcustomcommands.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    28
#include <mmf/common/mmfdrmcustomcommands.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    29
#include "mmfclientutility.h"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    30
#include <mmf/common/mmfdurationinfocustomcommands.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    31
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    32
static const TUid KUidMmfAudioController = {KMmfUidControllerAudio}; 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    33
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    34
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    35
Mixin class to allow notification that the timed silence has finished.
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
class MRepeatTrailingSilenceTimerObs
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    38
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    39
public:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    40
	virtual void RepeatTrailingSilenceTimerComplete() = 0;
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
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
CTimer-based active object that waits the requested time before notifying its observer.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    45
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    46
class CRepeatTrailingSilenceTimer : public CTimer
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    47
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    48
public:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    49
	static CRepeatTrailingSilenceTimer* NewL(MRepeatTrailingSilenceTimerObs& aObs);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    50
	void RunL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    51
private:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    52
	CRepeatTrailingSilenceTimer(MRepeatTrailingSilenceTimerObs& aObs);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    53
private:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    54
	MRepeatTrailingSilenceTimerObs& iObs;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    55
	};
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    58
Active object utility class to allow the callback to be called asynchronously.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    59
This should help prevent re-entrant code in clients of the mediaframework.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    60
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    61
class CMMFMdaAudioPlayerCallBack : public CActive
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
public:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    64
	enum TCallbackState {
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    65
		ECallbackInitComplete,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    66
		ECallbackPlayComplete
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    67
		};
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    68
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    69
		
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    70
public:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    71
	static CMMFMdaAudioPlayerCallBack* NewL(MMdaAudioPlayerCallback& aCallback);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    72
	~CMMFMdaAudioPlayerCallBack();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    73
	void InitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    74
	void PlayComplete(TInt aError);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    75
private:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    76
	CMMFMdaAudioPlayerCallBack(MMdaAudioPlayerCallback& aCallback);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    77
	void RunL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    78
	void DoCancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    79
private:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    80
	MMdaAudioPlayerCallback& iCallback;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    81
	TInt iError;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    82
	TTimeIntervalMicroSeconds iDuration;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    83
	TCallbackState iState;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    84
	};
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    85
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    86
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    87
Concrete implementation of the CMdaAudioPlayerUtility API.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    88
@see CMdaAudioPlayerUtility
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    89
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    90
class CMMFMdaAudioPlayerUtility;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    91
NONSHARABLE_CLASS( CMMFMdaAudioPlayerUtility ): public CBase, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    92
								  				public MMMFControllerEventMonitorObserver,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    93
								  				public MRepeatTrailingSilenceTimerObs,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    94
								  				public MMMFFindAndOpenControllerObserver
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    95
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    96
friend class CMdaAudioPlayerUtility;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    97
// friends for Unit testing only
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    98
friend class CTestStepUnitMMFAudClient;
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
public:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   101
	enum TMMFAudioPlayerState
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   102
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   103
		EStopped,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   104
		EOpening,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   105
		EPaused,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   106
		EPlaying		
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   107
		};
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   108
public:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   109
	static CMMFMdaAudioPlayerUtility* NewFilePlayerL(const TDesC& aFileName, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   110
								MMdaAudioPlayerCallback& aCallback, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   111
								TInt aPriority = EMdaPriorityNormal, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   112
								TInt aPref = EMdaPriorityPreferenceTimeAndQuality,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   113
								CMdaServer* aServer = NULL);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   114
	static CMMFMdaAudioPlayerUtility* NewDesPlayerL(const TDesC8& aData, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   115
								MMdaAudioPlayerCallback& aCallback, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   116
								TInt aPriority = EMdaPriorityNormal, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   117
								TInt aPref = EMdaPriorityPreferenceTimeAndQuality,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   118
								CMdaServer* aServer = NULL);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   119
	static CMMFMdaAudioPlayerUtility* NewDesPlayerReadOnlyL(const TDesC8& aData, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   120
								MMdaAudioPlayerCallback& aCallback, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   121
								TInt aPriority = EMdaPriorityNormal, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   122
								TInt aPref = EMdaPriorityPreferenceTimeAndQuality,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   123
								CMdaServer* aServer = NULL);
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
	static CMMFMdaAudioPlayerUtility* NewL(MMdaAudioPlayerCallback& aCallback,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   126
								TInt aPriority = EMdaPriorityNormal,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   127
								TInt aPref = EMdaPriorityPreferenceTimeAndQuality);
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   130
	Destructor
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   131
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   132
	~CMMFMdaAudioPlayerUtility();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   133
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   134
	void UseSharedHeap();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   135
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   136
	void OpenFileL(const TDesC& aFileName);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   137
	void OpenFileL(const RFile& aFile);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   138
	void OpenFileL(const TMMSource& aSource);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   139
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   140
	void OpenDesL(const TDesC8& aDescriptor);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   141
	void OpenUrlL(const TDesC& aUrl, TInt aIapId=KUseDefaultIap, const TDesC8& aMimeType = KNullDesC8);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   142
	void Play();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   143
	void Stop();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   144
	TInt SetVolume(TInt aVolume);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   145
	void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   146
	void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   147
	const TTimeIntervalMicroSeconds& Duration();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   148
	TInt MaxVolume();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   149
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   150
	// API Additions since version 7.0	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   151
	TInt Pause();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   152
	void Close();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   153
	TInt GetPosition(TTimeIntervalMicroSeconds& aPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   154
	void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   155
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   156
	TInt SetPriority(TInt aPriority, TInt aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   157
	TInt GetVolume(TInt& aVolume);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   158
	TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   159
	CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   160
	TInt SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   161
								const TTimeIntervalMicroSeconds& aEnd);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   162
	TInt ClearPlayWindow();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   163
	TInt SetBalance(TInt aBalance = KMMFBalanceCenter);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   164
	TInt GetBalance(TInt& aBalance);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   165
	TInt GetBitRate(TUint& aBitRate);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   166
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   167
	void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   168
	void GetAudioLoadingProgressL(TInt& aPercentageProgress);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   169
	const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   170
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   171
	TInt RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback,TUid aNotificationEventUid,const TDesC8& aNotificationRegistrationData = KNullDesC8);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   172
	TInt CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   173
	TInt WillResumePlay();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   174
	TInt 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
   175
	TInt 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
   176
	void 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
   177
	void 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
   178
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   179
	MMMFDRMCustomCommand* GetDRMCustomCommand();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   180
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   181
	TInt SetThreadPriority(const TThreadPriority& aThreadPriority) const;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   182
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   183
	TMMFDurationInfo Duration(TTimeIntervalMicroSeconds& aDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   184
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   185
	// from MMMFControllerEventMonitorObserver
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   186
	virtual void HandleEvent(const TMMFEvent& aEvent);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   187
	// from MRepeatTrailingSilenceTimerObs
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   188
	virtual void RepeatTrailingSilenceTimerComplete();
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
	// from MMMFFindAndOpenControllerObserver 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   191
	virtual void MfaocComplete(
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   192
		TInt& aError, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   193
		RMMFController* aController, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   194
		TUid aControllerUid, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   195
		TMMFMessageDestination* aSourceHandle, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   196
		TMMFMessageDestination* aSinkHandle);
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
protected:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   199
	CMMFMdaAudioPlayerUtility(MMdaAudioPlayerCallback& aCallback, TInt aPriority, TInt aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   200
	void ConstructL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   201
	void DoPlay();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   202
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   203
private:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   204
	void PlaySilence();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   205
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   206
private:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   207
	// last play window command
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   208
	enum TPlayWindowCommand
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
		ENone,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   211
		ESet,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   212
		EClear
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   215
	MMdaAudioPlayerCallback& iCallback;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   216
	CMMFMdaAudioPlayerCallBack* iAsyncCallBack;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   217
	MAudioLoadingObserver* iLoadingObserver;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   218
	MMMFAudioResourceNotificationCallback* iAudioResourceNotificationCallBack;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   219
	RMMFController iController;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   220
	CMMFControllerEventMonitor* iControllerEventMonitor;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   221
	TMMFAudioPlayerState iState;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   222
	TTimeIntervalMicroSeconds iDuration; // Needed because of api "Duration()" that returns a reference
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   223
	TMMFPrioritySettings iPrioritySettings;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   224
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   225
	TInt iNumberOfTimesPlayed;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   226
	TInt iNumberOfTimesToRepeat;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   227
	TTimeIntervalMicroSeconds iTrailingSilence;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   228
	TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay;	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   229
	CRepeatTrailingSilenceTimer* iRepeatTrailingSilenceTimer;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   230
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   231
	// Source and sink handle info
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   232
	TMMFMessageDestination iSourceHandle;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   233
	TMMFMessageDestination iSinkHandle;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   234
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   235
	// Custom command handlers
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   236
	RMMFAudioPlayDeviceCustomCommands iAudioPlayDeviceCommands;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   237
	RMMFAudioPlayControllerCustomCommands iAudioPlayControllerCommands;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   238
	RMMFResourceNotificationCustomCommands iNotificationRegistrationCommands;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   239
	RMMFDRMCustomCommands iDRMCustomCommands;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   240
	RMMFAudioPlayControllerSetRepeatsCustomCommands iAudioPlayControllerSetRepeatsCommands;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   241
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   242
	// Current playback time so we can resume from where we were stopped
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   243
	TTimeIntervalMicroSeconds iPosition;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   244
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   245
	// Play window start and end times and whether it has been set
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   246
	TTimeIntervalMicroSeconds iPlayStart;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   247
	TTimeIntervalMicroSeconds iPlayEnd;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   248
	TPlayWindowCommand iPlayWindowSet;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   249
	RArray<TUid> iMediaIds;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   250
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   251
	CMMFControllerImplementationInformation* iControllerImplementationInformation;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   252
	TUid iControllerUid;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   253
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   254
	// utility class to find and open a suitable controller asynchronously
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   255
	CMMFFindAndOpenController* iFindAndOpenController;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   256
	TUid iEventHolder;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   257
	TBuf8<256> iNotificationDataHolder;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   258
	TBool iRepeatCancelled;
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
#endif