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

Unified Diff: media/audio/simple_sources.h

Issue 2043353002: Make fake audio file playback loop by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: String handling is hard Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/fake_audio_input_stream.cc ('k') | media/audio/simple_sources.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/simple_sources.h
diff --git a/media/audio/simple_sources.h b/media/audio/simple_sources.h
index b00aa2420484171cc4dfb6f4b0ca02d3a9a94e9f..bd5797d814bf132b002f54bba94c67315bff5425 100644
--- a/media/audio/simple_sources.h
+++ b/media/audio/simple_sources.h
@@ -58,7 +58,8 @@ class MEDIA_EXPORT FileSource : public AudioOutputStream::AudioSourceCallback,
public AudioConverter::InputCallback {
public:
FileSource(const AudioParameters& params,
- const base::FilePath& path_to_wav_file);
+ const base::FilePath& path_to_wav_file,
+ bool loop);
~FileSource() override;
// Implementation of AudioSourceCallback.
@@ -80,12 +81,16 @@ class MEDIA_EXPORT FileSource : public AudioOutputStream::AudioSourceCallback,
std::unique_ptr<AudioConverter> file_audio_converter_;
int wav_file_read_pos_;
bool load_failed_;
+ bool looping_;
// Provides audio data from wav_audio_handler_ into the file audio converter.
double ProvideInput(AudioBus* audio_bus, uint32_t frames_delayed) override;
// Loads the wav file on the first OnMoreData invocation.
void LoadWavFile(const base::FilePath& path_to_wav_file);
+
+ // Rewinds the player to the start of the loaded wav file.
+ void Rewind();
};
class BeepingSource : public AudioOutputStream::AudioSourceCallback {
« no previous file with comments | « media/audio/fake_audio_input_stream.cc ('k') | media/audio/simple_sources.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698