1 #include "audioconfig.h"
4 #include "edlsession.h"
6 #include "preferences.h"
7 #include "recordconfig.h"
8 #include "vdeviceprefs.h"
9 #include "videoinprefs.h"
12 #define _(String) gettext(String)
13 #define gettext_noop(String) String
14 #define N_(String) gettext_noop (String)
17 VideoInPrefs::VideoInPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
18 : PreferencesDialog(mwindow, pwindow)
20 this->mwindow = mwindow;
23 VideoInPrefs::~VideoInPrefs()
27 int VideoInPrefs::create_objects()
34 add_subwindow(new BC_Title(x, y, _("Video In"), LARGEFONT, BLACK));
37 add_subwindow(new BC_Title(x, y, _("Record Driver:"), MEDIUMFONT, BLACK));
38 video_in_device = new VDevicePrefs(x + 110,
43 pwindow->thread->edl->session->vconfig_in,
45 video_in_device->initialize();
48 sprintf(string, "%d", pwindow->thread->edl->session->video_write_length);
49 add_subwindow(textbox = new VideoWriteLength(pwindow, string, y));
50 add_subwindow(new CaptureLengthTumbler(pwindow, textbox, textbox->get_x() + textbox->get_w(), y));
51 add_subwindow(new BC_Title(x, y, _("Frames to record to disk at a time:")));
53 sprintf(string, "%d", pwindow->thread->edl->session->vconfig_in->capture_length);
54 add_subwindow(textbox = new VideoCaptureLength(pwindow, string, y));
55 add_subwindow(new CaptureLengthTumbler(pwindow, textbox, textbox->get_x() + textbox->get_w(), y));
56 add_subwindow(new BC_Title(x, y, _("Frames to buffer in device:")));
59 add_subwindow(new RecordSoftwareTimer(pwindow,
60 pwindow->thread->edl->session->record_software_position,
64 add_subwindow(new RecordSyncDrives(pwindow,
65 pwindow->thread->edl->session->record_sync_drives,
70 BC_TextBox *w_text, *h_text;
71 add_subwindow(new BC_Title(x, y, _("Size of captured frame:")));
73 add_subwindow(w_text = new RecordW(pwindow, x, y));
74 x += w_text->get_w() + 2;
75 add_subwindow(new BC_Title(x, y, "x"));
77 add_subwindow(h_text = new RecordH(pwindow, x, y));
79 add_subwindow(new FrameSizePulldown(mwindow,
87 add_subwindow(new BC_Title(x, y, _("Frame rate is always the default frame rate of the project.")));
93 RecordW::RecordW(PreferencesWindow *pwindow, int x, int y)
94 : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->vconfig_in->w)
96 this->pwindow = pwindow;
98 int RecordW::handle_event()
100 pwindow->thread->edl->session->vconfig_in->w = atol(get_text());
104 RecordH::RecordH(PreferencesWindow *pwindow, int x, int y)
105 : BC_TextBox(x, y, 70, 1, pwindow->thread->edl->session->vconfig_in->h)
107 this->pwindow = pwindow;
109 int RecordH::handle_event()
111 pwindow->thread->edl->session->vconfig_in->h = atol(get_text());
116 VideoWriteLength::VideoWriteLength(PreferencesWindow *pwindow, char *text, int y)
117 : BC_TextBox(260, y, 100, 1, text)
119 this->pwindow = pwindow;
122 int VideoWriteLength::handle_event()
124 pwindow->thread->edl->session->video_write_length = atol(get_text());
129 VideoCaptureLength::VideoCaptureLength(PreferencesWindow *pwindow, char *text, int y)
130 : BC_TextBox(260, y, 100, 1, text)
132 this->pwindow = pwindow;
135 int VideoCaptureLength::handle_event()
137 pwindow->thread->edl->session->vconfig_in->capture_length = atol(get_text());
141 CaptureLengthTumbler::CaptureLengthTumbler(PreferencesWindow *pwindow, BC_TextBox *text, int x, int y)
148 int CaptureLengthTumbler::handle_up_event()
150 int value = atol(text->get_text());
152 char string[BCTEXTLEN];
153 sprintf(string, "%d", value);
154 text->update(string);
155 text->handle_event();
159 int CaptureLengthTumbler::handle_down_event()
161 int value = atol(text->get_text());
163 value = MAX(1, value);
164 char string[BCTEXTLEN];
165 sprintf(string, "%d", value);
166 text->update(string);
167 text->handle_event();
173 RecordSoftwareTimer::RecordSoftwareTimer(PreferencesWindow *pwindow, int value, int x, int y)
174 : BC_CheckBox(x, y, value, _("Use software for positioning information"))
176 this->pwindow = pwindow;
179 int RecordSoftwareTimer::handle_event()
181 pwindow->thread->edl->session->record_software_position = get_value();
187 RecordSyncDrives::RecordSyncDrives(PreferencesWindow *pwindow, int value, int x, int y)
188 : BC_CheckBox(x, y, value, _("Sync drives automatically"))
190 this->pwindow = pwindow;
193 int RecordSyncDrives::handle_event()
195 pwindow->thread->edl->session->record_sync_drives = get_value();