root/OpenSceneGraph/trunk/include/osg/ImageStream @ 3317

Revision 3317, 2.6 kB (checked in by robert, 10 years ago)

Added s/getLoopingMode() to ImageStream? and MPEG plugin

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_IMAGESTREAM
15#define OSG_IMAGESTREAM 1
16
17#include <osg/Image>
18
19namespace osg {
20
21/**
22 * Image Stream class.
23 */
24class SG_EXPORT ImageStream : public Image
25{
26    public:
27        ImageStream();
28
29        /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
30        ImageStream(const ImageStream& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
31
32        virtual Object* cloneType() const { return new ImageStream(); }
33        virtual Object* clone(const CopyOp& copyop) const { return new ImageStream(*this,copyop); }
34        virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const ImageStream*>(obj)!=0; }
35        virtual const char* libraryName() const { return "osg"; }
36        virtual const char* className() const { return "ImageStream"; }
37
38        /** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
39        virtual int compare(const Image& rhs) const;
40
41        enum StreamStatus
42        {
43            PLAYING,
44            PAUSED,
45            REWINDING
46        };
47       
48        virtual void play() { _status=PLAYING; }
49
50        virtual void pause() { _status=PAUSED; }
51
52        virtual void rewind() { _status=REWINDING; }
53       
54        virtual void quit(bool /*wiatForThreadToExit*/ = true) {}
55
56        StreamStatus getStatus() { return _status; }
57       
58
59        enum LoopingMode
60        {
61            NO_LOOPING,
62            LOOPING
63        };
64       
65        void setLoopingMode(LoopingMode mode) { _loopingMode = mode; }
66        LoopingMode getLoopingMode() const { return _loopingMode; }
67
68
69        virtual void setReferenceTime(double) {}
70        virtual double getReferenceTime() const { return 0.0; }
71               
72        virtual void setTimeMultiplier(double) {}
73        virtual double getTimeMultiplier() { return 0.0; }
74       
75        virtual void update() {}
76
77    protected:
78
79        virtual ~ImageStream() {}
80
81        StreamStatus    _status;
82        LoopingMode     _loopingMode;
83};
84
85} // namespace
86
87#endif
Note: See TracBrowser for help on using the browser.