4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "mwindow.inc"
23 #include "normalizewindow.h"
26 #define _(String) gettext(String)
27 #define gettext_noop(String) String
28 #define N_(String) gettext_noop (String)
30 NormalizeWindow::NormalizeWindow(int x, int y)
31 : BC_Window(PROGRAM_NAME ": Normalize",
44 NormalizeWindow::~NormalizeWindow()
48 void NormalizeWindow::create_objects(float *db_over, int *separate_tracks)
51 this->db_over = db_over;
52 this->separate_tracks = separate_tracks;
54 lock_window("NormalizeWindow::create_objects");
55 add_subwindow(new BC_Title(x, y, _("Enter the DB to overload by:")));
57 add_subwindow(new NormalizeWindowOverload(x, y, this->db_over));
59 add_subwindow(new NormalizeWindowSeparate(x, y, this->separate_tracks));
60 add_subwindow(new BC_OKButton(this));
61 add_subwindow(new BC_CancelButton(this));
66 int NormalizeWindow::close_event()
72 NormalizeWindowOverload::NormalizeWindowOverload(int x, int y, float *db_over)
73 : BC_TextBox(x, y, 200, 1, *db_over)
75 this->db_over = db_over;
78 NormalizeWindowOverload::~NormalizeWindowOverload()
82 int NormalizeWindowOverload::handle_event()
84 *db_over = atof(get_text());
89 NormalizeWindowSeparate::NormalizeWindowSeparate(int x, int y, int *separate_tracks)
90 : BC_CheckBox(x, y, *separate_tracks, _("Treat tracks independantly"))
92 this->separate_tracks = separate_tracks;
95 NormalizeWindowSeparate::~NormalizeWindowSeparate()
99 int NormalizeWindowSeparate::handle_event()
101 *separate_tracks = get_value();