diff --git a/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.cpp b/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.cpp index 442422efc..aa14452c6 100644 --- a/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.cpp +++ b/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.cpp @@ -33,6 +33,7 @@ class Gx_tremolo // pointer to buffer float* output; float* input; + float* reset; // pointer to dsp class PluginLV2* tremolo_st; // private functions @@ -97,6 +98,9 @@ void Gx_tremolo::connect_mono(uint32_t port,void* data) case EFFECTS_INPUT: input = static_cast(data); break; + case RESET: + reset = static_cast(data); + break; default: break; } @@ -131,6 +135,7 @@ void Gx_tremolo::run_dsp_mono(uint32_t n_samples) if (n_samples< 1) return; tremolo_st->mono_audio(static_cast(n_samples), input, output, tremolo_st); + if ((*reset)>0) tremolo_st->clear_state(tremolo_st); } void Gx_tremolo::connect_all_mono_ports(uint32_t port, void* data) diff --git a/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.h b/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.h index 4cfbe9b37..09c017202 100644 --- a/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.h +++ b/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.h @@ -35,6 +35,7 @@ typedef enum FREQ, EFFECTS_OUTPUT, EFFECTS_INPUT, + RESET, } PortIndex; #endif //SRC_HEADERS_GXEFFECTS_H_ diff --git a/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.ttl b/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.ttl index 0adb57313..53a814dfc 100644 --- a/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.ttl +++ b/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo.ttl @@ -26,6 +26,7 @@ @prefix guiext: . @prefix time: . @prefix units: . +@prefix pprop: . a foaf:Person ; @@ -115,6 +116,16 @@ Model of a vactrol tremolo unit by "transmogrify" lv2:index 5 ; lv2:symbol "in" ; lv2:name "In" ; + ] , [ + a lv2:InputPort , + lv2:ControlPort ; + lv2:index 6 ; + lv2:portProperty lv2:integer, pprop:trigger; + lv2:symbol "reset" ; + lv2:name "Reset" ; + lv2:default 0.0 ; + lv2:minimum 0.0 ; + lv2:maximum 1.0 ; ] . diff --git a/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo_ui.cpp b/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo_ui.cpp index 229532d7f..68cbf0e25 100644 --- a/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo_ui.cpp +++ b/trunk/src/LV2/gx_tremolo.lv2/gx_tremolo_ui.cpp @@ -31,7 +31,7 @@ ----------------------------------------------------------------------- ----------------------------------------------------------------------*/ -#define CONTROLS 4 +#define CONTROLS 5 /*--------------------------------------------------------------------- ----------------------------------------------------------------------- @@ -72,10 +72,15 @@ void plugin_create_controller_widgets(X11_UI *ui, const char * plugin_uri) { set_adjustment(ui->widget[2]->adj,50.0, 50.0, 0.0, 100.0, 0.1, CL_CONTINUOS); adj_set_scale(ui->widget[2]->adj, 5.0); + ui->widget[4] = add_button(ui->win, "Reset",40, 215,40,30); + ui->widget[4]->parent_struct = ui; + ui->widget[4]->data = RESET; + ui->widget[4]->func.value_changed_callback = value_changed; + // create combobox widgets const char* model[] = {"triangle","sine"}; size_t len = sizeof(model) / sizeof(model[0]); - ui->widget[3] = add_my_combobox(ui->widget[3], SINE, "Mode", model, len, 0, ui, 40, 215, 180, 30); + ui->widget[3] = add_my_combobox(ui->widget[3], SINE, "Mode", model, len, 0, ui, 80, 215, 140, 30); } void plugin_cleanup(X11_UI *ui) {