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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/PeriodicWave.h

Issue 2807673002: createPeriodicWave parameters are sequence<float> (Closed)
Patch Set: Rebase Created 3 years, 8 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
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 * 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 public: 49 public:
50 static PeriodicWave* CreateSine(float sample_rate); 50 static PeriodicWave* CreateSine(float sample_rate);
51 static PeriodicWave* CreateSquare(float sample_rate); 51 static PeriodicWave* CreateSquare(float sample_rate);
52 static PeriodicWave* CreateSawtooth(float sample_rate); 52 static PeriodicWave* CreateSawtooth(float sample_rate);
53 static PeriodicWave* CreateTriangle(float sample_rate); 53 static PeriodicWave* CreateTriangle(float sample_rate);
54 54
55 // Creates an arbitrary periodic wave given the frequency components (Fourier 55 // Creates an arbitrary periodic wave given the frequency components (Fourier
56 // coefficients). 56 // coefficients).
57 static PeriodicWave* Create(BaseAudioContext&, 57 static PeriodicWave* Create(BaseAudioContext&,
58 size_t real_length, 58 const Vector<float>& real,
59 const float* real, 59 const Vector<float>& imag,
60 size_t imag_length,
61 const float* imag,
62 bool normalize, 60 bool normalize,
63 ExceptionState&); 61 ExceptionState&);
64 62
65 static PeriodicWave* Create(BaseAudioContext&,
66 DOMFloat32Array* real,
67 DOMFloat32Array* imag,
68 bool normalize,
69 ExceptionState&);
70
71 static PeriodicWave* Create(BaseAudioContext*, 63 static PeriodicWave* Create(BaseAudioContext*,
72 const PeriodicWaveOptions&, 64 const PeriodicWaveOptions&,
73 ExceptionState&); 65 ExceptionState&);
74 66
75 virtual ~PeriodicWave(); 67 virtual ~PeriodicWave();
76 68
77 // Returns pointers to the lower and higher wave data for the pitch range 69 // Returns pointers to the lower and higher wave data for the pitch range
78 // containing the given fundamental frequency. These two tables are in 70 // containing the given fundamental frequency. These two tables are in
79 // adjacent "pitch" ranges where the higher table will have the maximum number 71 // adjacent "pitch" ranges where the higher table will have the maximum number
80 // of partials which won't alias when played back at this fundamental 72 // of partials which won't alias when played back at this fundamental
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void CreateBandLimitedTables(const float* real, 120 void CreateBandLimitedTables(const float* real,
129 const float* imag, 121 const float* imag,
130 unsigned number_of_components, 122 unsigned number_of_components,
131 bool disable_normalization); 123 bool disable_normalization);
132 Vector<std::unique_ptr<AudioFloatArray>> band_limited_tables_; 124 Vector<std::unique_ptr<AudioFloatArray>> band_limited_tables_;
133 }; 125 };
134 126
135 } // namespace blink 127 } // namespace blink
136 128
137 #endif // PeriodicWave_h 129 #endif // PeriodicWave_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698