aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llmediaremotectrl.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llmediaremotectrl.h')
-rw-r--r--linden/indra/newview/llmediaremotectrl.h92
1 files changed, 11 insertions, 81 deletions
diff --git a/linden/indra/newview/llmediaremotectrl.h b/linden/indra/newview/llmediaremotectrl.h
index 605be04..4f4ba77 100644
--- a/linden/indra/newview/llmediaremotectrl.h
+++ b/linden/indra/newview/llmediaremotectrl.h
@@ -30,94 +30,24 @@
30#define LL_LLMEDIAREMOTECTRL_H 30#define LL_LLMEDIAREMOTECTRL_H
31 31
32#include "llpanel.h" 32#include "llpanel.h"
33#include "llvolumesliderctrl.h"
34#include "lleventemitter.h"
35 33
36//////////////////////////////////////////////////////////////////////////////// 34////////////////////////////////////////////////////////////////////////////////
37// 35//
38class LLMediaRemoteCtrlEvent 36class LLMediaRemoteCtrl : public LLPanel
39{
40 public:
41 LLMediaRemoteCtrlEvent ( LLUICtrl* controlIn, F32 valueIn ):
42 control ( controlIn ),
43 value ( valueIn )
44 {
45 };
46
47 virtual ~LLMediaRemoteCtrlEvent () { }
48
49 LLUICtrl* getControl () const { return control; };
50 F32 getValue () const { return value; };
51
52 private:
53 LLUICtrl* control;
54 F32 value;
55};
56
57////////////////////////////////////////////////////////////////////////////////
58//
59class LLMediaRemoteCtrlObserver
60{ 37{
61public: 38public:
62 typedef LLMediaRemoteCtrlEvent EventType; 39 LLMediaRemoteCtrl ( const LLString& name,
63 virtual ~LLMediaRemoteCtrlObserver() {} 40 const LLString& label,
64 virtual void onVolumeChange ( const EventType& eventIn ) { }; 41 const LLRect& rect,
65 virtual void onStopButtonPressed ( const EventType& eventIn ) { }; 42 const LLString& xml_file );
66 virtual void onPlayButtonPressed ( const EventType& eventIn ) { };
67 virtual void onPauseButtonPressed ( const EventType& eventIn ) { };
68};
69
70////////////////////////////////////////////////////////////////////////////////
71//
72class LLMediaRemoteCtrl :
73 public LLPanel
74{
75 public:
76 LLMediaRemoteCtrl ( const std::string& name,
77 const std::string& label,
78 const LLRect& rect,
79 const std::string& xml_file );
80 43
81 virtual ~LLMediaRemoteCtrl (); 44 virtual ~LLMediaRemoteCtrl ();
82 45 virtual BOOL postBuild();
83 virtual EWidgetType getWidgetType() const;
84 virtual LLString getWidgetTag() const;
85
86 // set current transport state of remote control
87 enum TransportState { Stop, Play, Pause };
88 void setTransportState ( TransportState transportStateIn, BOOL pauseEnabled );
89 TransportState getTransportState ();
90 void setVolume ( F32 volumeIn );
91
92 // allow consumers to observe remote control events
93 virtual BOOL addObserver ( LLMediaRemoteCtrlObserver* observerIn )
94 {
95 return mediaRemoteCtrlEventEmitter.addObserver ( observerIn );
96 };
97 virtual BOOL remObserver ( LLMediaRemoteCtrlObserver* observerIn )
98 {
99 return mediaRemoteCtrlEventEmitter.remObserver ( observerIn );
100 };
101 46
102 private: 47 virtual void draw();
103 LLVolumeSliderCtrl* mVolumeSlider; 48
104 LLRect volumeSliderRect; 49 virtual EWidgetType getWidgetType() const;
105 50 virtual LLString getWidgetTag() const;
106 TransportState transportState;
107
108 LLTextBox* titleLabel;
109 LLButton* playButton;
110 LLButton* pauseButton;
111 LLButton* stopButton;
112
113 // event emitter
114 eventEmitter < LLMediaRemoteCtrlObserver > mediaRemoteCtrlEventEmitter;
115
116 // callbacks
117 static void onCommitVolume ( LLUICtrl* ctrl, void* data );
118 static void onPlayButton ( void* data );
119 static void onPauseButton ( void* data );
120 static void onStopButton ( void* data );
121}; 51};
122 52
123#endif 53#endif