edl plugin names eng, fix segv for opengl brender, renderfarm rework strategy, perf...
[goodguy/history.git] / cinelerra-5.1 / plugins / 720to480 / 720to480.C
index 8ebd26cfb2d18e4c8845f1fbb6a88bc051f64776..fda3e1d016bd6acba29f72ccb146b9b06495492c 100644 (file)
@@ -2,26 +2,27 @@
 /*
  * 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 "720to480.h"
 #include "clip.h"
 #include "bchash.h"
+#include "file.h"
 #include "filexml.h"
 #include "bcdisplayinfo.h"
 #include "keyframe.h"
@@ -51,18 +52,18 @@ _720to480Config::_720to480Config()
 
 
 _720to480Window::_720to480Window(_720to480Main *client, int x, int y)
- : BC_Window(client->gui_string, 
-       x, 
-       y, 
-       230, 
-       150, 
-       230, 
-       150, 
-       0, 
+ : BC_Window(client->gui_string,
+       x,
+       y,
+       230,
+       150,
+       230,
+       150,
+       0,
        0,
        1)
-{ 
-       this->client = client; 
+{
+       this->client = client;
 }
 
 
@@ -82,7 +83,7 @@ void _720to480Window::create_objects()
 //     add_tool(forward = new _720to480Direction(client, this, FORWARD, x, y, _("Downsample")));
 //     y += 25;
 //     add_tool(reverse = new _720to480Direction(client, this, REVERSE, x, y, _("Upsample")));
-// 
+//
        add_subwindow(new BC_OKButton(this));
        add_subwindow(new BC_CancelButton(this));
 
@@ -115,15 +116,15 @@ void _720to480Window::set_direction(int direction)
 
 
 
-_720to480Order::_720to480Order(_720to480Main *client, 
-               _720to480Window *window, 
-               int output, 
-               int x, 
-               int y, 
+_720to480Order::_720to480Order(_720to480Main *client,
+               _720to480Window *window,
+               int output,
+               int x,
+               int y,
                char *text)
- : BC_Radial(x, 
-       y, 
-       client->config.first_field == output, 
+ : BC_Radial(x,
+       y,
+       client->config.first_field == output,
        text)
 {
        this->client = client;
@@ -141,15 +142,15 @@ int _720to480Order::handle_event()
 
 
 
-_720to480Direction::_720to480Direction(_720to480Main *client, 
-               _720to480Window *window, 
-               int output, 
-               int x, 
-               int y, 
+_720to480Direction::_720to480Direction(_720to480Main *client,
+               _720to480Window *window,
+               int output,
+               int x,
+               int y,
                char *text)
- : BC_Radial(x, 
-       y, 
-       client->config.direction == output, 
+ : BC_Radial(x,
+       y,
+       client->config.direction == output,
        text)
 {
        this->client = client;
@@ -188,7 +189,7 @@ _720to480Main::~_720to480Main()
        if(temp) delete temp;
 }
 
-const char* _720to480Main::plugin_title() { return _("720 to 480"); }
+const char* _720to480Main::plugin_title() { return N_("720 to 480"); }
 int _720to480Main::is_realtime() { return 0; }
 
 double _720to480Main::get_framerate()
@@ -203,8 +204,8 @@ double _720to480Main::get_framerate()
 int _720to480Main::load_defaults()
 {
        char directory[BCTEXTLEN];
-       sprintf(directory, "%s720to480.rc", BCASTDIR);
-       
+       sprintf(directory, "%s/720to480.rc", File::get_config_path());
+
        defaults = new BC_Hash(directory);
        defaults->load();
        config.first_field = defaults->get("FIRST_FIELD", config.first_field);
@@ -224,8 +225,8 @@ int _720to480Main::save_defaults()
 int _720to480Main::get_parameters()
 {
        BC_DisplayInfo info;
-       _720to480Window window(this, 
-               info.get_abs_cursor_x(), 
+       _720to480Window window(this,
+               info.get_abs_cursor_x(),
                info.get_abs_cursor_y());
        window.create_objects();
        int result = window.run_window();
@@ -238,7 +239,7 @@ int _720to480Main::start_loop()
        {
                char string[BCTEXTLEN];
                sprintf(string, "%s...", plugin_title());
-               progress = start_progress(string, 
+               progress = start_progress(string,
                        PluginClient::end - PluginClient::start);
        }
 
@@ -329,12 +330,8 @@ int _720to480Main::process_loop(VFrame *output)
        int result = 0;
 
        if(!temp)
-               temp = new VFrame(0,
-                       -1,
-                       output->get_w(),
-                       output->get_h(),
-                       output->get_color_model(),
-                       -1);
+               temp = new VFrame(output->get_w(), output->get_h(),
+                               output->get_color_model(), 0);
 
        if(config.direction == FORWARD)
        {
@@ -348,7 +345,7 @@ int _720to480Main::process_loop(VFrame *output)
                input_position++;
        }
 
-       if(PluginClient::interactive) 
+       if(PluginClient::interactive)
                result = progress->update(input_position - PluginClient::start);
 
        if(input_position >= PluginClient::end) result = 1;