LMMS
Loading...
Searching...
No Matches
Fl_Osc_Output.cpp
Go to the documentation of this file.
1/*
2 ZynAddSubFX - a software synthesizer
3
4 Fl_Osc_Output.cpp - OSC Based Value Output
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#include "Fl_Osc_Output.H"
13#include <cstdlib>
14#include <cstring>
15#include <cmath>
16#include <cassert>
17#include <sstream>
18
19static void callback_fn_output(Fl_Widget *w, void *)
20{
21 ((Fl_Osc_Output*)w)->cb();
22}
23
24Fl_Osc_Output::Fl_Osc_Output(int X, int Y, int W, int H, const char *label)
25 :Fl_Value_Output(X,Y,W,H, label), Fl_Osc_Widget(this)
26{
27 Fl_Value_Output::callback(callback_fn_output);
28}
29
30
31void Fl_Osc_Output::init(const char *path)
32{
33 ext = path;
34 oscRegister(path);
35};
36
37void Fl_Osc_Output::callback(Fl_Callback *cb, void *p)
38{
39 cb_data.first = cb;
40 cb_data.second = p;
41}
42
44{
45 newvalue_ = v;
46 value(v);
47
48 //Hide the fact that this widget is async
49 if(cb_data.first)
50 cb_data.first(this, cb_data.second);
51}
52
54{
55 newvalue_ = v;
56 value(v);
57
58 //Hide the fact that this widget is async
59 if(cb_data.first)
60 cb_data.first(this, cb_data.second);
61}
62
64{
66}
67
68float Fl_Osc_Output::newvalue(void) const
69{
70 return newvalue_;
71}
72
74{
76}
static void callback_fn_output(Fl_Widget *w, void *)
Definition Fl_Osc_Output.cpp:19
Definition Fl_Osc_Output.H:17
void cb(void)
Definition Fl_Osc_Output.cpp:73
float newvalue() const
Definition Fl_Osc_Output.cpp:68
float newvalue_
Definition Fl_Osc_Output.H:32
Fl_Osc_Output(int x, int y, int w, int h, const char *label=NULL)
Definition Fl_Osc_Output.cpp:24
void callback(Fl_Callback *cb, void *p=NULL)
Definition Fl_Osc_Output.cpp:37
void OSC_value(char)
Definition Fl_Osc_Output.cpp:43
std::pair< Fl_Callback *, void * > cb_data
Definition Fl_Osc_Output.H:33
void init(const char *path)
Definition Fl_Osc_Output.cpp:31
void update(void)
Definition Fl_Osc_Output.cpp:63
std::string ext
Definition Fl_Osc_Widget.H:64
Fl_Osc_Widget(void)
Definition Fl_Osc_Widget.cpp:16
void oscRegister(const char *path)
Definition Fl_Osc_Widget.cpp:91
void oscWrite(std::string path, const char *args,...)
Definition Fl_Osc_Widget.cpp:60
UINT_D64 w
Definition inflate.c:942
unsigned v[N_MAX]
Definition inflate.c:1584
static PuglViewHint int value
Definition pugl.h:1708
#define X(str)
Definition juce_LV2Common.h:197
uch * p
Definition crypt.c:594