InstrumentTrackWindow.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * InstrumentTrackWindow.h - declaration of InstrumentTrackWindow class
  3. *
  4. * Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  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 INSTRUMENT_TRACK_WINDOW_H
  25. #define INSTRUMENT_TRACK_WINDOW_H
  26. #include <QWidget>
  27. #include "ModelView.h"
  28. #include "SerializingObject.h"
  29. class EffectRackView;
  30. class MixerLineLcdSpinBox;
  31. class InstrumentFunctionArpeggioView;
  32. class InstrumentFunctionNoteStackingView;
  33. class InstrumentMidiIOView;
  34. class InstrumentMiscView;
  35. class InstrumentSoundShapingView;
  36. class InstrumentTrack;
  37. class InstrumentTrackShapingView;
  38. class InstrumentTrackView;
  39. class Knob;
  40. class LcdSpinBox;
  41. class LeftRightNav;
  42. class PianoView;
  43. class PluginView;
  44. class QLabel;
  45. class QLineEdit;
  46. class QWidget;
  47. class TabWidget;
  48. class InstrumentTrackWindow : public QWidget, public ModelView,
  49. public SerializingObjectHook
  50. {
  51. Q_OBJECT
  52. public:
  53. InstrumentTrackWindow( InstrumentTrackView * _tv );
  54. virtual ~InstrumentTrackWindow();
  55. // parent for all internal tab-widgets
  56. TabWidget * tabWidgetParent()
  57. {
  58. return m_tabWidget;
  59. }
  60. InstrumentTrack * model()
  61. {
  62. return castModel<InstrumentTrack>();
  63. }
  64. const InstrumentTrack * model() const
  65. {
  66. return castModel<InstrumentTrack>();
  67. }
  68. void setInstrumentTrackView( InstrumentTrackView * _tv );
  69. InstrumentTrackView *instrumentTrackView()
  70. {
  71. return m_itv;
  72. }
  73. PianoView * pianoView()
  74. {
  75. return m_pianoView;
  76. }
  77. static void dragEnterEventGeneric( QDragEnterEvent * _dee );
  78. void dragEnterEvent( QDragEnterEvent * _dee ) override;
  79. void dropEvent( QDropEvent * _de ) override;
  80. public slots:
  81. void textChanged( const QString & _new_name );
  82. void toggleVisibility( bool _on );
  83. void updateName();
  84. void updateInstrumentView();
  85. protected:
  86. // capture close-events for toggling instrument-track-button
  87. void closeEvent( QCloseEvent * _ce ) override;
  88. void focusInEvent( QFocusEvent * _fe ) override;
  89. void saveSettings( QDomDocument & _doc, QDomElement & _this ) override;
  90. void loadSettings( const QDomElement & _this ) override;
  91. protected slots:
  92. void saveSettingsBtnClicked();
  93. void viewNextInstrument();
  94. void viewPrevInstrument();
  95. private:
  96. void modelChanged() override;
  97. void viewInstrumentInDirection(int d);
  98. //! adjust size of any child widget of the main tab
  99. //! required to keep the old look when using a variable sized tab widget
  100. void adjustTabSize(QWidget *w);
  101. InstrumentTrack * m_track;
  102. InstrumentTrackView * m_itv;
  103. // widgets on the top of an instrument-track-window
  104. QLineEdit * m_nameLineEdit;
  105. LeftRightNav * m_leftRightNav;
  106. Knob * m_volumeKnob;
  107. Knob * m_panningKnob;
  108. Knob * m_pitchKnob;
  109. QLabel * m_pitchLabel;
  110. LcdSpinBox* m_pitchRangeSpinBox;
  111. QLabel * m_pitchRangeLabel;
  112. MixerLineLcdSpinBox * m_mixerChannelNumber;
  113. // tab-widget with all children
  114. TabWidget * m_tabWidget;
  115. PluginView * m_instrumentView;
  116. InstrumentSoundShapingView * m_ssView;
  117. InstrumentFunctionNoteStackingView* m_noteStackingView;
  118. InstrumentFunctionArpeggioView* m_arpeggioView;
  119. InstrumentMidiIOView * m_midiView;
  120. EffectRackView * m_effectView;
  121. InstrumentMiscView *m_miscView;
  122. // test-piano at the bottom of every instrument-settings-window
  123. PianoView * m_pianoView;
  124. friend class InstrumentView;
  125. friend class InstrumentTrackView;
  126. } ;
  127. #endif