Mercurial > octave-nkf
comparison libinterp/dldfcn/recorder_class.h @ 19537:36a26a131209
Apply Octave coding style to audio project additions
* libinterp/dldfcn/__player_audioplayer__.cc,
libinterp/dldfcn/__recorder_audiorecorder__.cc,
libinterp/dldfcn/audiodevinfo.cc, libinterp/dldfcn/audioinfo.cc,
libinterp/dldfcn/audioread.cc, libinterp/dldfcn/audiowrite.cc,
libinterp/dldfcn/player_class.cc, libinterp/dldfcn/player_class.h,
libinterp/dldfcn/recorder_class.cc, libinterp/dldfcn/recorder_class.h,
scripts/audio/@audioplayer/__get_properties__.m,
scripts/audio/@audioplayer/audioplayer.m,
scripts/audio/@audioplayer/display.m, scripts/audio/@audioplayer/get.m,
scripts/audio/@audioplayer/isplaying.m, scripts/audio/@audioplayer/pause.m,
scripts/audio/@audioplayer/play.m,
scripts/audio/@audioplayer/playblocking.m,
scripts/audio/@audioplayer/resume.m, scripts/audio/@audioplayer/set.m,
scripts/audio/@audioplayer/stop.m, scripts/audio/@audioplayer/subsasgn.m,
scripts/audio/@audioplayer/subsref.m,
scripts/audio/@audiorecorder/__get_properties__.m,
scripts/audio/@audiorecorder/audiorecorder.m,
scripts/audio/@audiorecorder/display.m, scripts/audio/@audiorecorder/get.m,
scripts/audio/@audiorecorder/getaudiodata.m,
scripts/audio/@audiorecorder/getplayer.m,
scripts/audio/@audiorecorder/isrecording.m,
scripts/audio/@audiorecorder/pause.m, scripts/audio/@audiorecorder/play.m,
scripts/audio/@audiorecorder/record.m,
scripts/audio/@audiorecorder/recordblocking.m,
scripts/audio/@audiorecorder/resume.m, scripts/audio/@audiorecorder/set.m,
scripts/audio/@audiorecorder/stop.m,
scripts/audio/@audiorecorder/subsasgn.m,
scripts/audio/@audiorecorder/subsref.m: Apply consistent Octave indentation,
spacing, and quoting styles. Strip trailing whitespace. Remove braces from
one-line if-else blocks. Simplify some variable declarations.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Thu, 03 Oct 2013 07:52:58 -0400 |
parents | 8bb399569393 |
children |
comparison
equal
deleted
inserted
replaced
19536:97c9ba013ed1 | 19537:36a26a131209 |
---|---|
29 #include "ov-int32.h" | 29 #include "ov-int32.h" |
30 #include <portaudio.h> | 30 #include <portaudio.h> |
31 | 31 |
32 #include "player_class.h" | 32 #include "player_class.h" |
33 | 33 |
34 class audiorecorder : public octave_base_value | 34 class audiorecorder : public octave_base_value |
35 { | 35 { |
36 public: | 36 public: |
37 audiorecorder(); | 37 audiorecorder (void); |
38 ~audiorecorder(); | 38 ~audiorecorder (void) {}; |
39 // Overloaded base functions | |
40 double player_value() const { return 0; } | |
41 virtual double scalar_value (bool frc_str_conv = false) const | |
42 { | |
43 return 0; | |
44 } | |
45 void print (std::ostream& os, bool pr_as_read_syntax = false) const; | |
46 void print_raw (std::ostream& os, bool pr_as_read_syntax) const; | |
47 // Properties | |
48 bool is_constant (void) const { return true;} | |
49 bool is_defined (void) const { return true;} | |
50 bool print_as_scalar (void) const { return true;} | |
51 | 39 |
52 void init(); | 40 // Overloaded base functions |
53 void set_fs(int fs); | 41 double player_value (void) const { return 0; } |
54 int get_fs(); | 42 virtual double scalar_value (bool frc_str_conv = false) const { return 0; } |
55 void set_nbits(int nbits); | 43 void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
56 int get_nbits(); | 44 void print_raw (std::ostream& os, bool pr_as_read_syntax) const; |
57 void set_id(int id); | |
58 int get_id(); | |
59 void set_channels(int channels); | |
60 int get_channels(); | |
61 audio_type get_type(); | |
62 | 45 |
63 void set_sample_number(unsigned int sample); | 46 // Properties |
64 unsigned int get_sample_number(); | 47 bool is_constant (void) const { return true; } |
65 unsigned int get_total_samples(); | 48 bool is_defined (void) const { return true; } |
66 void set_end_sample(unsigned int sample); | 49 bool print_as_scalar (void) const { return true; } |
67 unsigned int get_end_sample(); | |
68 void reset_end_sample(); | |
69 void set_tag(charMatrix tag); | |
70 charMatrix get_tag(); | |
71 void set_userdata(octave_value userdata); | |
72 octave_value get_userdata(); | |
73 PaStream *get_stream(); | |
74 octave_function *octave_callback_function; | |
75 | 50 |
76 octave_value getaudiodata(); | 51 void init (void); |
77 audioplayer *getplayer(); | 52 void set_fs (int fs); |
78 bool isrecording(); | 53 int get_fs (void); |
79 audioplayer play(); | 54 void set_nbits (int nbits); |
80 void record(); | 55 int get_nbits (void); |
81 void recordblocking(float seconds); | 56 void set_id (int id); |
82 void pause(); | 57 int get_id (void); |
83 void resume(); | 58 void set_channels (int channels); |
84 void stop(); | 59 int get_channels (void); |
85 void append(float sample_l, float sample_r); | 60 audio_type get_type (void); |
61 | |
62 void set_sample_number (unsigned int sample); | |
63 unsigned int get_sample_number (void); | |
64 unsigned int get_total_samples (void); | |
65 void set_end_sample (unsigned int sample); | |
66 unsigned int get_end_sample (void); | |
67 void reset_end_sample (void); | |
68 void set_tag (charMatrix tag); | |
69 charMatrix get_tag (void); | |
70 void set_userdata (octave_value userdata); | |
71 octave_value get_userdata (void); | |
72 PaStream *get_stream (void); | |
73 octave_function *octave_callback_function; | |
74 | |
75 octave_value getaudiodata (void); | |
76 audioplayer *getplayer (void); | |
77 bool isrecording (void); | |
78 audioplayer play (void); | |
79 void record (void); | |
80 void recordblocking (float seconds); | |
81 void pause (void); | |
82 void resume (void); | |
83 void stop (void); | |
84 void append (float sample_l, float sample_r); | |
85 | |
86 private: | 86 private: |
87 Matrix y; | 87 Matrix y; |
88 std::vector<float> left; | 88 std::vector<float> left; |
89 std::vector<float> right; | 89 std::vector<float> right; |
90 charMatrix tag; | 90 charMatrix tag; |
91 octave_value userdata; | 91 octave_value userdata; |
92 int channels; | 92 int channels; |
93 int fs; | 93 int fs; |
94 int nbits; | 94 int nbits; |
95 int id; | 95 int id; |
96 unsigned int sample_number; | 96 unsigned int sample_number; |
97 unsigned int end_sample; | 97 unsigned int end_sample; |
98 PaStream *stream; | 98 PaStream *stream; |
99 PaStreamParameters input_parameters; | 99 PaStreamParameters input_parameters; |
100 audio_type type; | 100 audio_type type; |
101 DECLARE_OCTAVE_ALLOCATOR | 101 DECLARE_OCTAVE_ALLOCATOR |
102 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA | 102 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
103 }; | 103 }; |
104 | 104 |
105 #endif // RECORDER_CLASS_H | 105 #endif // RECORDER_CLASS_H |