OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 18 matching lines...) Expand all Loading... |
29 #ifndef AudioParam_h | 29 #ifndef AudioParam_h |
30 #define AudioParam_h | 30 #define AudioParam_h |
31 | 31 |
32 #include "bindings/core/v8/ScriptWrappable.h" | 32 #include "bindings/core/v8/ScriptWrappable.h" |
33 #include "modules/webaudio/AudioContext.h" | 33 #include "modules/webaudio/AudioContext.h" |
34 #include "modules/webaudio/AudioParamTimeline.h" | 34 #include "modules/webaudio/AudioParamTimeline.h" |
35 #include "modules/webaudio/AudioSummingJunction.h" | 35 #include "modules/webaudio/AudioSummingJunction.h" |
36 #include <sys/types.h> | 36 #include <sys/types.h> |
37 #include "wtf/Float32Array.h" | 37 #include "wtf/Float32Array.h" |
38 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
39 #include "wtf/RefCounted.h" | |
40 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
41 | 40 |
42 namespace blink { | 41 namespace blink { |
43 | 42 |
44 class AudioNodeOutput; | 43 class AudioNodeOutput; |
45 | 44 |
46 #if ENABLE(OILPAN) | 45 class AudioParam FINAL : public AudioSummingJunction, public ScriptWrappable { |
47 #define AUDIO_PARAM_BASE_CLASSES public AudioSummingJunction, public ScriptWrapp
able | |
48 #else | |
49 #define AUDIO_PARAM_BASE_CLASSES public RefCounted<AudioParam>, public ScriptWra
ppable, public AudioSummingJunction | |
50 #endif | |
51 class AudioParam FINAL : AUDIO_PARAM_BASE_CLASSES { | |
52 public: | 46 public: |
53 static const double DefaultSmoothingConstant; | 47 static const double DefaultSmoothingConstant; |
54 static const double SnapThreshold; | 48 static const double SnapThreshold; |
55 | 49 |
56 static PassRefPtrWillBeRawPtr<AudioParam> create(AudioContext* context, doub
le defaultValue) | 50 static AudioParam* create(AudioContext* context, double defaultValue) |
57 { | 51 { |
58 return adoptRefWillBeNoop(new AudioParam(context, defaultValue)); | 52 return new AudioParam(context, defaultValue); |
59 } | 53 } |
60 | 54 |
61 // AudioSummingJunction | 55 // AudioSummingJunction |
62 virtual bool canUpdateState() OVERRIDE { return true; } | 56 virtual bool canUpdateState() OVERRIDE { return true; } |
63 virtual void didUpdate() OVERRIDE { } | 57 virtual void didUpdate() OVERRIDE { } |
64 | 58 |
65 // Intrinsic value. | 59 // Intrinsic value. |
66 float value(); | 60 float value(); |
67 void setValue(float); | 61 void setValue(float); |
68 | 62 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 115 |
122 // Smoothing (de-zippering) | 116 // Smoothing (de-zippering) |
123 double m_smoothedValue; | 117 double m_smoothedValue; |
124 | 118 |
125 AudioParamTimeline m_timeline; | 119 AudioParamTimeline m_timeline; |
126 }; | 120 }; |
127 | 121 |
128 } // namespace blink | 122 } // namespace blink |
129 | 123 |
130 #endif // AudioParam_h | 124 #endif // AudioParam_h |
OLD | NEW |