// generated by Fast Light User Interface Designer (fluid) version 1.0300

#include "/build/infamousplugins/src/build/src/powerup/powerup_ui.h"

void PowerUpUI::cb_power_i(Button*, void*) {
  write_function(controller,FIRE_IT_UP,sizeof(float),0,&power->floatvalue);
reel->trigger = power->value();
}
void PowerUpUI::cb_power(Button* o, void* v) {
  ((PowerUpUI*)(o->parent()->parent()->user_data()))->cb_power_i(o,v);
}

void PowerUpUI::cb_time_i(Dial*, void*) {
  write_function(controller,STARTUP_TIME,sizeof(float),0,&time->floatvalue);
if(!power->value()){reel->time = time->value()/.06;};
}
void PowerUpUI::cb_time(Dial* o, void* v) {
  ((PowerUpUI*)(o->parent()->parent()->user_data()))->cb_time_i(o,v);
}

void PowerUpUI::cb_curve_i(Dial*, void*) {
  write_function(controller,STARTUP_CURVE,sizeof(float),0,&curve->floatvalue);
if(!power->value()){reel->curve = curve->value();};
}
void PowerUpUI::cb_curve(Dial* o, void* v) {
  ((PowerUpUI*)(o->parent()->parent()->user_data()))->cb_curve_i(o,v);
}

