~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libcore/swf/StartSoundTag.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "StartSoundTag.h"
21
21
#include "SWFStream.h"
 
22
#include "movie_root.h"
22
23
#include "movie_definition.h"
23
24
#include "log.h" // for log_parse
24
25
#include "sound_definition.h" // for sound_sample
25
 
#include "RunInfo.h"
 
26
#include "RunResources.h"
26
27
#include "SoundInfoRecord.h"
27
28
#include "MovieClip.h"
28
29
 
 
30
#include <limits>
 
31
 
29
32
namespace gnash {
30
33
namespace SWF {
31
34
 
32
35
 
33
36
void
34
37
StartSoundTag::loader(SWFStream& in, TagType tag, movie_definition& m,
35
 
        const RunInfo& r)
 
38
        const RunResources& r)
36
39
{
37
40
    assert(tag == STARTSOUND); 
38
41
 
73
76
StartSoundTag::execute(MovieClip* m, DisplayList& /* dlist */) const
74
77
{
75
78
 
76
 
    sound::sound_handler* handler = 
77
 
        m->getVM().getRoot().runInfo().soundHandler();
 
79
    sound::sound_handler* handler = getRunResources(*m).soundHandler();
78
80
 
79
81
    if (handler)
80
82
    {
86
88
        else
87
89
        {
88
90
 
89
 
            if (_soundInfo.noMultiple) {
90
 
                log_unimpl("TESTING: syncNoMultiple flag in StartSound tag");
91
 
            }
92
 
 
93
91
            //log_debug("Execute StartSoundTag with 'stop playback' flag OFF");
94
92
 
95
93
            const sound::SoundEnvelopes* env = 
96
94
                _soundInfo.envelopes.empty() ? 0 : &_soundInfo.envelopes;
97
95
 
98
 
            handler->playSound(m_handler_id,
 
96
            handler->startSound(m_handler_id,
99
97
                    _soundInfo.loopCount,
100
 
                    0, // secs offset
101
 
                    0, // byte offset
102
98
                    env, // envelopes
103
 
                    !_soundInfo.noMultiple // allow multiple instances ?
 
99
                    !_soundInfo.noMultiple, // allow multiple instances ?
 
100
                    _soundInfo.inPoint,
 
101
                    _soundInfo.outPoint
104
102
                    );
105
103
        }
106
104
    }
108
106
 
109
107
void
110
108
StartSound2Tag::loader(SWFStream& in, TagType tag, movie_definition& /*m*/,
111
 
        const RunInfo& /*r*/)
 
109
        const RunResources& /*r*/)
112
110
{
113
111
    assert(tag == STARTSOUND2);
114
112