X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Fplugins%2Fyuv411%2Fyuv411win.C;h=bb6a2c33c147442a14f76635badd9fd29a20a9c5;hb=fdf615e4b9eb6ce8faecc7f138c28edf0efac3be;hp=056f68bf04ca0148bdaba419a60d57333c2d573d;hpb=0df48ad2d876409c5beeae2e21933a728ea76c33;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/yuv411/yuv411win.C b/cinelerra-5.1/plugins/yuv411/yuv411win.C index 056f68bf..bb6a2c33 100644 --- a/cinelerra-5.1/plugins/yuv411/yuv411win.C +++ b/cinelerra-5.1/plugins/yuv411/yuv411win.C @@ -1,11 +1,34 @@ +/* + * CINELERRA + * Copyright (C) 2016 Eric Olson + * + * 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 "edl.h" +#include "edlsession.h" #include "yuv411win.h" #include "language.h" yuv411Window::yuv411Window(yuv411Main *client) - : PluginClientWindow(client, xS(250), yS(255), xS(250), yS(255), 0) + : PluginClientWindow(client, xS(260), yS(250), xS(260), yS(250), 0) { this->client = client; + colormodel = -1; } yuv411Window::~yuv411Window() @@ -15,7 +38,7 @@ yuv411Window::~yuv411Window() void yuv411Window::create_objects() { int xs10 = xS(10), xs90 = xS(90); - int ys10 = yS(10), ys30 = yS(30), ys35 = yS(35); + int ys10 = yS(10), ys30 = yS(30); int x = xs10, y = ys10, x1=xs90; add_tool(avg_vertical = new yuv411Toggle(client, &(client->config.avg_vertical), @@ -44,13 +67,21 @@ void yuv411Window::create_objects() add_subwindow(new BC_Title(x, y, _("Bias:"))); add_subwindow(bias=new yuv411Bias(client,x1,y)); y += ys30; - add_subwindow(reset = new yuv411Reset(client, this, x, y+ys35)); + int y1 = get_h() - yuv411Reset::calculate_h() - yS(20); + add_subwindow(reset = new yuv411Reset(client, this, x, y1+ys10)); show_window(); flush(); yuv_warning = new BC_Title(x, y, _("Warning: colormodel not YUV"),MEDIUMFONT,RED); add_subwindow(yuv_warning); - yuv_warning->hide_window(); + EDL *edl = client->get_edl(); + colormodel = edl->session->color_model; + switch( colormodel ) { + case BC_YUV888: + case BC_YUVA8888: + yuv_warning->hide_window(); + break; + } } void yuv411Window::update() @@ -87,7 +118,7 @@ int yuv411Toggle::handle_event() } yuv411Offset::yuv411Offset(yuv411Main *client, int x, int y) - : BC_FSlider(x, y, 0, xS(100), yS(100), (float)0, (float)2, + : BC_FSlider(x+xS(60), y, 0, xS(100), yS(100), (float)0, (float)2, (float)client->config.offset) { this->client = client; @@ -101,7 +132,7 @@ int yuv411Offset::handle_event() } yuv411Thresh::yuv411Thresh(yuv411Main *client, int x, int y) - : BC_FSlider(x, y, 0, xS(100), yS(100), (float)1, (float)100, + : BC_FSlider(x+xS(60), y, 0, xS(100), yS(100), (float)1, (float)100, (float)client->config.thresh) { this->client = client; @@ -115,7 +146,7 @@ int yuv411Thresh::handle_event() } yuv411Bias::yuv411Bias(yuv411Main *client, int x, int y) - : BC_FSlider(x, y, 0, xS(100), yS(100), (float)0, (float)25, + : BC_FSlider(x+xS(60), y, 0, xS(100), yS(100), (float)0, (float)25, (float)client->config.bias) { this->client = client; @@ -181,4 +212,3 @@ void yuv411Window::show_warning(int warn) yuv_warning->hide_window(); } -