15#include <FL/Fl_Tree.H>
32 if(
s[
s.length()-1] ==
'/') {
42 if(!find_item(
s.c_str()))
46 static void cb(Fl_Widget *
w,
void*)
48 using namespace rtosc;
50 int reason =
t->callback_reason();
53 t->item_pathname(pathname,
sizeof(pathname),
t->callback_item());
57 char *colon = index(pathname,
':');
60 t->osc->writeValue(
"/learn",
string(pathname));
67 printf(
"ok, I got the tree\n");
68 if(
auto *
i =
t->find_item((std::string(pathname)+
"/"+
"nil").c_str()))
70 for(
const Port &port :
p) {
71 printf(
"handling '%s'\n", port.name);
72 const bool subnodes = index(port.name,
'/');
73 const bool enumerated = index(port.name,
'#');
74 const string path = std::string(pathname)+
"/"+port.name;
80 strncpy(tmpa, path.c_str(), 1024);
81 char *pound = index(tmpa,
'#');
82 int N = atoi(pound+1);
84 char terminal = subnodes ?
'/' :
'\0';
86 for(
int i = 0;
i <
N; ++
i) {
87 snprintf(tmpb, 1024,
"%s%d%c",
99 using namespace rtosc;
103 if(
s[
s.length()-1] !=
'/')
106 for(
const Port &port : *
p) {
107 const char *
name = port.name;
108 if(!index(
name,
'/'))
112 s.substr(index(
s.c_str(),
'/')-
s.c_str()+1));
Definition Fl_Osc_Interface.h:56
void attach(std::string s)
Definition Fl_Osc_Tree.H:40
void sprout(std::string s)
Definition Fl_Osc_Tree.H:30
Fl_Osc_Interface * osc
Definition Fl_Osc_Tree.H:121
static void cb(Fl_Widget *w, void *)
Definition Fl_Osc_Tree.H:46
rtosc::Ports * root_ports
Definition Fl_Osc_Tree.H:120
Fl_Osc_Tree(int X, int Y, int W, int H, const char *L=0)
Definition Fl_Osc_Tree.H:20
static const rtosc::Ports * subtree_lookup(const rtosc::Ports *p, std::string s)
Definition Fl_Osc_Tree.H:97
UINT_D64 w
Definition inflate.c:942
struct huft * t
Definition inflate.c:943
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
bool rtosc_match(const char *pattern, const char *msg, const char **path_end)
Definition dispatch.c:132
static const char * name
Definition pugl.h:1582
#define X(str)
Definition juce_LV2Common.h:197
#define N
Definition nseel-cfunc.c:36
RECT const char void(* callback)(const char *droppath))) SWELL_API_DEFINE(BOOL
Definition swell-functions.h:1004
uch * p
Definition crypt.c:594