/*
* CINELERRA
* Copyright (C) 2008 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 "file.h"
#include "language.h"
#include "mainprogress.h"
#include "normalize.h"
{
}
-const char* NormalizeMain::plugin_title() { return _("Normalize"); }
+const char* NormalizeMain::plugin_title() { return N_("Normalize"); }
int NormalizeMain::is_realtime() { return 0; }
int NormalizeMain::is_multichannel() { return 1; }
char directory[BCTEXTLEN];
// set the default directory
- sprintf(directory, "%snormalize.rc", BCASTDIR);
-
+ sprintf(directory, "%s/normalize.rc", File::get_config_path());
+
// load the defaults
defaults = new BC_Hash(directory);
//printf("NormalizeMain::process_loop 1 %d %f\n", current_position, scale[0]);
current_position += fragment_len;
write_length = fragment_len;
- result = progress->update(PluginClient::end -
- PluginClient::start +
- current_position -
+ result = progress->update(PluginClient::end -
+ PluginClient::start +
+ current_position -
PluginClient::start);
if(current_position >= PluginClient::end) result = 1;
}
{
// Get peak
//printf("NormalizeMain::process_loop 4\n");
- for(int i = PluginClient::start;
- i < PluginClient::end && !result;
+ for(int i = PluginClient::start;
+ i < PluginClient::end && !result;
i += fragment_len)
{
fragment_len = PluginClient::in_buffer_size;
read_samples(buffer[j], j, i, fragment_len);
//printf("NormalizeMain::process_loop 7\n");
double *buffer_samples = buffer[j]->get_data();
-
+
for(int k = 0; k < fragment_len; k++)
{
double sample = fabs(buffer_samples[k]);
- if(peak[j] < sample)
+ if(peak[j] < sample)
peak[j] = sample;
}
}