~djfun/+junk/qmlfluidsynth

« back to all changes in this revision

Viewing changes to qmlfluidsynth.h

  • Committer: Martin Kaistra
  • Date: 2013-05-31 10:36:09 UTC
  • Revision ID: martin@djfun.de-20130531103609-erh489xdmfsgsvnc
set more settings on fluidsynth for stability and lower latency on mobile devices, allow some settings to be changed from QML

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
{
10
10
    Q_OBJECT
11
11
    Q_DISABLE_COPY(QmlFluidsynth)
 
12
    Q_PROPERTY( QString soundfont READ soundfont WRITE setSoundfont NOTIFY soundfontChanged )
 
13
    Q_PROPERTY( double sampleRate READ sampleRate WRITE setSampleRate NOTIFY sampleRateChanged )
 
14
    Q_PROPERTY( double gain READ gain WRITE setGain NOTIFY gainChanged )
 
15
    Q_PROPERTY( int program READ program WRITE setProgram NOTIFY programChanged )
12
16
    
13
17
public:
14
 
    QmlFluidsynth(QQuickItem *parent = 0);
 
18
    explicit QmlFluidsynth(QQuickItem *parent = 0);
15
19
    ~QmlFluidsynth();
 
20
 
 
21
Q_SIGNALS:
 
22
    void soundfontChanged();
 
23
    void sampleRateChanged();
 
24
    void gainChanged();
 
25
    void programChanged();
 
26
 
16
27
public slots:
17
28
    void noteOn(int key);
18
29
    void noteOff(int key);
19
 
private:
 
30
 
 
31
protected:
20
32
    fluid_synth_t *pSynth;
21
 
    fluid_settings_t *m_pFluidSettings;
22
 
    fluid_audio_driver_t *m_adriver;
23
 
    QString soundfont;
 
33
    fluid_settings_t *pFluidSettings;
 
34
    fluid_audio_driver_t *adriver;
 
35
    int soundfontId;
 
36
 
 
37
    QString m_soundfont;
 
38
    double m_sampleRate;
 
39
    double m_gain;
 
40
    int m_program;
 
41
 
 
42
    QString soundfont() { return this->m_soundfont; }
 
43
    double sampleRate() { return this->m_sampleRate; }
 
44
    double gain() { return this->m_gain; }
 
45
    int program() { return this->m_program; }
 
46
 
 
47
    void setSoundfont(QString soundfont);
 
48
    void setSampleRate(double sampleRate);
 
49
    void setGain(double gain);
 
50
    void setProgram(int program);
24
51
};
25
52
 
26
53
QML_DECLARE_TYPE(QmlFluidsynth)