Loopp/src/goptions.hxx

104 lines
2.0 KiB
C++
Raw Normal View History

#ifndef LUPPP_OPTIONS_H
#define LUPPP_OPTIONS_H
#include <string>
#include <FL/Fl.H>
2013-10-18 16:06:27 +02:00
#include <FL/Fl_Box.H>
2013-10-18 15:12:34 +02:00
#include <FL/Fl_Tabs.H>
2013-11-19 20:44:25 +01:00
#include <FL/Fl_Pack.H>
2013-10-18 16:56:20 +02:00
#include <FL/Fl_Table.H>
2013-10-18 15:12:34 +02:00
#include <FL/Fl_Group.H>
#include <FL/Fl_Double_Window.H>
2013-11-14 20:45:43 +01:00
#include "controller/genericmidi.hxx"
2013-10-18 16:56:20 +02:00
#include "avtk/bindings.h"
#include "avtk/avtk_button.h"
#include "avtk/avtk_light_button.h"
2013-10-18 16:56:20 +02:00
class Binding;
2013-11-11 00:13:12 +01:00
class OptionsWindow;
2013-10-18 16:56:20 +02:00
/// contains UI elements to represent one controller
class ControllerUI
{
public:
ControllerUI( int x, int y, int w, int h, std::string name,int id);
~ControllerUI();
void setAuthor(std::string author);
void setEmail (std::string email );
void setTarget(const char* n);
void setBindEnable( bool b );
void addBinding( Binding* b );
2013-11-14 20:45:43 +01:00
void addBindings( GenericMIDI* c );
// the ControllerID this UI class represents
int controllerID;
// for adding to GOptions tabs
Fl_Group* widget;
2013-11-21 15:43:22 +01:00
std::string name;
2013-11-11 00:13:12 +01:00
OptionsWindow* optionsWindow;
// public to redraw when removing from static
Fl_Scroll* scroll;
Fl_Pack* bindingsPack;
private:
// bindings
2013-11-21 15:43:22 +01:00
std::string target;
std::string author;
std::string email;
2013-11-21 15:43:22 +01:00
Fl_Box* authorLabel;
Fl_Box* emailLabel;
std::vector<int> bindingID;
2013-11-19 20:44:25 +01:00
Fl_Box* targetLabel;
Fl_Box* targetLabelStat;
Avtk::Bindings* bindings;
Avtk::LightButton* bindEnable;
Avtk::Button* removeController;
Avtk::Button* writeControllerBtn;
// Controller
Avtk::Button* ctlrButton;
};
class OptionsWindow
{
public:
OptionsWindow();
2013-11-11 17:48:34 +01:00
~OptionsWindow();
void show();
void hide();
void setTarget(const char* n);
ControllerUI* getControllerUI(int id);
// public for static methods only
Fl_Tabs* tabs;
std::vector<ControllerUI*> controllers;
2013-11-11 00:24:21 +01:00
Fl_Group* addGroup;
#ifdef BUILD_TESTS
int runTests();
#endif
private:
Fl_Double_Window* window;
Avtk::Button* newButton;
2013-11-11 00:24:21 +01:00
Avtk::Button* loadButton;
};
#endif // LUPPP_OPTIONS_H