kicker.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * kicker.h - drum synthesizer
  3. *
  4. * Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  5. * Copyright (c) 2014 grejppi <grejppi/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 KICKER_H
  26. #define KICKER_H
  27. #include <QObject>
  28. #include "Instrument.h"
  29. #include "InstrumentView.h"
  30. #include "Knob.h"
  31. #include "LedCheckbox.h"
  32. #include "TempoSyncKnob.h"
  33. #define KICKER_PRESET_VERSION 1
  34. class kickerInstrumentView;
  35. class NotePlayHandle;
  36. class kickerInstrument : public Instrument
  37. {
  38. Q_OBJECT
  39. public:
  40. kickerInstrument( InstrumentTrack * _instrument_track );
  41. virtual ~kickerInstrument();
  42. virtual void playNote( NotePlayHandle * _n,
  43. sampleFrame * _working_buffer );
  44. virtual void deleteNotePluginData( NotePlayHandle * _n );
  45. virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
  46. virtual void loadSettings( const QDomElement & _this );
  47. virtual QString nodeName() const;
  48. virtual Flags flags() const
  49. {
  50. return IsNotBendable;
  51. }
  52. virtual f_cnt_t desiredReleaseFrames() const
  53. {
  54. return( 512 );
  55. }
  56. virtual PluginView * instantiateView( QWidget * _parent );
  57. private:
  58. FloatModel m_startFreqModel;
  59. FloatModel m_endFreqModel;
  60. TempoSyncKnobModel m_decayModel;
  61. FloatModel m_distModel;
  62. FloatModel m_distEndModel;
  63. FloatModel m_gainModel;
  64. FloatModel m_envModel;
  65. FloatModel m_noiseModel;
  66. FloatModel m_clickModel;
  67. FloatModel m_slopeModel;
  68. BoolModel m_startNoteModel;
  69. BoolModel m_endNoteModel;
  70. IntModel m_versionModel;
  71. friend class kickerInstrumentView;
  72. } ;
  73. class kickerInstrumentView : public InstrumentView
  74. {
  75. Q_OBJECT
  76. public:
  77. kickerInstrumentView( Instrument * _instrument, QWidget * _parent );
  78. virtual ~kickerInstrumentView();
  79. private:
  80. virtual void modelChanged();
  81. Knob * m_startFreqKnob;
  82. Knob * m_endFreqKnob;
  83. Knob * m_decayKnob;
  84. Knob * m_distKnob;
  85. Knob * m_distEndKnob;
  86. Knob * m_gainKnob;
  87. Knob * m_envKnob;
  88. Knob * m_noiseKnob;
  89. Knob * m_clickKnob;
  90. Knob * m_slopeKnob;
  91. LedCheckBox * m_startNoteToggle;
  92. LedCheckBox * m_endNoteToggle;
  93. } ;
  94. #endif