2014-03-27 18:10:15 +00:00
|
|
|
#ifndef OPENMW_MWGUI_VIDEOWIDGET_H
|
|
|
|
#define OPENMW_MWGUI_VIDEOWIDGET_H
|
|
|
|
|
2015-05-01 01:03:44 +00:00
|
|
|
#include <MyGUI_Widget.h>
|
2014-03-27 18:10:15 +00:00
|
|
|
|
2015-01-10 00:00:52 +00:00
|
|
|
namespace Video
|
|
|
|
{
|
|
|
|
class VideoPlayer;
|
|
|
|
}
|
2014-03-27 18:10:15 +00:00
|
|
|
|
2015-05-01 01:03:44 +00:00
|
|
|
namespace VFS
|
|
|
|
{
|
|
|
|
class Manager;
|
|
|
|
}
|
|
|
|
|
2014-03-27 18:10:15 +00:00
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2014-06-09 23:57:54 +00:00
|
|
|
* Widget that plays a video.
|
2014-03-27 18:10:15 +00:00
|
|
|
*/
|
2015-05-01 01:03:44 +00:00
|
|
|
class VideoWidget : public MyGUI::Widget
|
2014-03-27 18:10:15 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
MYGUI_RTTI_DERIVED(VideoWidget)
|
|
|
|
|
|
|
|
VideoWidget();
|
|
|
|
|
2015-05-01 01:03:44 +00:00
|
|
|
/// Set the VFS (virtual file system) to find the videos on.
|
|
|
|
void setVFS(const VFS::Manager* vfs);
|
|
|
|
|
2014-06-09 23:57:54 +00:00
|
|
|
void playVideo (const std::string& video);
|
2014-03-27 18:10:15 +00:00
|
|
|
|
|
|
|
int getVideoWidth();
|
|
|
|
int getVideoHeight();
|
|
|
|
|
|
|
|
/// @return Is the video still playing?
|
|
|
|
bool update();
|
|
|
|
|
2014-10-22 20:11:03 +00:00
|
|
|
/// Return true if a video is currently playing and it has an audio stream.
|
|
|
|
bool hasAudioStream();
|
|
|
|
|
2014-06-09 23:57:54 +00:00
|
|
|
/// Stop video and free resources (done automatically on destruction)
|
|
|
|
void stop();
|
2014-06-05 13:39:08 +00:00
|
|
|
|
2015-01-27 23:02:05 +00:00
|
|
|
/// Adjust the coordinates of this video widget relative to its parent,
|
|
|
|
/// based on the dimensions of the playing video.
|
|
|
|
/// @param stretch Stretch the video to fill the whole screen? If false,
|
|
|
|
/// black bars may be added to fix the aspect ratio.
|
|
|
|
void autoResize (bool stretch);
|
|
|
|
|
2014-03-27 18:10:15 +00:00
|
|
|
private:
|
2015-05-01 01:03:44 +00:00
|
|
|
const VFS::Manager* mVFS;
|
|
|
|
std::auto_ptr<MyGUI::ITexture> mTexture;
|
|
|
|
std::auto_ptr<Video::VideoPlayer> mPlayer;
|
2014-03-27 18:10:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|