|
1 /* |
|
2 * Copyright (c) 2008 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: Audio configuration implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "mvtprotocolhandler.h" |
|
19 #include "caudioconfighandler.h" |
|
20 |
|
21 #ifdef _DEBUG |
|
22 # define __IF_DEBUG(t) {RDebug::t;} |
|
23 #else |
|
24 # define __IF_DEBUG(t) |
|
25 #endif |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // TAudioConfigHandler::TAudioConfigHandler |
|
29 // Constructor. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 TAudioConfigHandler::TAudioConfigHandler(MVtProtocolHandler* aProtocolHandler) : iProtocolHandler(aProtocolHandler) |
|
33 { |
|
34 __IF_DEBUG(Print(_L("VTProto: TAudioConfigHandler::TAudioConfigHandler<"))); |
|
35 __IF_DEBUG(Print(_L("VTProto: TAudioConfigHandler::TAudioConfigHandler>"))); |
|
36 } |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // CAudioConfigCommand::CAudioConfigCommand |
|
40 // Constructor. |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CAudioConfigCommand::CAudioConfigCommand() |
|
44 { |
|
45 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::CAudioConfigCommand<"))); |
|
46 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::CAudioConfigCommand>"))); |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CAudioConfigCommand::SetObserverL |
|
51 // This API allows the user to specify observers for the 324m interface. |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 void CAudioConfigCommand::SetObserverL(MVtProtocolHandler* aHandler) |
|
55 { |
|
56 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::SetObserverL<"))); |
|
57 iAudioConfigHandler = new (ELeave)TAudioConfigHandler(aHandler); |
|
58 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::SetObserverL>"))); |
|
59 } |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // CAudioConfigCommand::SetAudioVolumeL |
|
63 // Method to set the playback volume to the specified value. |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 TInt CAudioConfigCommand::SetAudioVolumeL(TInt aVolume) |
|
67 { |
|
68 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::SetAudioVolumeL"))); |
|
69 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::SetAudioVolumeL aVolume %d"), aVolume)); |
|
70 return KErrNone; |
|
71 } |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // CAudioConfigCommand::GetMaxAudioVolumeL |
|
75 // Method to get the maximum valid value for the playback volume. |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 TInt CAudioConfigCommand::GetMaxAudioVolumeL(TInt& aMaxVolume) |
|
79 { |
|
80 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::GetMaxAudioVolumeL"))); |
|
81 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::GetMaxAudioVolumeL aMaxVolume %d"), aMaxVolume)); |
|
82 return KErrNone; |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CAudioConfigCommand::~CAudioConfigCommand |
|
87 // Destructor. |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 CAudioConfigCommand::~CAudioConfigCommand() |
|
91 { |
|
92 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::~CAudioConfigCommand>"))); |
|
93 delete iAudioConfigHandler; |
|
94 __IF_DEBUG(Print(_L("VTProto: CAudioConfigCommand::~CAudioConfigCommand"))); |
|
95 } |
|
96 // End of File |
|
97 |