diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/client/vgui_video_player.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/client/vgui_video_player.h')
| -rw-r--r-- | sp/src/game/client/vgui_video_player.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/sp/src/game/client/vgui_video_player.h b/sp/src/game/client/vgui_video_player.h new file mode 100644 index 00000000..58a3400a --- /dev/null +++ b/sp/src/game/client/vgui_video_player.h @@ -0,0 +1,88 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// VGUI_VIDEO_PLAYER
+//
+// Creates a VGUI Panel that can play a video in engine with "media player like"
+// functionality. vgui_video.h has a basic player panel, but this allows for
+// much greater control over playback, etc
+//
+//=============================================================================
+
+#ifndef VGUI_VIDEO_PLAYER
+#define VGUI_VIDEO_PLAYER
+
+#ifdef _WIN32
+ #pragma once
+#endif
+
+#include <vgui_controls/Panel.h>
+#include "video/ivideoservices.h"
+
+
+class VideoPlayerPanel : public vgui::Panel // Should this be EditablePanel ?
+{
+ public:
+
+ DECLARE_CLASS_SIMPLE( VideoPlayerPanel, vgui::Panel );
+
+ VideoPlayerPanel( vgui::Panel *parent, const char *panelName, int nXpos, int nYpos, int nWidth, int nHeight, const char *pVideoFile = NULL );
+
+ virtual ~VideoPlayerPanel();
+
+ virtual void Activate( void );
+ virtual void Paint( void );
+ virtual void OnClose( void );
+
+ bool SetVideo( const char *pVideoFile );
+ void ClearVideo();
+ bool IsReady() { return m_VideoLoaded; }
+
+ bool StartVideo();
+ bool StopVideo();
+ bool PauseVideo();
+ bool UnpauseVideo();
+ bool IsPlaying() { return m_VideoPlaying; }
+ bool IsPaused() { return m_VideoPaused; }
+
+ float GetCurrentPlaybackTime();
+ bool SetCurrentPlaybackTime( float newTime );
+
+ float GetVideoDuration() { return m_VideoDuration; }
+ bool HasAudio();
+
+ bool IsMuted();
+ bool SetMute( bool muted );
+
+ float GetVolume();
+ bool SetVolume( float newVolume );
+
+
+ protected:
+
+ virtual void OnTick( void ) { BaseClass::OnTick(); }
+ virtual void OnCommand( const char *pcCommand ) { BaseClass::OnCommand( pcCommand ); }
+
+ private:
+
+ IVideoMaterial *m_VideoMaterial;
+ IMaterial *m_pMaterial;
+
+ bool m_VideoLoaded;
+ bool m_VideoPlaying;
+ bool m_VideoPaused;
+
+ int m_nPlaybackHeight; // Calculated to address ratio changes
+ int m_nPlaybackWidth;
+ int m_letterBox;
+
+ float m_flU, m_flV;
+
+ char *m_VideoFileName;
+ float m_VideoDuration;
+
+
+
+};
+
+#endif
+
|