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.

Dump.h 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. Dump.h - It dumps the notes to a text 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 DUMP_H
  18. #define DUMP_H
  19. #include <stdio.h>
  20. /**Object used to dump the notes into a text file
  21. * \todo see if this object should have knowledge about the file
  22. * that it will write to
  23. * \todo upgrade from stdio to iostream*/
  24. class Dump
  25. {
  26. public:
  27. /**Constructor*/
  28. Dump();
  29. /**Destructor
  30. * Closes the dumpfile*/
  31. ~Dump();
  32. /**Open dumpfile and prepare it for dumps
  33. * \todo see if this fits better in the constructor*/
  34. void startnow();
  35. /**Tick the timestamp*/
  36. void inctick();
  37. /**Dump Note to dumpfile
  38. * @param chan The channel of the note
  39. * @param note The note
  40. * @param vel The velocity of the note*/
  41. void dumpnote(char chan, char note, char vel);
  42. /** Dump the Controller
  43. * @param chan The channel of the Controller
  44. * @param type The type
  45. * @param par The value of the controller
  46. * \todo figure out what type is exactly meaning*/
  47. void dumpcontroller(char chan, unsigned int type, int par);
  48. private:
  49. FILE *file;
  50. int tick;
  51. int k; //This appears to be a constant used to flush the file
  52. //periodically when JACK is used
  53. int keyspressed;
  54. };
  55. #endif