X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Freverb%2Freverb.C;h=eb60c71dff2617ebe371031fe35b231bc297eb9c;hp=92417a6c42badb6b08e787422632eae36f066bb3;hb=9d832a1fff11b11aaa1108c460690ed05e2bdc05;hpb=4fedf98530b3a6ff1ada6d2b9fbbc470e3df300c diff --git a/cinelerra-5.1/plugins/reverb/reverb.C b/cinelerra-5.1/plugins/reverb/reverb.C index 92417a6c..eb60c71d 100644 --- a/cinelerra-5.1/plugins/reverb/reverb.C +++ b/cinelerra-5.1/plugins/reverb/reverb.C @@ -1,7 +1,7 @@ /* * CINELERRA - * Copyright (C) 2008 Adam Williams + * Copyright (C) 2017 Adam Williams * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -350,87 +350,91 @@ void Reverb::update_gui() { if(thread) { - thread->window->lock_window(); - ((ReverbWindow*)thread->window)->level_init->update(config.level_init); - ((ReverbWindow*)thread->window)->delay_init->update(config.delay_init); - ((ReverbWindow*)thread->window)->ref_level1->update(config.ref_level1); - ((ReverbWindow*)thread->window)->ref_level2->update(config.ref_level2); - ((ReverbWindow*)thread->window)->ref_total->update(config.ref_total); - ((ReverbWindow*)thread->window)->ref_length->update(config.ref_length); - ((ReverbWindow*)thread->window)->lowpass1->update(config.lowpass1); - ((ReverbWindow*)thread->window)->lowpass2->update(config.lowpass2); - thread->window->unlock_window(); - } -} - - - - -int Reverb::load_from_file(char *path) -{ - int result = 0; - int length; - char string[1024]; - - FILE *in = fopen(path, "rb"); - if( in ) - { - fseek(in, 0, SEEK_END); - length = ftell(in); - fseek(in, 0, SEEK_SET); - (void)fread(string, length, 1, in); - fclose(in); -// read_data(string); - } - else - { - perror("fopen:"); -// failed - ErrorBox errorbox(""); - char string[1024]; - sprintf(string, _("Couldn't open %s."), path); - errorbox.create_objects(string); - errorbox.run_window(); - result = 1; + if(load_configuration()) + { +//printf("Reverb::update_gui %d %d\n", __LINE__, config.ref_length); + thread->window->lock_window("Reverb::update_gui"); + ((ReverbWindow*)thread->window)->level_init->update(config.level_init); + ((ReverbWindow*)thread->window)->delay_init->update(config.delay_init); + ((ReverbWindow*)thread->window)->ref_level1->update(config.ref_level1); + ((ReverbWindow*)thread->window)->ref_level2->update(config.ref_level2); + ((ReverbWindow*)thread->window)->ref_total->update(config.ref_total); + ((ReverbWindow*)thread->window)->ref_length->update(config.ref_length); + ((ReverbWindow*)thread->window)->lowpass1->update(config.lowpass1); + ((ReverbWindow*)thread->window)->lowpass2->update(config.lowpass2); + thread->window->unlock_window(); + } } - - return result; } -int Reverb::save_to_file(char *path) -{ - int result = 0; - char string[1024]; - { -// ConfirmSave confirm; -// result = confirm.test_file("", path); - } - if(!result) - { - FILE *out = fopen(path, "wb"); - if( out ) - { -// save_data(string); - fwrite(string, strlen(string), 1, out); - fclose(out); - } - else - { - result = 1; -// failed - ErrorBox errorbox(""); - char string[1024]; - sprintf(string, _("Couldn't save %s."), path); - errorbox.create_objects(string); - errorbox.run_window(); - result = 1; - } - } - return result; -} +// int Reverb::load_from_file(char *path) +// { +// FILE *in; +// int result = 0; +// int length; +// char string[1024]; +// +// if(in = fopen(path, "rb")) +// { +// fseek(in, 0, SEEK_END); +// length = ftell(in); +// fseek(in, 0, SEEK_SET); +// int temp = fread(string, length, 1, in); +// fclose(in); +// // read_data(string); +// } +// else +// { +// perror("fopen:"); +// // failed +// ErrorBox errorbox(""); +// char string[1024]; +// sprintf(string, _("Couldn't open %s."), path); +// errorbox.create_objects(string); +// errorbox.run_window(); +// result = 1; +// } +// +// return result; +// } +// +// int Reverb::save_to_file(char *path) +// { +// FILE *out; +// int result = 0; +// char string[1024]; +// +// { +// // ConfirmSave confirm; +// // result = confirm.test_file("", path); +// } +// +// if(!result) +// { +// if(out = fopen(path, "wb")) +// { +// // save_data(string); +// fwrite(string, strlen(string), 1, out); +// fclose(out); +// } +// else +// { +// result = 1; +// // failed +// ErrorBox errorbox(""); +// char string[1024]; +// sprintf(string, _("Couldn't save %s."), path); +// errorbox.create_objects(string); +// errorbox.run_window(); +// result = 1; +// } +// } +// +// return result; +// } ReverbEngine::ReverbEngine(Reverb *plugin) : Thread(1, 0, 0)