/* ==================================== JUCER_BINARY_RESOURCE ====================================

   This is an auto-generated file: Any edits you make may be overwritten!

*/

#include <cstring>

namespace scripts
{

//================== ampui.lua ==================
static const unsigned char temp_binary_data_1[] =
"--- Editor for `amp` DSP script.\n"
"-- @script ampui\n"
"-- @type DSPUI amp\n"
"\n"
"local Widget        = require ('el.Widget')\n"
"local Slider        = require ('el.Slider')\n"
"local object        = require ('el.object')\n"
"local script        = require ('el.script')\n"
"\n"
"local bgcolor       = 0xff545454\n"
"local fgcolor       = 0xffffffff\n"
"\n"
"-- Derive a new widget type for the amp editor.\n"
"local Editor = object (Widget)\n"
"\n"
"function Editor:init (ctx)\n"
"    -- Invoke the parent class' init method\n"
"    Widget.init (self)\n"
"\n"
"    local volume = ctx.params [1]\n"
"\n"
"    self.knob = self:add (object.new (Slider))\n"
"    self.knob.style = Slider.Rotary\n"
"    self.knob:setTextBoxStyle (Slider.TextBoxBelow, true, 52, 26)\n"
"    self.knob:setRange (-90, 24, 0.01)\n"
"    self.knob:setValue (volume:get(), false)\n"
"    self.knob.dragging  = false\n"
"    self.knob.dragStart = function() self.knob.dragging = true end\n"
"    self.knob.dragEnd   = function() self.knob.dragging = false end\n"
"    self.knob.changed   = function()\n"
"        if not self.knob.dragging then return end\n"
"        volume:set (self.knob:value(), false)\n"
"    end\n"
"\n"
"    volume.changed = function()\n"
"        self.knob:setValue (volume:get(), false)\n"
"    end\n"
"\n"
"    self:resize (180, 170)\n"
"end\n"
"\n"
"function Editor:paint (g)\n"
"    g:fillAll (bgcolor)\n"
"    g:setColor (fgcolor)\n"
"    g:drawText (\"AMP\", 0, 0, self.width, 30)\n"
"end\n"
"\n"
"function Editor:resized()\n"
"    local r = self:localBounds()\n"
"    self.knob:setBounds (r:reduced (20))\n"
"end\n"
"\n"
"-- Editor factory function.\n"
"local function instantiate (ctx)\n"
"    return object.new (Editor, ctx)\n"
"end\n"
"\n"
"return {\n"
"    type        = 'DSPUI',\n"
"    instantiate = instantiate\n"
"}\n"
"\n"
"-- SPDX-FileCopyrightText: Copyright (C) Kushview, LLC.\n"
"-- SPDX-License-Identifier: GPL-3.0-or-later\n";

const char* ampui_lua = (const char*) temp_binary_data_1;
}
