1 //=============================================================================
2 //  MuseScore
3 //  Music Composition & Notation
4 //
5 //  Copyright (C) 2013 Werner Schweer
6 //
7 //  This program is free software; you can redistribute it and/or modify
8 //  it under the terms of the GNU General Public License version 2
9 //  as published by the Free Software Foundation and appearing in
10 //  the file LICENCE.GPL
11 //=============================================================================
12 
13 #include "aeolusgui.h"
14 #include "aeolus.h"
15 #include "mscore/preferences.h"
16 
17 //---------------------------------------------------------
18 //   gui
19 //---------------------------------------------------------
20 
gui()21 SynthesizerGui* Aeolus::gui()
22       {
23       if (_gui == 0)
24             _gui = new AeolusGui(this);
25       return _gui;
26       }
27 
28 //---------------------------------------------------------
29 //   AeolusGui
30 //---------------------------------------------------------
31 
AeolusGui(Synthesizer * s)32 AeolusGui::AeolusGui(Synthesizer* s)
33    : SynthesizerGui(s)
34       {
35       setupUi(this);
36 
37       reverbDelay->setId(A_REVSIZE);
38       reverbTime->setId(A_REVTIME);
39       position->setId(A_STPOSIT);
40 
41       connect (reverbDelay, SIGNAL(valueChanged(double,int)), SLOT(valueHasChanged(double,int)));
42       connect (reverbTime,  SIGNAL(valueChanged(double,int)), SLOT(valueHasChanged(double,int)));
43       connect (position,    SIGNAL(valueChanged(double,int)), SLOT(valueHasChanged(double,int)));
44       }
45 
46 //---------------------------------------------------------
47 //   synthesizerChanged
48 //---------------------------------------------------------
49 
synthesizerChanged()50 void AeolusGui::synthesizerChanged()
51       {
52       reverbDelay->setValue(synthesizer()->value(A_REVSIZE));
53       reverbTime->setValue(synthesizer()->value(A_REVTIME));
54       position->setValue(synthesizer()->value(A_STPOSIT));
55       }
56 
57 //---------------------------------------------------------
58 //   valueHasChanged
59 //---------------------------------------------------------
60 
valueHasChanged(double val,int id)61 void AeolusGui::valueHasChanged(double val, int id)
62       {
63       synthesizer()->setValue(id, val);
64       emit valueChanged();
65       }
66 
67