InstrumentTrackView.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * InstrumentTrackView.h - declaration of InstrumentTrackView 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_VIEW_H
  25. #define INSTRUMENT_TRACK_VIEW_H
  26. #include "TrackView.h"
  27. #include "InstrumentTrack.h"
  28. #include "MidiCCRackView.h"
  29. class InstrumentTrackWindow;
  30. class Knob;
  31. class TrackContainerView;
  32. class TrackLabelButton;
  33. class InstrumentTrackView : public TrackView
  34. {
  35. Q_OBJECT
  36. public:
  37. InstrumentTrackView( InstrumentTrack * _it, TrackContainerView* tc );
  38. virtual ~InstrumentTrackView();
  39. InstrumentTrackWindow * getInstrumentTrackWindow();
  40. InstrumentTrack * model()
  41. {
  42. return castModel<InstrumentTrack>();
  43. }
  44. const InstrumentTrack * model() const
  45. {
  46. return castModel<InstrumentTrack>();
  47. }
  48. static InstrumentTrackWindow * topLevelInstrumentTrackWindow();
  49. QMenu * midiMenu()
  50. {
  51. return m_midiMenu;
  52. }
  53. // Create a menu for assigning/creating channels for this track
  54. QMenu * createMixerMenu( QString title, QString newMixerLabel ) override;
  55. protected:
  56. void dragEnterEvent( QDragEnterEvent * _dee ) override;
  57. void dropEvent( QDropEvent * _de ) override;
  58. private slots:
  59. void toggleInstrumentWindow( bool _on );
  60. void toggleMidiCCRack();
  61. void activityIndicatorPressed();
  62. void activityIndicatorReleased();
  63. void midiInSelected();
  64. void midiOutSelected();
  65. void midiConfigChanged();
  66. void assignMixerLine( int channelIndex );
  67. void createMixerLine();
  68. void handleConfigChange(QString cls, QString attr, QString value);
  69. private:
  70. InstrumentTrackWindow * m_window;
  71. // widgets in track-settings-widget
  72. TrackLabelButton * m_tlb;
  73. Knob * m_volumeKnob;
  74. Knob * m_panningKnob;
  75. FadeButton * m_activityIndicator;
  76. QMenu * m_midiMenu;
  77. QAction * m_midiInputAction;
  78. QAction * m_midiOutputAction;
  79. std::unique_ptr<MidiCCRackView> m_midiCCRackView;
  80. QPoint m_lastPos;
  81. FadeButton * getActivityIndicator() override
  82. {
  83. return m_activityIndicator;
  84. }
  85. friend class InstrumentTrackWindow;
  86. } ;
  87. #endif