00001 #include "mwindow.inc"
00002 #include "normalizewindow.h"
00003
00004 #include <libintl.h>
00005 #define _(String) gettext(String)
00006 #define gettext_noop(String) String
00007 #define N_(String) gettext_noop (String)
00008
00009 NormalizeWindow::NormalizeWindow(int x, int y)
00010 : BC_Window(PROGRAM_NAME ": Normalize",
00011 x - 160,
00012 y - 75,
00013 320,
00014 150,
00015 320,
00016 150,
00017 0,
00018 0,
00019 1)
00020 {
00021 }
00022
00023 NormalizeWindow::~NormalizeWindow()
00024 {
00025 }
00026
00027 int NormalizeWindow::create_objects(float *db_over, int *separate_tracks)
00028 {
00029 int x = 10, y = 10;
00030 this->db_over = db_over;
00031 this->separate_tracks = separate_tracks;
00032 add_subwindow(new BC_Title(x, y, _("Enter the DB to overload by:")));
00033 y += 20;
00034 add_subwindow(new NormalizeWindowOverload(x, y, this->db_over));
00035 y += 30;
00036 add_subwindow(new NormalizeWindowSeparate(x, y, this->separate_tracks));
00037 add_subwindow(new BC_OKButton(this));
00038 add_subwindow(new BC_CancelButton(this));
00039 show_window();
00040 flush();
00041 return 0;
00042 }
00043
00044 int NormalizeWindow::close_event()
00045 {
00046 set_done(1);
00047 return 1;
00048 }
00049
00050 NormalizeWindowOverload::NormalizeWindowOverload(int x, int y, float *db_over)
00051 : BC_TextBox(x, y, 200, 1, *db_over)
00052 {
00053 this->db_over = db_over;
00054 }
00055
00056 NormalizeWindowOverload::~NormalizeWindowOverload()
00057 {
00058 }
00059
00060 int NormalizeWindowOverload::handle_event()
00061 {
00062 *db_over = atof(get_text());
00063 return 1;
00064 }
00065
00066
00067 NormalizeWindowSeparate::NormalizeWindowSeparate(int x, int y, int *separate_tracks)
00068 : BC_CheckBox(x, y, *separate_tracks, _("Treat tracks independantly"))
00069 {
00070 this->separate_tracks = separate_tracks;
00071 }
00072
00073 NormalizeWindowSeparate::~NormalizeWindowSeparate()
00074 {
00075 }
00076
00077 int NormalizeWindowSeparate::handle_event()
00078 {
00079 *separate_tracks = get_value();
00080 return 1;
00081 }