Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Recorder.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. Recorder.h - Records sound to a file
  4. Copyright (C) 2002-2005 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of version 2 of the GNU General Public License
  8. as published by the Free Software Foundation.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License (version 2 or later) for more details.
  13. You should have received a copy of the GNU General Public License (version 2)
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef RECORDER_H
  18. #define RECORDER_H
  19. #include <string>
  20. struct SYNTH_T;
  21. /**Records sound to a file*/
  22. class Recorder
  23. {
  24. public:
  25. Recorder(const SYNTH_T &synth);
  26. ~Recorder();
  27. /**Prepare the given file.
  28. * @returns 1 if the file exists */
  29. int preparefile(std::string filename_, int overwrite);
  30. void start();
  31. void stop();
  32. void pause();
  33. int recording();
  34. void triggernow();
  35. /** Status:
  36. * 0 - not ready(no file selected),
  37. * 1 - ready
  38. * 2 - recording */
  39. int status;
  40. private:
  41. int notetrigger;
  42. const SYNTH_T &synth;
  43. };
  44. #endif