2 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef _ardour_maschine2_menu_h_
20 #define _ardour_maschine2_menu_h_
23 #include <cairomm/refptr.h>
25 #include "pbd/signals.h"
26 #include "canvas/container.h"
28 namespace ArdourCanvas {
33 class AutomationControl;
40 namespace ArdourSurface {
43 class M2EncoderInterface;
45 class Maschine2Menu : public ArdourCanvas::Container
48 Maschine2Menu (PBD::EventLoop*, ArdourCanvas::Item*, const std::vector<std::string>&, double width = 64);
49 virtual ~Maschine2Menu ();
51 void set_control (M2EncoderInterface*);
52 void set_active (uint32_t index);
55 uint32_t active () const { return _active; }
56 uint32_t items() const { return _displays.size(); }
58 PBD::Signal0<void> ActiveChanged;
60 void render (ArdourCanvas::Rect const &, Cairo::RefPtr<Cairo::Context>) const;
63 void rearrange (uint32_t);
64 void encoder_changed (int);
66 M2EncoderInterface* _ctrl;
67 PBD::EventLoop* _eventloop;
68 PBD::ScopedConnection encoder_connection;
70 std::vector<ArdourCanvas::Text*> _displays;
71 ArdourCanvas::Rectangle* _active_bg;