|
1 /* |
|
2 * Copyright (c) 2004 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 |
|
19 |
|
20 |
|
21 // INCLUDES |
|
22 #include "createSpeakerSinkDialog.h" |
|
23 #include "CMCETestUIEngineAudioStream.h" |
|
24 #include "CMCETestUIEngineSink.h" |
|
25 #include <MCEAudioStream.h> |
|
26 #include <MCESpeakerSink.h> |
|
27 #include <MCEMediaSink.h> |
|
28 // CONSTANTS |
|
29 |
|
30 const TInt KBufLength = 100; |
|
31 |
|
32 // ============================ MEMBER FUNCTIONS ============================== |
|
33 |
|
34 // ---------------------------------------------------------------------------- |
|
35 // CCreateSpeakerSinkDialog::CCreateSpeakerSinkDialog( ) |
|
36 // . |
|
37 // ---------------------------------------------------------------------------- |
|
38 // |
|
39 CCreateSpeakerSinkDialog::CCreateSpeakerSinkDialog( |
|
40 CMCETestUIEngineAudioStream& aStream, TInt aIndex ) : |
|
41 iStream(aStream),iSinkIndex( aIndex ) |
|
42 { |
|
43 |
|
44 // No implementation required |
|
45 } |
|
46 |
|
47 // ---------------------------------------------------------------------------- |
|
48 // CCreateSpeakerSinkDialog::PreLayoutDynInitL() |
|
49 // . |
|
50 // ---------------------------------------------------------------------------- |
|
51 // |
|
52 void CCreateSpeakerSinkDialog::PreLayoutDynInitL() |
|
53 { |
|
54 CAknForm::PreLayoutDynInitL(); |
|
55 |
|
56 const RPointerArray<CMCETestUIEngineSink>& sinks = |
|
57 iStream.SinksL(); |
|
58 CMceMediaSink& mediaSink = static_cast<CMceMediaSink&>(sinks[iSinkIndex]->Sink()); |
|
59 CMceSpeakerSink& speakerSink = static_cast<CMceSpeakerSink&>(mediaSink); |
|
60 |
|
61 CEikNumberEditor* volume = static_cast<CEikNumberEditor*>( |
|
62 Control( ESpeakerSinkVolumeSetting ) ); |
|
63 volume->SetNumber(speakerSink.VolumeL()); |
|
64 // volume->SetNumber(50); |
|
65 |
|
66 CEikNumberEditor* routing = static_cast<CEikNumberEditor*>( |
|
67 Control( ESpeakerSinkRoutingSetting ) ); |
|
68 routing->SetNumber(speakerSink.RoutingL()); |
|
69 |
|
70 |
|
71 } |
|
72 |
|
73 // ---------------------------------------------------------------------------- |
|
74 // CCreateSpeakerSinkDialog::OkToExitL( TInt ) |
|
75 // . |
|
76 // ---------------------------------------------------------------------------- |
|
77 // |
|
78 |
|
79 TBool CCreateSpeakerSinkDialog::OkToExitL( TInt aKey ) |
|
80 { |
|
81 if ( aKey == EEikCmdCanceled ) |
|
82 { |
|
83 // Cancel pressed. Just exit. |
|
84 return ETrue; |
|
85 } |
|
86 const RPointerArray<CMCETestUIEngineSink>& sinks = |
|
87 iStream.SinksL(); |
|
88 |
|
89 CMceMediaSink& mediaSink = static_cast<CMceMediaSink&>(sinks[iSinkIndex]->Sink()); |
|
90 CMceSpeakerSink& speakerSink = static_cast<CMceSpeakerSink&>(mediaSink); |
|
91 |
|
92 CEikNumberEditor* volume = static_cast<CEikNumberEditor*>( |
|
93 Control( ESpeakerSinkVolumeSetting ) ); |
|
94 speakerSink.SetVolumeL( volume->Number() ); |
|
95 |
|
96 CEikNumberEditor* routing = static_cast<CEikNumberEditor*>( |
|
97 Control( ESpeakerSinkRoutingSetting ) ); |
|
98 speakerSink.SetRoutingL( routing->Number() ); |
|
99 return ETrue; |
|
100 } |
|
101 |
|
102 // ---------------------------------------------------------------------------- |
|
103 // CCreateSpeakerSinkDialog::~CCreateRtpSinkDialog() |
|
104 // . |
|
105 // ---------------------------------------------------------------------------- |
|
106 // |
|
107 CCreateSpeakerSinkDialog::~CCreateSpeakerSinkDialog() |
|
108 { |
|
109 return; |
|
110 } |
|
111 |
|
112 // End of File |