Loopp/src/goptions.hxx

121 lines
2.8 KiB
C++
Raw Normal View History

2013-12-08 22:44:43 +01:00
/*
* Author: Harry van Haaren 2013
* harryhaaren@gmail.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LUPPP_OPTIONS_H
#define LUPPP_OPTIONS_H
#include "config.hxx"
#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 setLink (std::string link );
std::string getAuthor(){return author;}
std::string getLink(){return link;}
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 link;
2013-11-21 15:43:22 +01:00
Avtk::Button* authorLabel;
Avtk::Button* linkLabel;
std::vector<int> bindingID;
2013-11-19 20:44:25 +01:00
Fl_Box* targetLabel;
Fl_Box* targetLabelStat;
2013-12-05 21:45:56 +01:00
//Avtk::Bindings* bindings;
Avtk::LightButton* bindEnable;
Avtk::Button* removeController;
Avtk::Button* writeControllerBtn;
};
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