1 #include "vdeviceprefs.h"
2 #include "videodevice.inc"
5 #include "edlsession.h"
7 #include "videooutprefs.h"
8 #include "preferences.h"
12 #define _(String) gettext(String)
13 #define gettext_noop(String) String
14 #define N_(String) gettext_noop (String)
16 VideoOutPrefs::VideoOutPrefs(MWindow *mwindow, PreferencesWindow *pwindow)
17 : PreferencesDialog(mwindow, pwindow)
25 VideoOutPrefs::~VideoOutPrefs()
28 mwindow->defaults->update("PLAYBACK_HEAD", current_head);
32 int VideoOutPrefs::create_objects()
36 BC_PopupTextBox *popup;
38 //printf("VideoOutPrefs::create_objects 1\n");
39 current_head = mwindow->defaults->get("PLAYBACK_HEAD", 0);
40 strategies.append(new BC_ListBoxItem(_("Local Host")));
41 strategies.append(new BC_ListBoxItem(_("Multihead")));
42 strategies.append(new BC_ListBoxItem(_("Blond Symphony")));
44 // add_subwindow(new BC_Title(x, y, _("Playback"), LARGEFONT, BLACK));
46 // add_subwindow(new BC_Title(x, y, _("Strategy:")));
47 // popup = new PlaybackStrategy(this, x + 70, y);
48 // popup->create_objects();
50 // y += popup->get_h() + 30;
52 // Global playback options
54 // All strategies use these
55 add_subwindow(new BC_Title(x, y, _("Video"), LARGEFONT, BLACK));
58 add_subwindow(new BC_Title(x, y, _("Framerate achieved:")));
59 add_subwindow(framerate_title = new BC_Title(x + 200, y, _("--"), RED));
62 add_subwindow(new VideoEveryFrame(pwindow, x, y));
64 add_subwindow(new BC_Title(x, y, _("Scaling equation:")));
66 add_subwindow(nearest_neighbor = new PlaybackNearest(pwindow,
68 pwindow->thread->edl->session->interpolation_type == NEAREST_NEIGHBOR,
72 add_subwindow(bicubic = new PlaybackBicubic(pwindow,
74 pwindow->thread->edl->session->interpolation_type == CUBIC_INTERPOLATE,
79 add_subwindow(new BC_Title(x, y, _("Preload buffer for Quicktime:"), MEDIUMFONT, BLACK));
80 sprintf(string, "%d", pwindow->thread->edl->session->playback_preload);
81 add_subwindow(new PlaybackPreload(x + 210, y, pwindow, this, string));
84 // Strategic playback options created here
85 set_strategy(pwindow->thread->edl->session->playback_strategy, y);
87 // add_subwindow(new BC_Title(x, y, _("Playback driver:"), MEDIUMFONT, BLACK));
88 // add_subwindow(new AudioDriverMenu(x, y + 20, out_device, &(pwindow->thread->preferences->aconfig->audio_out_driver), 0, 1));
94 void VideoOutPrefs::update(int interpolation)
96 pwindow->thread->edl->session->interpolation_type = interpolation;
97 nearest_neighbor->update(interpolation == NEAREST_NEIGHBOR);
98 bicubic->update(interpolation == CUBIC_INTERPOLATE);
101 char* VideoOutPrefs::strategy_to_string(int strategy)
105 case PLAYBACK_LOCALHOST:
106 return _("Local Host");
108 case PLAYBACK_MULTIHEAD:
109 return _("Multihead");
111 case PLAYBACK_BLONDSYMPHONY:
112 return _("Blond Symphony");
115 return _("Local Host");
118 // Delete strategy dependant objects
119 void VideoOutPrefs::delete_strategy()
135 delete head_count_title;
136 // delete head_count_text;
141 delete vdevice_title;
147 int VideoOutPrefs::set_strategy(int strategy, int y)
152 pwindow->thread->edl->session->playback_strategy = strategy;
155 case PLAYBACK_LOCALHOST:
156 add_subwindow(vdevice_title = new BC_Title(x, y, _("Video Driver:")));
157 video_device = new VDevicePrefs(x + 100,
161 current_config()->vconfig,
164 video_device->initialize();
166 case PLAYBACK_MULTIHEAD:
167 add_subwindow(head_title = new BC_Title(x, y, _("Head:")));
168 // head_text = new PlaybackHead(this, x1, y);
169 // head_text->create_objects();
171 // add_subwindow(head_count_title = new BC_Title(x, y, _("Total Heads:")));
172 // head_count_text = new PlaybackHeadCount(this, x1, y);
173 // head_count_text->create_objects();
177 case PLAYBACK_BLONDSYMPHONY:
178 add_subwindow(head_title = new BC_Title(x, y, _("Head:")));
179 // head_text = new PlaybackHead(this, x1, y);
180 // head_text->create_objects();
182 // add_subwindow(head_count_title = new BC_Title(x, y, _("Total Heads:")));
183 // head_count_text = new PlaybackHeadCount(this, x1, y);
184 // head_count_text->create_objects();
186 // add_subwindow(host_title = new BC_Title(x, y, _("Hostname:")));
187 // add_subwindow(host_text = new PlaybackHost(this, x1, y));
190 add_subwindow(vdevice_title = new BC_Title(x, y, _("Video Driver:")));
191 video_device = new VDevicePrefs(x + 100,
195 current_config()->vconfig,
198 video_device->initialize();
205 ArrayList<PlaybackConfig*>* VideoOutPrefs::current_config_list()
207 return &pwindow->thread->edl->session->playback_config[pwindow->thread->edl->session->playback_strategy];
210 PlaybackConfig* VideoOutPrefs::current_config()
212 return current_config_list()->values[current_head];
217 int VideoOutPrefs::get_buffer_bytes()
219 // return pwindow->thread->edl->session->aconfig->oss_out_bits / 8 * pwindow->thread->preferences->aconfig->oss_out_channels * pwindow->thread->preferences->playback_buffer;
223 PlaybackNearest::PlaybackNearest(PreferencesWindow *pwindow, VideoOutPrefs *prefs, int value, int x, int y)
224 : BC_Radial(x, y, value, _("Nearest neighbor"))
226 this->pwindow = pwindow;
229 int PlaybackNearest::handle_event()
231 prefs->update(NEAREST_NEIGHBOR);
239 PlaybackBicubic::PlaybackBicubic(PreferencesWindow *pwindow, VideoOutPrefs *prefs, int value, int x, int y)
240 : BC_Radial(x, y, value, _("Bicubic"))
242 this->pwindow = pwindow;
245 int PlaybackBicubic::handle_event()
247 prefs->update(CUBIC_INTERPOLATE);
253 PlaybackPreload::PlaybackPreload(int x,
255 PreferencesWindow *pwindow,
256 VideoOutPrefs *playback,
258 : BC_TextBox(x, y, 100, 1, text)
260 this->pwindow = pwindow;
261 this->playback = playback;
264 int PlaybackPreload::handle_event()
266 pwindow->thread->edl->session->playback_preload = atol(get_text());
272 VideoEveryFrame::VideoEveryFrame(PreferencesWindow *pwindow, int x, int y)
273 : BC_CheckBox(x, y, pwindow->thread->edl->session->video_every_frame, _("Play every frame"))
275 this->pwindow = pwindow;
278 VideoEveryFrame::~VideoEveryFrame()
282 int VideoEveryFrame::handle_event()
284 pwindow->thread->edl->session->video_every_frame = get_value();