Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: Source/modules/webaudio/AudioDestinationNode.h

Issue 635233004: Replace FINAL and OVERRIDE with their C++11 counterparts in Source/modules (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioNode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * 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 25 matching lines...) Expand all
36 class AudioBus; 36 class AudioBus;
37 class AudioContext; 37 class AudioContext;
38 38
39 class AudioDestinationNode : public AudioNode, public AudioIOCallback { 39 class AudioDestinationNode : public AudioNode, public AudioIOCallback {
40 DEFINE_WRAPPERTYPEINFO(); 40 DEFINE_WRAPPERTYPEINFO();
41 public: 41 public:
42 AudioDestinationNode(AudioContext*, float sampleRate); 42 AudioDestinationNode(AudioContext*, float sampleRate);
43 virtual ~AudioDestinationNode(); 43 virtual ~AudioDestinationNode();
44 44
45 // AudioNode 45 // AudioNode
46 virtual void dispose() OVERRIDE; 46 virtual void dispose() override;
47 virtual void process(size_t) OVERRIDE FINAL { } // we're pulled by hardware so this is never called 47 virtual void process(size_t) override final { } // we're pulled by hardware so this is never called
48 48
49 // The audio hardware calls render() to get the next render quantum of audio into destinationBus. 49 // The audio hardware calls render() to get the next render quantum of audio into destinationBus.
50 // It will optionally give us local/live audio input in sourceBus (if it's n ot 0). 50 // It will optionally give us local/live audio input in sourceBus (if it's n ot 0).
51 virtual void render(AudioBus* sourceBus, AudioBus* destinationBus, size_t nu mberOfFrames) OVERRIDE FINAL; 51 virtual void render(AudioBus* sourceBus, AudioBus* destinationBus, size_t nu mberOfFrames) override final;
52 52
53 size_t currentSampleFrame() const { return m_currentSampleFrame; } 53 size_t currentSampleFrame() const { return m_currentSampleFrame; }
54 double currentTime() const { return currentSampleFrame() / static_cast<doubl e>(sampleRate()); } 54 double currentTime() const { return currentSampleFrame() / static_cast<doubl e>(sampleRate()); }
55 55
56 virtual unsigned long maxChannelCount() const { return 0; } 56 virtual unsigned long maxChannelCount() const { return 0; }
57 57
58 virtual void startRendering() = 0; 58 virtual void startRendering() = 0;
59 59
60 protected: 60 protected:
61 // LocalAudioInputProvider allows us to expose an AudioSourceProvider for lo cal/live audio input. 61 // LocalAudioInputProvider allows us to expose an AudioSourceProvider for lo cal/live audio input.
62 // If there is local/live audio input, we call set() with the audio input da ta every render quantum. 62 // If there is local/live audio input, we call set() with the audio input da ta every render quantum.
63 class LocalAudioInputProvider FINAL : public AudioSourceProvider { 63 class LocalAudioInputProvider final : public AudioSourceProvider {
64 public: 64 public:
65 LocalAudioInputProvider() 65 LocalAudioInputProvider()
66 : m_sourceBus(AudioBus::create(2, AudioNode::ProcessingSizeInFrames) ) // FIXME: handle non-stereo local input. 66 : m_sourceBus(AudioBus::create(2, AudioNode::ProcessingSizeInFrames) ) // FIXME: handle non-stereo local input.
67 { 67 {
68 } 68 }
69 69
70 void set(AudioBus* bus) 70 void set(AudioBus* bus)
71 { 71 {
72 if (bus) 72 if (bus)
73 m_sourceBus->copyFrom(*bus); 73 m_sourceBus->copyFrom(*bus);
74 } 74 }
75 75
76 // AudioSourceProvider. 76 // AudioSourceProvider.
77 virtual void provideInput(AudioBus* destinationBus, size_t numberOfFrame s) OVERRIDE 77 virtual void provideInput(AudioBus* destinationBus, size_t numberOfFrame s) override
78 { 78 {
79 bool isGood = destinationBus && destinationBus->length() == numberOf Frames && m_sourceBus->length() == numberOfFrames; 79 bool isGood = destinationBus && destinationBus->length() == numberOf Frames && m_sourceBus->length() == numberOfFrames;
80 ASSERT(isGood); 80 ASSERT(isGood);
81 if (isGood) 81 if (isGood)
82 destinationBus->copyFrom(*m_sourceBus); 82 destinationBus->copyFrom(*m_sourceBus);
83 } 83 }
84 84
85 private: 85 private:
86 RefPtr<AudioBus> m_sourceBus; 86 RefPtr<AudioBus> m_sourceBus;
87 }; 87 };
88 88
89 virtual double tailTime() const OVERRIDE FINAL { return 0; } 89 virtual double tailTime() const override final { return 0; }
90 virtual double latencyTime() const OVERRIDE FINAL { return 0; } 90 virtual double latencyTime() const override final { return 0; }
91 91
92 // Counts the number of sample-frames processed by the destination. 92 // Counts the number of sample-frames processed by the destination.
93 size_t m_currentSampleFrame; 93 size_t m_currentSampleFrame;
94 94
95 LocalAudioInputProvider m_localAudioInputProvider; 95 LocalAudioInputProvider m_localAudioInputProvider;
96 }; 96 };
97 97
98 } // namespace blink 98 } // namespace blink
99 99
100 #endif // AudioDestinationNode_h 100 #endif // AudioDestinationNode_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698