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

Side by Side Diff: media/audio/sounds/audio_stream_handler.h

Issue 115693004: Added volume adjust sound behind the flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix, rebase. Created 6 years, 11 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
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | media/audio/sounds/audio_stream_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_AUDIO_SOUNDS_AUDIO_STREAM_HANDLER_H_ 5 #ifndef MEDIA_AUDIO_SOUNDS_AUDIO_STREAM_HANDLER_H_
6 #define MEDIA_AUDIO_SOUNDS_AUDIO_STREAM_HANDLER_H_ 6 #define MEDIA_AUDIO_SOUNDS_AUDIO_STREAM_HANDLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 24 matching lines...) Expand all
35 }; 35 };
36 36
37 // C-tor for AudioStreamHandler. |wav_data| should be a raw 37 // C-tor for AudioStreamHandler. |wav_data| should be a raw
38 // uncompressed WAVE data which will be sent to the audio manager. 38 // uncompressed WAVE data which will be sent to the audio manager.
39 explicit AudioStreamHandler(const base::StringPiece& wav_data); 39 explicit AudioStreamHandler(const base::StringPiece& wav_data);
40 virtual ~AudioStreamHandler(); 40 virtual ~AudioStreamHandler();
41 41
42 // Returns true iff AudioStreamHandler is correctly initialized; 42 // Returns true iff AudioStreamHandler is correctly initialized;
43 bool IsInitialized() const; 43 bool IsInitialized() const;
44 44
45 // Stops any previous playback if it's still not completed and 45 // Plays sound. Volume level will be set according to current settings
46 // starts new playback. Volume level will be set according to 46 // and won't be changed during playback. Returns true iff new playback
47 // current settings and won't be changed during playback. Returns 47 // was successfully started.
48 // true iff new playback was successfully started. 48 //
49 // NOTE: if current playback isn't at end of stream, playback request
50 // is dropped, but true is returned.
49 bool Play(); 51 bool Play();
50 52
51 // Stops current playback. 53 // Stops current playback.
52 void Stop(); 54 void Stop();
53 55
54 const WavAudioHandler& wav_audio_handler() const { return wav_audio_; } 56 const WavAudioHandler& wav_audio_handler() const { return wav_audio_; }
55 57
56 private: 58 private:
57 friend class AudioStreamHandlerTest; 59 friend class AudioStreamHandlerTest;
58 friend class SoundsManagerTest; 60 friend class SoundsManagerTest;
59 61
60 class AudioStreamContainer; 62 class AudioStreamContainer;
61 63
62 static void SetObserverForTesting(TestObserver* observer); 64 static void SetObserverForTesting(TestObserver* observer);
63 static void SetAudioSourceForTesting( 65 static void SetAudioSourceForTesting(
64 AudioOutputStream::AudioSourceCallback* source); 66 AudioOutputStream::AudioSourceCallback* source);
65 67
66 WavAudioHandler wav_audio_; 68 WavAudioHandler wav_audio_;
67 scoped_ptr<AudioStreamContainer> stream_; 69 scoped_ptr<AudioStreamContainer> stream_;
68 70
69 bool initialized_; 71 bool initialized_;
70 72
71 DISALLOW_COPY_AND_ASSIGN(AudioStreamHandler); 73 DISALLOW_COPY_AND_ASSIGN(AudioStreamHandler);
72 }; 74 };
73 75
74 } // namespace media 76 } // namespace media
75 77
76 #endif // MEDIA_AUDIO_SOUNDS_AUDIO_STREAM_HANDLER_H_ 78 #endif // MEDIA_AUDIO_SOUNDS_AUDIO_STREAM_HANDLER_H_
OLDNEW
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | media/audio/sounds/audio_stream_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698