zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

Recorder.h (1167B)


      1 /*
      2   ZynAddSubFX - a software synthesizer
      3 
      4   Recorder.h - Records sound to a file
      5   Copyright (C) 2002-2005 Nasca Octavian Paul
      6   Author: Nasca Octavian Paul
      7 
      8   This program is free software; you can redistribute it and/or
      9   modify it under the terms of the GNU General Public License
     10   as published by the Free Software Foundation; either version 2
     11   of the License, or (at your option) any later version.
     12 */
     13 
     14 #ifndef RECORDER_H
     15 #define RECORDER_H
     16 #include <rtosc/ports.h>
     17 #include <string>
     18 
     19 namespace zyn {
     20 
     21 struct SYNTH_T;
     22 /**Records sound to a file*/
     23 class Recorder
     24 {
     25     public:
     26 
     27         Recorder(const SYNTH_T &synth);
     28         ~Recorder();
     29         /**Prepare the given file.
     30          * @returns 1 if the file exists */
     31         int preparefile(std::string filename_, int overwrite);
     32         void start();
     33         void stop();
     34         void pause();
     35         int recording();
     36         void triggernow();
     37 
     38         /** Status:
     39          *  0 - not ready(no file selected),
     40          *  1 - ready
     41          *  2 - recording */
     42         int status;
     43 
     44         static const rtosc::Ports ports;
     45 
     46     private:
     47         int notetrigger;
     48         const SYNTH_T &synth;
     49 };
     50 
     51 }
     52 
     53 #endif