1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 3 /* 4 Rosegarden 5 A MIDI and audio sequencer and musical notation editor. 6 Copyright 2000-2021 the Rosegarden development team. 7 8 Other copyrights also apply to some parts of this work. Please 9 see the AUTHORS file and individual file headers for details. 10 11 This program is free software; you can redistribute it and/or 12 modify it under the terms of the GNU General Public License as 13 published by the Free Software Foundation; either version 2 of the 14 License, or (at your option) any later version. See the file 15 COPYING included with this distribution for more information. 16 */ 17 18 #ifndef RG_INSTRUMENTPARAMETERPANEL_H 19 #define RG_INSTRUMENTPARAMETERPANEL_H 20 21 #include <QFrame> 22 23 #include <vector> 24 #include <utility> 25 26 class QWidget; 27 class QLabel; 28 29 30 namespace Rosegarden 31 { 32 33 class RosegardenDocument; 34 class Instrument; 35 class SqueezedLabel; 36 37 38 //////////////////////////////////////////////////////////////////////// 39 40 /// Code shared by the MIDI and Audio Instrument Parameter Panels 41 class InstrumentParameterPanel : public QFrame 42 { 43 Q_OBJECT 44 public: 45 InstrumentParameterPanel(QWidget *parent); 46 ~InstrumentParameterPanel() override {} 47 48 protected: 49 void setSelectedInstrument(Instrument *); 50 Instrument *getSelectedInstrument(); 51 52 SqueezedLabel *m_instrumentLabel; 53 54 private slots: 55 /// m_selectedInstrument is being destroyed 56 void slotInstrumentGone(); 57 58 private: 59 // ??? This needs to go. If the panels need the selected instrument, 60 // they need to get it directly from the document. That 61 // simplifies things by not needing to maintain this pointer. 62 // And not needing to connect for the Instrument's destroy() signal. 63 // See InstrumentParameterBox::slotDocumentModified() for the 64 // proper steps to get the selected instrument pointer. 65 // As an interim solution, we could move those steps into 66 // getSelectedInstrument() and stub out setSelectedInstrument(). 67 Instrument *m_selectedInstrument; 68 }; 69 70 71 72 } 73 74 #endif 75