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

Side by Side Diff: media/audio/win/wavein_input_win.h

Issue 9418042: Adding microphone volume support to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added a comment about the number of channel, and fix a compiling issue on mac Created 8 years, 10 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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_WIN_WAVEIN_INPUT_WIN_H_ 5 #ifndef MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_
6 #define MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ 6 #define MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <mmsystem.h> 9 #include <mmsystem.h>
10 10
(...skipping 14 matching lines...) Expand all
25 const AudioParameters& params, 25 const AudioParameters& params,
26 int num_buffers, 26 int num_buffers,
27 const std::string& device_id); 27 const std::string& device_id);
28 virtual ~PCMWaveInAudioInputStream(); 28 virtual ~PCMWaveInAudioInputStream();
29 29
30 // Implementation of AudioInputStream. 30 // Implementation of AudioInputStream.
31 virtual bool Open() OVERRIDE; 31 virtual bool Open() OVERRIDE;
32 virtual void Start(AudioInputCallback* callback) OVERRIDE; 32 virtual void Start(AudioInputCallback* callback) OVERRIDE;
33 virtual void Stop() OVERRIDE; 33 virtual void Stop() OVERRIDE;
34 virtual void Close() OVERRIDE; 34 virtual void Close() OVERRIDE;
35 virtual double GetMaxVolume() OVERRIDE;
36 virtual void SetVolume(double volume) OVERRIDE;
37 virtual double GetVolume() OVERRIDE;
35 38
36 private: 39 private:
37 enum State { 40 enum State {
38 kStateEmpty, // Initial state. 41 kStateEmpty, // Initial state.
39 kStateReady, // Device obtained and ready to record. 42 kStateReady, // Device obtained and ready to record.
40 kStateRecording, // Recording audio. 43 kStateRecording, // Recording audio.
41 kStateStopping, // Trying to stop, waiting for callback to finish. 44 kStateStopping, // Trying to stop, waiting for callback to finish.
42 kStateStopped, // Stopped. Device was reset. 45 kStateStopped, // Stopped. Device was reset.
43 kStateClosed // Device has been released. 46 kStateClosed // Device has been released.
44 }; 47 };
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Pointer to the first allocated audio buffer. This object owns it. 103 // Pointer to the first allocated audio buffer. This object owns it.
101 WAVEHDR* buffer_; 104 WAVEHDR* buffer_;
102 105
103 // An event that is signaled when the callback thread is ready to stop. 106 // An event that is signaled when the callback thread is ready to stop.
104 base::win::ScopedHandle stopped_event_; 107 base::win::ScopedHandle stopped_event_;
105 108
106 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); 109 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream);
107 }; 110 };
108 111
109 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ 112 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698