X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fyuv%2Fyuvwindow.C;fp=cinelerra-5.1%2Fplugins%2Fyuv%2Fyuvwindow.C;h=4a446c262c06868e762f62f2fe0107f3f952eca3;hb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;hp=0000000000000000000000000000000000000000;hpb=52fcc46226f9df46f9ce9d0566dc568455a7db0b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/yuv/yuvwindow.C b/cinelerra-5.1/plugins/yuv/yuvwindow.C new file mode 100644 index 00000000..4a446c26 --- /dev/null +++ b/cinelerra-5.1/plugins/yuv/yuvwindow.C @@ -0,0 +1,130 @@ + +/* + * 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 "language.h" +#include "yuvwindow.h" + + +YUVWindow::YUVWindow(YUVMain *client) + : BC_Window("", MEGREY, client->gui_string, 210, 170, 200, 170, 0, !client->show_initially) +{ this->client = client; } + +YUVWindow::~YUVWindow() +{ + delete y_slider; + delete u_slider; + delete v_slider; + delete automation[0]; + delete automation[1]; + delete automation[2]; +} + +int YUVWindow::create_objects() +{ + int x = 10, y = 10; + add_tool(new BC_Title(x, y, _("Y:"))); + add_tool(automation[0] = new AutomatedFn(client, this, x + 80, y, 0)); + y += 20; + add_tool(y_slider = new YSlider(client, x, y)); + y += 35; + add_tool(new BC_Title(x, y, _("U:"))); + add_tool(automation[1] = new AutomatedFn(client, this, x + 80, y, 1)); + y += 20; + add_tool(u_slider = new USlider(client, x, y)); + y += 35; + add_tool(new BC_Title(x, y, _("V:"))); + add_tool(automation[2] = new AutomatedFn(client, this, x + 80, y, 2)); + y += 20; + add_tool(v_slider = new VSlider(client, x, y)); +} + +int YUVWindow::close_event() +{ + client->save_defaults(); + hide_window(); + client->send_hide_gui(); +} + +YSlider::YSlider(YUVMain *client, int x, int y) + : BC_ISlider(x, y, 190, 30, 200, client->y, -MAXVALUE, MAXVALUE, DKGREY, BLACK, 1) +{ + this->client = client; +} +YSlider::~YSlider() +{ +} +int YSlider::handle_event() +{ + client->y = get_value(); + client->send_configure_change(); +} + +USlider::USlider(YUVMain *client, int x, int y) + : BC_ISlider(x, y, 190, 30, 200, client->u, -MAXVALUE, MAXVALUE, DKGREY, BLACK, 1) +{ + this->client = client; +} +USlider::~USlider() +{ +} +int USlider::handle_event() +{ + client->u = get_value(); + client->send_configure_change(); +} + +VSlider::VSlider(YUVMain *client, int x, int y) + : BC_ISlider(x, y, 190, 30, 200, client->v, -MAXVALUE, MAXVALUE, DKGREY, BLACK, 1) +{ + this->client = client; +} +VSlider::~VSlider() +{ +} +int VSlider::handle_event() +{ + client->v = get_value(); + client->send_configure_change(); +} + +AutomatedFn::AutomatedFn(YUVMain *client, YUVWindow *window, int x, int y, int number) + : BC_CheckBox(x, y, 16, 16, client->automated_function == number, _("Automate")) +{ + this->client = client; + this->window = window; + this->number = number; +} + +AutomatedFn::~AutomatedFn() +{ +} + +int AutomatedFn::handle_event() +{ + for(int i = 0; i < 3; i++) + { + if(i != number) window->automation[i]->update(0); + } + update(1); + client->automated_function = number; + client->send_configure_change(); +} +