1 #include "cdripwindow.h"
7 #define _(String) gettext(String)
8 #define gettext_noop(String) String
9 #define N_(String) gettext_noop (String)
11 CDRipWindow::CDRipWindow(CDRipMain *cdripper, int x, int y)
12 : BC_Window(PROGRAM_NAME ": CD Ripper",
23 this->cdripper = cdripper;
26 CDRipWindow::~CDRipWindow()
30 int CDRipWindow::create_objects()
33 add_tool(new BC_Title(x, y, _("Select the range to transfer:"))); y += 25;
34 add_tool(new BC_Title(x, y, _("Track"))); x += 70;
35 add_tool(new BC_Title(x, y, _("Min"))); x += 70;
36 add_tool(new BC_Title(x, y, _("Sec"))); x += 100;
38 add_tool(new BC_Title(x, y, _("Track"))); x += 70;
39 add_tool(new BC_Title(x, y, _("Min"))); x += 70;
40 add_tool(new BC_Title(x, y, _("Sec"))); x += 100;
43 add_tool(track1 = new CDRipTextValue(this, &(cdripper->track1), x, y, 50));
45 add_tool(min1 = new CDRipTextValue(this, &(cdripper->min1), x, y, 50));
47 add_tool(sec1 = new CDRipTextValue(this, &(cdripper->sec1), x, y, 50));
50 add_tool(track2 = new CDRipTextValue(this, &(cdripper->track2), x, y, 50));
52 add_tool(min2 = new CDRipTextValue(this, &(cdripper->min2), x, y, 50));
54 add_tool(sec2 = new CDRipTextValue(this, &(cdripper->sec2), x, y, 50));
57 add_tool(new BC_Title(x, y, _("From"), LARGEFONT, RED));
59 add_tool(new BC_Title(x, y, _("To"), LARGEFONT, RED));
62 add_tool(new BC_Title(x, y, _("CD Device:")));
64 add_tool(device = new CDRipWindowDevice(this, cdripper->device, x, y, 200));
67 add_tool(new BC_OKButton(this));
69 add_tool(new BC_CancelButton(this));
82 CDRipTextValue::CDRipTextValue(CDRipWindow *window, int *output, int x, int y, int w)
83 : BC_TextBox(x, y, w, 1, *output)
85 this->output = output;
86 this->window = window;
89 CDRipTextValue::~CDRipTextValue()
93 int CDRipTextValue::handle_event()
95 *output = atol(get_text());
99 CDRipWindowDevice::CDRipWindowDevice(CDRipWindow *window, char *device, int x, int y, int w)
100 : BC_TextBox(x, y, w, 1, device)
102 this->window = window;
103 this->device = device;
106 CDRipWindowDevice::~CDRipWindowDevice()
110 int CDRipWindowDevice::handle_event()
112 strcpy(device, get_text());