X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fresample%2Fresample.C;h=562cbc664382b1121be0758b46f2ec4c82e44c79;hp=24f0f2f50b3d0dcc42f4c7032c69a50fe68151c5;hb=21c2e6b36d6a96c2f662a89459d607b5a387f4eb;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd diff --git a/cinelerra-5.1/plugins/resample/resample.C b/cinelerra-5.1/plugins/resample/resample.C index 24f0f2f5..562cbc66 100644 --- a/cinelerra-5.1/plugins/resample/resample.C +++ b/cinelerra-5.1/plugins/resample/resample.C @@ -2,26 +2,27 @@ /* * CINELERRA * Copyright (C) 2009 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "bcdisplayinfo.h" #include "bchash.h" #include "bcsignals.h" +#include "file.h" #include "language.h" #include "mainprogress.h" #include "../../cinelerra/resample.h" @@ -60,12 +61,12 @@ int ResampleFraction::handle_event() ResampleWindow::ResampleWindow(ResampleEffect *plugin, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Resample"), + : BC_Window(_(PROGRAM_NAME ": Resample"), x - 160, y - 75, - 320, - 150, - 320, + 320, + 150, + 320, 150, 0, 0, @@ -103,9 +104,9 @@ int ResampleResample::read_samples(Samples *buffer, int64_t start, int64_t len) { //printf("ResampleResample::read_samples %d %lld\n", __LINE__, len); - return plugin->read_samples(buffer, - 0, - start + plugin->get_source_start(), + return plugin->read_samples(buffer, + 0, + start + plugin->get_source_start(), len); } @@ -138,7 +139,7 @@ int ResampleEffect::get_parameters() ResampleWindow window(this, info.get_abs_cursor_x(), info.get_abs_cursor_y()); window.create_objects(); int result = window.run_window(); - + return result; } @@ -148,7 +149,7 @@ int ResampleEffect::load_defaults() char directory[BCTEXTLEN]; // set the default directory - sprintf(directory, "%sresample.rc", BCASTDIR); + sprintf(directory, "%s/resample.rc", File::get_config_path()); // load the defaults defaults = new BC_Hash(directory); defaults->load(); @@ -174,7 +175,7 @@ int ResampleEffect::start_loop() { char string[BCTEXTLEN]; sprintf(string, "%s...", plugin_title()); - progress = start_progress(string, + progress = start_progress(string, (int64_t)((double)(PluginClient::end - PluginClient::start) / scale)); } @@ -205,14 +206,14 @@ int ResampleEffect::process_loop(Samples *buffer, int64_t &write_length) int64_t predicted_total = (int64_t)((double)(PluginClient::end - PluginClient::start) / scale + 0.5); // Samples *input = new Samples(size); - + // read_samples(input, 0, current_position, size); // current_position += size; resample->resample(buffer, PluginAClient::out_buffer_size, - 1000000, - (int)(1000000.0 / scale), + 1000000, + (int)(1000000.0 / scale), total_written, PLAY_FORWARD); @@ -225,31 +226,31 @@ int ResampleEffect::process_loop(Samples *buffer, int64_t &write_length) total_written += write_length; //printf("ResampleEffect::process_loop %d %lld %f\n", __LINE__, write_length, scale); -// resample->resample_chunk(input, -// size, -// 1000000, -// (int)(1000000.0 / scale), +// resample->resample_chunk(input, +// size, +// 1000000, +// (int)(1000000.0 / scale), // 0); -// -// // +// +// // // if(resample->get_output_size(0)) // { // int64_t output_size = resample->get_output_size(0); -// +// // // if(output_size) // { // total_written += output_size; // } -// +// // // // Trim output to predicted length of stretched selection. // if(total_written > predicted_total) // { // output_size -= total_written - predicted_total; // result = 1; // } -// +// // // resample->read_output(buffer, 0, output_size); -// +// // // write_length = output_size; // }