00001
00002
00003
00004 #ifndef Impala_Application_IDash_NfiSixViewControl_h
00005 #define Impala_Application_IDash_NfiSixViewControl_h
00006
00007 #ifndef Impala_Application_IDash_NfiSixView_h
00008 #include "Application/idash/NfiSixView.h"
00009 #endif
00010
00011 #ifndef Impala_Visualization_VideoPlayerButtons_h
00012 #include "Visualization/VideoPlayerButtons.h"
00013 #endif
00014
00015 namespace Impala {
00016 namespace Application {
00017 namespace IDash {
00018
00019 class NfiSixViewControl : public Visualization::VideoPlayerButtons,
00020 public OglGui::RadioGroupListener
00021 {
00022 public:
00023 typedef OglGui::Window Window;
00024 typedef OglGui::RadioGroup RadioGroup;
00025 typedef Impala::Visualization::VideoPlayer VideoPlayer;
00026
00027 NfiSixViewControl(int x, int y, int w, int h, NfiSixView* nfiSixView) :
00028 VideoPlayerButtons(x, y, w, h)
00029 {
00030 Init(w, h, nfiSixView);
00031 }
00032
00033 NfiSixViewControl(Window* parent, int w, int h, NfiSixView* nfiSixView) :
00034 VideoPlayerButtons(parent, w, h)
00035 {
00036 Init(w, h, nfiSixView);
00037 }
00038
00039 NfiSixViewControl(Window* parent, int x, int y, int w, int h,
00040 NfiSixView* nfiSixView) :
00041 VideoPlayerButtons(parent, x, y, w, h)
00042 {
00043 Init(w, h, nfiSixView);
00044 }
00045
00046 void SetNfiSixView(NfiSixView* nfiSixView)
00047 {
00048 if (mNfiSixView = nfiSixView)
00049 MapKeysTo(mNfiSixView);
00050 }
00051
00052 NfiSixView* GetNfiSixView()
00053 {
00054 return mNfiSixView;
00055 }
00056
00057 virtual void OnRadioButton(RadioGroup *src, int button, void* data)
00058 {
00059 if (button == PLAY)
00060 {
00061 mNfiSixView->DoNormalSpeed(true);
00062 mNfiSixView->Play();
00063 }
00064 if (button == STOP)
00065 mNfiSixView->Stop();
00066 if (button == RESET)
00067 mNfiSixView->Rewind();
00068 if (button == INCR)
00069 {
00070 mNfiSixView->Stop();
00071 mNfiSixView->NextFrame(1);
00072 }
00073 if (button == DECR)
00074 {
00075 mNfiSixView->Stop();
00076 mNfiSixView->NextFrame(-1);
00077 }
00078 if (button == FFWD)
00079 mNfiSixView->FFwd();
00080 if (button == FBWD)
00081 mNfiSixView->FBwd();
00082 }
00083
00084 virtual void InitDisplayFunc()
00085 {
00086 VideoPlayerButtons::InitDisplayFunc();
00087
00088 if (mNfiSixView)
00089 {
00090 VideoPlayer* vPlayer = mNfiSixView->GetVideoPlayer(0);
00091 if (vPlayer->Playing())
00092 {
00093 if (vPlayer->FFwding())
00094 SetActiveRadio(FFWD);
00095 else if (vPlayer->FBwding())
00096 SetActiveRadio(FBWD);
00097 else
00098 SetActiveRadio(PLAY);
00099 }
00100 else
00101 SetActiveRadio(STOP);
00102 }
00103 }
00104
00105 private:
00106 void Init(int w, int h, NfiSixView* nfiSixView)
00107 {
00108 SetNfiSixView(nfiSixView);
00109 SetRadioListener(this,0);
00110 }
00111
00112 NfiSixView* mNfiSixView;
00113 };
00114
00115 }
00116 }
00117 }
00118 #endif