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

#include "synchronizer.h"

inline void Synchronizer::cb_Exit_i(Fl_Menu_*, void*) {
  DoExit();
}
void Synchronizer::cb_Exit(Fl_Menu_* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_Exit_i(o,v);
}

Fl_Menu_Item Synchronizer::menu_MainMenu[] = {
 {"File", 0,  0, 0, 64, 0, 0, 14, 56},
 {"Exit", 0,  (Fl_Callback*)Synchronizer::cb_Exit, 0, 0, 0, 0, 14, 56},
 {0},
 {0}
};
Fl_Menu_Item* Synchronizer::File = Synchronizer::menu_MainMenu + 0;
Fl_Menu_Item* Synchronizer::Exit = Synchronizer::menu_MainMenu + 1;

inline void Synchronizer::cb_RaceChooser_i(Fl_Browser*, void*) {
  GetTracks (RaceChooser->value());
}
void Synchronizer::cb_RaceChooser(Fl_Browser* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_RaceChooser_i(o,v);
}

inline void Synchronizer::cb_TrackSelector_i(Fl_Check_Browser*, void*) {
  UpdatePlayTime(1);
}
void Synchronizer::cb_TrackSelector(Fl_Check_Browser* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_TrackSelector_i(o,v);
}

inline void Synchronizer::cb_ChooseAllButton_i(Fl_Button*, void*) {
  TrackSelector->check_all();UpdatePlayTime(1);
}
void Synchronizer::cb_ChooseAllButton(Fl_Button* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_ChooseAllButton_i(o,v);
}

inline void Synchronizer::cb_ClearAllButton_i(Fl_Button*, void*) {
  TrackSelector->check_none();UpdatePlayTime(1);
}
void Synchronizer::cb_ClearAllButton(Fl_Button* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_ClearAllButton_i(o,v);
}

inline void Synchronizer::cb_PauseButton_i(Fl_Button*, void*) {
  PauseFrame ();
}
void Synchronizer::cb_PauseButton(Fl_Button* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_PauseButton_i(o,v);
}

inline void Synchronizer::cb_NextButton_i(Fl_Button*, void*) {
  NextFrame();
}
void Synchronizer::cb_NextButton(Fl_Button* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_NextButton_i(o,v);
}

inline void Synchronizer::cb_StartButton_i(Fl_Button*, void*) {
  StartPlayback ();
}
void Synchronizer::cb_StartButton(Fl_Button* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_StartButton_i(o,v);
}

inline void Synchronizer::cb_RestartButton_i(Fl_Button*, void*) {
  RestartFrame ();
}
void Synchronizer::cb_RestartButton(Fl_Button* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_RestartButton_i(o,v);
}

inline void Synchronizer::cb_StopButton_i(Fl_Button*, void*) {
  StopPlayback();
}
void Synchronizer::cb_StopButton(Fl_Button* o, void* v) {
  ((Synchronizer*)(o->parent()->user_data()))->cb_StopButton_i(o,v);
}

Synchronizer::Synchronizer() {
  Fl_Window* w;
  { Fl_Window* o = MainWindow = new Fl_Window(597, 356);
    w = o;
    o->user_data((void*)(this));
    { Fl_Menu_Bar* o = MainMenu = new Fl_Menu_Bar(0, 0, 475, 25);
      o->menu(menu_MainMenu);
    }
    { Fl_Output* o = CurrentTrack = new Fl_Output(245, 25, 135, 25, "Playing track:");
      CurrentTrack->deactivate();
    }
    { Fl_Output* o = CurrentFrame = new Fl_Output(455, 25, 135, 25, "Frame:");
      CurrentFrame->deactivate();
    }
    { Fl_Output* o = PlayTime = new Fl_Output(475, 0, 115, 25, "Time left:");
      PlayTime->deactivate();
    }
    { Fl_Output* o = TextScreen = new Fl_Output(155, 50, 435, 180);
      o->type(12);
      o->textsize(16);
      TextScreen->deactivate();
    }
    { Fl_Slider* o = Slider = new Fl_Slider(155, 235, 435, 30);
      o->type(5);
      Slider->deactivate();
    }
    { Fl_Browser* o = RaceChooser = new Fl_Browser(0, 50, 145, 105);
      o->type(2);
      o->callback((Fl_Callback*)cb_RaceChooser);
      RaceChooser->has_scrollbar(Fl_Browser_::VERTICAL);
    }
    { Fl_Check_Browser* o = TrackSelector = new Fl_Check_Browser(0, 180, 145, 120);
      o->callback((Fl_Callback*)cb_TrackSelector);
      o->when(FL_WHEN_RELEASE);
      TrackSelector->has_scrollbar(Fl_Browser_::VERTICAL);
    }
    { Fl_Button* o = ChooseAllButton = new Fl_Button(10, 305, 120, 20, "Choose All");
      o->callback((Fl_Callback*)cb_ChooseAllButton);
    }
    { Fl_Button* o = ClearAllButton = new Fl_Button(10, 330, 120, 20, "Clear All");
      o->callback((Fl_Callback*)cb_ClearAllButton);
    }
    new Fl_Box(0, 30, 130, 20, "Race");
    new Fl_Box(5, 160, 120, 20, "Track");
    { Fl_Button* o = PauseButton = new Fl_Button(335, 280, 105, 45, " Pause");
      o->shortcut(0x70);
      o->labelfont(1);
      o->labelsize(16);
      o->callback((Fl_Callback*)cb_PauseButton);
    }
    { Fl_Button* o = NextButton = new Fl_Button(155, 280, 135, 45, "Next Screen");
      o->shortcut(0x6e);
      o->labelfont(1);
      o->labelsize(16);
      o->callback((Fl_Callback*)cb_NextButton);
    }
    { Fl_Button* o = StartButton = new Fl_Button(490, 305, 100, 20, "Start");
      o->labelfont(1);
      o->callback((Fl_Callback*)cb_StartButton);
    }
    { Fl_Button* o = RestartButton = new Fl_Button(490, 280, 100, 20, "Restart");
      o->labelfont(1);
      o->callback((Fl_Callback*)cb_RestartButton);
    }
    { Fl_Button* o = StopButton = new Fl_Button(490, 330, 100, 20, "Stop");
      o->labelfont(1);
      o->callback((Fl_Callback*)cb_StopButton);
    }
    o->end();
  }
}

void Synchronizer::show(int argc, char **argv) {
  MainWindow->show(argc, argv);
}
