2013-05-16 23:30:41 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef OfflineAudioCompletionEvent_h_
|
|
|
|
#define OfflineAudioCompletionEvent_h_
|
|
|
|
|
|
|
|
#include "AudioBuffer.h"
|
2014-03-05 00:37:43 +00:00
|
|
|
#include "mozilla/dom/Event.h"
|
2013-05-16 23:30:41 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-08-15 19:44:14 +00:00
|
|
|
class AudioContext;
|
|
|
|
|
2015-04-28 06:42:00 +00:00
|
|
|
class OfflineAudioCompletionEvent final : public Event
|
2013-05-16 23:30:41 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
OfflineAudioCompletionEvent(AudioContext* aOwner,
|
2013-10-02 03:46:04 +00:00
|
|
|
nsPresContext* aPresContext,
|
|
|
|
WidgetEvent* aEvent);
|
2013-05-16 23:30:41 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-03-05 00:37:43 +00:00
|
|
|
NS_FORWARD_TO_EVENT
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OfflineAudioCompletionEvent, Event)
|
2013-05-16 23:30:41 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-05-16 23:30:41 +00:00
|
|
|
|
2013-05-16 23:30:57 +00:00
|
|
|
void InitEvent(AudioBuffer* aRenderedBuffer)
|
|
|
|
{
|
|
|
|
InitEvent(NS_LITERAL_STRING("complete"), false, false);
|
|
|
|
mRenderedBuffer = aRenderedBuffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
AudioBuffer* RenderedBuffer() const
|
2013-05-16 23:30:41 +00:00
|
|
|
{
|
|
|
|
return mRenderedBuffer;
|
|
|
|
}
|
|
|
|
|
2014-07-08 21:23:17 +00:00
|
|
|
protected:
|
|
|
|
virtual ~OfflineAudioCompletionEvent();
|
|
|
|
|
2013-05-16 23:30:41 +00:00
|
|
|
private:
|
|
|
|
nsRefPtr<AudioBuffer> mRenderedBuffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|