LMMS
Loading...
Searching...
No Matches
WatchPoint.h
Go to the documentation of this file.
1/*
2 ZynAddSubFX - a software synthesizer
3
4 WatchPoint.h - Synthesis State Watcher
5 Copyright (C) 2015-2015 Mark McCurry
6 Author: Mark McCurry
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12*/
13
14#pragma once
15
16namespace rtosc {class ThreadLink;}
17
18namespace zyncarla {
19
20struct WatchManager;
21
23{
24 bool active;
27 char identity[128];
28
29 WatchPoint(WatchManager *ref, const char *prefix, const char *id);
30 bool is_active(void);
31};
32
33#define MAX_WATCH 16
34#define MAX_WATCH_PATH 128
35#define MAX_SAMPLE 128
37{
45
46 //External API
47 WatchManager(thrlnk *link=0);
48 void add_watch(const char *);
49 void del_watch(const char *);
50 void tick(void);
51
52 //Watch Point Query API
53 bool active(const char *) const;
54 int samples(const char *) const;
55
56 //Watch Point Response API
57 void satisfy(const char *, float);
58 void satisfy(const char *, float*, int);
59};
60
62{
63 FloatWatchPoint(WatchManager *ref, const char *prefix, const char *id);
64 inline void operator()(float f)
65 {
66 if(is_active() && reference) {
67 reference->satisfy(identity, f);
68 active = false;
69 }
70 }
71};
72
73//basically the same as the float watch point, only it consumes tuples
75{
76 VecWatchPoint(WatchManager *ref, const char *prefix, const char *id);
77 inline void operator()(float *f, int n)
78 {
79 if(is_active() && reference) {
80 reference->satisfy(identity, f, n);
81 active = false;
82 }
83 }
84};
85
86}
#define MAX_WATCH
Definition WatchPoint.h:33
#define MAX_SAMPLE
Definition WatchPoint.h:35
#define MAX_WATCH_PATH
Definition WatchPoint.h:34
unsigned f
Definition inflate.c:1572
Definition globals.h:37
Definition zynaddsubfx-src.cpp:569
FloatWatchPoint(WatchManager *ref, const char *prefix, const char *id)
Definition WatchPoint.cpp:54
void operator()(float f)
Definition WatchPoint.h:64
void operator()(float *f, int n)
Definition WatchPoint.h:77
VecWatchPoint(WatchManager *ref, const char *prefix, const char *id)
Definition WatchPoint.cpp:58
Definition WatchPoint.h:37
void add_watch(const char *)
Definition WatchPoint.cpp:71
void satisfy(const char *, float)
Definition WatchPoint.cpp:148
char active_list[MAX_WATCH][MAX_WATCH_PATH]
Definition WatchPoint.h:41
bool active(const char *) const
Definition WatchPoint.cpp:128
WatchManager(thrlnk *link=0)
Definition WatchPoint.cpp:62
rtosc::ThreadLink thrlnk
Definition WatchPoint.h:38
void tick(void)
Definition WatchPoint.cpp:97
thrlnk * write_back
Definition WatchPoint.h:39
float data_list[MAX_SAMPLE][MAX_WATCH]
Definition WatchPoint.h:42
bool new_active
Definition WatchPoint.h:40
int samples(const char *) const
Definition WatchPoint.cpp:140
void del_watch(const char *)
Definition WatchPoint.cpp:89
int sample_list[MAX_WATCH]
Definition WatchPoint.h:43
bool deactivate[MAX_WATCH]
Definition WatchPoint.h:44
WatchPoint(WatchManager *ref, const char *prefix, const char *id)
Definition WatchPoint.cpp:28
WatchManager * reference
Definition WatchPoint.h:26
bool active
Definition WatchPoint.h:24
bool is_active(void)
Definition WatchPoint.cpp:38
char identity[128]
Definition WatchPoint.h:27
int samples_left
Definition WatchPoint.h:25
int n
Definition crypt.c:458