DrumSynth.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * DrumSynth.h - DrumSynth DS file renderer
  3. *
  4. * Copyright (c) 1998-2000 Paul Kellett (mda-vst.com)
  5. * Copyright (c) 2007 Paul Giblock <drfaygo/at/gmail.com>
  6. *
  7. * This file is part of LMMS - https://lmms.io
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2 of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public
  20. * License along with this program (see COPYING); if not, write to the
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. * Boston, MA 02110-1301 USA.
  23. *
  24. */
  25. #ifndef _DRUMSYNTH_H__
  26. #define _DRUMSYNTH_H__
  27. #include <stdint.h>
  28. #include "lmms_basics.h"
  29. class QString;
  30. class DrumSynth {
  31. public:
  32. DrumSynth() {};
  33. int GetDSFileSamples(QString dsfile, int16_t *&wave, int channels, sample_rate_t Fs);
  34. private:
  35. float LoudestEnv(void);
  36. int LongestEnv(void);
  37. void UpdateEnv(int e, long t);
  38. void GetEnv(int env, const char *sec, const char *key, QString ini);
  39. float waveform(float ph, int form);
  40. int GetPrivateProfileString(const char *sec, const char *key, const char *def, char *buffer, int size, QString file);
  41. int GetPrivateProfileInt(const char *sec, const char *key, int def, QString file);
  42. float GetPrivateProfileFloat(const char *sec, const char *key, float def, QString file);
  43. };
  44. #endif