From 43e97ed5aff7cc28d392c871fea71b8709390625 Mon Sep 17 00:00:00 2001 From: Pierre Date: Thu, 23 Aug 2018 17:04:47 +0200 Subject: [PATCH] add support for default FAUST file --- external/.default.dsp | 3 +++ src/faustgen_tilde.c | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 external/.default.dsp diff --git a/external/.default.dsp b/external/.default.dsp new file mode 100644 index 0000000..16d38de --- /dev/null +++ b/external/.default.dsp @@ -0,0 +1,3 @@ +import("stdfaust.lib"); + +process = _; diff --git a/src/faustgen_tilde.c b/src/faustgen_tilde.c index 4204dbf..de34f01 100644 --- a/src/faustgen_tilde.c +++ b/src/faustgen_tilde.c @@ -470,6 +470,8 @@ static void *faustgen_tilde_new(t_symbol* s, int argc, t_atom* argv) t_faustgen_tilde* x = (t_faustgen_tilde *)pd_new(faustgen_tilde_class); if(x) { + char default_file[MAXPDSTRING]; + sprintf(default_file, "%s/.default", class_gethelpdir(faustgen_tilde_class)); x->f_dsp_factory = NULL; x->f_dsp_instance = NULL; @@ -481,13 +483,9 @@ static void *faustgen_tilde_new(t_symbol* s, int argc, t_atom* argv) x->f_ui_manager = faust_ui_manager_new((t_object *)x); x->f_io_manager = faust_io_manager_new((t_object *)x, canvas_getcurrent()); x->f_opt_manager = faust_opt_manager_new((t_object *)x, canvas_getcurrent()); - x->f_dsp_name = atom_getsymbolarg(0, argc, argv); + x->f_dsp_name = argc ? atom_getsymbolarg(0, argc, argv) : gensym(default_file); x->f_clock = clock_new(x, (t_method)faustgen_tilde_autocompile_tick); faust_opt_manager_parse_compile_options(x->f_opt_manager, argc ? argc-1 : 0, argv ? argv+1 : NULL); - if(!argc) - { - return x; - } faustgen_tilde_compile(x); if(!x->f_dsp_instance) {