17 |
17 |
18 #include "glxtv.h" // for CGlxTv |
18 #include "glxtv.h" // for CGlxTv |
19 #include "glxtvconnectionobserver.h" |
19 #include "glxtvconnectionobserver.h" |
20 #include "glxtvoutwrapper_p.h" |
20 #include "glxtvoutwrapper_p.h" |
21 |
21 |
|
22 #include <glxtracer.h> |
|
23 #include <glxlog.h> |
22 |
24 |
23 // ----------------------------------------------------------------------------- |
25 // ----------------------------------------------------------------------------- |
24 // NewL |
26 // NewL |
25 // ----------------------------------------------------------------------------- |
27 // ----------------------------------------------------------------------------- |
26 CGlxConnectionObserver* CGlxConnectionObserver::NewL(GlxTvOutWrapperPrivate* aTvWrapperPrivate) |
28 CGlxConnectionObserver* CGlxConnectionObserver::NewL(GlxTvOutWrapperPrivate* aTvWrapperPrivate) |
27 { |
29 { |
|
30 TRACER("CGlxConnectionObserver::NewL()"); |
28 CGlxConnectionObserver* self = new (ELeave)CGlxConnectionObserver(aTvWrapperPrivate); |
31 CGlxConnectionObserver* self = new (ELeave)CGlxConnectionObserver(aTvWrapperPrivate); |
29 self->ConstructL(); |
32 self->ConstructL(); |
30 return self; |
33 return self; |
31 } |
34 } |
32 |
35 |
33 // ----------------------------------------------------------------------------- |
36 // ----------------------------------------------------------------------------- |
34 // ConstructL |
37 // ConstructL |
35 // ----------------------------------------------------------------------------- |
38 // ----------------------------------------------------------------------------- |
36 void CGlxConnectionObserver::ConstructL() |
39 void CGlxConnectionObserver::ConstructL() |
37 { |
40 { |
|
41 TRACER("CGlxConnectionObserver::ConstructL()"); |
38 iGlxTvOut = CGlxTv::NewL(*this); |
42 iGlxTvOut = CGlxTv::NewL(*this); |
39 } |
43 } |
40 |
44 |
41 // ----------------------------------------------------------------------------- |
45 // ----------------------------------------------------------------------------- |
42 // Constructor |
46 // Constructor |
43 // ----------------------------------------------------------------------------- |
47 // ----------------------------------------------------------------------------- |
44 CGlxConnectionObserver::CGlxConnectionObserver(GlxTvOutWrapperPrivate* aTvWrapperPrivate): |
48 CGlxConnectionObserver::CGlxConnectionObserver(GlxTvOutWrapperPrivate* aTvWrapperPrivate): |
45 iTvWrapperPrivate(aTvWrapperPrivate) |
49 iTvWrapperPrivate(aTvWrapperPrivate) |
46 { |
50 { |
|
51 TRACER("CGlxConnectionObserver::CGlxConnectionObserver()"); |
47 // ctor |
52 // ctor |
48 } |
53 } |
49 |
54 |
50 // ----------------------------------------------------------------------------- |
55 // ----------------------------------------------------------------------------- |
51 // Destructor |
56 // Destructor |
52 // ----------------------------------------------------------------------------- |
57 // ----------------------------------------------------------------------------- |
53 CGlxConnectionObserver::~CGlxConnectionObserver() |
58 CGlxConnectionObserver::~CGlxConnectionObserver() |
54 { |
59 { |
|
60 TRACER("CGlxConnectionObserver::~CGlxConnectionObserver()"); |
55 if (iGlxTvOut){ |
61 if (iGlxTvOut){ |
56 delete iGlxTvOut; |
62 delete iGlxTvOut; |
57 iGlxTvOut = NULL; |
63 iGlxTvOut = NULL; |
58 } |
64 } |
59 } |
65 } |
61 // ----------------------------------------------------------------------------- |
67 // ----------------------------------------------------------------------------- |
62 // HandleTvStatusChangedL |
68 // HandleTvStatusChangedL |
63 // ----------------------------------------------------------------------------- |
69 // ----------------------------------------------------------------------------- |
64 void CGlxConnectionObserver::HandleTvStatusChangedL(TTvChangeType aChangeType) |
70 void CGlxConnectionObserver::HandleTvStatusChangedL(TTvChangeType aChangeType) |
65 { |
71 { |
|
72 TRACER("CGlxConnectionObserver::HandleTvStatusChangedL()"); |
66 if ( aChangeType == ETvConnectionChanged ){ |
73 if ( aChangeType == ETvConnectionChanged ){ |
67 if ( iGlxTvOut->IsHDMIConnected() ){ |
74 if ( iGlxTvOut->IsHDMIConnected() ) |
|
75 { |
|
76 GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI and TV Connected"); |
68 iTvWrapperPrivate->HandleConnectionChange(ETrue); |
77 iTvWrapperPrivate->HandleConnectionChange(ETrue); |
69 // emit HDMI connected signal |
|
70 } |
78 } |
71 else{ |
79 else{ |
|
80 GLX_LOG_INFO("CGlxConnectionObserver::HandleTvStatusChangedL() - DisConnected"); |
72 iTvWrapperPrivate->HandleConnectionChange(EFalse); |
81 iTvWrapperPrivate->HandleConnectionChange(EFalse); |
73 // emit HDMI disconnected |
|
74 } |
82 } |
75 } |
83 } |
76 } |
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // IsHdmiConnected |
|
88 // ----------------------------------------------------------------------------- |
|
89 TBool CGlxConnectionObserver::IsHdmiConnected() |
|
90 { |
|
91 TRACER("CGlxConnectionObserver::IsHdmiConnected()"); |
|
92 return iGlxTvOut->IsHDMIConnected(); |
|
93 } |