1 |
// qsamplerFxSendList.h |
2 |
// |
3 |
/**************************************************************************** |
4 |
Copyright (C) 2010-2019, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2008, Christian Schoenebeck |
6 |
|
7 |
This program is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU General Public License |
9 |
as published by the Free Software Foundation; either version 2 |
10 |
of the License, or (at your option) any later version. |
11 |
|
12 |
This program is distributed in the hope that it will be useful, |
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
GNU General Public License for more details. |
16 |
|
17 |
You should have received a copy of the GNU General Public License |
18 |
along with this program; if not, write to the Free Software |
19 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 |
|
21 |
*****************************************************************************/ |
22 |
|
23 |
#ifndef __qsamplerFxSendList_h |
24 |
#define __qsamplerFxSendList_h |
25 |
|
26 |
#include "qsamplerFxSend.h" |
27 |
|
28 |
#include <lscp/client.h> |
29 |
|
30 |
#include <QAbstractListModel> |
31 |
|
32 |
namespace QSampler { |
33 |
|
34 |
class FxSendsModel : public QAbstractListModel |
35 |
{ |
36 |
Q_OBJECT |
37 |
|
38 |
public: |
39 |
|
40 |
FxSendsModel(int iChannelID, QObject *pParent = nullptr); |
41 |
|
42 |
// Overridden methods from subclass(es) |
43 |
int rowCount(const QModelIndex& parent) const; |
44 |
QVariant data(const QModelIndex& index, int role) const; |
45 |
bool setData(const QModelIndex& index, |
46 |
const QVariant& value, int role = Qt::EditRole); |
47 |
QVariant headerData(int section, Qt::Orientation orientation, |
48 |
int role = Qt::DisplayRole) const; |
49 |
Qt::ItemFlags flags(const QModelIndex& index) const; |
50 |
|
51 |
// Own methods |
52 |
FxSend *addFxSend(); |
53 |
FxSend *fxSend(const QModelIndex& index); |
54 |
void removeFxSend(const QModelIndex& index); |
55 |
|
56 |
signals: |
57 |
|
58 |
void fxSendsDirtyChanged(bool); |
59 |
|
60 |
public slots: |
61 |
|
62 |
void cleanRefresh(); |
63 |
void applyToSampler(); |
64 |
|
65 |
// not pretty, but more efficient than wiring connections for each element |
66 |
void onExternalModifiication(const QModelIndex& index); |
67 |
|
68 |
private: |
69 |
|
70 |
typedef QList<FxSend> FxSendsList; |
71 |
|
72 |
int m_iChannelID; |
73 |
FxSendsList m_fxSends; |
74 |
}; |
75 |
|
76 |
} // namespace QSampler |
77 |
|
78 |
#endif // __qsamplerFxSendList_h |
79 |
|
80 |
// end of qsamplerFxSendList.h |