~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgPlugins/xine/ReaderWriterXine.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-07-29 04:34:38 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080729043438-no1h9h0dpsrlzp1y
* Non-maintainer upload.
* No longer try to detect (using /proc/cpuinfo when available) how many
  CPUs are available, fixing the FTBFS (due to -j0) on various platforms
  (Closes: #477353). The right way to do it is to support parallel=n in
  DEB_BUILD_OPTIONS (see Debian Policy §4.9.1), and adequate support has
  been implemented.
* Add patch to fix FTBFS due to the build system now refusing to handle
  whitespaces (Policy CMP0004 say the logs), thanks to Andreas Putzo who
  provided it (Closes: #482239):
   - debian/patches/fix-cmp0004-build-failure.dpatch
* Remove myself from Uploaders, as requested a while ago, done by Luk in
  his 2.2.0-2.1 NMU, which was never acknowledged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
            _visual(0),
31
31
            _stream(0),
32
32
            _event_queue(0),
33
 
            _ready(false)
 
33
            _ready(false),
 
34
            _volume(-1.0)
34
35
        {
35
36
            setOrigin(osg::Image::TOP_LEFT);
36
37
        }
41
42
 
42
43
        META_Object(osgXine,XineImageStream);
43
44
        
 
45
        void setVolume(float volume)
 
46
        {
 
47
            _volume = osg::minimum(osg::maximum(volume,0.0f),1.0f);
 
48
            if (_stream) 
 
49
            {
 
50
                xine_set_param(_stream, XINE_PARAM_AUDIO_VOLUME, static_cast<int>(_volume*100.0f));
 
51
                osg::notify(osg::NOTICE)<<"Setting volume "<<_volume<<std::endl;
 
52
            }
 
53
        }
 
54
        
 
55
        float getVolume() const
 
56
        {
 
57
            return _volume;
 
58
        }
 
59
 
44
60
        bool open(xine_t* xine, const std::string& filename)
45
61
        {
46
62
            if (filename==getFileName()) return true;
70
86
 
71
87
            // set up stream
72
88
            _stream = xine_stream_new(_xine, _ao, _vo);
 
89
            
 
90
            if (_stream)
 
91
            {
 
92
                if (_volume < 0.0)
 
93
                {
 
94
                    _volume = static_cast<float>(xine_get_param(_stream, XINE_PARAM_AUDIO_VOLUME))/100.0f;
 
95
                }
 
96
                else
 
97
                {
 
98
                    setVolume(_volume);
 
99
                }
 
100
            }
73
101
 
74
102
            _event_queue = xine_event_new_queue(_stream);
75
103
            xine_event_create_listener_thread(_event_queue, event_listener, this);
200
228
        xine_stream_t*          _stream;
201
229
        xine_event_queue_t*     _event_queue;
202
230
        bool                    _ready;
 
231
        float                   _volume;
203
232
 
204
233
    protected:
205
234
 
312
341
            return osgDB::equalCaseInsensitive(extension,"mpg") ||
313
342
                   osgDB::equalCaseInsensitive(extension,"mpv") || 
314
343
                   osgDB::equalCaseInsensitive(extension,"db") || 
 
344
                   osgDB::equalCaseInsensitive(extension,"flv") || 
315
345
                   osgDB::equalCaseInsensitive(extension,"mov") || 
316
346
                   osgDB::equalCaseInsensitive(extension,"avi") ||
317
347
                   osgDB::equalCaseInsensitive(extension,"wmv") ||