/*
* 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 "filexml.h"
#include "guicast.h"
#include "language.h"
-#include "cicolors.h"
+#include "bccolors.h"
#include "pluginvclient.h"
#include "swapframes.h"
#include "vframe.h"
swap_even == src.swap_even;
}
-void SwapFramesConfig::interpolate(SwapFramesConfig &prev,
- SwapFramesConfig &next,
- int64_t prev_frame,
- int64_t next_frame,
+void SwapFramesConfig::interpolate(SwapFramesConfig &prev,
+ SwapFramesConfig &next,
+ int64_t prev_frame,
+ int64_t next_frame,
int64_t current_frame)
{
on = prev.on;
-SwapFramesOn::SwapFramesOn(SwapFrames *plugin,
+SwapFramesOn::SwapFramesOn(SwapFrames *plugin,
int x, int y)
- : BC_CheckBox(x,
- y,
- plugin->config.on,
+ : BC_CheckBox(x,
+ y,
+ plugin->config.on,
_("Enabled"))
{
this->plugin = plugin;
-SwapFramesEven::SwapFramesEven(SwapFrames *plugin,
- SwapFramesWindow *gui,
- int x,
+SwapFramesEven::SwapFramesEven(SwapFrames *plugin,
+ SwapFramesWindow *gui,
+ int x,
int y)
- : BC_Radial(x,
- y,
- plugin->config.swap_even,
+ : BC_Radial(x,
+ y,
+ plugin->config.swap_even,
_("Swap 0-1, 2-3, 4-5..."))
{
this->plugin = plugin;
-SwapFramesOdd::SwapFramesOdd(SwapFrames *plugin,
- SwapFramesWindow *gui,
- int x,
+SwapFramesOdd::SwapFramesOdd(SwapFrames *plugin,
+ SwapFramesWindow *gui,
+ int x,
int y)
- : BC_Radial(x,
- y,
- !plugin->config.swap_even,
+ : BC_Radial(x,
+ y,
+ !plugin->config.swap_even,
_("Swap 1-2, 3-4, 5-6..."))
{
this->plugin = plugin;
SwapFramesWindow::SwapFramesWindow(SwapFrames *plugin)
- : PluginClientWindow(plugin,
- 260,
- 130,
- 260,
- 130,
+ : PluginClientWindow(plugin,
+ 260,
+ 130,
+ 260,
+ 130,
0)
{
this->plugin = plugin;
BC_Bar *bar;
add_subwindow(bar = new BC_Bar(x, y, get_w() - x * 2));
y += bar->get_h() + 5;
- add_subwindow(swap_even = new SwapFramesEven(plugin,
- this,
- x,
+ add_subwindow(swap_even = new SwapFramesEven(plugin,
+ this,
+ x,
y));
y += swap_even->get_h() + 5;
- add_subwindow(swap_odd = new SwapFramesOdd(plugin,
- this,
- x,
+ add_subwindow(swap_odd = new SwapFramesOdd(plugin,
+ this,
+ x,
y));
show_window();
}
SwapFrames::SwapFrames(PluginServer *server)
: PluginVClient(server)
{
-
+
buffer = 0;
buffer_position = -1;
prev_frame = -1;
SwapFrames::~SwapFrames()
{
-
+
delete buffer;
}
-const char* SwapFrames::plugin_title() { return _("Swap Frames"); }
+const char* SwapFrames::plugin_title() { return N_("Swap Frames"); }
int SwapFrames::is_realtime() { return 1; }
NEW_WINDOW_MACRO(SwapFrames, SwapFramesWindow)
void SwapFrames::save_data(KeyFrame *keyframe)
{
FileXML output;
- output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+ output.set_shared_output(keyframe->xbuf);
output.tag.set_title("SWAPFRAMES");
output.tag.set_property("ON", config.on);
output.tag.set_property("SWAP_EVEN", config.swap_even);
void SwapFrames::read_data(KeyFrame *keyframe)
{
FileXML input;
- input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+ input.set_shared_input(keyframe->xbuf);
while(!input.read_tag())
{
if(input.tag.title_is("SWAPFRAMES"))
{
if(config.swap_even)
{
- if(new_position % 2)
+ if(new_position % 2)
new_position--;
else
new_position++;
if(new_position > prev_frame + 1)
{
//printf("SwapFrames::process_buffer %d\n", __LINE__);
- if(!buffer) buffer = new VFrame(0,
- -1,
- frame->get_w(),
- frame->get_h(),
- frame->get_color_model(),
- -1);
+ if(!buffer)
+ buffer = new VFrame(frame->get_w(), frame->get_h(),
+ frame->get_color_model(), 0);
buffer_position = new_position - 1;
- read_frame(buffer,
- 0,
- buffer_position,
+ read_frame(buffer,
+ 0,
+ buffer_position,
frame_rate,
0);
- read_frame(frame,
- 0,
- new_position,
+ read_frame(frame,
+ 0,
+ new_position,
frame_rate,
get_use_opengl());
prev_frame = new_position;
else
{
//printf("SwapFrames::process_buffer %d\n", __LINE__);
- read_frame(frame,
- 0,
- new_position,
+ read_frame(frame,
+ 0,
+ new_position,
frame_rate,
get_use_opengl());
prev_frame = new_position;
return 0;
}
-int SwapFrames::handle_opengl()
-{
- return 0;
-}
-