PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PlatformMovie.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/platforms/sdl/PlatformMovie.h
4// Purpose: Contains SDL platform-specific movie playing
5// code (using waave library)
6// Author: Shane T. Mueller, Ph.D.
7// Copyright: (c) 2012-2026 Shane T. Mueller <smueller@obereed.net>
8// License: GPL 2
9//
10//
11//
12// This file is part of the PEBL project.
13//
14// PEBL is free software; you can redistribute it and/or modify
15// it under the terms of the GNU General Public License as
16// published by the Free Software Foundation; either version 2
17// of the License, or (at your option) any later version.
18//
19// PEBL is distributed in the hope that it will be useful,
20// but WITHOUT ANY WARRANTY; without even the implied warranty of
21// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22// GNU General Public License for more details.
23//
24// You should have received a copy of the GNU General Public
25// License along with PEBL; if not, write to the Free Software
26// Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27// MA 02111-1307 USA
29#ifndef __PLATFORMMOVIE_H__
30#define __PLATFORMMOVIE_H__
31
32#include "PlatformWidget.h"
33#include "PlatformWindow.h"
34#include "../../objects/PMovie.h"
35#include "../../base/PEBLObject.h"
36
37
38#ifdef PEBL_OSX
39#include "SDL.h"
40#else
41#include "SDL.h"
42#endif
43
44#ifdef PEBL_MOVIES
45#include "WAAVE.h"
46
47#include <string>
51
52
53class PlatformMovie: virtual public PMovie, virtual public PlatformWidget
54{
55public:
56
57 PlatformMovie();
58 PlatformMovie(PlatformMovie & movie);
59 virtual ~PlatformMovie();
60
61 virtual bool LoadMovie(const std::string & imagefilename,
62 PlatformWindow* window,
63 int width, int height);
64
65 virtual bool LoadAudioFile(const std::string & imagefilename);
66
67
68
69 virtual void StartPlayback();
70 virtual void PausePlayback();
71
72 virtual std::string ObjectName() const{return "PlatformMovie";};
73
74 virtual void RefreshVideo(SDL_Event & event);
75
76
77 virtual WVStream * GetStream(){return mStream;};
78 virtual WVStreamingObject * GetStreamingObj(){return mStreamObj;};
79
80
81 virtual int GetState(int interface) const;
82
83 virtual void SetPosition(int x, int y);
84 virtual void SetWidth(int w);
85 virtual void SetHeight(int h);
86
87 virtual void SetPlaybackPosition(unsigned long int x);
88 virtual void SetVolume(long double vol);
89
90 virtual Variant GetProperty(std::string name)const;
91protected:
92
93 virtual std::ostream & SendToStream(std::ostream& out) const;
94 SDL_Surface * GetSurface();
95
96
97private:
98
99 /* playing stream */
100 PlatformWindow *mWindow; //movie needs to be attached to a window!
101 //SDL_Overlay * mOverlay;
102 WVStream * mStream;
103 WVStreamingObject* mStreamObj;
104
105
106
107
108};
109
110#endif
111#endif
Variant StartPlayback(Variant v)
Variant GetProperty(Variant v)
Variant PausePlayback(Variant v)
Variant LoadMovie(Variant v)
Variant LoadAudioFile(Variant v)