author | hgs |
Fri, 15 Oct 2010 16:26:27 +0300 | |
changeset 57 | 21be958eb3ce |
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 |
{ |
|
57 | 44 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 45 |
iAudioRouter->UnRegisterRoutableAudio( this ); |
46 |
delete iAudioOutput; |
|
47 |
delete iAudioRouter; |
|
48 |
} |
|
49 |
||
50 |
||
51 |
// --------------------------------------------------------------------------- |
|
52 |
// |
|
53 |
// --------------------------------------------------------------------------- |
|
54 |
// |
|
55 |
EXPORT_C void CRadioRoutableAudio::SetAudioOutput( CAudioOutput* aAudioOutput ) |
|
56 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
57 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 58 |
delete iAudioOutput; |
59 |
iAudioOutput = aAudioOutput; |
|
60 |
} |
|
61 |
||
62 |
// --------------------------------------------------------------------------- |
|
63 |
// |
|
64 |
// --------------------------------------------------------------------------- |
|
65 |
// |
|
66 |
EXPORT_C void CRadioRoutableAudio::DeleteAudioOutput() |
|
67 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
68 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 69 |
delete iAudioOutput; |
70 |
iAudioOutput = NULL; |
|
71 |
} |
|
72 |
||
73 |
// --------------------------------------------------------------------------- |
|
74 |
// |
|
75 |
// --------------------------------------------------------------------------- |
|
76 |
// |
|
77 |
EXPORT_C void CRadioRoutableAudio::SetAudioRouteL( RadioEngine::TRadioAudioRoute aRoute ) |
|
78 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
79 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 80 |
if ( iAudioOutput ) |
81 |
{ |
|
82 |
iAudioOutput->SetAudioOutputL( aRoute == RadioEngine::ERadioSpeaker ? CAudioOutput::EPublic |
|
83 |
: CAudioOutput::EPrivate ); |
|
84 |
} |
|
85 |
} |
|
86 |
||
87 |
// --------------------------------------------------------------------------- |
|
88 |
// |
|
89 |
// --------------------------------------------------------------------------- |
|
90 |
// |
|
91 |
EXPORT_C TBool CRadioRoutableAudio::AudioRoutingSupported() const |
|
92 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
93 |
LEVEL3( LOG_METHOD_AUTO ); |
24 | 94 |
#ifdef __WINS__ |
95 |
return ETrue; |
|
96 |
#else |
|
97 |
return iAudioOutput ? ETrue : EFalse; |
|
98 |
#endif |
|
99 |
} |