Ardour  9.0-pre0-427-gd2a3450e2f
ardour_knob.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2017-2021 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (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  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef _WIDGETS_ARDOUR_KNOB_H_
21 #define _WIDGETS_ARDOUR_KNOB_H_
22 
24 #include "widgets/visibility.h"
25 
26 namespace ArdourWidgets {
27 
29 {
30 public:
31  enum Element {
32  Arc = 0x1,
33  Bevel = 0x2,
34  unused2 = 0x4,
35  unused3 = 0x8,
36  unused4 = 0x10,
37  unused5 = 0x20,
38  };
39 
40  ArdourKnob (Element e = default_elements, Flags flags = NoFlags);
41 
42  Element elements () const
43  {
44  return _elements;
45  }
48 
50 
51  void gen_faceplate (Pango::FontDescription const&, std::string const&, std::string const&, std::string const&);
52 
53 protected:
54  virtual void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
56 
57 private:
60 
61  Cairo::RefPtr<Cairo::ImageSurface> _bg;
62 };
63 
64 } // namespace ArdourWidgets
65 
66 #endif /* __gtk2_ardour_ardour_knob_h__ */
static Element default_elements
Definition: ardour_knob.h:49
virtual void render(Cairo::RefPtr< Cairo::Context > const &, cairo_rectangle_t *)
void set_elements(Element)
ArdourKnob(Element e=default_elements, Flags flags=NoFlags)
void add_elements(Element)
void gen_faceplate(Pango::FontDescription const &, std::string const &, std::string const &, std::string const &)
void on_size_request(Gtk::Requisition *req)
This is a default handler for the signal signal_size_request().
Element elements() const
Definition: ardour_knob.h:42
Cairo::RefPtr< Cairo::ImageSurface > _bg
Definition: ardour_knob.h:61
#define LIBWIDGETS_API