r1009: Move the dependencies to newer package names
[cinelerra_cv/mob.git] / cinelerra / new.C
blobed87a326b5bf04b2a608c3537602ba18e8c2f684
1 #include "clip.h"
2 #include "cplayback.h"
3 #include "cwindow.h"
4 #include "bchash.h"
5 #include "edl.h"
6 #include "edlsession.h"
7 #include "filexml.h"
8 #include "interlacemodes.h"
9 #include "language.h"
10 #include "levelwindow.h"
11 #include "mainundo.h"
12 #include "mainmenu.h"
13 #include "mutex.h"
14 #include "mwindow.h"
15 #include "mwindowgui.h"
16 #include "new.h"
17 #include "newpresets.h"
18 #include "mainsession.h"
19 #include "patchbay.h"
20 #include "preferences.h"
21 #include "theme.h"
22 #include "transportque.h"
23 #include "videowindow.h"
24 #include "vplayback.h"
25 #include "vwindow.h"
28 #include <string.h>
31 #define WIDTH 600
32 #define HEIGHT 400
35 New::New(MWindow *mwindow)
36  : BC_MenuItem(_("New..."), "n", 'n')
38         this->mwindow = mwindow;
39         script = 0;
42 int New::create_objects()
44         thread = new NewThread(mwindow, this);
45         return 0;
48 int New::handle_event() 
50         if(thread->running())
51         {
52                 thread->window_lock->lock("New::handle_event");
53                 if(thread->nwindow)
54                 {
55                         thread->nwindow->lock_window("New::handle_event");
56                         thread->nwindow->raise_window();
57                         thread->nwindow->unlock_window();
58                 }
59                 thread->window_lock->unlock();
60                 return 1;
61         }
62         mwindow->edl->save_defaults(mwindow->defaults);
63         create_new_edl();
64         thread->start(); 
66         return 1;
69 void New::create_new_edl()
71         new_edl = new EDL;
72         new_edl->create_objects();
73         new_edl->load_defaults(mwindow->defaults);
77 int New::create_new_project()
79         mwindow->cwindow->playback_engine->que->send_command(STOP,
80                 CHANGE_NONE, 
81                 0,
82                 0);
83         mwindow->vwindow->playback_engine->que->send_command(STOP,
84                 CHANGE_NONE, 
85                 0,
86                 0);
87         mwindow->cwindow->playback_engine->interrupt_playback(0);
88         mwindow->vwindow->playback_engine->interrupt_playback(0);
90         mwindow->gui->lock_window();
91         mwindow->reset_caches();
93         memcpy(new_edl->session->achannel_positions,
94                 &mwindow->preferences->channel_positions[
95                         MAXCHANNELS * (new_edl->session->audio_channels - 1)],
96                 sizeof(int) * MAXCHANNELS);
97         new_edl->session->boundaries();
98         new_edl->create_default_tracks();
100         mwindow->set_filename("");
101         mwindow->undo->update_undo(_("New"), LOAD_ALL);
103         mwindow->hide_plugins();
104         delete mwindow->edl;
105         mwindow->edl = new_edl;
106         mwindow->save_defaults();
108 // Load file sequence
109         mwindow->update_project(LOAD_REPLACE);
110         mwindow->session->changes_made = 0;
111         mwindow->gui->unlock_window();
112         return 0;
115 NewThread::NewThread(MWindow *mwindow, New *new_project)
116  : Thread()
118         this->mwindow = mwindow;
119         this->new_project = new_project;
120         window_lock = new Mutex("NewThread::window_lock");
123 NewThread::~NewThread()
125         delete window_lock;
129 void NewThread::run()
131         int result = 0;
132         load_defaults();
134         int x = mwindow->gui->get_root_w(0, 1) / 2 - WIDTH / 2;
135         int y = mwindow->gui->get_root_h(1) / 2 - HEIGHT / 2;
137         window_lock->lock("NewThread::run 1\n");
138         nwindow = new NewWindow(mwindow, this, x, y);
139         nwindow->create_objects();
140         window_lock->unlock();
142         result = nwindow->run_window();
144         window_lock->lock("NewThread::run 2\n");
145         delete nwindow; 
146         nwindow = 0;
147         window_lock->unlock();
149         new_project->new_edl->save_defaults(mwindow->defaults);
150         mwindow->defaults->save();
152         if(result)
153         {
154 // Aborted
155                 delete new_project->new_edl;
156         }
157         else
158         {
159                 new_project->create_new_project();
160         }
163 int NewThread::load_defaults()
165         auto_aspect = mwindow->defaults->get("AUTOASPECT", 0);
166         return 0;
169 int NewThread::save_defaults()
171         mwindow->defaults->update("AUTOASPECT", auto_aspect);
172         return 0;
175 int NewThread::update_aspect()
177         if(auto_aspect)
178         {
179                 char string[BCTEXTLEN];
180                 mwindow->create_aspect_ratio(new_project->new_edl->session->aspect_w, 
181                         new_project->new_edl->session->aspect_h, 
182                         new_project->new_edl->session->output_w, 
183                         new_project->new_edl->session->output_h);
184                 sprintf(string, "%.02f", new_project->new_edl->session->aspect_w);
185                 nwindow->aspect_w_text->update(string);
186                 sprintf(string, "%.02f", new_project->new_edl->session->aspect_h);
187                 nwindow->aspect_h_text->update(string);
188         }
189         return 0;
195 #if 0
196 N_("Cinelerra: New Project");
197 #endif
199 NewWindow::NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y)
200  : BC_Window(_(PROGRAM_NAME ": New Project"), 
201                 x,
202                 y,
203                 WIDTH, 
204                 HEIGHT,
205                 -1,
206                 -1,
207                 0,
208                 0,
209                 1)
211         this->mwindow = mwindow;
212         this->new_thread = new_thread;
213         this->new_edl = new_thread->new_project->new_edl;
214         format_presets = 0;
217 NewWindow::~NewWindow()
219         if(format_presets) delete format_presets;
222 int NewWindow::create_objects()
224         int x = 10, y = 10, x1, y1;
225         BC_TextBox *textbox;
227         mwindow->theme->draw_new_bg(this);
229         add_subwindow(new BC_Title(x, y, _("Parameters for the new project:")));
230         y += 20;
232         format_presets = new NewPresets(mwindow,
233                 this, 
234                 x, 
235                 y);
236         format_presets->create_objects();
237         x = format_presets->x;
238         y = format_presets->y;
242         y += 40;
243         y1 = y;
244         add_subwindow(new BC_Title(x, y, _("Audio"), LARGEFONT));
245         y += 30;
247         x1 = x;
248         add_subwindow(new BC_Title(x1, y, _("Tracks:")));
249         x1 += 100;
250         add_subwindow(atracks = new NewATracks(this, "", x1, y));
251         x1 += atracks->get_w();
252         add_subwindow(new NewATracksTumbler(this, x1, y));
253         y += atracks->get_h() + 5;
255         x1 = x;
256         add_subwindow(new BC_Title(x1, y, _("Channels:")));
257         x1 += 100;
258         add_subwindow(achannels = new NewAChannels(this, "", x1, y));
259         x1 += achannels->get_w();
260         add_subwindow(new NewAChannelsTumbler(this, x1, y));
261         y += achannels->get_h() + 5;
263         x1 = x;
264         add_subwindow(new BC_Title(x1, y, _("Samplerate:")));
265         x1 += 100;
266         add_subwindow(sample_rate = new NewSampleRate(this, "", x1, y));
267         x1 += sample_rate->get_w();
268         add_subwindow(new SampleRatePulldown(mwindow, sample_rate, x1, y));
269         
270         x += 250;
271         y = y1;
272         add_subwindow(new BC_Title(x, y, _("Video"), LARGEFONT));
273         y += 30;
274         x1 = x;
275         add_subwindow(new BC_Title(x1, y, _("Tracks:")));
276         x1 += 100;
277         add_subwindow(vtracks = new NewVTracks(this, "", x1, y));
278         x1 += vtracks->get_w();
279         add_subwindow(new NewVTracksTumbler(this, x1, y));
280         y += vtracks->get_h() + 5;
282 //      x1 = x;
283 //      add_subwindow(new BC_Title(x1, y, _("Channels:")));
284 //      x1 += 100;
285 //      add_subwindow(vchannels = new NewVChannels(this, "", x1, y));
286 //      x1 += vchannels->get_w();
287 //      add_subwindow(new NewVChannelsTumbler(this, x1, y));
288 //      y += vchannels->get_h() + 5;
289         x1 = x;
290         add_subwindow(new BC_Title(x1, y, _("Framerate:")));
291         x1 += 100;
292         add_subwindow(frame_rate = new NewFrameRate(this, "", x1, y));
293         x1 += frame_rate->get_w();
294         add_subwindow(new FrameRatePulldown(mwindow, frame_rate, x1, y));
295         y += frame_rate->get_h() + 5;
297 //      x1 = x;
298 //      add_subwindow(new BC_Title(x1, y, _("Canvas size:")));
299 //      x1 += 100;
300 //      add_subwindow(canvas_w_text = new NewTrackW(this, x1, y));
301 //      x1 += canvas_w_text->get_w() + 2;
302 //      add_subwindow(new BC_Title(x1, y, "x"));
303 //      x1 += 10;
304 //      add_subwindow(canvas_h_text = new NewTrackH(this, x1, y));
305 //      x1 += canvas_h_text->get_w();
306 //      add_subwindow(new FrameSizePulldown(mwindow, 
307 //              canvas_w_text, 
308 //              canvas_h_text, 
309 //              x1, 
310 //              y));
311 //      x1 += 100;
312 //      add_subwindow(new NewCloneToggle(mwindow, this, x1, y));
313 //      y += canvas_h_text->get_h() + 5;
315         x1 = x;
316         add_subwindow(new BC_Title(x1, y, _("Canvas size:")));
317         x1 += 100;
318         add_subwindow(output_w_text = new NewOutputW(this, x1, y));
319         x1 += output_w_text->get_w() + 2;
320         add_subwindow(new BC_Title(x1, y, "x"));
321         x1 += 10;
322         add_subwindow(output_h_text = new NewOutputH(this, x1, y));
323         x1 += output_h_text->get_w();
324         FrameSizePulldown *pulldown;
325         add_subwindow(pulldown = new FrameSizePulldown(mwindow, 
326                 output_w_text, 
327                 output_h_text, 
328                 x1, 
329                 y));
330         x1 += pulldown->get_w() + 5;
331         add_subwindow(new NewSwapExtents(mwindow, this, x1, y));
332         y += output_h_text->get_h() + 5;
334         x1 = x;
335         add_subwindow(new BC_Title(x1, y, _("Aspect ratio:")));
336         x1 += 100;
337         add_subwindow(aspect_w_text = new NewAspectW(this, "", x1, y));
338         x1 += aspect_w_text->get_w() + 2;
339         add_subwindow(new BC_Title(x1, y, ":"));
340         x1 += 10;
341         add_subwindow(aspect_h_text = new NewAspectH(this, "", x1, y));
342         x1 += aspect_h_text->get_w();
343         add_subwindow(new AspectPulldown(mwindow, 
344                 aspect_w_text, 
345                 aspect_h_text, 
346                 x1, 
347                 y));
349         x1 = aspect_w_text->get_x();
350         y += aspect_w_text->get_h() + 5;
351         add_subwindow(new NewAspectAuto(this, x1, y));
352         y += 40;
353         add_subwindow(new BC_Title(x, y, _("Color model:")));
354         add_subwindow(textbox = new BC_TextBox(x + 100, y, 200, 1, ""));
355         add_subwindow(new ColormodelPulldown(mwindow, 
356                 textbox, 
357                 &new_edl->session->color_model,
358                 x + 100 + textbox->get_w(),
359                 y));
360         y += textbox->get_h() + 5;
362         // --------------------
363         add_subwindow(new BC_Title(x, y, _("Interlace mode:")));
364         add_subwindow(textbox = new BC_TextBox(x + 100, y, 140, 1, ""));
365         add_subwindow(interlace_pulldown = new InterlacemodePulldown(mwindow, 
366                 textbox, 
367                 &new_edl->session->interlace_mode,
368                 (ArrayList<BC_ListBoxItem*>*)&mwindow->interlace_project_modes,
369                 x + 100 + textbox->get_w(), 
370                 y)); 
371         y += textbox->get_h() + 5;
373         add_subwindow(new BC_OKButton(this, 
374                 mwindow->theme->get_image_set("new_ok_images")));
375         add_subwindow(new BC_CancelButton(this, 
376                 mwindow->theme->get_image_set("new_cancel_images")));
377         flash();
378         update();
379         show_window();
380         return 0;
383 int NewWindow::update()
385         char string[BCTEXTLEN];
386         atracks->update((int64_t)new_edl->session->audio_tracks);
387         achannels->update((int64_t)new_edl->session->audio_channels);
388         sample_rate->update((int64_t)new_edl->session->sample_rate);
389         vtracks->update((int64_t)new_edl->session->video_tracks);
390         frame_rate->update((float)new_edl->session->frame_rate);
391         output_w_text->update((int64_t)new_edl->session->output_w);
392         output_h_text->update((int64_t)new_edl->session->output_h);
393         aspect_w_text->update((float)new_edl->session->aspect_w);
394         aspect_h_text->update((float)new_edl->session->aspect_h);
395         interlace_pulldown->update(new_edl->session->interlace_mode);
396         return 0;
405 NewPresets::NewPresets(MWindow *mwindow, NewWindow *gui, int x, int y)
406  : FormatPresets(mwindow, gui, 0, x, y)
410 NewPresets::~NewPresets()
414 int NewPresets::handle_event()
416         new_gui->update();
417         return 1;
420 EDL* NewPresets::get_edl()
422         return new_gui->new_edl;
427 NewATracks::NewATracks(NewWindow *nwindow, char *text, int x, int y)
428  : BC_TextBox(x, y, 90, 1, text)
430         this->nwindow = nwindow;
433 int NewATracks::handle_event()
435         nwindow->new_edl->session->audio_tracks = atol(get_text());
436         return 1;
439 NewATracksTumbler::NewATracksTumbler(NewWindow *nwindow, int x, int y)
440  : BC_Tumbler(x, y)
442         this->nwindow = nwindow;
444 int NewATracksTumbler::handle_up_event()
446         nwindow->new_edl->session->audio_tracks++;
447         nwindow->new_edl->boundaries();
448         nwindow->update();
449         return 1;
451 int NewATracksTumbler::handle_down_event()
453         nwindow->new_edl->session->audio_tracks--;
454         nwindow->new_edl->boundaries();
455         nwindow->update();
456         return 1;
459 NewAChannels::NewAChannels(NewWindow *nwindow, char *text, int x, int y)
460  : BC_TextBox(x, y, 90, 1, text)
462         this->nwindow = nwindow;
465 int NewAChannels::handle_event()
467         nwindow->new_edl->session->audio_channels = atol(get_text());
468         return 1;
471 NewAChannelsTumbler::NewAChannelsTumbler(NewWindow *nwindow, int x, int y)
472  : BC_Tumbler(x, y)
474         this->nwindow = nwindow;
476 int NewAChannelsTumbler::handle_up_event()
478         nwindow->new_edl->session->audio_channels++;
479         nwindow->new_edl->boundaries();
480         nwindow->update();
481         return 1;
483 int NewAChannelsTumbler::handle_down_event()
485         nwindow->new_edl->session->audio_channels--;
486         nwindow->new_edl->boundaries();
487         nwindow->update();
488         return 1;
492 NewSampleRate::NewSampleRate(NewWindow *nwindow, char *text, int x, int y)
493  : BC_TextBox(x, y, 90, 1, text)
495         this->nwindow = nwindow;
498 int NewSampleRate::handle_event()
500         nwindow->new_edl->session->sample_rate = atol(get_text());
501         return 1;
504 SampleRatePulldown::SampleRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y)
505  : BC_ListBox(x,
506         y,
507         100,
508         200,
509         LISTBOX_TEXT,
510         &mwindow->theme->sample_rates,
511         0,
512         0,
513         1,
514         0,
515         1)
517         this->mwindow = mwindow;
518         this->output = output;
520 int SampleRatePulldown::handle_event()
522         char *text = get_selection(0, 0)->get_text();
523         output->update(text);
524         output->handle_event();
525         return 1;
542 NewVTracks::NewVTracks(NewWindow *nwindow, char *text, int x, int y)
543  : BC_TextBox(x, y, 90, 1, text)
545         this->nwindow = nwindow;
548 int NewVTracks::handle_event()
550         nwindow->new_edl->session->video_tracks = atol(get_text());
551         return 1;
554 NewVTracksTumbler::NewVTracksTumbler(NewWindow *nwindow, int x, int y)
555  : BC_Tumbler(x, y)
557         this->nwindow = nwindow;
559 int NewVTracksTumbler::handle_up_event()
561         nwindow->new_edl->session->video_tracks++;
562         nwindow->new_edl->boundaries();
563         nwindow->update();
564         return 1;
566 int NewVTracksTumbler::handle_down_event()
568         nwindow->new_edl->session->video_tracks--;
569         nwindow->new_edl->boundaries();
570         nwindow->update();
571         return 1;
574 NewVChannels::NewVChannels(NewWindow *nwindow, char *text, int x, int y)
575  : BC_TextBox(x, y, 90, 1, text)
577         this->nwindow = nwindow;
580 int NewVChannels::handle_event()
582         nwindow->new_edl->session->video_channels = atol(get_text());
583         return 1;
586 NewVChannelsTumbler::NewVChannelsTumbler(NewWindow *nwindow, int x, int y)
587  : BC_Tumbler(x, y)
589         this->nwindow = nwindow;
591 int NewVChannelsTumbler::handle_up_event()
593         nwindow->new_edl->session->video_channels++;
594         nwindow->new_edl->boundaries();
595         nwindow->update();
596         return 1;
598 int NewVChannelsTumbler::handle_down_event()
600         nwindow->new_edl->session->video_channels--;
601         nwindow->new_edl->boundaries();
602         nwindow->update();
603         return 1;
606 NewFrameRate::NewFrameRate(NewWindow *nwindow, char *text, int x, int y)
607  : BC_TextBox(x, y, 90, 1, text)
609         this->nwindow = nwindow;
612 int NewFrameRate::handle_event()
614         nwindow->new_edl->session->frame_rate = Units::atoframerate(get_text());
615         return 1;
618 FrameRatePulldown::FrameRatePulldown(MWindow *mwindow, 
619         BC_TextBox *output, 
620         int x, 
621         int y)
622  : BC_ListBox(x,
623         y,
624         100,
625         200,
626         LISTBOX_TEXT,
627         &mwindow->theme->frame_rates,
628         0,
629         0,
630         1,
631         0,
632         1)
634         this->mwindow = mwindow;
635         this->output = output;
637 int FrameRatePulldown::handle_event()
639         char *text = get_selection(0, 0)->get_text();
640         output->update(text);
641         output->handle_event();
642         return 1;
645 FrameSizePulldown::FrameSizePulldown(MWindow *mwindow, 
646                 BC_TextBox *output_w, 
647                 BC_TextBox *output_h, 
648                 int x, 
649                 int y)
650  : BC_ListBox(x,
651         y,
652         100,
653         200,
654         LISTBOX_TEXT,
655         &mwindow->theme->frame_sizes,
656         0,
657         0,
658         1,
659         0,
660         1)
662         this->mwindow = mwindow;
663         this->output_w = output_w;
664         this->output_h = output_h;
666 int FrameSizePulldown::handle_event()
668         char *text = get_selection(0, 0)->get_text();
669         char string[BCTEXTLEN];
670         int64_t w, h;
671         char *ptr;
672         
673         strcpy(string, text);
674         ptr = strrchr(string, 'x');
675         if(ptr)
676         {
677                 ptr++;
678                 h = atol(ptr);
679                 
680                 *--ptr = 0;
681                 w = atol(string);
682                 output_w->update(w);
683                 output_h->update(h);
684                 output_w->handle_event();
685                 output_h->handle_event();
686         }
687         return 1;
690 NewOutputW::NewOutputW(NewWindow *nwindow, int x, int y)
691  : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_w)
693         this->nwindow = nwindow;
695 int NewOutputW::handle_event()
697         nwindow->new_edl->session->output_w = MAX(1,atol(get_text()));
698         nwindow->new_thread->update_aspect();
699         return 1;
702 NewOutputH::NewOutputH(NewWindow *nwindow, int x, int y)
703  : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_h)
705         this->nwindow = nwindow;
707 int NewOutputH::handle_event()
709         nwindow->new_edl->session->output_h = MAX(1, atol(get_text()));
710         nwindow->new_thread->update_aspect();
711         return 1;
714 NewAspectW::NewAspectW(NewWindow *nwindow, char *text, int x, int y)
715  : BC_TextBox(x, y, 70, 1, text)
717         this->nwindow = nwindow;
720 int NewAspectW::handle_event()
722         nwindow->new_edl->session->aspect_w = atof(get_text());
723         return 1;
726 NewAspectH::NewAspectH(NewWindow *nwindow, char *text, int x, int y)
727  : BC_TextBox(x, y, 70, 1, text)
729         this->nwindow = nwindow;
732 int NewAspectH::handle_event()
734         nwindow->new_edl->session->aspect_h = atof(get_text());
735         return 1;
738 AspectPulldown::AspectPulldown(MWindow *mwindow, 
739                 BC_TextBox *output_w, 
740                 BC_TextBox *output_h, 
741                 int x, 
742                 int y)
743  : BC_ListBox(x,
744         y,
745         100,
746         200,
747         LISTBOX_TEXT,
748         &mwindow->theme->aspect_ratios,
749         0,
750         0,
751         1,
752         0,
753         1)
755         this->mwindow = mwindow;
756         this->output_w = output_w;
757         this->output_h = output_h;
759 int AspectPulldown::handle_event()
761         char *text = get_selection(0, 0)->get_text();
762         char string[BCTEXTLEN];
763         float w, h;
764         char *ptr;
765         
766         strcpy(string, text);
767         ptr = strrchr(string, ':');
768         if(ptr)
769         {
770                 ptr++;
771                 h = atof(ptr);
772                 
773                 *--ptr = 0;
774                 w = atof(string);
775                 output_w->update(w);
776                 output_h->update(h);
777                 output_w->handle_event();
778                 output_h->handle_event();
779         }
780         return 1;
783 ColormodelItem::ColormodelItem(char *text, int value)
784  : BC_ListBoxItem(text)
786         this->value = value;
789 ColormodelPulldown::ColormodelPulldown(MWindow *mwindow, 
790                 BC_TextBox *output_text, 
791                 int *output_value,
792                 int x, 
793                 int y)
794  : BC_ListBox(x,
795         y,
796         200,
797         150,
798         LISTBOX_TEXT,
799         (ArrayList<BC_ListBoxItem*>*)&mwindow->colormodels,
800         0,
801         0,
802         1,
803         0,
804         1)
806         this->mwindow = mwindow;
807         this->output_text = output_text;
808         this->output_value = output_value;
809         output_text->update(colormodel_to_text());
812 int ColormodelPulldown::handle_event()
814         output_text->update(get_selection(0, 0)->get_text());
815         *output_value = ((ColormodelItem*)get_selection(0, 0))->value;
816         return 1;
819 char* ColormodelPulldown::colormodel_to_text()
821         for(int i = 0; i < mwindow->colormodels.total; i++)
822                 if(mwindow->colormodels.values[i]->value == *output_value) 
823                         return mwindow->colormodels.values[i]->get_text();
824         return "Unknown";
827 InterlacemodeItem::InterlacemodeItem(char *text, int value)
828  : BC_ListBoxItem(text)
830         this->value = value;
833 InterlacemodePulldown::InterlacemodePulldown(MWindow *mwindow, 
834                 BC_TextBox *output_text,
835                 int *output_value,
836                 ArrayList<BC_ListBoxItem*> *data,
837                 int x, 
838                 int y)
839  : BC_ListBox(x,
840         y,
841         200,
842         150,
843         LISTBOX_TEXT,
844         data,
845         0,
846         0,
847         1,
848         0,
849         1)
851         char string[BCTEXTLEN];
852         this->mwindow = mwindow;
853         this->output_text = output_text;
854         this->output_value = output_value;
855         output_text->update(interlacemode_to_text());
858 int InterlacemodePulldown::handle_event()
860         output_text->update(get_selection(0, 0)->get_text());
861         *output_value = ((InterlacemodeItem*)get_selection(0, 0))->value;
862         return 1;
865 char* InterlacemodePulldown::interlacemode_to_text()
867         ilacemode_to_text(this->string,*output_value);
868         return (this->string);
871 int InterlacemodePulldown::update(int interlace_mode)
873         *output_value = interlace_mode;
874         output_text->update(interlacemode_to_text());
875         return 1;
879 NewAspectAuto::NewAspectAuto(NewWindow *nwindow, int x, int y)
880  : BC_CheckBox(x, y, nwindow->new_thread->auto_aspect, _("Auto aspect ratio"))
882         this->nwindow = nwindow;
884 NewAspectAuto::~NewAspectAuto()
887 int NewAspectAuto::handle_event()
889         nwindow->new_thread->auto_aspect = get_value();
890         nwindow->new_thread->update_aspect();
891         return 1;
901 NewSwapExtents::NewSwapExtents(MWindow *mwindow, NewWindow *gui, int x, int y)
902  : BC_Button(x, y, mwindow->theme->get_image_set("swap_extents"))
904         this->mwindow = mwindow;
905         this->gui = gui;
906         set_tooltip("Swap dimensions");
909 int NewSwapExtents::handle_event()
911         int w = gui->new_edl->session->output_w;
912         int h = gui->new_edl->session->output_h;
913         gui->new_edl->session->output_w = h;
914         gui->new_edl->session->output_h = w;
915         gui->output_w_text->update((int64_t)h);
916         gui->output_h_text->update((int64_t)w);
917         gui->new_thread->update_aspect();
918         return 1;