1 class Scorealign; 2 3 class Audio_reader { 4 public: 5 long samples_per_frame; 6 long hop_samples; 7 double actual_frame_period; 8 long frame_count; // number of chroma vectors (analysis windows) 9 virtual void print_info() = 0; 10 long read_window(float *data); 11 virtual long read(float *data, long n) = 0; 12 virtual double get_sample_rate() = 0; 13 virtual long get_frames() = 0; // returns frames of input audio 14 // i.e. (samples/channels) 15 void calculate_parameters(Scorealign &sa, bool verbose); Audio_reader()16 Audio_reader() { 17 reading_first_window = true; 18 reading_last_window = false; 19 temp_data = NULL; 20 } ~Audio_reader()21 ~Audio_reader() { 22 if (temp_data) free(temp_data); 23 } 24 protected: 25 bool reading_first_window; 26 bool reading_last_window; 27 float *temp_data; 28 }; 29 30