5 #include "edlsession.h"
7 #include "levelwindow.h"
11 #include "mwindowgui.h"
13 #include "mainsession.h"
16 #include "transportque.h"
17 #include "videowindow.h"
18 #include "vplayback.h"
24 #define _(String) gettext(String)
25 #define gettext_noop(String) String
26 #define N_(String) gettext_noop (String)
28 New::New(MWindow *mwindow)
29 : BC_MenuItem(_("New..."), "n", 'n')
31 this->mwindow = mwindow;
35 int New::create_objects()
37 thread = new NewThread(mwindow, this);
41 int New::handle_event()
45 thread->nwindow->raise_window();
48 mwindow->edl->save_defaults(mwindow->defaults);
55 void New::create_new_edl()
58 new_edl->create_objects();
59 new_edl->load_defaults(mwindow->defaults);
63 int New::create_new_project()
65 mwindow->cwindow->playback_engine->que->send_command(STOP,
69 mwindow->vwindow->playback_engine->que->send_command(STOP,
73 mwindow->cwindow->playback_engine->interrupt_playback(0);
74 mwindow->vwindow->playback_engine->interrupt_playback(0);
76 mwindow->gui->lock_window();
77 mwindow->undo->update_undo_before(_("New"), LOAD_ALL);
79 new_edl->session->boundaries();
80 new_edl->create_default_tracks();
82 mwindow->set_filename("");
83 mwindow->undo->update_undo_after();
85 mwindow->hide_plugins();
87 // Delete patches which are pointing to tracks which have been just deleted.
88 mwindow->patches->delete_all_patches();
89 mwindow->edl = new_edl;
90 mwindow->save_defaults();
93 mwindow->update_project(LOAD_REPLACE);
94 mwindow->session->changes_made = 0;
95 mwindow->gui->unlock_window();
99 NewThread::NewThread(MWindow *mwindow, New *new_project)
102 this->mwindow = mwindow;
103 this->new_project = new_project;
106 NewThread::~NewThread()
111 void NewThread::run()
117 nwindow = new NewWindow(mwindow, this);
118 nwindow->create_objects();
119 result = nwindow->run_window();
121 //printf("NewThread::run 1\n");
122 new_project->new_edl->save_defaults(mwindow->defaults);
123 //printf("NewThread::run 2\n");
124 mwindow->defaults->save();
125 //printf("NewThread::run 3\n");
131 delete new_project->new_edl;
135 //printf("NewThread::run 4\n");
136 new_project->create_new_project();
137 //printf("NewThread::run 5\n");
141 int NewThread::load_defaults()
143 auto_aspect = mwindow->defaults->get("AUTOASPECT", 0);
147 int NewThread::save_defaults()
149 mwindow->defaults->update("AUTOASPECT", auto_aspect);
153 int NewThread::update_aspect()
158 mwindow->create_aspect_ratio(new_project->new_edl->session->aspect_w,
159 new_project->new_edl->session->aspect_h,
160 new_project->new_edl->session->output_w,
161 new_project->new_edl->session->output_h);
162 sprintf(string, "%.02f", new_project->new_edl->session->aspect_w);
163 nwindow->aspect_w_text->update(string);
164 sprintf(string, "%.02f", new_project->new_edl->session->aspect_h);
165 nwindow->aspect_h_text->update(string);
174 N_("Cinelerra: New Project");
177 NewWindow::NewWindow(MWindow *mwindow, NewThread *new_thread)
178 : BC_Window(_(PROGRAM_NAME ": New Project"),
179 mwindow->gui->get_root_w() / 2 - WIDTH / 2,
180 mwindow->gui->get_root_h() / 2 - HEIGHT / 2,
189 this->mwindow = mwindow;
190 this->new_thread = new_thread;
191 this->new_edl = new_thread->new_project->new_edl;
194 NewWindow::~NewWindow()
196 for(int i = 0; i < preset_items.total; i++)
197 delete preset_items.values[i];
200 void NewWindow::create_presets(int &x, int &y)
203 add_subwindow(new BC_Title(x, y, _("Presets:")));
207 item = new NewPresetItem(mwindow, this, _("User Defined"));
208 preset_items.append(item);
210 item = new NewPresetItem(mwindow, this, _("1080 Progressive"));
211 item->edl->session->audio_channels = 2;
212 item->edl->session->audio_tracks = 2;
213 item->edl->session->sample_rate = 48000;
214 item->edl->session->video_channels = 1;
215 item->edl->session->video_tracks = 1;
216 item->edl->session->frame_rate = (double)30000.0 / 1001;
217 // item->edl->session->track_w = 1920;
218 // item->edl->session->track_h = 1080;
219 item->edl->session->output_w = 1920;
220 item->edl->session->output_h = 1080;
221 item->edl->session->aspect_w = 16;
222 item->edl->session->aspect_h = 9;
223 preset_items.append(item);
225 item = new NewPresetItem(mwindow, this, _("1080 Interlaced"));
226 item->edl->session->audio_channels = 2;
227 item->edl->session->audio_tracks = 2;
228 item->edl->session->sample_rate = 48000;
229 item->edl->session->video_channels = 1;
230 item->edl->session->video_tracks = 1;
231 item->edl->session->frame_rate = (double)60000.0 / 1001;
232 // item->edl->session->track_w = 1920;
233 // item->edl->session->track_h = 1080;
234 item->edl->session->output_w = 1920;
235 item->edl->session->output_h = 1080;
236 item->edl->session->aspect_w = 16;
237 item->edl->session->aspect_h = 9;
238 preset_items.append(item);
240 item = new NewPresetItem(mwindow, this, _("720 Progressive"));
241 item->edl->session->audio_channels = 2;
242 item->edl->session->audio_tracks = 2;
243 item->edl->session->sample_rate = 48000;
244 item->edl->session->video_channels = 1;
245 item->edl->session->video_tracks = 1;
246 item->edl->session->frame_rate = (double)30000.0 / 1001;
247 // item->edl->session->track_w = 1280;
248 // item->edl->session->track_h = 720;
249 item->edl->session->output_w = 1280;
250 item->edl->session->output_h = 720;
251 item->edl->session->aspect_w = 16;
252 item->edl->session->aspect_h = 9;
253 preset_items.append(item);
255 item = new NewPresetItem(mwindow, this, _("480 Progressive"));
256 item->edl->session->audio_channels = 2;
257 item->edl->session->audio_tracks = 2;
258 item->edl->session->sample_rate = 48000;
259 item->edl->session->video_channels = 1;
260 item->edl->session->video_tracks = 1;
261 item->edl->session->frame_rate = (double)30000.0 / 1001;
262 // item->edl->session->track_w = 720;
263 // item->edl->session->track_h = 480;
264 item->edl->session->output_w = 720;
265 item->edl->session->output_h = 480;
266 item->edl->session->aspect_w = 4;
267 item->edl->session->aspect_h = 3;
268 preset_items.append(item);
270 item = new NewPresetItem(mwindow, this, _("480 Interlaced"));
271 item->edl->session->audio_channels = 2;
272 item->edl->session->audio_tracks = 2;
273 item->edl->session->sample_rate = 48000;
274 item->edl->session->video_channels = 1;
275 item->edl->session->video_tracks = 1;
276 item->edl->session->frame_rate = (double)60000.0 / 1001;
277 // item->edl->session->track_w = 720;
278 // item->edl->session->track_h = 480;
279 item->edl->session->output_w = 720;
280 item->edl->session->output_h = 480;
281 item->edl->session->aspect_w = 4;
282 item->edl->session->aspect_h = 3;
283 preset_items.append(item);
285 item = new NewPresetItem(mwindow, this, _("Half D-1 NTSC"));
286 item->edl->session->audio_channels = 2;
287 item->edl->session->audio_tracks = 2;
288 item->edl->session->sample_rate = 48000;
289 item->edl->session->video_channels = 1;
290 item->edl->session->video_tracks = 1;
291 item->edl->session->frame_rate = (double)30000.0 / 1001;
292 // item->edl->session->track_w = 360;
293 // item->edl->session->track_h = 240;
294 item->edl->session->output_w = 360;
295 item->edl->session->output_h = 240;
296 item->edl->session->aspect_w = 4;
297 item->edl->session->aspect_h = 3;
298 preset_items.append(item);
300 item = new NewPresetItem(mwindow, this, _("Internet"));
301 item->edl->session->audio_channels = 1;
302 item->edl->session->audio_tracks = 1;
303 item->edl->session->sample_rate = 22050;
304 item->edl->session->video_channels = 1;
305 item->edl->session->video_tracks = 1;
306 item->edl->session->frame_rate = 15;
307 // item->edl->session->track_w = 320;
308 // item->edl->session->track_h = 240;
309 item->edl->session->output_w = 320;
310 item->edl->session->output_h = 240;
311 item->edl->session->aspect_w = 4;
312 item->edl->session->aspect_h = 3;
313 preset_items.append(item);
315 item = new NewPresetItem(mwindow, this, _("CD Audio"));
316 item->edl->session->audio_channels = 2;
317 item->edl->session->audio_tracks = 2;
318 item->edl->session->sample_rate = 44100;
319 item->edl->session->video_channels = 1;
320 item->edl->session->video_tracks = 0;
321 item->edl->session->frame_rate = (double)30000.0 / 1001;
322 // item->edl->session->track_w = 720;
323 // item->edl->session->track_h = 480;
324 item->edl->session->output_w = 720;
325 item->edl->session->output_h = 480;
326 item->edl->session->aspect_w = 4;
327 item->edl->session->aspect_h = 3;
328 preset_items.append(item);
330 item = new NewPresetItem(mwindow, this, _("DAT Audio"));
331 item->edl->session->audio_channels = 2;
332 item->edl->session->audio_tracks = 2;
333 item->edl->session->sample_rate = 48000;
334 item->edl->session->video_channels = 1;
335 item->edl->session->video_tracks = 0;
336 item->edl->session->frame_rate = (double)30000.0 / 1001;
337 // item->edl->session->track_w = 720;
338 // item->edl->session->track_h = 480;
339 item->edl->session->output_w = 720;
340 item->edl->session->output_h = 480;
341 item->edl->session->aspect_w = 4;
342 item->edl->session->aspect_h = 3;
343 preset_items.append(item);
345 add_subwindow(presets_text = new NewPresetsText(mwindow, this, x, y));
346 x += presets_text->get_w();
347 add_subwindow(presets = new NewPresetsPulldown(mwindow, this, x, y));
351 int NewWindow::create_objects()
353 int x = 10, y = 10, x1, y1;
356 mwindow->theme->draw_new_bg(this);
358 add_subwindow(new BC_Title(x, y, _("Parameters for the new project:")));
360 create_presets(x, y);
363 add_subwindow(new BC_Title(x, y, _("Audio"), LARGEFONT));
367 add_subwindow(new BC_Title(x1, y, _("Tracks:")));
369 add_subwindow(atracks = new NewATracks(this, "", x1, y));
370 x1 += atracks->get_w();
371 add_subwindow(new NewATracksTumbler(this, x1, y));
372 y += atracks->get_h() + 5;
375 add_subwindow(new BC_Title(x1, y, _("Channels:")));
377 add_subwindow(achannels = new NewAChannels(this, "", x1, y));
378 x1 += achannels->get_w();
379 add_subwindow(new NewAChannelsTumbler(this, x1, y));
380 y += achannels->get_h() + 5;
383 add_subwindow(new BC_Title(x1, y, _("Samplerate:")));
385 add_subwindow(sample_rate = new NewSampleRate(this, "", x1, y));
386 x1 += sample_rate->get_w();
387 add_subwindow(new SampleRatePulldown(mwindow, sample_rate, x1, y));
391 add_subwindow(new BC_Title(x, y, _("Video"), LARGEFONT));
394 add_subwindow(new BC_Title(x1, y, _("Tracks:")));
396 add_subwindow(vtracks = new NewVTracks(this, "", x1, y));
397 x1 += vtracks->get_w();
398 add_subwindow(new NewVTracksTumbler(this, x1, y));
399 y += vtracks->get_h() + 5;
402 // add_subwindow(new BC_Title(x1, y, _("Channels:")));
404 // add_subwindow(vchannels = new NewVChannels(this, "", x1, y));
405 // x1 += vchannels->get_w();
406 // add_subwindow(new NewVChannelsTumbler(this, x1, y));
407 // y += vchannels->get_h() + 5;
409 add_subwindow(new BC_Title(x1, y, _("Framerate:")));
411 add_subwindow(frame_rate = new NewFrameRate(this, "", x1, y));
412 x1 += frame_rate->get_w();
413 add_subwindow(new FrameRatePulldown(mwindow, frame_rate, x1, y));
414 y += frame_rate->get_h() + 5;
417 // add_subwindow(new BC_Title(x1, y, _("Canvas size:")));
419 // add_subwindow(canvas_w_text = new NewTrackW(this, x1, y));
420 // x1 += canvas_w_text->get_w() + 2;
421 // add_subwindow(new BC_Title(x1, y, "x"));
423 // add_subwindow(canvas_h_text = new NewTrackH(this, x1, y));
424 // x1 += canvas_h_text->get_w();
425 // add_subwindow(new FrameSizePulldown(mwindow,
431 // add_subwindow(new NewCloneToggle(mwindow, this, x1, y));
432 // y += canvas_h_text->get_h() + 5;
435 add_subwindow(new BC_Title(x1, y, _("Canvas size:")));
437 add_subwindow(output_w_text = new NewOutputW(this, x1, y));
438 x1 += output_w_text->get_w() + 2;
439 add_subwindow(new BC_Title(x1, y, "x"));
441 add_subwindow(output_h_text = new NewOutputH(this, x1, y));
442 x1 += output_h_text->get_w();
443 add_subwindow(new FrameSizePulldown(mwindow,
448 y += output_h_text->get_h() + 5;
451 add_subwindow(new BC_Title(x1, y, _("Aspect ratio:")));
453 add_subwindow(aspect_w_text = new NewAspectW(this, "", x1, y));
454 x1 += aspect_w_text->get_w() + 2;
455 add_subwindow(new BC_Title(x1, y, ":"));
457 add_subwindow(aspect_h_text = new NewAspectH(this, "", x1, y));
458 x1 += aspect_h_text->get_w();
459 add_subwindow(new AspectPulldown(mwindow,
465 x1 = aspect_w_text->get_x();
466 y += aspect_w_text->get_h() + 5;
467 add_subwindow(new NewAspectAuto(this, x1, y));
469 add_subwindow(new BC_Title(x, y, _("Color model:")));
471 add_subwindow(textbox = new BC_TextBox(x, y, 200, 1, ""));
472 x += textbox->get_w();
473 add_subwindow(new ColormodelPulldown(mwindow,
475 &new_edl->session->color_model,
479 add_subwindow(new BC_OKButton(this));
480 add_subwindow(new BC_CancelButton(this));
487 int NewWindow::update()
489 char string[BCTEXTLEN];
490 atracks->update((int64_t)new_edl->session->audio_tracks);
491 achannels->update((int64_t)new_edl->session->audio_channels);
492 sample_rate->update((int64_t)new_edl->session->sample_rate);
493 vtracks->update((int64_t)new_edl->session->video_tracks);
494 // vchannels->update((int64_t)new_edl->session->video_channels);
495 frame_rate->update((float)new_edl->session->frame_rate);
496 // canvas_w_text->update((int64_t)new_edl->session->track_w);
497 // canvas_h_text->update((int64_t)new_edl->session->track_h);
498 output_w_text->update((int64_t)new_edl->session->output_w);
499 output_h_text->update((int64_t)new_edl->session->output_h);
500 aspect_w_text->update((float)new_edl->session->aspect_w);
501 aspect_h_text->update((float)new_edl->session->aspect_h);
505 NewPresetsText::NewPresetsText(MWindow *mwindow, NewWindow *window, int x, int y)
506 : BC_TextBox(x, y, 200, 1, window->preset_items.values[0]->get_text())
508 this->mwindow = mwindow;
509 this->window = window;
512 int NewPresetsText::handle_event()
521 NewPresetsPulldown::NewPresetsPulldown(MWindow *mwindow, NewWindow *window, int x, int y)
526 LISTBOX_TEXT, // Display text list or icons
527 (ArrayList<BC_ListBoxItem*>*)&window->preset_items, // Each column has an ArrayList of BC_ListBoxItems.
528 0, // Titles for columns. Set to 0 for no titles
529 0, // width of each column
531 0, // Pixel of top of window.
534 this->mwindow = mwindow;
535 this->window = window;
537 int NewPresetsPulldown::handle_event()
539 NewPresetItem *preset = ((NewPresetItem*)get_selection(0, 0));
540 window->new_edl->copy_all(preset->edl);
542 window->presets_text->update(preset->get_text());
546 NewPresetItem::NewPresetItem(MWindow *mwindow, NewWindow *window, char *text)
547 : BC_ListBoxItem(text)
549 this->mwindow = mwindow;
550 this->window = window;
552 edl->create_objects();
553 edl->copy_all(window->new_edl);
556 NewPresetItem::~NewPresetItem()
565 NewATracks::NewATracks(NewWindow *nwindow, char *text, int x, int y)
566 : BC_TextBox(x, y, 90, 1, text)
568 this->nwindow = nwindow;
571 int NewATracks::handle_event()
573 nwindow->new_edl->session->audio_tracks = atol(get_text());
577 NewATracksTumbler::NewATracksTumbler(NewWindow *nwindow, int x, int y)
580 this->nwindow = nwindow;
582 int NewATracksTumbler::handle_up_event()
584 nwindow->new_edl->session->audio_tracks++;
585 nwindow->new_edl->boundaries();
589 int NewATracksTumbler::handle_down_event()
591 nwindow->new_edl->session->audio_tracks--;
592 nwindow->new_edl->boundaries();
597 NewAChannels::NewAChannels(NewWindow *nwindow, char *text, int x, int y)
598 : BC_TextBox(x, y, 90, 1, text)
600 this->nwindow = nwindow;
603 int NewAChannels::handle_event()
605 nwindow->new_edl->session->audio_channels = atol(get_text());
609 NewAChannelsTumbler::NewAChannelsTumbler(NewWindow *nwindow, int x, int y)
612 this->nwindow = nwindow;
614 int NewAChannelsTumbler::handle_up_event()
616 nwindow->new_edl->session->audio_channels++;
617 nwindow->new_edl->boundaries();
621 int NewAChannelsTumbler::handle_down_event()
623 nwindow->new_edl->session->audio_channels--;
624 nwindow->new_edl->boundaries();
630 NewSampleRate::NewSampleRate(NewWindow *nwindow, char *text, int x, int y)
631 : BC_TextBox(x, y, 90, 1, text)
633 this->nwindow = nwindow;
636 int NewSampleRate::handle_event()
638 nwindow->new_edl->session->sample_rate = atol(get_text());
642 SampleRatePulldown::SampleRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y)
648 &mwindow->theme->sample_rates,
655 this->mwindow = mwindow;
656 this->output = output;
658 int SampleRatePulldown::handle_event()
660 char *text = get_selection(0, 0)->get_text();
661 output->update(text);
662 output->handle_event();
680 NewVTracks::NewVTracks(NewWindow *nwindow, char *text, int x, int y)
681 : BC_TextBox(x, y, 90, 1, text)
683 this->nwindow = nwindow;
686 int NewVTracks::handle_event()
688 nwindow->new_edl->session->video_tracks = atol(get_text());
692 NewVTracksTumbler::NewVTracksTumbler(NewWindow *nwindow, int x, int y)
695 this->nwindow = nwindow;
697 int NewVTracksTumbler::handle_up_event()
699 printf("NewVTracks::handle_event 1 %f\n", nwindow->new_edl->session->frame_rate);
700 nwindow->new_edl->session->video_tracks++;
701 printf("NewVTracks::handle_event 2 %d %f\n", nwindow->new_edl->session->video_tracks, nwindow->new_edl->session->frame_rate);
702 nwindow->new_edl->boundaries();
703 printf("NewVTracks::handle_event 3 %d %f\n", nwindow->new_edl->session->video_tracks, nwindow->new_edl->session->frame_rate);
705 printf("NewVTracks::handle_event 4 %d %f\n", nwindow->new_edl->session->video_tracks, nwindow->new_edl->session->frame_rate);
708 int NewVTracksTumbler::handle_down_event()
710 nwindow->new_edl->session->video_tracks--;
711 nwindow->new_edl->boundaries();
716 NewVChannels::NewVChannels(NewWindow *nwindow, char *text, int x, int y)
717 : BC_TextBox(x, y, 90, 1, text)
719 this->nwindow = nwindow;
722 int NewVChannels::handle_event()
724 nwindow->new_edl->session->video_channels = atol(get_text());
728 NewVChannelsTumbler::NewVChannelsTumbler(NewWindow *nwindow, int x, int y)
731 this->nwindow = nwindow;
733 int NewVChannelsTumbler::handle_up_event()
735 nwindow->new_edl->session->video_channels++;
736 nwindow->new_edl->boundaries();
740 int NewVChannelsTumbler::handle_down_event()
742 nwindow->new_edl->session->video_channels--;
743 nwindow->new_edl->boundaries();
748 NewFrameRate::NewFrameRate(NewWindow *nwindow, char *text, int x, int y)
749 : BC_TextBox(x, y, 90, 1, text)
751 this->nwindow = nwindow;
754 int NewFrameRate::handle_event()
756 nwindow->new_edl->session->frame_rate = Units::atoframerate(get_text());
760 FrameRatePulldown::FrameRatePulldown(MWindow *mwindow,
769 &mwindow->theme->frame_rates,
776 this->mwindow = mwindow;
777 this->output = output;
779 int FrameRatePulldown::handle_event()
781 char *text = get_selection(0, 0)->get_text();
782 output->update(text);
783 output->handle_event();
787 // NewTrackW::NewTrackW(NewWindow *nwindow, int x, int y)
788 // : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->track_w)
790 // this->nwindow = nwindow;
792 // int NewTrackW::handle_event()
794 // nwindow->new_edl->session->track_w = atol(get_text());
798 // NewTrackH::NewTrackH(NewWindow *nwindow, int x, int y)
799 // : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->track_h)
801 // this->nwindow = nwindow;
804 // int NewTrackH::handle_event()
806 // nwindow->new_edl->session->track_h = atol(get_text());
810 FrameSizePulldown::FrameSizePulldown(MWindow *mwindow,
811 BC_TextBox *output_w,
812 BC_TextBox *output_h,
820 &mwindow->theme->frame_sizes,
827 this->mwindow = mwindow;
828 this->output_w = output_w;
829 this->output_h = output_h;
831 int FrameSizePulldown::handle_event()
833 char *text = get_selection(0, 0)->get_text();
834 char string[BCTEXTLEN];
838 strcpy(string, text);
839 ptr = strrchr(string, 'x');
849 output_w->handle_event();
850 output_h->handle_event();
855 NewOutputW::NewOutputW(NewWindow *nwindow, int x, int y)
856 : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_w)
858 this->nwindow = nwindow;
860 int NewOutputW::handle_event()
862 nwindow->new_edl->session->output_w = atol(get_text());
863 nwindow->new_thread->update_aspect();
867 NewOutputH::NewOutputH(NewWindow *nwindow, int x, int y)
868 : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_h)
870 this->nwindow = nwindow;
872 int NewOutputH::handle_event()
874 nwindow->new_edl->session->output_h = atol(get_text());
875 nwindow->new_thread->update_aspect();
879 NewAspectW::NewAspectW(NewWindow *nwindow, char *text, int x, int y)
880 : BC_TextBox(x, y, 70, 1, text)
882 this->nwindow = nwindow;
885 int NewAspectW::handle_event()
887 nwindow->new_edl->session->aspect_w = atof(get_text());
891 NewAspectH::NewAspectH(NewWindow *nwindow, char *text, int x, int y)
892 : BC_TextBox(x, y, 70, 1, text)
894 this->nwindow = nwindow;
897 int NewAspectH::handle_event()
899 nwindow->new_edl->session->aspect_h = atof(get_text());
903 AspectPulldown::AspectPulldown(MWindow *mwindow,
904 BC_TextBox *output_w,
905 BC_TextBox *output_h,
913 &mwindow->theme->aspect_ratios,
920 this->mwindow = mwindow;
921 this->output_w = output_w;
922 this->output_h = output_h;
924 int AspectPulldown::handle_event()
926 char *text = get_selection(0, 0)->get_text();
927 char string[BCTEXTLEN];
931 strcpy(string, text);
932 ptr = strrchr(string, ':');
942 output_w->handle_event();
943 output_h->handle_event();
948 ColormodelItem::ColormodelItem(char *text, int value)
949 : BC_ListBoxItem(text)
954 ColormodelPulldown::ColormodelPulldown(MWindow *mwindow,
955 BC_TextBox *output_text,
964 (ArrayList<BC_ListBoxItem*>*)&mwindow->colormodels,
971 this->mwindow = mwindow;
972 this->output_text = output_text;
973 this->output_value = output_value;
974 output_text->update(colormodel_to_text());
977 int ColormodelPulldown::handle_event()
979 output_text->update(get_selection(0, 0)->get_text());
980 *output_value = ((ColormodelItem*)get_selection(0, 0))->value;
984 char* ColormodelPulldown::colormodel_to_text()
986 for(int i = 0; i < mwindow->colormodels.total; i++)
987 if(mwindow->colormodels.values[i]->value == *output_value)
988 return mwindow->colormodels.values[i]->get_text();
1001 NewAspectAuto::NewAspectAuto(NewWindow *nwindow, int x, int y)
1002 : BC_CheckBox(x, y, nwindow->new_thread->auto_aspect, _("Auto aspect ratio"))
1004 this->nwindow = nwindow;
1006 NewAspectAuto::~NewAspectAuto()
1009 int NewAspectAuto::handle_event()
1011 nwindow->new_thread->auto_aspect = get_value();
1012 nwindow->new_thread->update_aspect();
1019 NewCloneToggle::NewCloneToggle(MWindow *mwindow, NewWindow *nwindow, int x, int y)
1022 mwindow->theme->chain_data,
1023 nwindow->new_thread->auto_sizes,
1029 this->mwindow = mwindow;
1030 this->nwindow = nwindow;
1033 int NewCloneToggle::handle_event()
1035 nwindow->canvas_w_text->update((int64_t)nwindow->new_edl->session->track_w);
1036 nwindow->canvas_h_text->update((int64_t)nwindow->new_edl->session->track_h);
1037 nwindow->new_edl->session->output_w = nwindow->new_edl->session->track_w;
1038 nwindow->new_edl->session->output_h = nwindow->new_edl->session->track_h;
1039 nwindow->new_thread->update_aspect();