X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fnormalize%2Fnormalizewindow.C;fp=cinelerra-5.1%2Fplugins%2Fnormalize%2Fnormalizewindow.C;h=2bdb20cab9ee15e102175f7202f62c0a4ad15b28;hb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;hp=0000000000000000000000000000000000000000;hpb=52fcc46226f9df46f9ce9d0566dc568455a7db0b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/plugins/normalize/normalizewindow.C b/cinelerra-5.1/plugins/normalize/normalizewindow.C new file mode 100644 index 00000000..2bdb20ca --- /dev/null +++ b/cinelerra-5.1/plugins/normalize/normalizewindow.C @@ -0,0 +1,99 @@ + +/* + * 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 "mwindow.inc" +#include "normalizewindow.h" + +NormalizeWindow::NormalizeWindow(int x, int y) + : BC_Window(_(PROGRAM_NAME ": Normalize"), + x - 160, + y - 75, + 320, + 150, + 320, + 150, + 0, + 0, + 1) +{ +} + +NormalizeWindow::~NormalizeWindow() +{ +} + +void NormalizeWindow::create_objects(float *db_over, int *separate_tracks) +{ + int x = 10, y = 10; + this->db_over = db_over; + this->separate_tracks = separate_tracks; + + lock_window("NormalizeWindow::create_objects"); + add_subwindow(new BC_Title(x, y, _("Enter the DB to overload by:"))); + y += 20; + add_subwindow(new NormalizeWindowOverload(x, y, this->db_over)); + y += 30; + add_subwindow(new NormalizeWindowSeparate(x, y, this->separate_tracks)); + add_subwindow(new BC_OKButton(this)); + add_subwindow(new BC_CancelButton(this)); + show_window(); + unlock_window(); +} + +int NormalizeWindow::close_event() +{ + set_done(1); + return 1; +} + +NormalizeWindowOverload::NormalizeWindowOverload(int x, int y, float *db_over) + : BC_TextBox(x, y, 200, 1, *db_over) +{ + this->db_over = db_over; +} + +NormalizeWindowOverload::~NormalizeWindowOverload() +{ +} + +int NormalizeWindowOverload::handle_event() +{ + *db_over = atof(get_text()); + return 1; +} + + +NormalizeWindowSeparate::NormalizeWindowSeparate(int x, int y, int *separate_tracks) + : BC_CheckBox(x, y, *separate_tracks, _("Treat tracks independantly")) +{ + this->separate_tracks = separate_tracks; +} + +NormalizeWindowSeparate::~NormalizeWindowSeparate() +{ +} + +int NormalizeWindowSeparate::handle_event() +{ + *separate_tracks = get_value(); + return 1; +}