vibed.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * vibed.h - combination of PluckedStringSynth and BitInvader
  3. *
  4. * Copyright (c) 2006-2008 Danny McRae <khjklujn/at/yahoo/com>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #ifndef _VIBED_H
  25. #define _VIBED_H
  26. #include "Instrument.h"
  27. #include "InstrumentView.h"
  28. #include "Graph.h"
  29. #include "Knob.h"
  30. #include "PixmapButton.h"
  31. #include "LedCheckbox.h"
  32. #include "nine_button_selector.h"
  33. class vibedView;
  34. class NotePlayHandle;
  35. class vibed : public Instrument
  36. {
  37. Q_OBJECT
  38. public:
  39. vibed( InstrumentTrack * _instrument_track );
  40. virtual ~vibed();
  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 Flags flags() const
  48. {
  49. return IsNotBendable;
  50. }
  51. virtual PluginView * instantiateView( QWidget * _parent );
  52. private:
  53. QList<FloatModel*> m_pickKnobs;
  54. QList<FloatModel*> m_pickupKnobs;
  55. QList<FloatModel*> m_stiffnessKnobs;
  56. QList<FloatModel*> m_volumeKnobs;
  57. QList<FloatModel*> m_panKnobs;
  58. QList<FloatModel*> m_detuneKnobs;
  59. QList<FloatModel*> m_randomKnobs;
  60. QList<FloatModel*> m_lengthKnobs;
  61. QList<BoolModel*> m_powerButtons;
  62. QList<graphModel*> m_graphs;
  63. QList<BoolModel*> m_impulses;
  64. QList<nineButtonSelectorModel*> m_harmonics;
  65. static const int __sampleLength = 128;
  66. friend class vibedView;
  67. } ;
  68. class vibedView : public InstrumentView
  69. {
  70. Q_OBJECT
  71. public:
  72. vibedView( Instrument * _instrument,
  73. QWidget * _parent );
  74. virtual ~vibedView() {};
  75. public slots:
  76. void showString( int _string );
  77. void contextMenuEvent( QContextMenuEvent * );
  78. void displayHelp();
  79. protected slots:
  80. void sinWaveClicked();
  81. void triangleWaveClicked();
  82. void sawWaveClicked();
  83. void sqrWaveClicked();
  84. void noiseWaveClicked();
  85. void usrWaveClicked();
  86. void smoothClicked();
  87. void normalizeClicked();
  88. private:
  89. virtual void modelChanged();
  90. // String-related
  91. Knob * m_pickKnob;
  92. Knob * m_pickupKnob;
  93. Knob * m_stiffnessKnob;
  94. Knob * m_volumeKnob;
  95. Knob * m_panKnob;
  96. Knob * m_detuneKnob;
  97. Knob * m_randomKnob;
  98. Knob * m_lengthKnob;
  99. Graph * m_graph;
  100. nineButtonSelector * m_harmonic;
  101. LedCheckBox * m_impulse;
  102. LedCheckBox * m_power;
  103. // Not in model
  104. nineButtonSelector * m_stringSelector;
  105. PixmapButton * m_smoothBtn;
  106. PixmapButton * m_normalizeBtn;
  107. // From impulse editor
  108. PixmapButton * m_sinWaveBtn;
  109. PixmapButton * m_triangleWaveBtn;
  110. PixmapButton * m_sqrWaveBtn;
  111. PixmapButton * m_sawWaveBtn;
  112. PixmapButton * m_whiteNoiseWaveBtn;
  113. PixmapButton * m_usrWaveBtn;
  114. };
  115. #endif