X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ffreezeframe%2Ffreezeframe.C;h=b873b22f89365914d352fb34963828f355183607;hb=502b6f3b6fd04f6b01c6d70dcb81aa304dd0db1c;hp=69385755bb94173f203a0c097027753a94695f76;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/freezeframe/freezeframe.C b/cinelerra-5.1/plugins/freezeframe/freezeframe.C index 69385755..b873b22f 100644 --- a/cinelerra-5.1/plugins/freezeframe/freezeframe.C +++ b/cinelerra-5.1/plugins/freezeframe/freezeframe.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 1997-2012 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" @@ -55,10 +55,10 @@ int FreezeFrameConfig::equivalent(FreezeFrameConfig &that) line_double == that.line_double; } -void FreezeFrameConfig::interpolate(FreezeFrameConfig &prev, - FreezeFrameConfig &next, - long prev_frame, - long next_frame, +void FreezeFrameConfig::interpolate(FreezeFrameConfig &prev, + FreezeFrameConfig &next, + long prev_frame, + long next_frame, long current_frame) { this->enabled = prev.enabled; @@ -75,14 +75,9 @@ void FreezeFrameConfig::interpolate(FreezeFrameConfig &prev, FreezeFrameWindow::FreezeFrameWindow(FreezeFrameMain *client) - : PluginClientWindow(client, - 200, - 100, - 200, - 100, - 0) + : PluginClientWindow(client, 260, 100, 260, 100, 0) { - this->client = client; + this->client = client; } FreezeFrameWindow::~FreezeFrameWindow() @@ -92,17 +87,17 @@ FreezeFrameWindow::~FreezeFrameWindow() void FreezeFrameWindow::create_objects() { int x = 10, y = 10; - add_tool(enabled = new FreezeFrameToggle(client, + add_tool(enabled = new FreezeFrameToggle(client, &client->config.enabled, - x, + x, y, _("Enabled"))); // Try using extra effect for the line double since it doesn't // change the overhead. // y += 30; -// add_tool(line_double = new FreezeFrameToggle(client, +// add_tool(line_double = new FreezeFrameToggle(client, // &client->config.line_double, -// x, +// x, // y, // _("Line double"))); show_window(); @@ -114,9 +109,9 @@ void FreezeFrameWindow::create_objects() -FreezeFrameToggle::FreezeFrameToggle(FreezeFrameMain *client, - int *value, - int x, +FreezeFrameToggle::FreezeFrameToggle(FreezeFrameMain *client, + int *value, + int x, int y, char *text) : BC_CheckBox(x, y, *value, text) @@ -148,18 +143,18 @@ int FreezeFrameToggle::handle_event() FreezeFrameMain::FreezeFrameMain(PluginServer *server) : PluginVClient(server) { - + first_frame = 0; first_frame_position = -1; } FreezeFrameMain::~FreezeFrameMain() { - + if(first_frame) delete first_frame; } -const char* FreezeFrameMain::plugin_title() { return _("Freeze Frame"); } +const char* FreezeFrameMain::plugin_title() { return N_("Freeze Frame"); } int FreezeFrameMain::is_synthesis() { return 1; } int FreezeFrameMain::is_realtime() { return 1; } @@ -263,15 +258,11 @@ int FreezeFrameMain::process_buffer(VFrame *frame, if(!first_frame && config.enabled) { if(!first_frame) - first_frame = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + first_frame = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); //printf("FreezeFrameMain::process_buffer 1 %jd\n", first_frame_position); - read_frame(first_frame, - 0, + read_frame(first_frame, + 0, get_direction() == PLAY_REVERSE ? first_frame_position + 1 : first_frame_position, frame_rate, get_use_opengl()); @@ -282,8 +273,8 @@ int FreezeFrameMain::process_buffer(VFrame *frame, // Still not frozen if(!first_frame && !config.enabled) { - read_frame(frame, - 0, + read_frame(frame, + 0, start_position, frame_rate, get_use_opengl()); @@ -294,8 +285,8 @@ int FreezeFrameMain::process_buffer(VFrame *frame, { delete first_frame; first_frame = 0; - read_frame(frame, - 0, + read_frame(frame, + 0, start_position, frame_rate, get_use_opengl()); @@ -307,8 +298,8 @@ int FreezeFrameMain::process_buffer(VFrame *frame, // Had a keyframe in frozen range. Load new first frame if(previous_first_frame != first_frame_position) { - read_frame(first_frame, - 0, + read_frame(first_frame, + 0, get_direction() == PLAY_REVERSE ? first_frame_position + 1 : first_frame_position, frame_rate, get_use_opengl()); @@ -323,8 +314,8 @@ int FreezeFrameMain::process_buffer(VFrame *frame, // { // for(int i = 0; i < frame->get_h() - 1; i += 2) // { -// memcpy(frame->get_rows()[i + 1], -// frame->get_rows()[i], +// memcpy(frame->get_rows()[i + 1], +// frame->get_rows()[i], // frame->get_bytes_per_line()); // } // }