diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-16 08:39:28 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-27 14:59:31 -0500 |
commit | 7c9f3acc60fb29a562d28d1f43a9e22298545bf1 (patch) | |
tree | 7418a4922ff7670d6ffc08dce39432afd1e5669c /libs/surfaces/push2/scale.cc | |
parent | 2810e5619a1926a286c6192143ada4973066efd8 (diff) |
first compiling and theoretically correct version of Push2 canvas display.
Not tested with device at this point
Diffstat (limited to 'libs/surfaces/push2/scale.cc')
-rw-r--r-- | libs/surfaces/push2/scale.cc | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/libs/surfaces/push2/scale.cc b/libs/surfaces/push2/scale.cc index 8f04b22635..97b59220c3 100644 --- a/libs/surfaces/push2/scale.cc +++ b/libs/surfaces/push2/scale.cc @@ -16,6 +16,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <cairomm/region.h> #include <pangomm/layout.h> #include "pbd/compose.h" @@ -51,37 +52,26 @@ using namespace std; using namespace PBD; using namespace Glib; using namespace ArdourSurface; +using namespace ArdourCanvas; -ScaleLayout::ScaleLayout (Push2& p, Session& s, Cairo::RefPtr<Cairo::Context> context) +ScaleLayout::ScaleLayout (Push2& p, Session& s) : Push2Layout (p, s) { - build_scale_menu (context); + build_scale_menu (); } ScaleLayout::~ScaleLayout () { } -bool -ScaleLayout::redraw (Cairo::RefPtr<Cairo::Context> context, bool force) const +void +ScaleLayout::render (Rect const& area, Cairo::RefPtr<Cairo::Context> context) const { - bool draw = false; - - if (scale_menu->dirty()) { - draw = true; - } - - if (!draw) { - return false; - } - context->set_source_rgb (0.764, 0.882, 0.882); context->rectangle (0, 0, 960, 160); context->fill (); - scale_menu->redraw (context, force); - - return true; + scale_menu->render (area, context); } void @@ -109,11 +99,11 @@ ScaleLayout::strip_vpot_touch (int, bool) } void -ScaleLayout::build_scale_menu (Cairo::RefPtr<Cairo::Context> context) +ScaleLayout::build_scale_menu () { vector<string> v; - scale_menu = new Push2Menu (context); + scale_menu = new Push2Menu (this); v.push_back ("Dorian"); v.push_back ("IonianMajor"); |