|
@@ -21,6 +21,7 @@
|
21
|
21
|
#include "cmTime.h"
|
22
|
22
|
#include "cmAudioSys.h"
|
23
|
23
|
#include "cmProcObj.h"
|
|
24
|
+#include "cmPP_NARG.h"
|
24
|
25
|
#include "cmDspCtx.h"
|
25
|
26
|
#include "cmDspClass.h"
|
26
|
27
|
#include "cmDspSys.h"
|
|
@@ -2870,36 +2871,77 @@ cmDspRC_t _cmDspSysPgm_PortToSym( cmDspSysH_t h, void** userPtrPtr )
|
2870
|
2871
|
{
|
2871
|
2872
|
cmDspRC_t rc = kOkDspRC;
|
2872
|
2873
|
|
2873
|
|
- cmDspInst_t* btn0 = cmDspSysAllocButton( h, "Btn0", 0.0 );
|
2874
|
|
- cmDspInst_t* btn1 = cmDspSysAllocButton( h, "Btn1", 0.0 );
|
2875
|
|
- cmDspInst_t* btn2 = cmDspSysAllocButton( h, "Btn2", 0.0 );
|
|
2874
|
+ inst_t* btn0 = button( "Btn0", 0.0 );
|
|
2875
|
+ inst_t* btn1 = button( "Btn1", 0.0 );
|
|
2876
|
+ inst_t* btn2 = button( "Btn2", 0.0 );
|
2876
|
2877
|
|
2877
|
|
- cmDspInst_t* pts = cmDspSysAllocInst( h, "PortToSym", NULL, 3, "one", "two", "three");
|
|
2878
|
+ inst_t* pts = inst( "PortToSym", NULL, "one", "two", "three");
|
2878
|
2879
|
|
2879
|
|
- cmDspInst_t* pr0 = cmDspSysAllocInst( h, "Printer", NULL, 1, "0:" );
|
2880
|
|
- cmDspInst_t* pr1 = cmDspSysAllocInst( h, "Printer", NULL, 1, "1:" );
|
|
2880
|
+ inst_t* pr0 = inst( "Printer", NULL, "sym:" );
|
|
2881
|
+ inst_t* pr1 = inst( "Printer", NULL, "btn:" );
|
|
2882
|
+ inst_t* pr2 = inst( "Printer", NULL, "out:" );
|
2881
|
2883
|
|
2882
|
2884
|
// check for allocation errors
|
2883
|
2885
|
if((rc = cmDspSysLastRC(h)) != kOkDspRC )
|
2884
|
2886
|
goto errLabel;
|
2885
|
2887
|
|
2886
|
|
- cmDspSysInstallCb( h, btn0, "out", pts, "one",NULL);
|
2887
|
|
- cmDspSysInstallCb( h, btn1, "out", pts, "two",NULL);
|
2888
|
|
- cmDspSysInstallCb( h, btn2, "out", pts, "three",NULL);
|
|
2888
|
+ event( btn0, out, pts, one );
|
|
2889
|
+ event( btn1, out, pts, two );
|
|
2890
|
+ event( btn2, out, pts, three );
|
|
2891
|
+
|
|
2892
|
+ event( btn0, out, pr1, in );
|
|
2893
|
+ event( btn1, out, pr1, in );
|
|
2894
|
+ event( btn2, out, pr1, in );
|
|
2895
|
+
|
|
2896
|
+ event( pts, one, pr0, in );
|
|
2897
|
+ event( pts, two, pr0, in );
|
|
2898
|
+ event( pts, three, pr0, in );
|
|
2899
|
+ event( pts, out, pr2, in );
|
|
2900
|
+
|
|
2901
|
+ errLabel:
|
|
2902
|
+ return rc;
|
|
2903
|
+}
|
|
2904
|
+
|
|
2905
|
+//------------------------------------------------------------------------------
|
|
2906
|
+//)
|
|
2907
|
+//( { label:cmDspPgm_IntToSym file_desc:"IntToSym example program." kw:[spgm] }
|
|
2908
|
+cmDspRC_t _cmDspSysPgm_IntToSym( cmDspSysH_t h, void** userPtrPtr )
|
|
2909
|
+{
|
|
2910
|
+ cmDspRC_t rc = kOkDspRC;
|
2889
|
2911
|
|
2890
|
|
- cmDspSysInstallCb( h, btn0, "out", pr1, "in",NULL);
|
2891
|
|
- cmDspSysInstallCb( h, btn1, "out", pr1, "in",NULL);
|
2892
|
|
- cmDspSysInstallCb( h, btn2, "out", pr1, "in",NULL);
|
|
2912
|
+ inst_t* btn0 = button( "Btn0", 0.0 );
|
|
2913
|
+ inst_t* btn1 = button( "Btn1", 1.0 );
|
|
2914
|
+ inst_t* btn2 = button( "Btn2", 2.0 );
|
2893
|
2915
|
|
2894
|
|
- cmDspSysInstallCb( h, pts, "one", pr0, "in", NULL );
|
2895
|
|
- cmDspSysInstallCb( h, pts, "two", pr0, "in", NULL );
|
2896
|
|
- cmDspSysInstallCb( h, pts, "three", pr0, "in", NULL );
|
|
2916
|
+ inst_t* pts = inst( "IntToSym", NULL, 1, "one", 2, "two", 3, "three");
|
2897
|
2917
|
|
|
2918
|
+ inst_t* pr0 = inst( "Printer", NULL, "btn:" );
|
|
2919
|
+ inst_t* pr1 = inst( "Printer", NULL, "sym:" );
|
|
2920
|
+ inst_t* pr2 = inst( "Printer", NULL, "out:" );
|
2898
|
2921
|
|
|
2922
|
+ // check for allocation errors
|
|
2923
|
+ if((rc = cmDspSysLastRC(h)) != kOkDspRC )
|
|
2924
|
+ goto errLabel;
|
|
2925
|
+
|
|
2926
|
+ event( btn0, out, pts, one );
|
|
2927
|
+ event( btn1, out, pts, two );
|
|
2928
|
+ event( btn2, out, pts, three );
|
|
2929
|
+
|
|
2930
|
+ event( btn0, out, pr0, in );
|
|
2931
|
+ event( btn1, out, pr0, in );
|
|
2932
|
+ event( btn2, out, pr0, in );
|
|
2933
|
+
|
|
2934
|
+ event( pts, one, pr1, in );
|
|
2935
|
+ event( pts, two, pr1, in );
|
|
2936
|
+ event( pts, three, pr1, in );
|
|
2937
|
+
|
|
2938
|
+ event( pts, out, pr2, in );
|
|
2939
|
+
|
2899
|
2940
|
errLabel:
|
2900
|
2941
|
return rc;
|
2901
|
2942
|
}
|
2902
|
2943
|
|
|
2944
|
+
|
2903
|
2945
|
//------------------------------------------------------------------------------
|
2904
|
2946
|
//)
|
2905
|
2947
|
//( { label:cmDspPgm_Line file_desc:"Line generator example program." kw:[spgm] }
|
|
@@ -3288,6 +3330,7 @@ _cmDspSysPgm_t _cmDspSysPgmArray[] =
|
3288
|
3330
|
{ "line", _cmDspSysPgm_Line, NULL, NULL },
|
3289
|
3331
|
{ "1Up", _cmDspSysPgm_1Up, NULL, NULL },
|
3290
|
3332
|
{ "PortToSym", _cmDspSysPgm_PortToSym, NULL, NULL },
|
|
3333
|
+ { "IntToSym", _cmDspSysPgm_IntToSym, NULL, NULL },
|
3291
|
3334
|
{ "preset", _cmDspSysPgm_Preset, NULL, NULL },
|
3292
|
3335
|
{ "rsrcWr", _cmDspSysPgm_RsrcWr, NULL, NULL },
|
3293
|
3336
|
{ "router", _cmDspSysPgm_Router, NULL, NULL },
|