Skip to content

Commit

Permalink
adding separate method to handle int messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Wolek authored and Nathan Wolek committed May 18, 2017
1 parent c699ae6 commit 256f8ca
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions source/projects/vbap/vbap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void additive_vbap(float *final_gs, float cartdir[3], t_vbap *x);
void vbap_bang(t_vbap *x);
void vbap_matrix(t_vbap *x, t_symbol *s, int ac, t_atom *av);
void vbap_float(t_vbap *x, double n);
void vbap_int(t_vbap *x, long l);
void vbap_set_azimuth(t_vbap *x, double n);
void vbap_set_elevation(t_vbap *x, double n);
void vbap_set_spread(t_vbap *x, double n);
Expand Down Expand Up @@ -82,6 +83,7 @@ int C74_EXPORT main(void)

class_addmethod(c, (method)vbap_bang, "bang", 0);
class_addmethod(c, (method)vbap_float, "float", A_FLOAT, 0);
class_addmethod(c, (method)vbap_int, "int", A_LONG, 0);
class_addmethod(c, (method)vbap_matrix, "loudspeaker-matrices", A_GIMME, 0);
class_addmethod(c, (method)traces, "enabletrace", A_LONG, 0);

Expand Down Expand Up @@ -127,6 +129,30 @@ void vbap_float(t_vbap *x, double n) {
}
}

void vbap_int(t_vbap *x, long l) {
switch (proxy_getinlet((t_object *)x)) {
case 1:
object_post((t_object*)x, "inlet 1");
vbap_set_azimuth(x, (double)l);
break;
case 2:
object_post((t_object*)x, "inlet 2");
vbap_set_elevation(x, (double)l);
break;
case 3:
object_post((t_object*)x, "inlet 3");
vbap_set_spread(x, (double)l);
break;
case 4:
object_post((t_object*)x, "inlet 4");
vbap_set_gain(x, (double)l);
break;
default:
object_error((t_object*)x, "inlet does not accept int");
break;
}
}

/*--------------------------------------------------------------------------*/
// panning angle azimuth
//void vbap_in1(t_vbap *x, long n) { x->x_azi = n; }
Expand Down

0 comments on commit 256f8ca

Please sign in to comment.