Debian Codegraph @

Source/Widgets/Fader.h

raw
1 /*
2 * Fader.h
3 *
4 * Created on: 21 Aug 2016
5 * Author: jeremy
6 */
7
8 #ifndef SOURCE_WIDGETS_FADER_H_
9 #define SOURCE_WIDGETS_FADER_H_
10
11 #include <gtkmm/grid.h>
12 #include <gtkmm/label.h>
13 #include <gtkmm/scale.h>
14
15 #include <string>
16 #include <memory>
17
18 namespace Widgets
19 {
20
21 class Fader : public Gtk::Grid
22 {
23
24 public:
25
26 Fader(const std::string& name, int instrumentId, int vol);
27 virtual ~Fader() = default;
28
29 Gtk::Scale& GetScale() { return volScale; }; //FIXME: check if this is fixable on Raspbian Buster
30
31 int GetInstrumentId() const { return instrument; }
32 int GetValue() const { return (int)volScale.get_value(); }
33
34 private:
35
36 int instrument;
37 int volume;
38 Gtk::Label label;
39 Gtk::Scale volScale;
40
41 };
42
43 using FaderPtr = std::unique_ptr<Fader>;
44
45 } /* namespace Gui */
46
47 #endif /* SOURCE_WIDGETS_FADER_H_ */