author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:33:45 +0100 | |
branch | GCC_SURGE |
changeset 37 | 451b2e1545b2 |
parent 14 | 63aabac4416d |
parent 28 | 075425b8d9a4 |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <AudioOutput.h> |
|
20 |
||
21 |
// User includes |
|
22 |
#include "cradioroutableaudio.h" |
|
23 |
#include "cradioaudiorouter.h" |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
24 |
#include "cradioenginelogger.h" |
24 | 25 |
|
26 |
||
27 |
// --------------------------------------------------------------------------- |
|
28 |
// |
|
29 |
// --------------------------------------------------------------------------- |
|
30 |
// |
|
31 |
EXPORT_C CRadioRoutableAudio::CRadioRoutableAudio( CRadioAudioRouter* aAudioRouter ) |
|
32 |
: iAudioRouter( aAudioRouter ) |
|
33 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
34 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 35 |
iAudioRouter->RegisterRoutableAudio( this ); |
36 |
} |
|
37 |
||
38 |
// --------------------------------------------------------------------------- |
|
39 |
// |
|
40 |
// --------------------------------------------------------------------------- |
|
41 |
// |
|
42 |
EXPORT_C CRadioRoutableAudio::~CRadioRoutableAudio() |
|
43 |
{ |
|
44 |
iAudioRouter->UnRegisterRoutableAudio( this ); |
|
45 |
delete iAudioOutput; |
|
46 |
delete iAudioRouter; |
|
47 |
} |
|
48 |
||
49 |
||
50 |
// --------------------------------------------------------------------------- |
|
51 |
// |
|
52 |
// --------------------------------------------------------------------------- |
|
53 |
// |
|
54 |
EXPORT_C void CRadioRoutableAudio::SetAudioOutput( CAudioOutput* aAudioOutput ) |
|
55 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
56 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 57 |
delete iAudioOutput; |
58 |
iAudioOutput = aAudioOutput; |
|
59 |
} |
|
60 |
||
61 |
// --------------------------------------------------------------------------- |
|
62 |
// |
|
63 |
// --------------------------------------------------------------------------- |
|
64 |
// |
|
65 |
EXPORT_C void CRadioRoutableAudio::DeleteAudioOutput() |
|
66 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
67 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 68 |
delete iAudioOutput; |
69 |
iAudioOutput = NULL; |
|
70 |
} |
|
71 |
||
72 |
// --------------------------------------------------------------------------- |
|
73 |
// |
|
74 |
// --------------------------------------------------------------------------- |
|
75 |
// |
|
76 |
EXPORT_C void CRadioRoutableAudio::SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute ) |
|
77 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
78 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 79 |
if ( iAudioOutput ) |
80 |
{ |
|
81 |
iAudioOutput->SetAudioOutputL( aRoute == RadioEngine::ERadioSpeaker ? CAudioOutput::EPublic |
|
82 |
: CAudioOutput::EPrivate ); |
|
83 |
} |
|
84 |
} |
|
85 |
||
86 |
// --------------------------------------------------------------------------- |
|
87 |
// |
|
88 |
// --------------------------------------------------------------------------- |
|
89 |
// |
|
90 |
EXPORT_C TBool CRadioRoutableAudio::AudioRoutingSupported() const |
|
91 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
92 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 93 |
#ifdef __WINS__ |
94 |
return ETrue; |
|
95 |
#else |
|
96 |
return iAudioOutput ? ETrue : EFalse; |
|
97 |
#endif |
|
98 |
} |