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

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

Issue 20300002: Fix trailing whitespace in .cpp, .h, and .idl files (ex. Source/core) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 SINE = 0, 48 SINE = 0,
49 SQUARE = 1, 49 SQUARE = 1,
50 SAWTOOTH = 2, 50 SAWTOOTH = 2,
51 TRIANGLE = 3, 51 TRIANGLE = 3,
52 CUSTOM = 4 52 CUSTOM = 4
53 }; 53 };
54 54
55 static PassRefPtr<OscillatorNode> create(AudioContext*, float sampleRate); 55 static PassRefPtr<OscillatorNode> create(AudioContext*, float sampleRate);
56 56
57 virtual ~OscillatorNode(); 57 virtual ~OscillatorNode();
58 58
59 // AudioNode 59 // AudioNode
60 virtual void process(size_t framesToProcess); 60 virtual void process(size_t framesToProcess);
61 virtual void reset(); 61 virtual void reset();
62 62
63 String type() const; 63 String type() const;
64 64
65 bool setType(unsigned); // Returns true on success. 65 bool setType(unsigned); // Returns true on success.
66 void setType(const String&); 66 void setType(const String&);
67 67
68 AudioParam* frequency() { return m_frequency.get(); } 68 AudioParam* frequency() { return m_frequency.get(); }
69 AudioParam* detune() { return m_detune.get(); } 69 AudioParam* detune() { return m_detune.get(); }
70 70
71 void setPeriodicWave(PeriodicWave*); 71 void setPeriodicWave(PeriodicWave*);
72 72
73 private: 73 private:
74 OscillatorNode(AudioContext*, float sampleRate); 74 OscillatorNode(AudioContext*, float sampleRate);
75 75
76 // Returns true if there are sample-accurate timeline parameter changes. 76 // Returns true if there are sample-accurate timeline parameter changes.
77 bool calculateSampleAccuratePhaseIncrements(size_t framesToProcess); 77 bool calculateSampleAccuratePhaseIncrements(size_t framesToProcess);
78 78
79 virtual bool propagatesSilence() const OVERRIDE; 79 virtual bool propagatesSilence() const OVERRIDE;
80 80
81 // One of the waveform types defined in the enum. 81 // One of the waveform types defined in the enum.
82 unsigned short m_type; 82 unsigned short m_type;
83 83
84 // Frequency value in Hertz. 84 // Frequency value in Hertz.
85 RefPtr<AudioParam> m_frequency; 85 RefPtr<AudioParam> m_frequency;
86 86
87 // Detune value (deviating from the frequency) in Cents. 87 // Detune value (deviating from the frequency) in Cents.
88 RefPtr<AudioParam> m_detune; 88 RefPtr<AudioParam> m_detune;
89 89
90 bool m_firstRender; 90 bool m_firstRender;
91 91
92 // m_virtualReadIndex is a sample-frame index into our buffer representing t he current playback position. 92 // m_virtualReadIndex is a sample-frame index into our buffer representing t he current playback position.
93 // Since it's floating-point, it has sub-sample accuracy. 93 // Since it's floating-point, it has sub-sample accuracy.
94 double m_virtualReadIndex; 94 double m_virtualReadIndex;
95 95
96 // This synchronizes process(). 96 // This synchronizes process().
97 mutable Mutex m_processLock; 97 mutable Mutex m_processLock;
98 98
99 // Stores sample-accurate values calculated according to frequency and detun e. 99 // Stores sample-accurate values calculated according to frequency and detun e.
100 AudioFloatArray m_phaseIncrements; 100 AudioFloatArray m_phaseIncrements;
101 AudioFloatArray m_detuneValues; 101 AudioFloatArray m_detuneValues;
102 102
103 RefPtr<PeriodicWave> m_periodicWave; 103 RefPtr<PeriodicWave> m_periodicWave;
104 104
105 // Cache the wave tables for different waveform types, except CUSTOM. 105 // Cache the wave tables for different waveform types, except CUSTOM.
106 static PeriodicWave* s_periodicWaveSine; 106 static PeriodicWave* s_periodicWaveSine;
107 static PeriodicWave* s_periodicWaveSquare; 107 static PeriodicWave* s_periodicWaveSquare;
108 static PeriodicWave* s_periodicWaveSawtooth; 108 static PeriodicWave* s_periodicWaveSawtooth;
109 static PeriodicWave* s_periodicWaveTriangle; 109 static PeriodicWave* s_periodicWaveTriangle;
110 }; 110 };
111 111
112 } // namespace WebCore 112 } // namespace WebCore
113 113
114 #endif // OscillatorNode_h 114 #endif // OscillatorNode_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/OfflineAudioDestinationNode.cpp ('k') | Source/modules/webaudio/PannerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698