LMMS
Loading...
Searching...
No Matches
PatchesDialog.h
Go to the documentation of this file.
1/*
2 * PatchesDialog.h - display GIG patches (based on Sf2 patches_dialog.h)
3 *
4 * Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail/dot/com>
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
25
26#ifndef PATCHES_DIALOG_H
27#define PATCHES_DIALOG_H
28
29#include "ui_PatchesDialog.h"
30#include "LcdSpinBox.h"
31#include "GigPlayer.h"
32
33#include <QWidget>
34#include <QLabel>
35
36//----------------------------------------------------------------------------
37// qsynthPresetForm -- UI wrapper form.
38
39namespace lmms::gui
40{
41
42
43class PatchesDialog : public QDialog, private Ui::PatchesDialog
44{
45 Q_OBJECT
46
47public:
48
49 // Constructor.
50 PatchesDialog(QWidget * pParent = 0, Qt::WindowFlags wflags = QFlag(0));
51
52 // Destructor.
53 ~PatchesDialog() override = default;
54
55
56 void setup( GigInstance * pSynth, int iChan, const QString & chanName,
57 LcdSpinBoxModel * bankModel, LcdSpinBoxModel * progModel, QLabel * patchLabel );
58
59public slots:
60
61 void stabilizeForm();
62 void bankChanged();
63 void progChanged( QTreeWidgetItem * curr, QTreeWidgetItem * prev );
64
65protected slots:
66
67 void accept() override;
68 void reject() override;
69
70protected:
71
72 void setBankProg( int iBank, int iProg );
73
74 QTreeWidgetItem * findBankItem( int iBank );
75 QTreeWidgetItem * findProgItem( int iProg );
76
77 bool validateForm();
78
79private:
80
81 // Instance variables.
83
87
89
92 QLabel * m_patchLabel;
93};
94
95
96} // namespace lmms::gui
97
98#endif
Definition GigPlayer.h:74
int m_dirty
Definition PatchesDialog.h:88
LcdSpinBoxModel * m_progModel
Definition PatchesDialog.h:91
QTreeWidgetItem * findProgItem(int iProg)
Definition PatchesDialog.cpp:301
void stabilizeForm()
Definition PatchesDialog.cpp:200
QLabel * m_patchLabel
Definition PatchesDialog.h:92
GigInstance * m_pSynth
Definition PatchesDialog.h:82
void setup(GigInstance *pSynth, int iChan, const QString &chanName, LcdSpinBoxModel *bankModel, LcdSpinBoxModel *progModel, QLabel *patchLabel)
Definition PatchesDialog.cpp:111
int m_iChan
Definition PatchesDialog.h:84
void accept() override
Definition PatchesDialog.cpp:235
LcdSpinBoxModel * m_bankModel
Definition PatchesDialog.h:90
void progChanged(QTreeWidgetItem *curr, QTreeWidgetItem *prev)
Definition PatchesDialog.cpp:382
int m_iProg
Definition PatchesDialog.h:86
void bankChanged()
Definition PatchesDialog.cpp:323
int m_iBank
Definition PatchesDialog.h:85
QTreeWidgetItem * findBankItem(int iBank)
Definition PatchesDialog.cpp:279
~PatchesDialog() override=default
PatchesDialog(QWidget *pParent=0, Qt::WindowFlags wflags=QFlag(0))
Definition PatchesDialog.cpp:66
void setBankProg(int iBank, int iProg)
Definition PatchesDialog.cpp:223
bool validateForm()
Definition PatchesDialog.cpp:209
void reject() override
Definition PatchesDialog.cpp:263
Definition AudioPortAudio.cpp:223
IntModel LcdSpinBoxModel
Definition LcdSpinBox.h:88