| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #ifndef OfflineAudioContext_h | 26 #ifndef OfflineAudioContext_h |
| 27 #define OfflineAudioContext_h | 27 #define OfflineAudioContext_h |
| 28 | 28 |
| 29 #include "modules/ModulesExport.h" | 29 #include "modules/ModulesExport.h" |
| 30 #include "modules/webaudio/BaseAudioContext.h" | 30 #include "modules/webaudio/BaseAudioContext.h" |
| 31 #include "platform/wtf/HashMap.h" | 31 #include "platform/wtf/HashMap.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class ExceptionState; | 35 class ExceptionState; |
| 36 class OfflineAudioContextOptions; |
| 36 class OfflineAudioDestinationHandler; | 37 class OfflineAudioDestinationHandler; |
| 37 | 38 |
| 38 class MODULES_EXPORT OfflineAudioContext final : public BaseAudioContext { | 39 class MODULES_EXPORT OfflineAudioContext final : public BaseAudioContext { |
| 39 DEFINE_WRAPPERTYPEINFO(); | 40 DEFINE_WRAPPERTYPEINFO(); |
| 40 | 41 |
| 41 public: | 42 public: |
| 42 static OfflineAudioContext* Create(ExecutionContext*, | 43 static OfflineAudioContext* Create(ExecutionContext*, |
| 43 unsigned number_of_channels, | 44 unsigned number_of_channels, |
| 44 unsigned number_of_frames, | 45 unsigned number_of_frames, |
| 45 float sample_rate, | 46 float sample_rate, |
| 46 ExceptionState&); | 47 ExceptionState&); |
| 47 | 48 |
| 49 static OfflineAudioContext* Create(ExecutionContext*, |
| 50 const OfflineAudioContextOptions&, |
| 51 ExceptionState&); |
| 52 |
| 48 ~OfflineAudioContext() override; | 53 ~OfflineAudioContext() override; |
| 49 | 54 |
| 50 DECLARE_VIRTUAL_TRACE(); | 55 DECLARE_VIRTUAL_TRACE(); |
| 51 | 56 |
| 52 size_t length() const { return total_render_frames_; } | 57 size_t length() const { return total_render_frames_; } |
| 53 | 58 |
| 54 ScriptPromise startOfflineRendering(ScriptState*); | 59 ScriptPromise startOfflineRendering(ScriptState*); |
| 55 | 60 |
| 56 ScriptPromise suspendContext(ScriptState*, double); | 61 ScriptPromise suspendContext(ScriptState*, double); |
| 57 ScriptPromise resumeContext(ScriptState*) final; | 62 ScriptPromise resumeContext(ScriptState*) final; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // state when the context is suspended. | 130 // state when the context is suspended. |
| 126 bool is_rendering_started_; | 131 bool is_rendering_started_; |
| 127 | 132 |
| 128 // Total render sample length. | 133 // Total render sample length. |
| 129 size_t total_render_frames_; | 134 size_t total_render_frames_; |
| 130 }; | 135 }; |
| 131 | 136 |
| 132 } // namespace blink | 137 } // namespace blink |
| 133 | 138 |
| 134 #endif // OfflineAudioContext_h | 139 #endif // OfflineAudioContext_h |
| OLD | NEW |