content/media/webaudio/OfflineAudioCompletionEvent.h

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:f3c8b10b144e
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #ifndef OfflineAudioCompletionEvent_h_
8 #define OfflineAudioCompletionEvent_h_
9
10 #include "AudioBuffer.h"
11 #include "mozilla/dom/Event.h"
12
13 namespace mozilla {
14 namespace dom {
15
16 class AudioContext;
17
18 class OfflineAudioCompletionEvent : public Event
19 {
20 public:
21 OfflineAudioCompletionEvent(AudioContext* aOwner,
22 nsPresContext* aPresContext,
23 WidgetEvent* aEvent);
24
25 NS_DECL_ISUPPORTS_INHERITED
26 NS_FORWARD_TO_EVENT
27 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OfflineAudioCompletionEvent, Event)
28
29 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
30
31 void InitEvent(AudioBuffer* aRenderedBuffer)
32 {
33 InitEvent(NS_LITERAL_STRING("complete"), false, false);
34 mRenderedBuffer = aRenderedBuffer;
35 }
36
37 AudioBuffer* RenderedBuffer() const
38 {
39 return mRenderedBuffer;
40 }
41
42 private:
43 nsRefPtr<AudioBuffer> mRenderedBuffer;
44 };
45
46 }
47 }
48
49 #endif
50

mercurial