aboutsummaryrefslogtreecommitdiff
path: root/osc.lv2
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2015-06-24 10:52:42 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2015-06-24 10:52:42 +0200
commit01d321a22d5aa0bb11a03509fdb91b9f5cbb8b7d (patch)
tree8fc6a84b0a88ebcc0b5f8e1cc974728dd2787f5a /osc.lv2
parent538a1b637ecdb3b3c34974faf7190a9775443d8c (diff)
parent9a50670c9c9027a3fd054be19d48cdc41969c06b (diff)
downloadmoony.lv2-01d321a22d5aa0bb11a03509fdb91b9f5cbb8b7d.tar.xz
Merge commit '9a50670c9c9027a3fd054be19d48cdc41969c06b'
Diffstat (limited to 'osc.lv2')
-rw-r--r--osc.lv2/lv2_osc.h56
1 files changed, 20 insertions, 36 deletions
diff --git a/osc.lv2/lv2_osc.h b/osc.lv2/lv2_osc.h
index 9474e51..241cbc3 100644
--- a/osc.lv2/lv2_osc.h
+++ b/osc.lv2/lv2_osc.h
@@ -317,7 +317,6 @@ static inline LV2_Atom_Forge_Ref
osc_forge_midi(osc_forge_t *oforge, LV2_Atom_Forge *forge, uint32_t size,
const uint8_t *m)
{
- // Note: this is not standard MIDI, e.g. first byte is a port number
LV2_Atom_Forge_Ref ref;
if(!(ref = lv2_atom_forge_atom(forge, size, oforge->MIDI_MidiEvent)))
return 0;
@@ -329,30 +328,6 @@ osc_forge_midi(osc_forge_t *oforge, LV2_Atom_Forge *forge, uint32_t size,
}
static inline LV2_Atom_Forge_Ref
-osc_forge_true(osc_forge_t *oforge, LV2_Atom_Forge *forge)
-{
- return lv2_atom_forge_bool(forge, 1);
-}
-
-static inline LV2_Atom_Forge_Ref
-osc_forge_false(osc_forge_t *oforge, LV2_Atom_Forge *forge)
-{
- return lv2_atom_forge_bool(forge, 0);
-}
-
-static inline LV2_Atom_Forge_Ref
-osc_forge_nil(osc_forge_t *oforge, LV2_Atom_Forge *forge)
-{
- return lv2_atom_forge_atom(forge, 0, 0);
-}
-
-static inline LV2_Atom_Forge_Ref
-osc_forge_bang(osc_forge_t *oforge, LV2_Atom_Forge *forge)
-{
- return lv2_atom_forge_float(forge, INFINITY);
-}
-
-static inline LV2_Atom_Forge_Ref
osc_forge_message_varlist(osc_forge_t *oforge, LV2_Atom_Forge *forge,
const char *path, const char *fmt, va_list args)
{
@@ -367,21 +342,29 @@ osc_forge_message_varlist(osc_forge_t *oforge, LV2_Atom_Forge *forge,
switch(*type)
{
case 'i':
+ {
if(!(ref =osc_forge_int32(oforge, forge, va_arg(args, int32_t))))
return 0;
break;
+ }
case 'f':
+ {
if(!(ref = osc_forge_float(oforge, forge, (float)va_arg(args, double))))
return 0;
break;
+ }
case 's':
+ {
if(!(ref = osc_forge_string(oforge, forge, va_arg(args, const char *))))
return 0;
break;
+ }
case 'S':
+ {
if(!(ref = osc_forge_symbol(oforge, forge, va_arg(args, const char *))))
return 0;
break;
+ }
case 'b':
{
int32_t size = va_arg(args, int32_t);
@@ -392,22 +375,30 @@ osc_forge_message_varlist(osc_forge_t *oforge, LV2_Atom_Forge *forge,
}
case 'h':
+ {
if(!(ref = osc_forge_int64(oforge, forge, va_arg(args, int64_t))))
return 0;
break;
+ }
case 'd':
+ {
if(!(ref = osc_forge_double(oforge, forge, va_arg(args, double))))
return 0;
break;
+ }
case 't':
+ {
if(!(ref = osc_forge_timestamp(oforge, forge, va_arg(args, uint64_t))))
return 0;
break;
+ }
case 'c':
+ {
if(!(ref = osc_forge_char(oforge, forge, (char)va_arg(args, unsigned int))))
return 0;
break;
+ }
case 'm':
{
int32_t size = va_arg(args, int32_t);
@@ -418,24 +409,17 @@ osc_forge_message_varlist(osc_forge_t *oforge, LV2_Atom_Forge *forge,
}
case 'T':
- if(!(ref = osc_forge_true(oforge, forge)))
- return 0;
- break;
case 'F':
- if(!(ref = osc_forge_false(oforge, forge)))
- return 0;
- break;
case 'N':
- if(!(ref = osc_forge_nil(oforge, forge)))
- return 0;
- break;
case 'I':
- if(!(ref = osc_forge_bang(oforge, forge)))
- return 0;
+ {
break;
+ }
default: // unknown argument type
+ {
return 0;
+ }
}
}