зеркало из https://github.com/mozilla/gecko-dev.git
Bug 849713 - Part 1: Add DOM bindings for AudioBufferSourceNode loop attributes; r=roc
This commit is contained in:
Родитель
fe44f36220
Коммит
dae847512c
|
@ -127,6 +127,9 @@ public:
|
|||
|
||||
AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* aContext)
|
||||
: AudioSourceNode(aContext)
|
||||
, mLoopStart(0.0)
|
||||
, mLoopEnd(0.0)
|
||||
, mLoop(false)
|
||||
, mStartCalled(false)
|
||||
{
|
||||
SetProduceOwnOutput(true);
|
||||
|
|
|
@ -51,10 +51,38 @@ public:
|
|||
mBuffer = aBuffer;
|
||||
}
|
||||
|
||||
bool Loop() const
|
||||
{
|
||||
return mLoop;
|
||||
}
|
||||
void SetLoop(bool aLoop)
|
||||
{
|
||||
mLoop = aLoop;
|
||||
}
|
||||
double LoopStart() const
|
||||
{
|
||||
return mLoopStart;
|
||||
}
|
||||
void SetLoopStart(double aStart)
|
||||
{
|
||||
mLoopStart = aStart;
|
||||
}
|
||||
double LoopEnd() const
|
||||
{
|
||||
return mLoopEnd;
|
||||
}
|
||||
void SetLoopEnd(double aEnd)
|
||||
{
|
||||
mLoopEnd = aEnd;
|
||||
}
|
||||
|
||||
virtual void NotifyMainThreadStateChanged() MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
nsRefPtr<AudioBuffer> mBuffer;
|
||||
double mLoopStart;
|
||||
double mLoopEnd;
|
||||
bool mLoop;
|
||||
bool mStartCalled;
|
||||
};
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ addLoadEvent(function() {
|
|||
is(source.context, context, "Source node has proper context");
|
||||
is(source.numberOfInputs, 0, "Source node has 0 inputs");
|
||||
is(source.numberOfOutputs, 1, "Source node has 1 outputs");
|
||||
is(source.loop, false, "Source node is not looping");
|
||||
is(source.loopStart, 0, "Correct default value for loopStart");
|
||||
is(source.loopEnd, 0, "Correct default value for loopEnd");
|
||||
ok(!source.buffer, "Source node should not have a buffer when it's created");
|
||||
|
||||
source.buffer = buffer;
|
||||
|
|
|
@ -25,7 +25,10 @@ interface AudioBufferSourceNode : AudioSourceNode {
|
|||
attribute AudioBuffer? buffer;
|
||||
|
||||
//attribute AudioParam playbackRate;
|
||||
//attribute boolean loop;
|
||||
|
||||
attribute boolean loop;
|
||||
attribute double loopStart;
|
||||
attribute double loopEnd;
|
||||
|
||||
[Throws]
|
||||
void start(optional double when = 0, optional double grainOffset = 0,
|
||||
|
|
Загрузка…
Ссылка в новой задаче