45 #include "EST_Featured.h"
46 #include "EST_rw_status.h"
47 #include "EST_types.h"
71 void default_vals(
int n=0,
int c=1);
78 static const int default_sample_rate;
79 static const int default_num_channels;
90 short *memory,
int offset=0,
int sample_rate=default_sample_rate,
91 int free_when_destroyed=0);
103 short &
a(
int i,
int channel = 0);
104 short a(
int i,
int channel = 0)
const;
105 INLINE
short &a_no_check(
int i,
int channel = 0)
107 INLINE
short a_no_check(
int i,
int channel = 0)
const
109 INLINE
short &a_no_check_1(
int i,
int channel = 0)
110 {
return p_values.a_no_check_1(i,channel); }
111 INLINE
short a_no_check_1(
int i,
int channel = 0)
const
112 {
return p_values.a_no_check_1(i,channel); }
117 INLINE
short set_a(
int i,
int channel = 0,
short val = 0)
118 {
return a(i,channel) = val; }
124 {
return a(i,channel); }
134 short &
a_safe(
int i,
int channel = 0);
137 float t(
int i)
const {
return (
float)i/(float)p_sample_rate; }
157 {
return p_values.have_rows_before(n); }
164 void set_sample_type(
const EST_String t) { f_set(
"sample_type", t); }
166 EST_String file_type()
const {
return f_String(
"file_type",
"riff"); }
167 void set_file_type(
const EST_String t) { f_set(
"file_type", t); }
177 const EST_SMatrix &values()
const {
return p_values; }
194 void rescale(
float gain,
int normalize=0);
207 void fill(
short v=0,
int channel=EST_ALL);
209 void empty(
int channel=EST_ALL) { fill(0,channel); }
212 { p_values.
row(sv, n); }
214 { p_values.
column(cv, n); }
216 void copy_channel(
int n,
short *buf,
int offset=0,
int num=EST_ALL)
const
218 void copy_sample(
int n,
short *buf,
int offset=0,
int num=EST_ALL)
const
219 { p_values.
copy_row(n, buf, offset, num); }
221 void set_channel(
int n,
const short *buf,
int offset=0,
int num=EST_ALL)
223 void set_sample(
int n,
const short *buf,
int offset=0,
int num=EST_ALL)
224 { p_values.
set_row(n, buf, offset, num); }
228 int offset=0,
int num=EST_ALL,
229 int start_c=0,
int nchan=EST_ALL);
232 int offset=0,
int num=EST_ALL,
233 int start_c=0,
int nchan=EST_ALL)
const
234 { ((
EST_Wave *)
this)->sub_wave(sw, offset, num, start_c, nchan); }
250 int rate = default_sample_rate);
255 int rate = default_sample_rate);
261 int rate = default_sample_rate);
267 int rate = default_sample_rate);
281 int offset = 0,
int length = 0);
285 int offset = 0,
int length = 0);
290 EST_write_status save(
const EST_String filename,
293 EST_write_status save(FILE *fp,
296 EST_write_status save_file(
const EST_String filename,
300 EST_write_status save_file(FILE *fp,
320 void integrity()
const { p_values.integrity() ; }