1 /*
2  * ZamHeadX2 stereo HRTF tool
3  * Copyright (C) 2014  Damien Zammit <damien@zamaudio.com>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * For a full copy of the GNU General Public License see the doc/GPL.txt file.
16  */
17 
18 #ifndef ZAMCOMPX2UI_HPP_INCLUDED
19 #define ZAMCOMPX2UI_HPP_INCLUDED
20 
21 #include "DistrhoUI.hpp"
22 #include "ImageWidgets.hpp"
23 #include "../../widgets/ZamWidgets.hpp"
24 
25 #include "ZamHeadX2Artwork.hpp"
26 
27 using DGL::Image;
28 using DGL::ZamKnob;
29 
30 START_NAMESPACE_DISTRHO
31 
32 // -----------------------------------------------------------------------
33 
34 class ZamHeadX2UI : public UI,
35                     public ZamKnob::Callback
36 {
37 public:
38     ZamHeadX2UI();
39 
40 protected:
41     // -------------------------------------------------------------------
42     // DSP Callbacks
43 
44     void parameterChanged(uint32_t index, float value) override;
45     void programLoaded(uint32_t index) override;
46 
47     // -------------------------------------------------------------------
48     // Widget Callbacks
49 
50     void imageKnobDragStarted(ZamKnob* knob) override;
51     void imageKnobDragFinished(ZamKnob* knob) override;
52     void imageKnobValueChanged(ZamKnob* knob, float value) override;
53 
54     void onDisplay() override;
55 
56     void stateChanged(const char*, const char*) override;
57 
58 private:
59     Image fImgBackground;
60     ScopedPointer<ZamKnob> fKnobAzimuth, fKnobElevation, fKnobWidth;
61 };
62 
63 // -----------------------------------------------------------------------
64 
65 END_NAMESPACE_DISTRHO
66 
67 #endif // ZAMCOMPX2UI_HPP_INCLUDED
68