zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

Fl_Osc_Widget.H (2199B)


      1 /*
      2   ZynAddSubFX - a software synthesizer
      3 
      4   Fl_Osc_Widget.H - OSC Widget Superclass
      5   Copyright (C) 2016 Mark McCurry
      6 
      7   This program is free software; you can redistribute it and/or
      8   modify it under the terms of the GNU General Public License
      9   as published by the Free Software Foundation; either version 2
     10   of the License, or (at your option) any later version.
     11 */
     12 #pragma once
     13 #include <string>
     14 #include <cstring>
     15 #include <cassert>
     16 #include <cmath>
     17 #include "Fl_Osc_Interface.h"
     18 #include <FL/Fl_Group.H>
     19 
     20 class Fl_Osc_Widget
     21 {
     22     public:
     23         Fl_Osc_Widget(void); //Deprecated
     24         Fl_Osc_Widget(Fl_Widget *self);
     25         Fl_Osc_Widget(std::string loc, Fl_Osc_Interface *osc);
     26         virtual ~Fl_Osc_Widget(void);
     27 
     28         //Callback methods
     29         virtual void OSC_value(float);
     30         virtual void OSC_value(bool);
     31         virtual void OSC_value(int);
     32         virtual void OSC_value(char);
     33         virtual void OSC_value(unsigned,void*);
     34         virtual void OSC_value(const char *);
     35 
     36         //labeled forwarding methods
     37         virtual void OSC_value(float x, const char *);
     38         virtual void OSC_value(bool x, const char *);
     39         virtual void OSC_value(int x, const char *);
     40         virtual void OSC_value(char x, const char *);
     41         virtual void OSC_value(unsigned x, void *v, const char *);
     42         virtual void OSC_value(const char *x, const char *);
     43 
     44         //Raw messages
     45         virtual void OSC_raw(const char *);
     46         
     47         //Widget methods
     48         void oscWrite(std::string path, const char *args, ...);
     49         void oscWrite(std::string path);
     50         void oscRegister(const char *path);
     51 
     52         //Forces an update of parameters as they have become stale somehow
     53         virtual void update(void);
     54 
     55         //Smoothly change the base path
     56         virtual void rebase(std::string new_base);
     57         void oscMove(std::string new_ext);
     58         //Explicit version for weirdly routed controls
     59         void oscMove(std::string old_loc, std::string new_loc);
     60 
     61         //Base path
     62         std::string loc;
     63         //Extension
     64         std::string ext;
     65         Fl_Osc_Interface *osc;
     66     protected:
     67         class Fl_Osc_Pane *fetch_osc_pane(Fl_Widget *w);
     68 };