r105: This commit was manufactured by cvs2svn to create tag
[cinelerra_cv/mob.git] / hvirtual / cinelerra / videoinprefs.C
blobb8f9b5c526be02ce502737f2082239ed8ecd087e
1 #include "audioconfig.h"
2 #include "clip.h"
3 #include "edl.h"
4 #include "edlsession.h"
5 #include "new.h"
6 #include "preferences.h"
7 #include "recordconfig.h"
8 #include "vdeviceprefs.h"
9 #include "videoinprefs.h"
11 #include <libintl.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()
29         int x = 5, y = 5;
30         char string[1024];
31         BC_TextBox *textbox;
34         add_subwindow(new BC_Title(x, y, _("Video In"), LARGEFONT, BLACK));
35         y += 25;
37         add_subwindow(new BC_Title(x, y, _("Record Driver:"), MEDIUMFONT, BLACK));
38         video_in_device = new VDevicePrefs(x + 110, 
39                 y, 
40                 pwindow, 
41                 this, 
42                 0, 
43                 pwindow->thread->edl->session->vconfig_in, 
44                 MODERECORD);
45         video_in_device->initialize();
47         y += 55;
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:")));
52         y += 27;
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:")));
57         y += 27;
59         add_subwindow(new RecordSoftwareTimer(pwindow, 
60                 pwindow->thread->edl->session->record_software_position, 
61                 x, 
62                 y));
63         y += 27;
64         add_subwindow(new RecordSyncDrives(pwindow, 
65                 pwindow->thread->edl->session->record_sync_drives, 
66                 x, 
67                 y));
68         y += 35;
70         BC_TextBox *w_text, *h_text;
71         add_subwindow(new BC_Title(x, y, _("Size of captured frame:")));
72         x += 170;
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"));
76         x += 10;
77         add_subwindow(h_text = new RecordH(pwindow, x, y));
78         x += h_text->get_w();
79         add_subwindow(new FrameSizePulldown(mwindow, 
80                 w_text, 
81                 h_text, 
82                 x, 
83                 y));
85         y += 27;
86         x = 5;
87         add_subwindow(new BC_Title(x, y, _("Frame rate is always the default frame rate of the project.")));
88         return 0;
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());
101         return 1;
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());
112         return 1;
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()); 
125         return 1;
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()); 
138         return 1; 
141 CaptureLengthTumbler::CaptureLengthTumbler(PreferencesWindow *pwindow, BC_TextBox *text, int x, int y)
142  : BC_Tumbler(x, y)
144         this->pwindow;
145         this->text = text;
148 int CaptureLengthTumbler::handle_up_event()
150         int value = atol(text->get_text());
151         value++;
152         char string[BCTEXTLEN];
153         sprintf(string, "%d", value);
154         text->update(string);
155         text->handle_event();
156         return 1;
159 int CaptureLengthTumbler::handle_down_event()
161         int value = atol(text->get_text());
162         value--;
163         value = MAX(1, value);
164         char string[BCTEXTLEN];
165         sprintf(string, "%d", value);
166         text->update(string);
167         text->handle_event();
168         return 1;
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(); 
182         return 1;
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(); 
196         return 1;