papu_instrument.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. * papu_Instrument.h - GameBoy papu based instrument
  3. *
  4. * Copyright (c) 2008 <Attila Herman <attila589/at/gmail.com>
  5. * Csaba Hruska <csaba.hruska/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 _PAPU_H
  26. #define _PAPU_H
  27. #include <QObject>
  28. #include "Instrument.h"
  29. #include "InstrumentView.h"
  30. #include "Knob.h"
  31. #include "Graph.h"
  32. class papuInstrumentView;
  33. class NotePlayHandle;
  34. class PixmapButton;
  35. class papuInstrument : public Instrument
  36. {
  37. Q_OBJECT
  38. public:
  39. papuInstrument( InstrumentTrack * _instrument_track );
  40. virtual ~papuInstrument();
  41. virtual void playNote( NotePlayHandle * _n,
  42. sampleFrame * _working_buffer );
  43. virtual void deleteNotePluginData( NotePlayHandle * _n );
  44. virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
  45. virtual void loadSettings( const QDomElement & _this );
  46. virtual QString nodeName() const;
  47. virtual f_cnt_t desiredReleaseFrames() const;
  48. virtual PluginView * instantiateView( QWidget * _parent );
  49. /*public slots:
  50. void updateKnobHint();
  51. void updateKnobToolTip();*/
  52. private:
  53. FloatModel m_ch1SweepTimeModel;
  54. BoolModel m_ch1SweepDirModel;
  55. FloatModel m_ch1SweepRtShiftModel;
  56. FloatModel m_ch1WavePatternDutyModel;
  57. FloatModel m_ch1VolumeModel;
  58. BoolModel m_ch1VolSweepDirModel;
  59. FloatModel m_ch1SweepStepLengthModel;
  60. FloatModel m_ch2WavePatternDutyModel;
  61. FloatModel m_ch2VolumeModel;
  62. BoolModel m_ch2VolSweepDirModel;
  63. FloatModel m_ch2SweepStepLengthModel;
  64. BoolModel m_ch3OnModel;
  65. FloatModel m_ch3VolumeModel;
  66. FloatModel m_ch4VolumeModel;
  67. BoolModel m_ch4VolSweepDirModel;
  68. FloatModel m_ch4SweepStepLengthModel;
  69. FloatModel m_ch4ShiftClockFreqModel;
  70. BoolModel m_ch4ShiftRegWidthModel;
  71. FloatModel m_ch4FreqDivRatioModel;
  72. FloatModel m_so1VolumeModel;
  73. FloatModel m_so2VolumeModel;
  74. BoolModel m_ch1So1Model;
  75. BoolModel m_ch2So1Model;
  76. BoolModel m_ch3So1Model;
  77. BoolModel m_ch4So1Model;
  78. BoolModel m_ch1So2Model;
  79. BoolModel m_ch2So2Model;
  80. BoolModel m_ch3So2Model;
  81. BoolModel m_ch4So2Model;
  82. FloatModel m_trebleModel;
  83. FloatModel m_bassModel;
  84. graphModel m_graphModel;
  85. friend class papuInstrumentView;
  86. } ;
  87. class papuInstrumentView : public InstrumentView
  88. {
  89. Q_OBJECT
  90. public:
  91. papuInstrumentView( Instrument * _instrument, QWidget * _parent );
  92. virtual ~papuInstrumentView();
  93. private:
  94. virtual void modelChanged();
  95. Knob * m_ch1SweepTimeKnob;
  96. PixmapButton * m_ch1SweepDirButton;
  97. Knob * m_ch1SweepRtShiftKnob;
  98. Knob * m_ch1WavePatternDutyKnob;
  99. Knob * m_ch1VolumeKnob;
  100. PixmapButton * m_ch1VolSweepDirButton;
  101. Knob * m_ch1SweepStepLengthKnob;
  102. Knob * m_ch2WavePatternDutyKnob;
  103. Knob * m_ch2VolumeKnob;
  104. PixmapButton * m_ch2VolSweepDirButton;
  105. Knob * m_ch2SweepStepLengthKnob;
  106. Knob * m_ch3VolumeKnob;
  107. Knob * m_ch4VolumeKnob;
  108. PixmapButton * m_ch4VolSweepDirButton;
  109. Knob * m_ch4SweepStepLengthKnob;
  110. PixmapButton * m_ch4ShiftRegWidthButton;
  111. Knob * m_so1VolumeKnob;
  112. Knob * m_so2VolumeKnob;
  113. PixmapButton * m_ch1So1Button;
  114. PixmapButton * m_ch2So1Button;
  115. PixmapButton * m_ch3So1Button;
  116. PixmapButton * m_ch4So1Button;
  117. PixmapButton * m_ch1So2Button;
  118. PixmapButton * m_ch2So2Button;
  119. PixmapButton * m_ch3So2Button;
  120. PixmapButton * m_ch4So2Button;
  121. Knob * m_trebleKnob;
  122. Knob * m_bassKnob;
  123. Graph * m_graph;
  124. /*protected slots:
  125. void updateKnobHint();
  126. void updateKnobToolTip();*/
  127. } ;
  128. #endif