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

Side by Side Diff: ppapi/cpp/dev/audio_config_dev.h

Issue 6281007: Remove dev/audio, dev/audio_config, and dev/audio_trusted... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | « ppapi/c/dev/ppb_audio_trusted_dev.h ('k') | ppapi/cpp/dev/audio_config_dev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PPAPI_CPP_DEV_AUDIO_CONFIG_DEV_H_
6 #define PPAPI_CPP_DEV_AUDIO_CONFIG_DEV_H_
7
8 #include "ppapi/c/dev/ppb_audio_config_dev.h"
9 #include "ppapi/c/pp_stdint.h"
10 #include "ppapi/cpp/resource.h"
11
12 namespace pp {
13
14 class Instance;
15
16 // Typical usage:
17 //
18 // // Create an audio config with a supported frame count.
19 // uint32_t sample_frame_count =
20 // AudioConfig_Dev::RecommendSampleFrameCount(4096);
21 // AudioConfig_Dev config(PP_AUDIOSAMPLERATE_44100, sample_frame_count);
22 // if (config.is_null())
23 // return false; // Couldn't configure audio.
24 //
25 // // Then use the config to create your audio resource.
26 // Audio_dev audio(..., config, ...);
27 // if (audio.is_null())
28 // return false; // Couldn't create audio.
29 class AudioConfig_Dev : public Resource {
30 public:
31 AudioConfig_Dev();
32
33 // Creates an audio config based on the given sample rate and frame count.
34 // If the rate and frame count aren't supported, the resulting resource
35 // will be is_null(). Pass the result of RecommendSampleFrameCount as the
36 // sample frame count.
37 //
38 // See PPB_AudioConfigDev.CreateStereo16Bit for more.
39 AudioConfig_Dev(Instance* instance,
40 PP_AudioSampleRate_Dev sample_rate,
41 uint32_t sample_frame_count);
42
43 // Returns a supported frame count for use in the constructor.
44 //
45 // See PPB_AudioConfigDev.RecommendSampleFrameCount.
46 static uint32_t RecommendSampleFrameCount(
47 uint32_t requested_sample_frame_count);
48
49 PP_AudioSampleRate_Dev sample_rate() const { return sample_rate_; }
50 uint32_t sample_frame_count() { return sample_frame_count_; }
51
52 private:
53 PP_AudioSampleRate_Dev sample_rate_;
54 uint32_t sample_frame_count_;
55 };
56
57 } // namespace pp
58
59 #endif // PPAPI_CPP_DEV_AUDIO_CONFIG_DEV_H_
60
OLDNEW
« no previous file with comments | « ppapi/c/dev/ppb_audio_trusted_dev.h ('k') | ppapi/cpp/dev/audio_config_dev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698