Skip to content
Snippets Groups Projects
Commit 242e7b03 authored by Florent Berthaut's avatar Florent Berthaut
Browse files

Transfered files from private repo

parent 7190deef
No related branches found
No related tags found
No related merge requests found
Showing
with 3591 additions and 0 deletions
/***************************************************************************
* GroupWidget.cpp
* Part of
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "GroupWidget.hpp"
#include <iostream>
#include <sstream>
#include <cmath>
#include "Controlar.hpp"
using namespace std;
GroupWidget::GroupWidget(int x, int y, int w, int h):Fl_Widget(x,y,w,h,"") {
box(FL_FLAT_BOX);
m_dragging=false;
m_highlight=false;
m_editing=false;
m_scaleX=1;
m_scaleY=1;
}
void GroupWidget::copy(GroupWidget* original) {
resize(original->x(), original->y(), original->w(), original->h());
}
GroupWidget::~GroupWidget() {}
void GroupWidget::draw() {
Controlar* cont = Controlar::getInstance();
//draw
#ifdef GL
glUniform1f(cont->getGroupHighlightUniform(), m_highlight);
glUniform1f(cont->getGroupEditingUniform(), m_editing);
glUniform2f(cont->getGroupSizeUniform(), w(), h());
glUniform2f(cont->getGroupPosUniform(), x(), y());
glDrawArrays(GL_TRIANGLES, 0, 6);
#else
//process drawing
fl_rect(x(), cont->isFlipped()?cont->h()-y()-h():y(),w(),h(),FL_DARK_GREEN);
if(m_highlight) {
fl_rect(x(), cont->isFlipped()?cont->h()-y()-h():y(),w(),h(),FL_GREEN);
}
#endif
}
int GroupWidget::handle(int event) {
int res=0;
switch(event) {
case FL_PUSH:{
switch(Fl::event_button()) {
case FL_RIGHT_MOUSE: {
do_callback();
res=1;
}break;
case FL_LEFT_MOUSE: {
if(Fl::event_shift()) {
startDraggingGroup();
m_editing=true;
m_dragging=true;
res=1;
}
}break;
default:break;
}
}break;
case FL_DRAG: {
if(m_dragging) {
if(Fl::event_button()==FL_LEFT_MOUSE) {
if(Fl::event_command()) {
size(m_dragW+Fl::event_x(), m_dragH+Fl::event_y());
}
else {
Controlar* cont = Controlar::getInstance();
cont->moveAllZonesInsideGroupBy(this,
m_dragX+Fl::event_x()-x(),
m_dragY+Fl::event_y()-y());
position(m_dragX+Fl::event_x(),
m_dragY+Fl::event_y());
}
res=1;
}
}
}break;
case FL_SHORTCUT: {
if(m_highlight && Fl::event_key()==FL_Shift_L) {
m_editing=true;
res=1;
}
}break;
case FL_KEYUP: {
if(m_highlight && Fl::event_key()==FL_Shift_L) {
m_editing=false;
res=1;
}
}break;
case FL_RELEASE: {
if(m_dragging) {
m_editing=false;
m_dragging=false;
res=1;
}
}break;
case FL_MOVE:{
m_highlight=true;
if(Fl::event_shift()) {
m_editing=true;
res=1;
}
}break;
case FL_ENTER: {
m_highlight=true;
res=1;
}break;
case FL_LEAVE: {
m_highlight=false;
res=1;
}break;
default:break;
}
if(res==1) {
parent()->redraw();
}
return res;
}
void GroupWidget::startDraggingGroup() {
m_dragX=x()-Fl::event_x();
m_dragY=y()-Fl::event_y();
m_dragW=w()-Fl::event_x();
m_dragH=h()-Fl::event_y();
}
void GroupWidget::resize(int nx, int ny, int nw, int nh) {
Fl_Widget::resize(nx, ny, nw, nh);
}
void GroupWidget::load(xmlNodePtr groupNode) {
char* value = NULL;
int x=0,y=0,w=20,h=20;
value = (char*)xmlGetProp(groupNode,(xmlChar*)"group_x");
if(value!=NULL) {
x = atoi(value);
}
value = (char*)xmlGetProp(groupNode,(xmlChar*)"group_y");
if(value!=NULL) {
y = atoi(value);
}
value = (char*)xmlGetProp(groupNode,(xmlChar*)"group_w");
if(value!=NULL) {
w = atoi(value);
}
value = (char*)xmlGetProp(groupNode,(xmlChar*)"group_h");
if(value!=NULL) {
h = atoi(value);
}
resize(x,y,w,h);
}
void GroupWidget::save(xmlNodePtr parentNode) {
xmlNodePtr newNode = xmlNewChild(parentNode, NULL,
BAD_CAST "Group", NULL);
ostringstream oss1, oss2, oss3, oss4, oss5,
oss6, oss7, oss8, oss9, oss10,
oss11, oss12, oss13, oss14, oss15,
oss16, oss17;
oss5<<x();
xmlNewProp(newNode, BAD_CAST "group_x",
BAD_CAST oss5.str().c_str());
oss6<<y();
xmlNewProp(newNode, BAD_CAST "group_y",
BAD_CAST oss6.str().c_str());
oss7<<w();
xmlNewProp(newNode, BAD_CAST "group_w",
BAD_CAST oss7.str().c_str());
oss8<<h();
xmlNewProp(newNode, BAD_CAST "group_h",
BAD_CAST oss8.str().c_str());
}
/***************************************************************************
* GroupWidget.hpp
* Part of
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef GroupWidget_h
#define GroupWidget_h
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/fl_draw.H>
#include <GL/glew.h>
#include <FL/gl.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <sys/time.h>
#include <string>
#include <vector>
class GroupWidget : public Fl_Widget {
public:
GroupWidget(int x=0, int y=0, int w=10, int h=10);
~GroupWidget();
void copy(GroupWidget*);
void draw();
int handle(int event);
void save(xmlNodePtr parentNode);
void load(xmlNodePtr);
void resize(int x, int y, int w, int h);
inline void setID(const unsigned int& id){m_id=id;}
inline const unsigned int& getID(){return m_id;}
void startDraggingGroup();
void forceDraggingGroup();
private:
unsigned int m_id;
bool m_dragging;
bool m_highlight;
bool m_editing;
float m_dragX, m_dragY;
float m_dragW, m_dragH;
float m_dragStartX, m_dragStartY;
float m_scaleX, m_scaleY;
#ifdef GL
GLint m_sizeUniform;
GLint m_posUniform;
GLint m_editingUniform;
#endif
};
#endif
/***************************************************************************
* MainPanel.cpp
* Part of ControllAR
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "MainPanel.hpp"
#include <FL/Fl_Button.H>
#include <FL/fl_draw.H>
#include <algorithm>
#include <iostream>
#include "Controlar.hpp"
using namespace std;
MainPanel::MainPanel(): FlipGroup(0, 0, 240, 160) {
int labW=60;
int butW=40;
int smButW=20;
int butH=20;
int sep=5;
Fl_Pack* fileP = new Fl_Pack(sep, sep, (butW+sep)*3, butH, "File");
fileP->type(Fl_Pack::HORIZONTAL);
fileP->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
fileP->spacing(sep);
fileP->box(FL_NO_BOX);
add(fileP);
fileP->add(new Fl_Group(0,0,labW,0,""));
Fl_Button* opBut = new Fl_Button(0, 0, butW, butH, "open");
opBut->callback(statOpen,this);
fileP->add(opBut);
Fl_Button* saBut = new Fl_Button(0, 0, butW, butH, "save");
saBut->callback(statSave,this);
fileP->add(saBut);
Fl_Button* quBut = new Fl_Button(0, 0, butW, butH, "quit");
quBut->callback(statQuit,this);
fileP->add(quBut);
Fl_Pack* disP = new Fl_Pack(sep, sep+(butH+sep),
(butW+sep)*3, butH, "Display");
disP->type(Fl_Pack::HORIZONTAL);
disP->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
disP->spacing(sep);
disP->box(FL_NO_BOX);
add(disP);
disP->add(new Fl_Group(0,0,labW,0,""));
Fl_Button* fsBut = new Fl_Button(0, 0, butW*2, butH, "fullscreen");
fsBut->callback(statFullscreen,this);
disP->add(fsBut);
Fl_Button* mirBut = new Fl_Button(0, 0, butW*2, butH, "mirror");
mirBut->callback(statMirror,this);
disP->add(mirBut);
int brW=160;
int brH=70;
Fl_Group* inps = new Fl_Group(sep,sep+(butH+sep)*2,brW+labW, brH, "Inputs");
inps->box(FL_NO_BOX);
inps->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
add(inps);
m_midiBr = new Fl_Multi_Browser(sep*2+labW, sep+(butH+sep)*2, brW, brH, "");
m_midiBr->align(FL_ALIGN_TOP);
m_midiBr->has_scrollbar(Fl_Browser_::VERTICAL_ALWAYS);
m_midiBr->callback(statMidiBr, this);
inps->add(m_midiBr);
Fl_Pack* scnP = new Fl_Pack(sep, sep+(butH+sep)*2+brH+sep,
brW, butH, "Scenes");
scnP->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
scnP->type(Fl_Pack::HORIZONTAL);
scnP->spacing(sep);
scnP->box(FL_NO_BOX);
add(scnP);
scnP->add(new Fl_Group(0, 0, labW, 0, ""));
Fl_Button* prevSc = new Fl_Button(0, 0, smButW, butH, "<");
prevSc->callback(statScenePrev, this);
scnP->add(prevSc);
m_sceneOut = new Fl_Value_Output(0, 0, butW, butH, "");
m_sceneOut->value(0);
scnP->add(m_sceneOut);
Fl_Button* nextSc = new Fl_Button(0, 0, smButW, butH, ">");
nextSc->callback(statSceneNext, this);
scnP->add(nextSc);
Fl_Button* delSc = new Fl_Button(0, 0, smButW, butH, "x");
delSc->callback(statSceneDel, this);
scnP->add(delSc);
Fl_Button* learnSc = new Fl_Button(0, 0, butW, butH, "learn");
learnSc->callback(statSceneLearn, this);
scnP->add(learnSc);
}
MainPanel* MainPanel::getInstance() {
static MainPanel instance;
return &instance;
}
void MainPanel::cbMidiBr() {
for(int i=1; i<=m_midiBr->size(); ++i) {
if(m_midiBr->selected(i)) {
Controlar::getInstance()->openMidiDevice(m_midiBr->text(i));
}
else {
Controlar::getInstance()->closeMidiDevice(m_midiBr->text(i));
}
}
}
void MainPanel::setMidiDevices(const vector<string>& devs,
const vector<bool>& opened) {
m_midiBr->clear();
vector<string>::const_iterator itDev = devs.begin();
vector<bool>::const_iterator itOp = opened.begin();
int el=1;
for(; itDev!=devs.end(); ++itDev, ++itOp, ++el) {
m_midiBr->add((*itDev).c_str(), NULL);
if((*itOp)) {
m_midiBr->select(el);
}
}
}
/***************************************************************************
* MainPanel.hpp
* Part of ControllAR
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef MainPanel_h
#define MainPanel_h
#include <FL/Fl_Multi_Browser.H>
#include <FL/Fl_Value_Output.H>
#include "Controlar.hpp"
#include "FlipGroup.hpp"
class MainPanel: public FlipGroup {
public :
static MainPanel* getInstance();
~MainPanel(){};
static void statOpen(Fl_Widget* w,void* f){
Controlar::getInstance()->cbOpen();
}
static void statSave(Fl_Widget* w, void* f){
Controlar::getInstance()->cbSave();
}
static void statQuit(Fl_Widget* w,void* f){
Controlar::getInstance()->cbQuit();
}
static void statMidiBr(Fl_Widget* w, void* f){
MainPanel::getInstance()->cbMidiBr();
}
void cbMidiBr();
static void statSceneNext(Fl_Widget* w, void* f){
Controlar::getInstance()->cbSceneNext();
MainPanel::getInstance()->refresh();
}
static void statScenePrev(Fl_Widget* w, void* f){
Controlar::getInstance()->cbScenePrev();
MainPanel::getInstance()->refresh();
}
static void statSceneDel(Fl_Widget* w,void* f){
Controlar::getInstance()->cbSceneDelete();
MainPanel::getInstance()->refresh();
}
static void statSceneLearn(Fl_Widget* w,void* f){
Controlar::getInstance()->cbSceneLearn();
MainPanel::getInstance()->refresh();
}
static void statFullscreen(Fl_Widget* w,void* f){
Controlar::getInstance()->cbFullscreen();
MainPanel::getInstance()->refresh();
}
static void statMirror(Fl_Widget* w,void* f){
Controlar::getInstance()->cbFlip();
MainPanel::getInstance()->refresh();
}
void setMidiDevices(const std::vector<std::string>& midiDeviceNames,
const std::vector<bool>& midiDeviceOp);
inline void setCurrentScene(const int& sc){m_sceneOut->value(sc);}
private:
MainPanel();
Fl_Multi_Browser* m_midiBr;
Fl_Value_Output* m_sceneOut;
};
#endif
/***************************************************************************
* ZonePanel.cpp
* Part of
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "ZonePanel.hpp"
#include <FL/Fl_Button.H>
#include <FL/fl_draw.H>
#include <algorithm>
#include <iostream>
#include "Controlar.hpp"
#include "ZoneWidget.hpp"
using namespace std;
ZonePanel::ZonePanel(): FlipGroup(0, 0, 420, 200) {
int sep=5;
int butH=20;
int offY=sep;
int brW=200;
int brH=160;
int labW=60;
m_winsBr = new Fl_Hold_Browser(sep, offY, brW, brH, "window:");
m_winsBr->align(FL_ALIGN_TOP);
m_winsBr->has_scrollbar(Fl_Browser_::VERTICAL_ALWAYS);
m_winsBr->callback(statWinBr, this);
addWid(m_winsBr);
//transformations
Fl_Pack* radButs=new Fl_Pack(2*sep+brW, sep,(butH+sep)*4+50,
butH,"Transfo");
add(radButs);
radButs->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
radButs->type(Fl_Pack::HORIZONTAL);
radButs->spacing(sep);
radButs->box(FL_NO_BOX);
radButs->add(new Fl_Group(0, 0, labW, butH, ""));
for(int i=0; i<ZoneWidget::NB_TRANSFO; ++i) {
m_transfos[i]=ZoneWidget::ZONE_TRANSFO(i);
m_transfoButs[i]= new Fl_Radio_Button(0, 0, butH, butH, "");
m_transfoButs[i]->callback(statZoneTransfo, &m_transfos[i]);
radButs->add(m_transfoButs[i]);
}
m_transfoButs[0]->label("@8->");
m_transfoButs[1]->label("@6->");
m_transfoButs[2]->label("@2->");
m_transfoButs[3]->label("@4->");
//shapes
radButs=new Fl_Pack(2*sep+brW, sep*2+butH, 0, butH, "Shape");
add(radButs);
radButs->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
radButs->type(Fl_Pack::HORIZONTAL);
radButs->spacing(sep);
radButs->box(FL_NO_BOX);
radButs->add(new Fl_Group(0, 0, labW, butH, ""));
for(int i=0; i<ZoneWidget::NB_SHAPES; ++i) {
m_shapes[i]=ZoneWidget::ZONE_SHAPE(i);
m_shapeButs[i] = new Fl_Radio_Button(0, 0, butH, butH, "");
m_shapeButs[i]->callback(statZoneShape, &m_shapes[i]);
radButs->add(m_shapeButs[i]);
}
m_shapeButs[0]->label("@-1square");
m_shapeButs[1]->label("@-1circle");
m_shapeButs[2]->label("@-1||");
//alpha
radButs=new Fl_Pack(2*sep+brW, sep+(sep+butH)*2,
(butH+sep)*3+60, butH, "Alpha");
add(radButs);
radButs->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
radButs->type(Fl_Pack::HORIZONTAL);
radButs->spacing(sep);
radButs->box(FL_NO_BOX);
radButs->add(new Fl_Group(0, 0, labW, butH, ""));
m_alphaSlider=new Fl_Slider(0, 0, (butH+sep)*3, butH, "");
m_alphaSlider->callback(statZoneAlpha, this);
m_alphaSlider->type(FL_HORIZONTAL);
m_alphaSlider->bounds(0, 255);
radButs->add(m_alphaSlider);
//colors
radButs=new Fl_Pack(2*sep+brW, sep+(sep+butH)*3,
(butH+sep)*2+50, butH, "Color");
add(radButs);
radButs->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
radButs->type(Fl_Pack::HORIZONTAL);
radButs->spacing(sep);
radButs->box(FL_NO_BOX);
radButs->add(new Fl_Group(0, 0, labW, butH, ""));
for(int i=0; i<ZoneWidget::NB_COLORS; ++i) {
m_colors[i]=ZoneWidget::ZONE_COLOR(i);
m_colorButs[i] = new Fl_Radio_Button(0,0,
butH, butH, "");
m_colorButs[i]->callback(statZoneColor, &m_colors[i]);
radButs->add(m_colorButs[i]);
}
m_colorButs[0]->label("N");
m_colorButs[1]->label("I");
//activity
radButs=new Fl_Pack(2*sep+brW, sep+(sep+butH)*4,
(butH+sep)*3+50, butH, "Activity");
add(radButs);
radButs->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
radButs->type(Fl_Pack::HORIZONTAL);
radButs->spacing(sep);
radButs->box(FL_NO_BOX);
radButs->add(new Fl_Group(0, 0, 60, butH, ""));
for(int i=0; i<ZoneWidget::NB_EFFECTS; ++i) {
m_inputs[i]=ZoneWidget::ZONE_INPUT_EFFECT(i);
m_inputButs[i] = new Fl_Radio_Button(0, 0, butH, butH, "");
m_inputButs[i]->callback(statZoneInput, &m_inputs[i]);
radButs->add(m_inputButs[i]);
}
m_inputButs[0]->label("-");
m_inputButs[1]->label("S");
m_inputButs[2]->label("H");
Fl_Button* learnBut = new Fl_Button(0, 0, 50, butH, "Learn");
radButs->add(learnBut);
learnBut->callback(statZoneLearn,this);
//content
radButs=new Fl_Pack(2*sep+brW, sep+(sep+butH)*6,
(butH+sep)*3+50, butH, "Content");
add(radButs);
radButs->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
radButs->type(Fl_Pack::HORIZONTAL);
radButs->spacing(sep);
radButs->box(FL_NO_BOX);
radButs->add(new Fl_Group(0, 0, 60, butH, ""));
for(int i=0; i<ZoneWidget::NB_CONTENTS; ++i) {
m_contents[i]=ZoneWidget::ZONE_CONTENT(i);
m_contentButs[i] = new Fl_Radio_Button(0, 0, butH*3, butH, "");
m_contentButs[i]->callback(statZoneContent, &m_contents[i]);
radButs->add(m_contentButs[i]);
}
m_contentButs[0]->label("global");
m_contentButs[1]->label("local");
//update
radButs=new Fl_Pack(2*sep+brW, sep+(sep+butH)*5,
(butH+sep)*3+50, butH, "Update");
add(radButs);
radButs->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
radButs->type(Fl_Pack::HORIZONTAL);
radButs->spacing(sep);
radButs->box(FL_NO_BOX);
radButs->add(new Fl_Group(0, 0, 60, butH, ""));
for(int i=0; i<ZoneWidget::NB_UPDATES; ++i) {
m_updates[i]=ZoneWidget::ZONE_UPDATE(i);
m_updateButs[i] = new Fl_Radio_Button(0, 0, butH*3, butH, "");
m_updateButs[i]->callback(statZoneUpdate, &m_updates[i]);
radButs->add(m_updateButs[i]);
}
m_updateButs[0]->label("all");
m_updateButs[1]->label("current");
//delete
Fl_Button* delBut = new Fl_Button(sep, h()-sep-butH, 60, butH, "Delete");
delBut->callback(statZoneDelete,this);
add(delBut);
}
void ZonePanel::setWindowList(vector<CutWindow*>& wins) {
m_winsBr->clear();
m_winsBr->add("none", NULL);
vector<CutWindow*>::iterator itWin = wins.begin();
for(; itWin!=wins.end(); ++itWin) {
m_winsBr->add(((*itWin)->getName()).c_str(), (*itWin));
}
m_winsBr->value(1);
}
void ZonePanel::setZone(ZoneWidget* z) {
m_curZone=z;
//retrieve values
if(m_curZone) {
CutWindow* cutW = m_curZone->getCutWin();
if(cutW) {
string cutWN = cutW->getName();
for(int i=1; i<=m_winsBr->size(); ++i) {
if(cutWN.compare(m_winsBr->text(i))==0) {
m_winsBr->value(i);
}
}
}
else {
m_winsBr->value(1);
}
for(int i=0; i<int(ZoneWidget::NB_TRANSFO); ++i) {
m_transfoButs[i]->value(0);
}
m_transfoButs[int(m_curZone->getTransformation())]->value(1);
for(int i=0; i<int(ZoneWidget::NB_SHAPES); ++i) {
m_shapeButs[i]->value(0);
}
m_shapeButs[int(m_curZone->getShape())]->value(1);
for(int i=0; i<int(ZoneWidget::NB_COLORS); ++i) {
m_colorButs[i]->value(0);
}
m_colorButs[int(m_curZone->getColor())]->value(1);
for(int i=0; i<int(ZoneWidget::NB_EFFECTS); ++i) {
m_inputButs[i]->value(0);
}
m_inputButs[int(m_curZone->getEffect())]->value(1);
for(int i=0; i<int(ZoneWidget::NB_UPDATES); ++i) {
m_updateButs[i]->value(0);
}
m_updateButs[int(m_curZone->getZoneUpdate())]->value(1);
for(int i=0; i<int(ZoneWidget::NB_CONTENTS); ++i) {
m_contentButs[i]->value(0);
}
m_contentButs[int(m_curZone->getContent())]->value(1);
m_alphaSlider->value(m_curZone->getAlpha());
}
}
void ZonePanel::cbWinBr(Fl_Widget*) {
m_curZone->setCutWin((CutWindow*)(m_winsBr->data(m_winsBr->value())));
refresh();
}
void ZonePanel::cbZoneTransfo(const ZoneWidget::ZONE_TRANSFO& trans) {
m_curZone->setTransformation(trans);
refresh();
}
void ZonePanel::cbZoneShape(const ZoneWidget::ZONE_SHAPE& shape) {
m_curZone->setShape(shape);
refresh();
}
void ZonePanel::cbZoneAlpha() {
m_curZone->setAlpha(m_alphaSlider->value());
refresh();
}
void ZonePanel::cbZoneColor(const ZoneWidget::ZONE_COLOR& color) {
m_curZone->setColor(color);
refresh();
}
void ZonePanel::cbZoneInput(const ZoneWidget::ZONE_INPUT_EFFECT& inp) {
m_curZone->setInputEffect(inp);
refresh();
}
void ZonePanel::cbZoneUpdate(const ZoneWidget::ZONE_UPDATE& up) {
Controlar::getInstance()->cbZoneUpdate(up);
refresh();
}
void ZonePanel::cbZoneContent(const ZoneWidget::ZONE_CONTENT& cont) {
m_curZone->setContent(cont);
refresh();
}
ZonePanel* ZonePanel::getInstance() {
static ZonePanel instance;
return &instance;
}
/***************************************************************************
* ZonePanel.hpp
* Part of ControllAR
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef ZonePanel_h
#define ZonePanel_h
#include <string>
#include <map>
#include <vector>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Hold_Browser.H>
#include <FL/Fl_Radio_Round_Button.H>
#include <FL/Fl_Radio_Button.H>
#include <FL/Fl_Slider.H>
#include "Controlar.hpp"
#include "FlipGroup.hpp"
#include "CutWindow.hpp"
class ZoneWidget;
class ZonePanel: public FlipGroup {
public :
static ZonePanel* getInstance();
~ZonePanel(){};
void setWindowList(std::vector<CutWindow*>& wins);
static void statWinBr(Fl_Widget* w, void* f){
ZonePanel *tmpf = static_cast<ZonePanel *>(f);
tmpf->cbWinBr(w);
}
void cbWinBr(Fl_Widget*);
static void statZoneTransfo(Fl_Widget* w, void* f){
ZonePanel::getInstance()
->cbZoneTransfo(*(ZoneWidget::ZONE_TRANSFO*)(f));
}
void cbZoneTransfo(const ZoneWidget::ZONE_TRANSFO&);
static void statZoneShape(Fl_Widget* w, void* f){
ZonePanel::getInstance()
->cbZoneShape(*(ZoneWidget::ZONE_SHAPE*)(f));
}
void cbZoneShape(const ZoneWidget::ZONE_SHAPE&);
static void statZoneAlpha(Fl_Widget* w, void* f){
ZonePanel::getInstance()->cbZoneAlpha();
}
void cbZoneAlpha();
static void statZoneColor(Fl_Widget* w, void* f){
ZonePanel::getInstance()
->cbZoneColor(*(ZoneWidget::ZONE_COLOR*)(f));
}
void cbZoneColor(const ZoneWidget::ZONE_COLOR&);
static void statZoneInput(Fl_Widget* w, void* f){
ZonePanel::getInstance()
->cbZoneInput(*(ZoneWidget::ZONE_INPUT_EFFECT*)(f));
}
void cbZoneInput(const ZoneWidget::ZONE_INPUT_EFFECT&);
static void statZoneContent(Fl_Widget* w, void* f){
ZonePanel::getInstance()
->cbZoneContent(*(ZoneWidget::ZONE_CONTENT*)(f));
}
void cbZoneContent(const ZoneWidget::ZONE_CONTENT&);
static void statZoneUpdate(Fl_Widget* w, void* f){
ZonePanel::getInstance()
->cbZoneUpdate(*(ZoneWidget::ZONE_UPDATE*)(f));
}
void cbZoneUpdate(const ZoneWidget::ZONE_UPDATE&);
static void statZoneLearn(Fl_Widget* w, void* f){
Controlar::getInstance()->cbZoneMidiLearn();
}
static void statZoneDelete(Fl_Widget* w, void* f){
Controlar::getInstance()->cbZoneDelete();
}
void setZone(ZoneWidget*);
private:
ZonePanel();
Fl_Hold_Browser* m_winsBr;
ZoneWidget* m_curZone;
ZoneWidget::ZONE_TRANSFO m_transfos[ZoneWidget::NB_TRANSFO];
Fl_Radio_Button* m_transfoButs[ZoneWidget::NB_TRANSFO];
ZoneWidget::ZONE_SHAPE m_shapes[ZoneWidget::NB_SHAPES];
Fl_Radio_Button* m_shapeButs[ZoneWidget::NB_SHAPES];
ZoneWidget::ZONE_COLOR m_colors[ZoneWidget::NB_COLORS];
Fl_Radio_Button* m_colorButs[ZoneWidget::NB_COLORS];
ZoneWidget::ZONE_INPUT_EFFECT m_inputs[ZoneWidget::NB_EFFECTS];
Fl_Radio_Button* m_inputButs[ZoneWidget::NB_EFFECTS];
ZoneWidget::ZONE_CONTENT m_contents[ZoneWidget::NB_CONTENTS];
Fl_Radio_Button* m_contentButs[ZoneWidget::NB_CONTENTS];
ZoneWidget::ZONE_UPDATE m_updates[ZoneWidget::NB_UPDATES];
Fl_Radio_Button* m_updateButs[ZoneWidget::NB_UPDATES];
Fl_Slider* m_alphaSlider;
};
#endif
This diff is collapsed.
/***************************************************************************
* ZoneWidget.hpp
* Part of
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef ZoneWidget_h
#define ZoneWidget_h
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/fl_draw.H>
#include <GL/glew.h>
#include <FL/gl.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <sys/time.h>
#include <string>
#include <vector>
#include <map>
class CutWindow;
class ZoneWidget : public Fl_Widget {
public:
enum ZONE_TRANSFO{NONE, ROTATE_90, ROTATE_180, ROTATE_270, NB_TRANSFO};
enum ZONE_SHAPE{BOX, CIRCLE, FRAME, NB_SHAPES};
enum ZONE_INPUT_EFFECT{NO_EFFECT, SHOW, HIDE, NB_EFFECTS};
enum ZONE_COLOR{NORMAL, INVERT, NB_COLORS};
enum ZONE_VISIBLE{VISIBLE_ALL, VISIBLE_CURRENT};
enum ZONE_UPDATE{UPDATE_ALL, UPDATE_CURRENT, NB_UPDATES};
enum ZONE_CONTENT{CONTENT_GLOBAL, CONTENT_LOCAL, NB_CONTENTS};
enum ZONE_STATE{NORMAL_STATE,MOVE_CUT,RESIZE_CUT,MOVE_ZONE,RESIZE_ZONE};
static const int INNER=20;
static const int OUTER=20;
struct CutProps {
CutProps(): m_ovWin(NULL), m_ovWinName(""), m_winX(0), m_winY(0),
m_winW(0), m_winH(0), m_alpha(255), m_transfo(NONE),
m_color(NORMAL), m_shape(BOX), m_effect(NO_EFFECT){}
CutWindow* m_ovWin;
std::string m_ovWinName;
int m_winX, m_winY;
int m_winW, m_winH;
int m_alpha;
ZONE_TRANSFO m_transfo;
ZONE_COLOR m_color;
ZONE_SHAPE m_shape;
ZONE_INPUT_EFFECT m_effect;
};
public:
ZoneWidget(int x=0, int y=0, int w=10, int h=10);
~ZoneWidget();
void copy(ZoneWidget*);
inline void draw(){drawZone(-1);}
void drawZone(const int&);
int handle(int event);
void setCutWin(CutWindow* ow);
CutWindow* getCutWin();
void save(xmlNodePtr parentNode);
void load(xmlNodePtr);
void resize(int x, int y, int w, int h);
inline void setID(const unsigned int& id){m_id=id;}
inline const unsigned int& getID(){return m_id;}
inline void setAlpha(const int& alpha) {
m_cutProps[m_curCutProps].m_alpha=alpha;
recomputePixels();
}
inline const int& getAlpha(){return m_cutProps[m_curCutProps].m_alpha;}
inline void setTransformation(const ZONE_TRANSFO& transfo) {
m_cutProps[m_curCutProps].m_transfo=transfo;
recomputePixels();
}
inline const ZONE_TRANSFO& getTransformation() {
return m_cutProps[m_curCutProps].m_transfo;
}
inline void setShape(const ZONE_SHAPE& shape) {
m_cutProps[m_curCutProps].m_shape=shape;
recomputePixels();
}
inline const ZONE_SHAPE& getShape() {
return m_cutProps[m_curCutProps].m_shape;
}
void setScene(const int& scene);
void setInputEffect(const ZONE_INPUT_EFFECT& effect);
inline const ZONE_INPUT_EFFECT& getEffect() {
return m_cutProps[m_curCutProps].m_effect;
}
void setColor(const ZONE_COLOR& color) {
m_cutProps[m_curCutProps].m_color=color;
}
inline const ZONE_COLOR& getColor() {
return m_cutProps[m_curCutProps].m_color;
}
void setVisible(const int& vis=-1);
void setUpdate(const int& up=-1);
inline int getUpdate(){return m_updateInScene;}
inline ZONE_UPDATE getZoneUpdate() {
return ZONE_UPDATE(m_updateInScene>=0);
}
void setContent(const ZONE_CONTENT& cont);
inline const ZONE_CONTENT& getContent() {
return m_content;
}
inline void learnMidi(){m_midiLearning=true;}
void refreshCutWin();
void startDraggingZone();
void forceDraggingZone();
inline void setRateReached(){m_rateReached=true;}
void processMidi(const int& midiType,
const int& midiChannel,
const int& midiControl,
const int& midiValue);
void recomputePixels();
private:
void recreateImage();
private:
unsigned int m_id;
// CutWindow* m_ovWin;
// std::string m_ovWinName;
Fl_RGB_Image* m_image;
uchar* m_imageData;
/*
int m_winX, m_winY;
int m_winW, m_winH;
*/
std::map<int, CutProps> m_cutProps;
static const int GLOBAL_PROPS=-1;
int m_curCutProps;
int m_currentScene;
ZONE_STATE m_state;
bool m_editing;
bool m_highlight;
bool m_dragging;
bool m_forcedDragging;
float m_dragX, m_dragY;
float m_dragW, m_dragH;
float m_dragStartX, m_dragStartY;
float m_scaleX, m_scaleY;
int m_nbPixPerRow;
std::vector<int> m_srcIndices;
std::vector<std::vector<int> > m_srcCoords;
std::vector<int> m_destIndices;
/*
int m_alpha;
ZONE_TRANSFO m_transfo;
ZONE_SHAPE m_shape;
*/
bool m_rateReached;
// ZONE_COLOR m_color;
ZONE_CONTENT m_content;
bool m_midiLearning;
int m_midiControl;
int m_midiChannel;
int m_midiType;
// ZONE_INPUT_EFFECT m_effect;
timeval m_effectDelay;
timeval m_effectStartTime;
bool m_hiddenByEffect;
bool m_effectDelayOver;
bool m_initialized;
float* m_coordImage;
int m_visibleInScene;
int m_updateInScene;
};
#endif
/***************************************************************************
* MacWindow.cpp
* Part of
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "MacWindow.hpp"
#include <iostream>
#include "../Controlar.hpp"
using namespace std;
MacWindow::MacWindow(CutWindowsManager* man, CGWindowID id): CutWindow(man) {
CGRect rect = CGRectMake(0, 0, 100, 100);
m_idCArray[0] = id;
m_idArray = CFArrayCreate(NULL, (const void **) m_idCArray, 1, NULL);
CFArrayRef descArray = CGWindowListCreateDescriptionFromArray(m_idArray);
if(CFArrayGetCount(descArray)>0) {
CFDictionaryRef description =
(CFDictionaryRef) CFArrayGetValueAtIndex(descArray, 0);
if (CFDictionaryContainsKey(description, kCGWindowBounds)) {
CFDictionaryRef bounds =
(CFDictionaryRef) CFDictionaryGetValue(description,
kCGWindowBounds);
if (bounds) {
CGRectMakeWithDictionaryRepresentation(bounds, &rect);
}
}
}
CFRelease(descArray);
m_posX = rect.origin.x;
m_posY = rect.origin.y;
m_width = rect.size.width;
m_height = rect.size.height;
m_offsetX = m_posX;
m_offsetY = m_posY;
m_pixPerRow = m_width;
m_isBGR=true;
m_needsOffset=true;
m_pixPerRow=m_width;
m_grabbed=false;
m_defaultImgData = new uchar[m_width*m_height*3];
}
MacWindow::~MacWindow() {
CFRelease(m_idArray);
}
int MacWindow::computeNbPixPerRow(const int& srcW, const int& srcH) {
CGImageRef img = CGWindowListCreateImageFromArray(CGRectNull,
m_idArray,
kCGWindowImageBoundsIgnoreFraming);
int nb = CGImageGetBytesPerRow(img)/4;
m_width=CGImageGetWidth(img)*Controlar::getInstance()->getDisplayScale();
m_height=CGImageGetHeight(img)*Controlar::getInstance()->getDisplayScale();
CFRelease(img);
return nb;
}
void MacWindow::getPixels(const int& srcX, const int& srcY,
const int& srcW, const int& srcH,
const vector<int>& srcIndices,
const vector<vector<int> >& srcCoords,
const vector<int>& destIndices,
const uchar& alpha,
const ZoneWidget::ZONE_COLOR& color,
uchar* destImg) {
//CGRect rect = CGRectMake(m_posX+srcX, m_posY+srcY, srcW, srcH);
//CGImageRef img = CGWindowListCreateImageFromArray(rect,
CGImageRef img = CGWindowListCreateImageFromArray(CGRectNull,
m_idArray,
kCGWindowImageBoundsIgnoreFraming);
if(img!=NULL) {
CFDataRef data = CGDataProviderCopyData(CGImageGetDataProvider(img));
uchar* buf = (uchar*)CFDataGetBytePtr(data);
vector<int>::const_iterator itId = srcIndices.begin();
vector<vector<int> >::const_iterator itCo = srcCoords.begin();
vector<int>::const_iterator itDe = destIndices.begin();
for(; itCo!=srcCoords.end(); ++itCo) {
if((*itCo)[0]>=0) {
//copy rgb
for(int c=0; c<3; ++c) {
destImg[(*itDe)] = (color==ZoneWidget::NORMAL)
?buf[(*itId)]
:255-buf[(*itId)];
++itId;
++itDe;
}
//copy alpha
destImg[(*itDe)] = alpha;
++itId;
++itDe;
}
else { //black
for(int c=0; c<4; ++c) {
destImg[(*itDe)] = 0;
++itId;
++itDe;
}
}
}
//release CG stuff
CFRelease(data);
CFRelease(img);
}
else {
cout<<"Error getting image of window "<<m_name<<endl;
}
}
void MacWindow::releaseImage() {
if(m_grabbed) {
CFRelease(m_data);
CFRelease(m_img);
m_grabbed=false;
}
}
uchar* MacWindow::grabImage() {
if(!m_grabbed) {
m_img = CGWindowListCreateImageFromArray(CGRectNull,
m_idArray,
kCGWindowImageBoundsIgnoreFraming);
if(m_img) {
m_data = CGDataProviderCopyData(CGImageGetDataProvider(m_img));
m_imgData = (uchar*)CFDataGetBytePtr(m_data);
m_grabbed=true;
}
else {
m_imgData=m_defaultImgData;
}
}
return m_imgData;
}
void MacWindow::storeImage(const int& id) {
int size = m_pixPerRow*m_height*4;
if(m_storedImgData.find(id)!=m_storedImgData.end()) {
delete [] m_storedImgData[id];
}
m_storedImgData[id] = new uchar[size];
memcpy(m_storedImgData[id], m_imgData, size);
}
uchar* MacWindow::retrieveImage(const int& id) {
map<int, uchar*>::iterator itSt = m_storedImgData.find(id);
if(itSt!=m_storedImgData.end()) {
return itSt->second;
}
return NULL;
}
/***************************************************************************
* MacWindow.hpp
* Part of
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef MacWindow_h
#define MacWindow_h
#include <vector>
#include <string>
#include "../CutWindow.hpp"
#import <ApplicationServices/ApplicationServices.h>
//#import <Cocoa/Cocoa.h>
//#import <QuartzCore/QuartzCore.h>
//#import <AppKit/AppKit.h>
class MacWindow: public CutWindow {
public :
MacWindow(CutWindowsManager* man, CGWindowID winID);
virtual ~MacWindow();
virtual void getPixels(const int& x, const int& y,
const int& sx, const int& sy,
const std::vector<int>& srcIndices,
const std::vector<std::vector<int> >& srcCoords,
const std::vector<int>& destIndices,
const uchar& alpha,
const ZoneWidget::ZONE_COLOR& color,
uchar* destImg);
int computeNbPixPerRow(const int& srcW, const int& srcH);
virtual uchar* grabImage();
virtual void releaseImage();
virtual void storeImage(const int& id);
virtual uchar* retrieveImage(const int& id);
protected:
CGWindowID m_idCArray[1];
CFArrayRef m_idArray;
CGImageRef m_img;
CFDataRef m_data;
};
#endif
/***************************************************************************
* MacWindowsManager.cpp
* Part of
* 2016- Florent Berthaut
* hitmuri.net
****************************************************************************/
/*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
Relies on code from:
https://github.com/JoelSjogren/window-copy/blob/master/windowutils.cpp
*/
#include "MacWindowsManager.hpp"
#include <iostream>
#include <stdlib.h>
#include "../Controlar.hpp"
using namespace std;
MacWindowsManager::MacWindowsManager(): CutWindowsManager() {}
MacWindowsManager::~MacWindowsManager() {}
void MacWindowsManager::updateWindowsList() {
map<unsigned int, CutWindow*> eraseWindows = m_windowMap;
m_windowList.clear();
CFArrayRef windowArray =
CGWindowListCreate(kCGWindowListExcludeDesktopElements
|kCGWindowListOptionOnScreenOnly, kCGNullWindowID);
CFArrayRef descArray = CGWindowListCreateDescriptionFromArray(windowArray);
if(descArray!=NULL) {
for(int i=0; i<CFArrayGetCount(descArray); ++i) {
CFDictionaryRef win =
(CFDictionaryRef)CFArrayGetValueAtIndex(descArray,i);
CFStringRef name =
(CFStringRef) CFDictionaryGetValue(win, kCGWindowName);
if(name!=NULL) {
if(CFStringGetLength(name)>0) {
char tempStr[128];
CFStringGetCString(name,tempStr,128,kCFStringEncodingUTF8);
string nameStr(tempStr);
unsigned int winID=(uintptr_t)
CFArrayGetValueAtIndex(windowArray,i);
if(m_windowMap.find(winID)==m_windowMap.end()) {
MacWindow* newWin
= new MacWindow(this,
(CGWindowID)(uintptr_t)
CFArrayGetValueAtIndex(windowArray,i));
newWin->setName(nameStr);
newWin->setWinID(winID);
m_windowMap[winID]=newWin;
}
m_windowList.push_back(m_windowMap[winID]);
eraseWindows.erase(winID);
}
}
CFRelease(win);
}
//remove/delete windows not present anymore
map<unsigned int, CutWindow*>::iterator itWin = eraseWindows.begin();
for(; itWin!=eraseWindows.end(); ++itWin) {
m_windowMap.erase(itWin->first);
delete itWin->second;
}
}
else {
cout<<"Error: No windows found"<<endl;
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
oscpack -- Open Sound Control packet manipulation library
http://www.audiomulch.com/~rossb/oscpack
Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef INCLUDED_TIMERLISTENER_H
#define INCLUDED_TIMERLISTENER_H
class TimerListener{
public:
virtual ~TimerListener() {}
virtual void TimerExpired() = 0;
};
#endif /* INCLUDED_TIMERLISTENER_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment