/*
* CINELERRA
* Copyright (C) 2009 Adam Williams <broadcast at earthling dot net>
- *
+ *
* 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"
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,
{
//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);
}
{
}
-const char* ResampleEffect::plugin_title() { return _("Resample"); }
+const char* ResampleEffect::plugin_title() { return N_("Resample"); }
void ResampleEffect::reset()
{
ResampleWindow window(this, info.get_abs_cursor_x(), info.get_abs_cursor_y());
window.create_objects();
int result = window.run_window();
-
+
return result;
}
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();
{
char string[BCTEXTLEN];
sprintf(string, "%s...", plugin_title());
- progress = start_progress(string,
+ progress = start_progress(string,
(int64_t)((double)(PluginClient::end - PluginClient::start) / scale));
}
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);
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;
// }