Fl_Double_Window* PowerUpUI::show() {
  { Fl_Double_Window* o = ui = new Fl_Double_Window(487, 318, "the infamous power cut");
    ui->box(FL_UP_BOX);
    ui->user_data((void*)(this));
    { Fl_Group* o = new Fl_Group(0, 0, 667, 389);
      { Background* o = bg = new Background(0, 0, 487, 318);
        bg->box(FL_NO_BOX);
        bg->color(FL_BACKGROUND_COLOR);
        bg->selection_color(FL_BACKGROUND_COLOR);
        bg->labeltype(FL_NORMAL_LABEL);
        bg->labelfont(0);
        bg->labelsize(14);
        bg->labelcolor(FL_FOREGROUND_COLOR);
        bg->align(Fl_Align(FL_ALIGN_CENTER));
        bg->when(FL_WHEN_RELEASE);
        o->drawing_h = cairo_code_draw_powerbg_get_height(); o->drawing_w = cairo_code_draw_powerbg_get_width(); o->drawing_f = &cairo_code_draw_powerbg_render;
      } // Background* bg
      { Background* o = title = new Background(28, 20, 271, 38);
        title->box(FL_NO_BOX);
        title->color(FL_BACKGROUND_COLOR);
        title->selection_color(FL_BACKGROUND_COLOR);
        title->labeltype(FL_NORMAL_LABEL);
        title->labelfont(0);
        title->labelsize(14);
        title->labelcolor(FL_FOREGROUND_COLOR);
        title->align(Fl_Align(FL_ALIGN_CENTER));
        title->when(FL_WHEN_RELEASE);
        o->drawing_h = cairo_code_draw_pwrupLabel_get_height(); o->drawing_w = cairo_code_draw_pwrupLabel_get_width(); o->drawing_f = &cairo_code_draw_pwrupLabel_render;
      } // Background* title
      { Background* o = timelabel = new Background(13, 179, 127, 25);
        timelabel->box(FL_NO_BOX);
        timelabel->color(FL_BACKGROUND_COLOR);
        timelabel->selection_color(FL_BACKGROUND_COLOR);
        timelabel->labeltype(FL_NORMAL_LABEL);
        timelabel->labelfont(0);
        timelabel->labelsize(14);
        timelabel->labelcolor(FL_FOREGROUND_COLOR);
        timelabel->align(Fl_Align(FL_ALIGN_CENTER));
        timelabel->when(FL_WHEN_RELEASE);
        o->drawing_h = cairo_code_draw_pwrstarttLabel_get_height(); o->drawing_w = cairo_code_draw_pwrstarttLabel_get_width(); o->drawing_f = &cairo_code_draw_pwrstarttLabel_render;
      } // Background* timelabel
      { Background* o = curvelabel = new Background(145, 179, 132, 119);
        curvelabel->box(FL_NO_BOX);
        curvelabel->color(FL_BACKGROUND_COLOR);
        curvelabel->selection_color(FL_BACKGROUND_COLOR);
        curvelabel->labeltype(FL_NORMAL_LABEL);
        curvelabel->labelfont(0);
        curvelabel->labelsize(14);
        curvelabel->labelcolor(FL_FOREGROUND_COLOR);
        curvelabel->align(Fl_Align(FL_ALIGN_CENTER));
        curvelabel->when(FL_WHEN_RELEASE);
        o->drawing_h = cairo_code_draw_pwrstartcLabel_get_height(); o->drawing_w = cairo_code_draw_pwrstartcLabel_get_width(); o->drawing_f = &cairo_code_draw_pwrstartcLabel_render;
      } // Background* curvelabel
      { PowerReel* o = reel = new PowerReel(286, 8, 381, 381);
        reel->box(FL_NO_BOX);
        reel->color(FL_BACKGROUND_COLOR);
        reel->selection_color(FL_BACKGROUND_COLOR);
        reel->labeltype(FL_NORMAL_LABEL);
        reel->labelfont(0);
        reel->labelsize(14);
        reel->labelcolor(FL_FOREGROUND_COLOR);
        reel->align(Fl_Align(FL_ALIGN_CENTER));
        reel->when(FL_WHEN_RELEASE);
        o->drawing_h = cairo_code_draw_reel_get_height(); o->drawing_w = cairo_code_draw_reel_get_width();
      } // PowerReel* reel
      { Button* o = power = new Button(42, 80, 160, 64);
        power->tooltip("Fire it Up!");
        power->box(FL_UP_BOX);
        power->color(FL_BACKGROUND_COLOR);
        power->selection_color(FL_BACKGROUND_COLOR);
        power->labeltype(FL_NORMAL_LABEL);
        power->labelfont(0);
        power->labelsize(14);
        power->labelcolor(FL_FOREGROUND_COLOR);
        power->callback((Fl_Callback*)cb_power);
        power->align(Fl_Align(FL_ALIGN_CENTER));
        power->when(FL_WHEN_RELEASE);
        o->type(FL_TOGGLE_BUTTON);
        o->drawing_h = cairo_code_draw_powerButton_get_height(); o->drawing_w = cairo_code_draw_powerButton_get_width(); o->drawing_f = &cairo_code_draw_powerButton_render;
      } // Button* power
      { Dial* o = time = new Dial(38, 218, 77, 77);
        time->tooltip("Startup Time");
        time->box(FL_NO_BOX);
        time->color(FL_BACKGROUND_COLOR);
        time->selection_color(FL_INACTIVE_COLOR);
        time->labeltype(FL_NORMAL_LABEL);
        time->labelfont(0);
        time->labelsize(14);
        time->labelcolor(FL_FOREGROUND_COLOR);
        time->maximum(10);
        time->step(0.1);
        time->value(0.5);
        time->callback((Fl_Callback*)cb_time);
        time->align(Fl_Align(FL_ALIGN_BOTTOM));
        time->when(FL_WHEN_CHANGED);
        o->drawing_h = cairo_code_draw_silverDial_get_height(); o->drawing_w = cairo_code_draw_silverDial_get_width(); o->drawing_f = &cairo_code_draw_silverDial_render;
        sprintf(o->units,"s");
      } // Dial* time
      { Dial* o = curve = new Dial(172, 218, 77, 77);
        curve->tooltip("Startup Curve");
        curve->box(FL_NO_BOX);
        curve->color(FL_BACKGROUND_COLOR);
        curve->selection_color(FL_INACTIVE_COLOR);
        curve->labeltype(FL_NORMAL_LABEL);
        curve->labelfont(0);
        curve->labelsize(14);
        curve->labelcolor(FL_FOREGROUND_COLOR);
        curve->minimum(-10);
        curve->maximum(10);
        curve->step(0.2);
        curve->callback((Fl_Callback*)cb_curve);
        curve->align(Fl_Align(FL_ALIGN_BOTTOM));
        curve->when(FL_WHEN_CHANGED);
        o->drawing_h = cairo_code_draw_silverDial_get_height(); o->drawing_w = cairo_code_draw_silverDial_get_width(); o->drawing_f = &cairo_code_draw_silverDial_render;
      } // Dial* curve
      o->end();
      Fl_Group::current()->resizable(o);
    } // Fl_Group* o
    o->show();
    ui->end();
  } // Fl_Double_Window* ui
  return ui;
}

void PowerUpUI::idle() {
  Fl::check();
  Fl::flush();
}
