X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fswapframes%2Fswapframes.C;h=60a8a98c000314b286e2a972c5dbf6f7b3a58acc;hb=HEAD;hp=c6280972107c262456010b39fd6448c9f32f40fe;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/swapframes/swapframes.C b/cinelerra-5.1/plugins/swapframes/swapframes.C index c6280972..60a8a98c 100644 --- a/cinelerra-5.1/plugins/swapframes/swapframes.C +++ b/cinelerra-5.1/plugins/swapframes/swapframes.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 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" @@ -25,7 +25,7 @@ #include "filexml.h" #include "guicast.h" #include "language.h" -#include "cicolors.h" +#include "bccolors.h" #include "pluginvclient.h" #include "swapframes.h" #include "vframe.h" @@ -62,10 +62,10 @@ int SwapFramesConfig::equivalent(SwapFramesConfig &src) 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; @@ -81,11 +81,11 @@ void SwapFramesConfig::interpolate(SwapFramesConfig &prev, -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; @@ -103,13 +103,13 @@ int SwapFramesOn::handle_event() -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; @@ -129,13 +129,13 @@ int SwapFramesEven::handle_event() -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; @@ -156,11 +156,11 @@ int SwapFramesOdd::handle_event() SwapFramesWindow::SwapFramesWindow(SwapFrames *plugin) - : PluginClientWindow(plugin, - 260, - 130, - 260, - 130, + : PluginClientWindow(plugin, + 260, + 130, + 260, + 130, 0) { this->plugin = plugin; @@ -174,14 +174,14 @@ void SwapFramesWindow::create_objects() 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(); } @@ -201,7 +201,7 @@ void SwapFramesWindow::create_objects() SwapFrames::SwapFrames(PluginServer *server) : PluginVClient(server) { - + buffer = 0; buffer_position = -1; prev_frame = -1; @@ -209,11 +209,11 @@ SwapFrames::SwapFrames(PluginServer *server) 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) @@ -238,7 +238,7 @@ void SwapFrames::update_gui() 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); @@ -252,7 +252,7 @@ void SwapFrames::save_data(KeyFrame *keyframe) 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")) @@ -275,7 +275,7 @@ int SwapFrames::process_buffer(VFrame *frame, { if(config.swap_even) { - if(new_position % 2) + if(new_position % 2) new_position--; else new_position++; @@ -301,21 +301,18 @@ int SwapFrames::process_buffer(VFrame *frame, 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; @@ -324,9 +321,9 @@ int SwapFrames::process_buffer(VFrame *frame, 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; @@ -336,8 +333,3 @@ int SwapFrames::process_buffer(VFrame *frame, return 0; } -int SwapFrames::handle_opengl() -{ - return 0; -} -