r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / plugins / normalize / normalizewindow.C
blobd78044da952a22c3d8600c998d2506a53813bc50
1 #include "mwindow.inc"
2 #include "normalizewindow.h"
4 #include <libintl.h>
5 #define _(String) gettext(String)
6 #define gettext_noop(String) String
7 #define N_(String) gettext_noop (String)
9 NormalizeWindow::NormalizeWindow(int x, int y)
10  : BC_Window(PROGRAM_NAME ": Normalize", 
11                                 x - 160,
12                                 y - 75,
13                                 320, 
14                                 150, 
15                                 320, 
16                                 150,
17                                 0,
18                                 0,
19                                 1)
20
23 NormalizeWindow::~NormalizeWindow()
27 int NormalizeWindow::create_objects(float *db_over, int *separate_tracks)
29         int x = 10, y = 10;
30         this->db_over = db_over;
31         this->separate_tracks = separate_tracks;
32         add_subwindow(new BC_Title(x, y, _("Enter the DB to overload by:")));
33         y += 20;
34         add_subwindow(new NormalizeWindowOverload(x, y, this->db_over));
35         y += 30;
36         add_subwindow(new NormalizeWindowSeparate(x, y, this->separate_tracks));
37         add_subwindow(new BC_OKButton(this));
38         add_subwindow(new BC_CancelButton(this));
39         show_window();
40         flush();
41         return 0;
44 int NormalizeWindow::close_event()
46         set_done(1);
47         return 1;
50 NormalizeWindowOverload::NormalizeWindowOverload(int x, int y, float *db_over)
51  : BC_TextBox(x, y, 200, 1, *db_over)
53         this->db_over = db_over;
56 NormalizeWindowOverload::~NormalizeWindowOverload()
59         
60 int NormalizeWindowOverload::handle_event()
62         *db_over = atof(get_text());
63         return 1;
67 NormalizeWindowSeparate::NormalizeWindowSeparate(int x, int y, int *separate_tracks)
68  : BC_CheckBox(x, y, *separate_tracks, _("Treat tracks independantly"))
70         this->separate_tracks = separate_tracks;
73 NormalizeWindowSeparate::~NormalizeWindowSeparate()
76         
77 int NormalizeWindowSeparate::handle_event()
79         *separate_tracks = get_value();
80         return 1;