FreeBoy.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * FreeBoyInstrument.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 FREEBOY_H
  26. #define FREEBOY_H
  27. #include <QObject>
  28. #include "Instrument.h"
  29. #include "InstrumentView.h"
  30. #include "Knob.h"
  31. #include "Graph.h"
  32. #include "Gb_Apu.h"
  33. class FreeBoyInstrumentView;
  34. class NotePlayHandle;
  35. class PixmapButton;
  36. class FreeBoyInstrument : public Instrument
  37. {
  38. Q_OBJECT
  39. public:
  40. FreeBoyInstrument( InstrumentTrack * _instrument_track );
  41. virtual ~FreeBoyInstrument();
  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 f_cnt_t desiredReleaseFrames() const;
  49. virtual PluginView * instantiateView( QWidget * _parent );
  50. /*public slots:
  51. void updateKnobHint();
  52. void updateKnobToolTip();*/
  53. private:
  54. FloatModel m_ch1SweepTimeModel;
  55. BoolModel m_ch1SweepDirModel;
  56. FloatModel m_ch1SweepRtShiftModel;
  57. FloatModel m_ch1WavePatternDutyModel;
  58. FloatModel m_ch1VolumeModel;
  59. BoolModel m_ch1VolSweepDirModel;
  60. FloatModel m_ch1SweepStepLengthModel;
  61. FloatModel m_ch2WavePatternDutyModel;
  62. FloatModel m_ch2VolumeModel;
  63. BoolModel m_ch2VolSweepDirModel;
  64. FloatModel m_ch2SweepStepLengthModel;
  65. BoolModel m_ch3OnModel;
  66. FloatModel m_ch3VolumeModel;
  67. FloatModel m_ch4VolumeModel;
  68. BoolModel m_ch4VolSweepDirModel;
  69. FloatModel m_ch4SweepStepLengthModel;
  70. FloatModel m_ch4ShiftClockFreqModel;
  71. BoolModel m_ch4ShiftRegWidthModel;
  72. FloatModel m_ch4FreqDivRatioModel;
  73. FloatModel m_so1VolumeModel;
  74. FloatModel m_so2VolumeModel;
  75. BoolModel m_ch1So1Model;
  76. BoolModel m_ch2So1Model;
  77. BoolModel m_ch3So1Model;
  78. BoolModel m_ch4So1Model;
  79. BoolModel m_ch1So2Model;
  80. BoolModel m_ch2So2Model;
  81. BoolModel m_ch3So2Model;
  82. BoolModel m_ch4So2Model;
  83. FloatModel m_trebleModel;
  84. FloatModel m_bassModel;
  85. graphModel m_graphModel;
  86. // Fake CPU timing
  87. blip_time_t m_time;
  88. blip_time_t fakeClock() { return m_time += 4; }
  89. friend class FreeBoyInstrumentView;
  90. } ;
  91. class FreeBoyInstrumentView : public InstrumentViewFixedSize
  92. {
  93. Q_OBJECT
  94. public:
  95. FreeBoyInstrumentView( Instrument * _instrument, QWidget * _parent );
  96. virtual ~FreeBoyInstrumentView();
  97. private:
  98. virtual void modelChanged();
  99. Knob * m_ch1SweepTimeKnob;
  100. PixmapButton * m_ch1SweepDirButton;
  101. Knob * m_ch1SweepRtShiftKnob;
  102. Knob * m_ch1WavePatternDutyKnob;
  103. Knob * m_ch1VolumeKnob;
  104. PixmapButton * m_ch1VolSweepDirButton;
  105. Knob * m_ch1SweepStepLengthKnob;
  106. Knob * m_ch2WavePatternDutyKnob;
  107. Knob * m_ch2VolumeKnob;
  108. PixmapButton * m_ch2VolSweepDirButton;
  109. Knob * m_ch2SweepStepLengthKnob;
  110. Knob * m_ch3VolumeKnob;
  111. Knob * m_ch4VolumeKnob;
  112. PixmapButton * m_ch4VolSweepDirButton;
  113. Knob * m_ch4SweepStepLengthKnob;
  114. PixmapButton * m_ch4ShiftRegWidthButton;
  115. Knob * m_so1VolumeKnob;
  116. Knob * m_so2VolumeKnob;
  117. PixmapButton * m_ch1So1Button;
  118. PixmapButton * m_ch2So1Button;
  119. PixmapButton * m_ch3So1Button;
  120. PixmapButton * m_ch4So1Button;
  121. PixmapButton * m_ch1So2Button;
  122. PixmapButton * m_ch2So2Button;
  123. PixmapButton * m_ch3So2Button;
  124. PixmapButton * m_ch4So2Button;
  125. Knob * m_trebleKnob;
  126. Knob * m_bassKnob;
  127. Graph * m_graph;
  128. /*protected slots:
  129. void updateKnobHint();
  130. void updateKnobToolTip();*/
  131. } ;
  132. #endif