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 "cdripwindow.h"
24 #include "mwindow.inc"
28 CDRipWindow::CDRipWindow(CDRipMain *cdripper, int x, int y)
29 : BC_Window(_(PROGRAM_NAME ": CD Ripper"),
30 x, y, xS(450), yS(230), xS(450), yS(230), 0, 0, 1)
32 this->cdripper = cdripper;
33 // *** CONTEXT_HELP ***
34 if(cdripper) context_help_set_keyword(cdripper->plugin_title());
35 else context_help_set_keyword("Rendered Audio Effects");
38 CDRipWindow::~CDRipWindow()
42 void CDRipWindow::create_objects()
44 int xs10 = xS(10), xs70 = xS(70), xs100 = xS(100);
45 int ys10 = yS(10), ys25 = yS(25), ys30 = yS(30), ys35 = yS(35);
46 int y = ys10, x = xs10;
47 add_tool(new BC_Title(x, y, _("Select the range to transfer:"))); y += ys25;
48 add_tool(new BC_Title(x, y, _("Track:"))); x += xs70;
49 add_tool(new BC_Title(x, y, _("Min."))); x += xs70;
50 add_tool(new BC_Title(x, y, _("Sec."))); x += xs100;
52 add_tool(new BC_Title(x, y, _("Track:"))); x += xs70;
53 add_tool(new BC_Title(x, y, _("Min."))); x += xs70;
54 add_tool(new BC_Title(x, y, _("Sec."))); x += xs100;
57 add_tool(track1 = new CDRipTextValue(this, &(cdripper->track1), x, y, 50));
59 add_tool(min1 = new CDRipTextValue(this, &(cdripper->min1), x, y, 50));
61 add_tool(sec1 = new CDRipTextValue(this, &(cdripper->sec1), x, y, 50));
64 add_tool(track2 = new CDRipTextValue(this, &(cdripper->track2), x, y, 50));
66 add_tool(min2 = new CDRipTextValue(this, &(cdripper->min2), x, y, 50));
68 add_tool(sec2 = new CDRipTextValue(this, &(cdripper->sec2), x, y, 50));
71 add_tool(new BC_Title(x, y, _("From"), LARGEFONT, RED));
73 add_tool(new BC_Title(x, y, _("To"), LARGEFONT, RED));
76 add_tool(new BC_Title(x, y, _("CD Device:")));
78 add_tool(device = new CDRipWindowDevice(this, cdripper->device, x, y, 200));
81 add_tool(new BC_OKButton(this));
83 add_tool(new BC_CancelButton(this));
95 CDRipTextValue::CDRipTextValue(CDRipWindow *window, int *output, int x, int y, int w)
96 : BC_TextBox(x, y, w, 1, *output)
98 this->output = output;
99 this->window = window;
102 CDRipTextValue::~CDRipTextValue()
106 int CDRipTextValue::handle_event()
108 *output = atol(get_text());
112 CDRipWindowDevice::CDRipWindowDevice(CDRipWindow *window, char *device, int x, int y, int w)
113 : BC_TextBox(x, y, w, 1, device)
115 this->window = window;
116 this->device = device;
119 CDRipWindowDevice::~CDRipWindowDevice()
123 int CDRipWindowDevice::handle_event()
125 strcpy(device, get_text());