1 /* -*- c-basic-offset: 4 -*-  vi:set ts=8 sts=4 sw=4: */
2 
3 /* less_trivial_synth_qt_gui.h
4 
5    DSSI Soft Synth Interface
6    Constructed by Chris Cannam and Steve Harris
7 
8    This is an example Qt GUI for an example DSSI synth plugin.
9 
10    This example file is in the public domain.
11 */
12 
13 #ifndef _LESS_TRIVIAL_SYNTH_QT_GUI_H_INCLUDED_
14 #define _LESS_TRIVIAL_SYNTH_QT_GUI_H_INCLUDED_
15 
16 #include <QFrame>
17 #include <QDial>
18 #include <QLabel>
19 #include <QLayout>
20 
21 extern "C" {
22 #include <lo/lo.h>
23 }
24 
25 class SynthGUI : public QFrame
26 {
27     Q_OBJECT
28 
29 public:
30     SynthGUI(const char * host, const char * port,
31 	     QByteArray controlPath, QByteArray midiPath, QByteArray programPath,
32 	     QByteArray exitingPath, QWidget *w = 0);
33     virtual ~SynthGUI();
34 
ready()35     bool ready() const { return m_ready; }
setReady(bool ready)36     void setReady(bool ready) { m_ready = ready; }
37 
setHostRequestedQuit(bool r)38     void setHostRequestedQuit(bool r) { m_hostRequestedQuit = r; }
39 
40 public slots:
41     void setTuning (float hz);
42     void setAttack (float sec);
43     void setDecay  (float sec);
44     void setSustain(float percent);
45     void setRelease(float sec);
46     void setTimbre (float val);
47     void aboutToQuit();
48 
49 protected slots:
50     void tuningChanged (int);
51     void attackChanged (int);
52     void decayChanged  (int);
53     void sustainChanged(int);
54     void releaseChanged(int);
55     void timbreChanged (int);
56     void test_press();
57     void test_release();
58     void oscRecv();
59 
60 protected:
61     QDial *newQDial( int, int, int, int );
62 
63     QDial *m_tuning;
64     QDial *m_attack;
65     QDial *m_decay;
66     QDial *m_sustain;
67     QDial *m_release;
68     QDial *m_timbre;
69 
70     QLabel *m_tuningLabel;
71     QLabel *m_attackLabel;
72     QLabel *m_decayLabel;
73     QLabel *m_sustainLabel;
74     QLabel *m_releaseLabel;
75     QLabel *m_timbreLabel;
76 
77     lo_address m_host;
78     QByteArray m_controlPath;
79     QByteArray m_midiPath;
80     QByteArray m_programPath;
81     QByteArray m_exitingPath;
82 
83     bool m_suppressHostUpdate;
84     bool m_hostRequestedQuit;
85     bool m_ready;
86 };
87 
88 
89 #endif
90