1 |
schoenebeck |
1667 |
// qsamplerFxSendList.h |
2 |
|
|
// |
3 |
|
|
/**************************************************************************** |
4 |
|
|
Copyright (C) 2008, Christian Schoenebeck |
5 |
capela |
2074 |
Copyright (C) 2010, rncbc aka Rui Nuno Capela. All rights reserved. |
6 |
schoenebeck |
1667 |
|
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 <QAbstractListModel> |
27 |
|
|
#include <lscp/client.h> |
28 |
|
|
|
29 |
|
|
#include "qsamplerFxSend.h" |
30 |
|
|
|
31 |
|
|
namespace QSampler { |
32 |
|
|
|
33 |
|
|
class FxSendsModel : public QAbstractListModel |
34 |
|
|
{ |
35 |
|
|
Q_OBJECT |
36 |
|
|
public: |
37 |
|
|
FxSendsModel(int SamplerChannelID, QObject* pParent = NULL); |
38 |
|
|
|
39 |
|
|
// Overridden methods from subclass(es) |
40 |
|
|
int rowCount(const QModelIndex& parent) const; |
41 |
|
|
QVariant data(const QModelIndex& index, int role) const; |
42 |
|
|
bool setData(const QModelIndex& index, |
43 |
|
|
const QVariant& value, int role = Qt::EditRole); |
44 |
|
|
QVariant headerData(int section, Qt::Orientation orientation, |
45 |
|
|
int role = Qt::DisplayRole) const; |
46 |
|
|
Qt::ItemFlags flags(const QModelIndex& index) const; |
47 |
|
|
|
48 |
|
|
// Make the following method public |
49 |
|
|
QAbstractListModel::reset; |
50 |
|
|
|
51 |
|
|
// Own methods |
52 |
|
|
FxSend* addFxSend(); |
53 |
|
|
FxSend* fxSend(const QModelIndex& index); |
54 |
|
|
void removeFxSend(const QModelIndex& index); |
55 |
|
|
|
56 |
|
|
signals: |
57 |
|
|
void fxSendsDirtyChanged(bool); |
58 |
|
|
|
59 |
|
|
public slots: |
60 |
|
|
void cleanRefresh(); |
61 |
|
|
void applyToSampler(); |
62 |
schoenebeck |
1668 |
// not pretty, but more efficient than wiring connections for each element |
63 |
|
|
void onExternalModifiication(const QModelIndex& index); |
64 |
schoenebeck |
1667 |
|
65 |
|
|
private: |
66 |
|
|
typedef QList<FxSend> FxSendsList; |
67 |
|
|
|
68 |
|
|
int m_SamplerChannelID; |
69 |
|
|
FxSendsList m_FxSends; |
70 |
|
|
}; |
71 |
|
|
|
72 |
|
|
} // namespace QSampler |
73 |
|
|
|
74 |
|
|
#endif // __qsamplerFxSendList_h |
75 |
|
|
|
76 |
|
|
// end of qsamplerFxSendList.h |