OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 21 matching lines...) Expand all Loading... |
32 #include "wtf/RefPtr.h" | 32 #include "wtf/RefPtr.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class AudioBus; | 36 class AudioBus; |
37 class AudioContext; | 37 class AudioContext; |
38 | 38 |
39 class OfflineAudioDestinationHandler final : public AudioDestinationHandler { | 39 class OfflineAudioDestinationHandler final : public AudioDestinationHandler { |
40 public: | 40 public: |
41 static PassRefPtr<OfflineAudioDestinationHandler> create(AudioNode&, AudioBu
ffer* renderTarget); | 41 static PassRefPtr<OfflineAudioDestinationHandler> create(AudioNode&, AudioBu
ffer* renderTarget); |
42 virtual ~OfflineAudioDestinationHandler(); | 42 ~OfflineAudioDestinationHandler() override; |
43 | 43 |
44 // AudioHandler | 44 // AudioHandler |
45 virtual void dispose() override; | 45 void dispose() override; |
46 virtual void initialize() override; | 46 void initialize() override; |
47 virtual void uninitialize() override; | 47 void uninitialize() override; |
48 | 48 |
49 // AudioDestinationHandler | 49 // AudioDestinationHandler |
50 virtual void startRendering() override; | 50 void startRendering() override; |
51 virtual void stopRendering() override; | 51 void stopRendering() override; |
52 | 52 |
53 virtual float sampleRate() const override { return m_renderTarget->sampleRa
te(); } | 53 float sampleRate() const override { return m_renderTarget->sampleRate(); } |
54 | 54 |
55 private: | 55 private: |
56 OfflineAudioDestinationHandler(AudioNode&, AudioBuffer* renderTarget); | 56 OfflineAudioDestinationHandler(AudioNode&, AudioBuffer* renderTarget); |
57 void offlineRender(); | 57 void offlineRender(); |
58 void offlineRenderInternal(); | 58 void offlineRenderInternal(); |
59 | 59 |
60 // For completion callback on main thread. | 60 // For completion callback on main thread. |
61 void notifyComplete(); | 61 void notifyComplete(); |
62 | 62 |
63 // This AudioHandler renders into this AudioBuffer. | 63 // This AudioHandler renders into this AudioBuffer. |
(...skipping 12 matching lines...) Expand all Loading... |
76 public: | 76 public: |
77 static OfflineAudioDestinationNode* create(AudioContext*, AudioBuffer* rende
rTarget); | 77 static OfflineAudioDestinationNode* create(AudioContext*, AudioBuffer* rende
rTarget); |
78 | 78 |
79 private: | 79 private: |
80 OfflineAudioDestinationNode(AudioContext&, AudioBuffer* renderTarget); | 80 OfflineAudioDestinationNode(AudioContext&, AudioBuffer* renderTarget); |
81 }; | 81 }; |
82 | 82 |
83 } // namespace blink | 83 } // namespace blink |
84 | 84 |
85 #endif // OfflineAudioDestinationNode_h | 85 #endif // OfflineAudioDestinationNode_h |
OLD | NEW |