breakdeps/mmfclienttoneplayer.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 <mmf/common/mmfpaniccodes.h>
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    17
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    18
#include "mmfclienttoneplayer.h"
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    19
using namespace ContentAccess;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    20
enum TMmfMdaAudioToneUtility
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    21
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    22
	EBadArgument,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    23
	EPostConditionViolation, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    24
	EPlayStartedCalledWithError
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    27
void Panic(TInt aPanicCode)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    28
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    29
	_LIT(KMMFMediaClientAudioPanicCategory, "Stem_MMFAudioClient");
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    30
	User::Panic(KMMFMediaClientAudioPanicCategory, aPanicCode);
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    33
// Dummy DevSound class
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
CDummyDevSound::CDummyDevSound()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    36
	: CTimer(EPriorityStandard)
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    39
CDummyDevSound* CDummyDevSound::NewL()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    40
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    41
	CDummyDevSound* self = new(ELeave) CDummyDevSound();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    42
	return self;
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    45
void CDummyDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    46
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    47
	iObserver = &aDevSoundObserver;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    48
	iObserver->InitializeComplete(KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    49
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    50
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    51
void CDummyDevSound::Play(const TTimeIntervalMicroSeconds& aDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    52
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    53
	if (IsActive())
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
		// currently playing - ignore the request?
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    56
		return;
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
	TTimeIntervalMicroSeconds32 d = I64LOW(aDuration.Int64());
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    59
	if (d <= TTimeIntervalMicroSeconds32(0))
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
		d = 10;
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
	After(d);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    64
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    65
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    66
void CDummyDevSound::RunL()
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
	RDebug::Printf("!Beep!\n");
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    69
	iObserver->ToneFinished(KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    70
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    71
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
Creates a new instance of the tone player utility.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    74
The default  volume is set to MaxVolume() / 2.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    75
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    76
@param  aObserver
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    77
        A class to receive notifications from the tone player.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    78
@param  aServer
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    79
        This parameter is no longer used and should be NULL.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    80
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    81
@return A pointer to the new audio tone player utility object.
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
@since 5.0
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
EXPORT_C CMdaAudioToneUtility* CMdaAudioToneUtility::NewL(MMdaAudioToneObserver& aObserver, CMdaServer* aServer /*= NULL*/)
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
	return CMdaAudioToneUtility::NewL(aObserver, aServer, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    88
	}
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    91
Creates a new instance of the tone player utility.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    92
The default  volume is set to MaxVolume() / 2.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    93
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    94
@param  aObserver
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    95
        A class to receive notifications from the tone player
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    96
@param  aServer
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    97
        This parameter is no longer used and should be NULL
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    98
@param  aPriority
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
    99
        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
   100
        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
   101
@param  aPref
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   102
        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
   103
        EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   104
        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
   105
        portable code.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   106
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   107
@return A pointer to the new audio tone player utility object.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   108
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   109
@since 5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   110
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   111
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
   112
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
   113
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
   114
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
   115
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
   116
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   117
EXPORT_C CMdaAudioToneUtility* CMdaAudioToneUtility::NewL(MMdaAudioToneObserver& aObserver, CMdaServer* /*aServer = NULL*/,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   118
														  TInt aPriority /*= EMdaPriorityNormal*/,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   119
														  TInt aPref /*= EMdaPriorityPreferenceTimeAndQuality*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   120
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   121
	CMdaAudioToneUtility* self = new(ELeave) CMdaAudioToneUtility();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   122
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   123
	self->iProperties = CMMFMdaAudioToneUtility::NewL(aObserver, NULL, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   124
	CleanupStack::Pop(); //self
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   125
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   126
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   127
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
Destructor. Frees any resources held by the tone player
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   130
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   131
@since 5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   132
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   133
CMdaAudioToneUtility::~CMdaAudioToneUtility()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   134
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   135
	delete iProperties;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   136
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   137
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   138
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   139
Returns the current state of the audio tone utility.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   140
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   141
@return The state of the audio tone utility.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   142
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   143
@since  5.0
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
TMdaAudioToneUtilityState CMdaAudioToneUtility::State()
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   148
	return iProperties->State();
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
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   151
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   152
Returns the maximum volume supported by the device. This is the maximum value which can be 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   153
passed to CMdaAudioToneUtility::SetVolume().
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
@return The maximum volume. This value is platform dependent but is always greater than or equal to one.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   156
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   157
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   158
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   159
TInt CMdaAudioToneUtility::MaxVolume()
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   162
	return iProperties->MaxVolume();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   163
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   164
	
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
Returns an integer representing the current volume of the audio device.
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
@return The current volume.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   169
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   170
@since 		5.0
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
TInt CMdaAudioToneUtility::Volume()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   173
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   174
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   175
	return iProperties->Volume();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   176
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   177
	
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
Changes the volume of the audio device.
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
The volume can be changed before or during play and is effective
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   182
immediately.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   183
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   184
@param  aVolume
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   185
        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
   186
        the value returned by a call to
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   187
        CMdaAudioToneUtility::MaxVolume().
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   188
        Setting a zero value mutes the sound. Setting the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   189
        maximum value results in the loudest possible sound.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   190
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   191
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   192
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   193
void CMdaAudioToneUtility::SetVolume(TInt aVolume)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   194
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   195
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   196
	iProperties->SetVolume(aVolume);
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
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   199
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   200
Changes the clients priority.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   201
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   202
@param  aPriority
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   203
        The Priority Value.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   204
@param  aPref
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   205
        The Priority Preference.
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
@see CMdaAudioToneUtility::NewL()
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
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   210
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
void CMdaAudioToneUtility::SetPriority(TInt aPriority, TInt aPref)
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   215
	iProperties->SetPriority(aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   216
	}
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
Changes the duration of DTMF tones, the gaps between DTMF tones and the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   220
pauses.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   221
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   222
@param  aToneLength
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   223
        The duration of the DTMF tone in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   224
@param  aToneOffLength
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   225
        The gap between DTFM tones in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   226
@param  aPauseLength
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   227
        Pauses in microseconds
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   228
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   229
void CMdaAudioToneUtility::SetDTMFLengths(TTimeIntervalMicroSeconds32 aToneLength,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   230
										  TTimeIntervalMicroSeconds32 aToneOffLength,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   231
										  TTimeIntervalMicroSeconds32 aPauseLength)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   232
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   233
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   234
	iProperties->SetDTMFLengths(aToneLength, aToneOffLength, aPauseLength);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   235
	}
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
Sets the number of times the tone sequence is to be repeated during
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   239
the play operation.
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
A period of silence can follow each playing of the tone sequence. The
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   242
tone sequence can be repeated indefinitely.
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
@param  aRepeatNumberOfTimes
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   245
        The number of times the tone sequence, together with
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   246
        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
   247
        set to KMdaRepeatForever, then the tone
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   248
        sequence, together with the trailing silence, is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   249
        repeated indefinitely. The behaviour is undefined for values other than  
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   250
		KMdaRepeatForever, zero and positive.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   251
@param  aTrailingSilence
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   252
        The time interval of the training silence. The behaviour is undefined
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   253
        for values other than zero and positive.
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
@since  5.0
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
void CMdaAudioToneUtility::SetRepeats(TInt aRepeatNumberOfTimes,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   258
									  const TTimeIntervalMicroSeconds& aTrailingSilence)
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   261
	iProperties->SetRepeats(aRepeatNumberOfTimes, aTrailingSilence);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   262
	}
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   265
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
   266
from nothing to the normal volume level.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   267
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   268
@param  aRampDuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   269
        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
   270
        value causes the tone to be played at the normal level
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   271
        for the full duration of the playback. A value which
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   272
        is longer than the duration of the tone sequence means
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   273
        that the tone never reaches its normal volume level.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   274
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   275
@since  5.0
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
void CMdaAudioToneUtility::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   280
	iProperties->SetVolumeRamp(aRampDuration);
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   283
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   284
Returns the number of available pre-defined tone sequences.
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
@return The number of tone sequences. This value is implementation 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   287
		dependent but is always greater than or equal to zero.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   288
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   289
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   290
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   291
TInt CMdaAudioToneUtility::FixedSequenceCount()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   292
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   293
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   294
	return iProperties->FixedSequenceCount();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   295
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   296
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
Returns the name assigned to a specific pre-defined tone sequence.
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
@param  aSequenceNumber
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   301
        The index identifying the specific pre-defined tone sequence. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   302
        Index values are relative to zero. This can be any value from 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   303
        zero to the value returned by a call to FixedSequenceCount() - 1.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   304
        The function raises a panic if sequence number is not within this
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   305
 		range.
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
@see CMMFDevSound::FixedSequenceName(TInt aSequenceNumber)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   308
@see FixedSequenceCount()
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
@return The name assigned to the tone sequence.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   311
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   312
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   313
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   314
const TDesC& CMdaAudioToneUtility::FixedSequenceName(TInt aSequenceNumber)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   315
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   316
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   317
	return iProperties->FixedSequenceName(aSequenceNumber);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   318
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   319
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   320
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   321
Configures the audio tone player utility to play a single tone.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   322
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   323
This function is asynchronous. On completion, the observer callback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   324
function MMdaAudioToneObserver::MatoPrepareComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   325
called, indicating the success or failure of the configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   326
operation.The configuration operation can be cancelled by calling
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   327
CMdaAudioToneUtility::CancelPrepare(). The configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   328
operation cannot be started if a play operation is in progress.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   329
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   330
@param     aFrequency
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   331
           The frequency (pitch) of the tone in Hz.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   332
@param     aDuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   333
           The duration of the tone in microseconds.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   334
@since     5.0
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
void CMdaAudioToneUtility::PrepareToPlayTone(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   337
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   338
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   339
	iProperties->PrepareToPlayTone(aFrequency, aDuration);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   340
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   341
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   342
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   343
Configures the audio tone player utility to play a dual tone.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   344
The generated tone consists of two sine waves of different
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   345
frequencies summed together.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   346
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   347
This function is asynchronous. On completion, the observer callback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   348
function MMdaAudioToneObserver::MatoPrepareComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   349
called, indicating the success or failure of the configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   350
operation. The configuration operation can be cancelled by calling
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   351
CMdaAudioToneUtility::CancelPrepare(). The configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   352
operation cannot be started if a play operation is in progress.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   353
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   354
@param  aFrequencyOne
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   355
        The first frequency (pitch) of the tone.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   356
@param  aFrequencyTwo
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   357
        The second frequency (pitch) of the tone.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   358
@param  aDuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   359
        The duration of the tone in microseconds.
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
@since  7.0sy
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   362
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   363
EXPORT_C void CMdaAudioToneUtility::PrepareToPlayDualTone(TInt aFrequencyOne, TInt aFrequencyTwo, const TTimeIntervalMicroSeconds& aDuration)
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   366
	iProperties->PrepareToPlayDualTone(aFrequencyOne, aFrequencyTwo, aDuration);
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   369
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   370
Configures the audio tone utility player to play a DTMF (Dual-Tone
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   371
Multi-Frequency) string.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   372
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   373
This function is asynchronous. On completion, the observer callback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   374
function MMdaAudioToneObserver::MatoPrepareComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   375
called, indicating the success or failure of the configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   376
operation. The configuration operation can be cancelled by calling
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   377
CMdaAudioToneUtility::CancelPrepare(). The configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   378
operation cannot be started if a play operation is in progress.
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
@param  aDTMF
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   381
        A descriptor containing the DTMF string.
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
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   384
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   385
void CMdaAudioToneUtility::PrepareToPlayDTMFString(const TDesC& aDTMF)
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   388
	iProperties->PrepareToPlayDTMFString(aDTMF);
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
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
Configures the audio tone player utility to play a tone sequence
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   393
contained in a descriptor.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   394
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   395
This function is asynchronous. On completion, the observer callback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   396
function MMdaAudioToneObserver::MatoPrepareComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   397
called, indicating the success or failure of the configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   398
operation. The configuration operation can be cancelled by calling
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   399
CMdaAudioToneUtility::CancelPrepare(). The configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   400
operation cannot be started if a play operation is in progress.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   401
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   402
@param  aSequence
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   403
        The descriptor containing the tone sequence. The
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   404
        format of the data is unspecified but is expected to
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   405
        be platform dependent. A device might support more
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   406
        than one form of sequence data.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   407
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   408
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   409
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   410
void CMdaAudioToneUtility::PrepareToPlayDesSequence(const TDesC8& aSequence)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   411
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   412
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   413
	iProperties->PrepareToPlayDesSequence(aSequence);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   414
	}
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   417
Configures the audio tone player utility to play a tone sequence
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   418
contained in a file.
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
This function is asynchronous. On completion, the observer callback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   421
function MMdaAudioToneObserver::MatoPrepareComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   422
called, indicating the success or failure of the configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   423
operation. The configuration operation can be cancelled by calling
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   424
CMdaAudioToneUtility::CancelPrepare(). The configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   425
operation cannot be started if a play operation is in progress.
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
@param  aFileName
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   428
        The full path name of the file containing the tone
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   429
        sequence. The format of the data is unspecified but is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   430
        expected to be platform dependent. A device might
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   431
        support more than one form of sequence data.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   432
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   433
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   434
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   435
void CMdaAudioToneUtility::PrepareToPlayFileSequence(const TDesC& aFileName)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   436
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   437
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   438
	iProperties->PrepareToPlayFileSequence(aFileName);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   439
	}
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   442
Configures the audio tone player utility to play a tone sequence
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   443
contained in a file.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   444
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   445
This function is asynchronous. On completion, the observer callback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   446
function MMdaAudioToneObserver::MatoPrepareComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   447
called, indicating the success or failure of the configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   448
operation. The configuration operation can be cancelled by calling
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   449
CMdaAudioToneUtility::CancelPrepare(). The configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   450
operation cannot be started if a play operation is in progress.
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
@param  aFile
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   453
        A handle to an open file containing the tone
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   454
        sequence. The format of the data is unspecified but is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   455
        expected to be platform dependent. A device might
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   456
        support more than one form of sequence data.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   457
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   458
@since  5.0
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 CMdaAudioToneUtility::PrepareToPlayFileSequence(RFile& aFile)
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->PrepareToPlayFileSequence(aFile);
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   468
Configures the audio tone player utility to play the specified
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   469
pre-defined tone sequence.
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
This function is asynchronous. On completion, the observer callback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   472
function MMdaAudioToneObserver::MatoPrepareComplete() is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   473
called, indicating the success or failure of the configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   474
operation. The configuration operation can be cancelled by calling
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   475
CMdaAudioToneUtility::CancelPrepare(). The configuration
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   476
operation cannot be started if a play operation is in progress.
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
@param  aSequenceNumber
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   479
        An index into the set of pre-defined tone sequences.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   480
        This can be any value from zero to the value returned by a 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   481
        call to FixedSequenceCount() - 1.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   482
        If the sequence number is not within this range, a panic will be 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   483
        raised when Play() is called later.
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
@see FixedSequenceCount()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   486
@see CMMFDevSound::PlayFixedSequenceL(TInt aSequenceNumber)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   487
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   488
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   489
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   490
void CMdaAudioToneUtility::PrepareToPlayFixedSequence(TInt aSequenceNumber)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   491
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   492
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   493
	iProperties->PrepareToPlayFixedSequence(aSequenceNumber);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   494
	}
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   497
Cancels the configuration operation.
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
The observer callback function
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   500
MMdaAudioToneObserver::MatoPrepareComplete() is not
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   501
called.
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
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   504
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   505
void CMdaAudioToneUtility::CancelPrepare()
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   508
	iProperties->CancelPrepare();
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   511
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   512
Plays the tone.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   513
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   514
The tone played depends on the current configuration.This function is
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   515
asynchronous. On completion, the observer callback function
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   516
MMdaAudioToneObserver::MatoPlayComplete() is called,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   517
indicating the success or failure of the play operation.The play
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   518
operation can be cancelled by
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   519
calling CMdaAudioToneUtility::CancelPlay().
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
@since  5.0
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   522
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   523
void CMdaAudioToneUtility::Play()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   524
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   525
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   526
	iProperties->Play();
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   529
EXPORT_C TInt CMdaAudioToneUtility::Pause()
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
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   532
	return iProperties->Pause();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   533
	}
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
EXPORT_C TInt CMdaAudioToneUtility::Resume()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   536
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   537
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   538
	return iProperties->Resume();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   539
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   540
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
Cancels the tone playing operation.
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
The observer callback
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   545
function MMdaAudioToneObserver::MatoPlayComplete() is not
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   546
called.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   547
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   548
@since  5.0
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
void CMdaAudioToneUtility::CancelPlay()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   551
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   552
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   553
	iProperties->CancelPlay();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   554
	}
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   557
Sets the stereo balance for playback.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   558
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   559
@param 	aBalance
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   560
        The balance. Should be between KMMFBalanceMaxLeft and KMMFBalanceMaxRight.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   561
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   562
@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
   563
        another of the system-wide error codes.
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
@since 7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   566
*/
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   567
EXPORT_C void CMdaAudioToneUtility::SetBalanceL(TInt aBalance /*=KMMFBalanceCenter*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   568
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   569
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   570
	iProperties->SetBalanceL(aBalance);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   571
	}
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   574
 *	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
   575
 *			as passed to SetBalanceL depending on the internal implementation in 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   576
 *			the underlying components.
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
 *	@return The balance. Should be between KMMFBalanceMaxLeft and KMMFBalanceMaxRight.
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
 *  @since 	7.0s
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   581
 */
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   582
EXPORT_C TInt CMdaAudioToneUtility::GetBalanceL()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   583
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   584
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   585
	return iProperties->GetBalanceL();
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
/**
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   589
Retrieves a custom interface to the underlying device.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   590
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   591
@param  aInterfaceId
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   592
        The interface UID, defined with the custom interface.
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   593
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   594
@return A pointer to the interface implementation, or NULL if the device does not
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   595
        implement the interface requested. The return value must be cast to the
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   596
        correct type by the user.
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 TAny* CMdaAudioToneUtility::CustomInterface(TUid aInterfaceId)
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 0;
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
EXPORT_C void CMdaAudioToneUtility::RegisterPlayStartCallback(MMdaAudioTonePlayStartObserver& aObserver)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   605
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   606
	ASSERT(iProperties);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   607
	iProperties->RegisterPlayStartCallback(aObserver);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   608
	}
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   611
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   612
CMMFMdaAudioToneUtility* CMMFMdaAudioToneUtility::NewL(MMdaAudioToneObserver& aObserver, CMdaServer* /*aServer = NULL*/,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   613
														  TInt aPriority /*= EMdaPriorityNormal*/, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   614
														  TInt aPref /*= EMdaPriorityPreferenceTimeAndQuality*/)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   615
														  
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
	CMMFMdaAudioToneUtility* self = new(ELeave) CMMFMdaAudioToneUtility(aObserver, aPriority, aPref);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   618
	CleanupStack::PushL(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   619
	self->ConstructL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   620
	CleanupStack::Pop(self);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   621
	return self;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   622
	}
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   625
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   626
CMMFMdaAudioToneUtility::CMMFMdaAudioToneUtility(MMdaAudioToneObserver& aCallback, TInt aPriority, TInt aPref) :
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   627
	iCallback(aCallback)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   628
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   629
	iPrioritySettings.iPref = aPref;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   630
	iPrioritySettings.iPriority = aPriority;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   631
	iState = EMdaAudioToneUtilityNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   632
	iInitialized = EFalse;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   633
	iPlayCalled = EFalse;
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
#ifdef _DEBUG
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   636
	iPlayCalledBeforeInitialized = EFalse;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   637
#endif
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   638
	}
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
void CMMFMdaAudioToneUtility::ConstructL()
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
	iAsyncCallback = CMMFMdaAudioToneObserverCallback::NewL(*this, *this);
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
	// iDevSound = CMMFDevSound::NewL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   645
	// iDevSound->InitializeL(*this,EMMFStateTonePlaying);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   646
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   647
	iTimer = CDummyDevSound::NewL();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   648
	iTimer->InitializeL(*this);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   649
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   650
	SetVolume(MaxVolume()/2 ); // set the volume to an intermediate value 
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   653
CMMFMdaAudioToneUtility::~CMMFMdaAudioToneUtility()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   654
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   655
	delete iAsyncCallback;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   656
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   657
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   658
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   659
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   660
void CMMFMdaAudioToneUtility::InitializeComplete(TInt aError)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   661
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   662
#ifdef _DEBUG
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   663
	__ASSERT_ALWAYS(!iPlayCalledBeforeInitialized, User::Panic(_L("PlayInitialized called before InitializeComplete"), 0));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   664
#endif
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   665
	iInitialized = ETrue;
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
	if (iPlayCalled)
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
		// Play() is called before InitializeComplete()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   670
		if (aError == KErrNone)
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
			PlayAfterInitialized();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   673
 			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   674
 		else 
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
 			// InitializeComplete() with error other than KErrNone
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   677
			iState = EMdaAudioToneUtilityNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   678
			iAsyncCallback->MatoPlayComplete(aError);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   679
 			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   680
 		iPlayCalled = EFalse;
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
 	iInitializeState = aError;
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   685
void CMMFMdaAudioToneUtility::ToneFinished(TInt aError)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   686
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   687
	if (aError != KErrCancel)
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
		if (aError == KErrUnderflow)
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
			aError = KErrNone;
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   694
		iAsyncCallback->MatoPlayComplete(aError);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   695
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   696
	// else don't want to callback after a cancel
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   699
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   700
TMdaAudioToneUtilityState CMMFMdaAudioToneUtility::State()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   701
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   702
	return iState;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   703
	}
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
TInt CMMFMdaAudioToneUtility::MaxVolume()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   706
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   707
	return 100;
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
TInt CMMFMdaAudioToneUtility::Volume()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   711
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   712
	return iDevSoundVolume;
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   715
void CMMFMdaAudioToneUtility::SetVolume(TInt aVolume) 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   716
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   717
	iDevSoundVolume = aVolume;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   718
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   719
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   720
void CMMFMdaAudioToneUtility::SetPriority(TInt aPriority, TInt aPref)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   721
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   722
	iPrioritySettings.iPref = aPref;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   723
	iPrioritySettings.iPriority = aPriority;
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   726
void CMMFMdaAudioToneUtility::SetDTMFLengths(TTimeIntervalMicroSeconds32 aToneLength, 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   727
										 TTimeIntervalMicroSeconds32 aToneOffLength,
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   728
										 TTimeIntervalMicroSeconds32 aPauseLength)
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
	}
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
void CMMFMdaAudioToneUtility::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
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
	// iDevSound->SetToneRepeats(aRepeatNumberOfTimes, aTrailingSilence);
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   737
void CMMFMdaAudioToneUtility::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   738
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   739
	}
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
TInt CMMFMdaAudioToneUtility::FixedSequenceCount()
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
	return 1; // iDevSound->FixedSequenceCount();
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   746
_LIT(KFixedSequenceName, "FixedSequenceName");
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   747
const TDesC& CMMFMdaAudioToneUtility::FixedSequenceName(TInt aSequenceNumber)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   748
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   749
	return KFixedSequenceName;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   750
	}
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
void CMMFMdaAudioToneUtility::CalculateBalance( TInt& aBalance, TInt aLeft, TInt aRight ) const
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   753
	{
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
void CMMFMdaAudioToneUtility::CalculateLeftRightBalance( TInt& aLeft, TInt& aRight, TInt aBalance ) const
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
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   760
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
void CMMFMdaAudioToneUtility::SetBalanceL(TInt aBalance) 
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
	iDevSoundBalance = aBalance;
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   767
TInt CMMFMdaAudioToneUtility::GetBalanceL() 
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
	return iDevSoundBalance; 
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   772
void CMMFMdaAudioToneUtility::PrepareToPlayTone(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   773
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   774
	iDuration = aDuration;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   775
	iAsyncCallback->MatoPrepareComplete(KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   776
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   777
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   778
void CMMFMdaAudioToneUtility::PrepareToPlayDualTone(TInt aFrequencyOne, TInt aFrequencyTwo, const TTimeIntervalMicroSeconds& aDuration)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   779
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   780
	iDuration = aDuration;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   781
	iAsyncCallback->MatoPrepareComplete(KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   782
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   783
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   784
void CMMFMdaAudioToneUtility::PrepareToPlayDTMFString(const TDesC& aDTMF)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   785
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   786
	iDuration = TTimeIntervalMicroSeconds(100);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   787
	iAsyncCallback->MatoPrepareComplete(KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   788
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   789
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   790
void CMMFMdaAudioToneUtility::PrepareToPlayDesSequence(const TDesC8& aSequence)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   791
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   792
	iDuration = TTimeIntervalMicroSeconds(100);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   793
	iAsyncCallback->MatoPrepareComplete(KErrNone);
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   796
void CMMFMdaAudioToneUtility::PrepareToPlayFileSequence(const TDesC& aFileName)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   797
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   798
	iDuration = TTimeIntervalMicroSeconds(100);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   799
	iAsyncCallback->MatoPrepareComplete(KErrNone);
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
void CMMFMdaAudioToneUtility::PrepareToPlayFileSequence(RFile& aFileName)
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
	iDuration = TTimeIntervalMicroSeconds(100);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   805
	iAsyncCallback->MatoPrepareComplete(KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   806
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   807
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   808
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   809
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   810
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   811
void CMMFMdaAudioToneUtility::PrepareToPlayFixedSequence(TInt aSequenceNumber)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   812
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   813
	iDuration = TTimeIntervalMicroSeconds(100);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   814
	iSequenceNumber = aSequenceNumber;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   815
	iAsyncCallback->MatoPrepareComplete(KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   816
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   817
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   818
void CMMFMdaAudioToneUtility::CancelPrepare()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   819
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   820
	if (iState == EMdaAudioToneUtilityPrepared)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   821
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   822
		iState = EMdaAudioToneUtilityNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   823
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   824
	// Cancel the AO
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   825
	iAsyncCallback->Cancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   826
	}
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
TInt CMMFMdaAudioToneUtility::Pause()
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
	// Handle scenario when Pause is called before playback has started
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   831
	if (iState != EMdaAudioToneUtilityPlaying || (iState == EMdaAudioToneUtilityPlaying && !iInitialized))
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   832
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   833
		return KErrNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   834
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   835
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   836
	iState = EMdaAudioToneUtilityPaused;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   837
	return KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   838
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   839
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   840
TInt CMMFMdaAudioToneUtility::Resume()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   841
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   842
	if (iState != EMdaAudioToneUtilityPaused)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   843
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   844
		return KErrNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   845
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   846
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   847
	iState = EMdaAudioToneUtilityPlaying;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   848
	return KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   849
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   850
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   851
void CMMFMdaAudioToneUtility::Play()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   852
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   853
	TInt error = KErrNone;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   854
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   855
	if ((iState == EMdaAudioToneUtilityPlaying) || (iState == EMdaAudioToneUtilityPaused) || iPlayCalled)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   856
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   857
		iState = EMdaAudioToneUtilityNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   858
		iAsyncCallback->MatoPlayComplete(error);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   859
		return;
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
			
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   862
	iState = EMdaAudioToneUtilityPlaying;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   863
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   864
	if (iInitialized)
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
		// Play() is called after InitializeComplete()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   867
		if (iInitializeState)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   868
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   869
			// InitializeComplete() with error other than KErrNone
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   870
			iState = EMdaAudioToneUtilityNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   871
			iAsyncCallback->MatoPlayComplete(iInitializeState);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   872
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   873
		else
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
			PlayAfterInitialized();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   876
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   877
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   878
	else
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   879
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   880
		// Play() is called before InitializeComplete()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   881
		iPlayCalled = ETrue;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   882
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   883
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   884
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   885
void CMMFMdaAudioToneUtility::PlayAfterInitialized()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   886
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   887
#ifdef _DEBUG
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   888
	if (iInitialized == EFalse)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   889
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   890
		iPlayCalledBeforeInitialized = ETrue;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   891
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   892
#endif
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
	// Really play something!
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   895
	// TRAP(error, iDevSound->PlayToneL(c->Frequency(), c->Duration()));
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   896
	iTimer->Play(iDuration);
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
#if 0 // the error case 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   899
	iState = EMdaAudioToneUtilityNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   900
	iAsyncCallback->MatoPlayComplete(error);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   901
	return;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   902
#endif
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   903
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   904
	if(iPlayStartObserver)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   905
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   906
		iAsyncCallback->MatoPlayStarted(KErrNone);
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
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   909
	
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   910
void CMMFMdaAudioToneUtility::CancelPlay()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   911
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   912
	iTimer->Cancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   913
	if(iState == EMdaAudioToneUtilityPlaying || iState == EMdaAudioToneUtilityPaused)
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
		iState = EMdaAudioToneUtilityPrepared;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   916
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   917
	// Cancel the AO
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   918
	iAsyncCallback->Cancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   919
	iPlayCalled = EFalse;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   920
	}
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   923
void CMMFMdaAudioToneUtility::SendEventToClient(const TMMFEvent& /*aEvent*/)
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
	if(iState == EMdaAudioToneUtilityPlaying)
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
		iState = EMdaAudioToneUtilityPrepared;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   928
		}
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
	iAsyncCallback->MatoPlayComplete(KErrInUse);
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
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
void CMMFMdaAudioToneUtility::RegisterPlayStartCallback(MMdaAudioTonePlayStartObserver& aObserver)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   935
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   936
	iPlayStartObserver = &aObserver;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   937
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   938
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   939
void CMMFMdaAudioToneUtility::MatoPrepareComplete(TInt aError)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   940
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   941
	if (!aError)
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
		iState = EMdaAudioToneUtilityPrepared;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   944
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   945
	else 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   946
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   947
		iState = EMdaAudioToneUtilityNotReady;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   948
		}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   949
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   950
	iCallback.MatoPrepareComplete(aError);
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
void CMMFMdaAudioToneUtility::MatoPlayComplete(TInt aError)
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
	iState = EMdaAudioToneUtilityPrepared;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   956
	iCallback.MatoPlayComplete(aError);
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   959
void CMMFMdaAudioToneUtility::MatoPlayStarted(TInt aError)
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
	__ASSERT_DEBUG(aError==KErrNone, Panic(EPlayStartedCalledWithError));
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
	// Not always there is an observer registered
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   964
	if(iPlayStartObserver)
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
		iPlayStartObserver->MatoPlayStarted(aError);
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
	}
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
// CustomInferface - just pass on to DevSound. 
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   971
TAny* CMMFMdaAudioToneUtility::CustomInterface(TUid aInterfaceId)
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
	return 0;
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   976
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   977
CMMFMdaAudioToneObserverCallback* CMMFMdaAudioToneObserverCallback::NewL(MMdaAudioToneObserver& aCallback, MMdaAudioTonePlayStartObserver& aPlayStartCallback)
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
	return new(ELeave) CMMFMdaAudioToneObserverCallback(aCallback, aPlayStartCallback);
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
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   982
CMMFMdaAudioToneObserverCallback::CMMFMdaAudioToneObserverCallback(MMdaAudioToneObserver& aCallback, MMdaAudioTonePlayStartObserver& aPlayStartCallback) :
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   983
	CActive(CActive::EPriorityHigh),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   984
	iCallback(aCallback),
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   985
	iPlayStartCallback(aPlayStartCallback)
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
	CActiveScheduler::Add(this);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   988
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   989
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   990
CMMFMdaAudioToneObserverCallback::~CMMFMdaAudioToneObserverCallback()
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   991
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   992
	Cancel();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   993
	}
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
void CMMFMdaAudioToneObserverCallback::MatoPrepareComplete(TInt aError)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   996
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   997
	iAction = EPrepareComplete;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
   998
	iErrorCode = aError;
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
	TRequestStatus* s = &iStatus;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1001
	SetActive();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1002
	User::RequestComplete(s, KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1003
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1004
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1005
void CMMFMdaAudioToneObserverCallback::MatoPlayComplete(TInt aError)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1006
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1007
    if(!IsActive())
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1008
        {
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1009
        iAction = EPlayComplete;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1010
        iErrorCode = aError;
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
        TRequestStatus* s = &iStatus;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1013
        SetActive();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1014
        User::RequestComplete(s, KErrNone);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1015
        }
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1016
	}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1017
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1018
void CMMFMdaAudioToneObserverCallback::MatoPlayStarted(TInt aError)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1019
	{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1020
	iAction = EPlayStarted;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1021
	iErrorCode = aError;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1022
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1023
	TRequestStatus* s = &iStatus;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1024
	SetActive();
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1025
	User::RequestComplete(s, KErrNone);
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
void CMMFMdaAudioToneObserverCallback::RunL()
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
	switch (iAction)
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1031
		{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1032
		case EPrepareComplete:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1033
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1034
			iCallback.MatoPrepareComplete(iErrorCode);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1035
			break;
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
		case EPlayComplete:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1038
			{
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1039
			iCallback.MatoPlayComplete(iErrorCode);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1040
			break;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1041
			}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1042
		case EPlayStarted:
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1043
			iPlayStartCallback.MatoPlayStarted(iErrorCode);
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1044
			break;
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1045
		}
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 CMMFMdaAudioToneObserverCallback::DoCancel()
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
	//nothing to cancel
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
void MMMFClientUtility::ReservedVirtual1() {}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1054
void MMMFClientUtility::ReservedVirtual2() {}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1055
void MMMFClientUtility::ReservedVirtual3() {}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1056
void MMMFClientUtility::ReservedVirtual4() {}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1057
void MMMFClientUtility::ReservedVirtual5() {}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1058
void MMMFClientUtility::ReservedVirtual6() {}
a2070821d450 Add William's draft of mediaclientaudio stub.
markw <markw@symbian.org>
parents:
diff changeset
  1059