r827: Fix a crash when no audio output device can be opened.
[cinelerra_cv.git] / cinelerra / new.C
blob671281580a30cf47cf4bb716c07ccc50a8ef504a
1 #include "clip.h"
2 #include "cplayback.h"
3 #include "cwindow.h"
4 #include "defaults.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 "mwindow.h"
14 #include "mwindowgui.h"
15 #include "new.h"
16 #include "newpresets.h"
17 #include "mainsession.h"
18 #include "patchbay.h"
19 #include "theme.h"
20 #include "transportque.h"
21 #include "videowindow.h"
22 #include "vplayback.h"
23 #include "vwindow.h"
25 #include <string.h>
28 #define WIDTH 600
29 #define HEIGHT 400
32 New::New(MWindow *mwindow)
33  : BC_MenuItem(_("New..."), "n", 'n')
35         this->mwindow = mwindow;
36         script = 0;
39 int New::create_objects()
41         thread = new NewThread(mwindow, this);
42         return 0;
45 int New::handle_event() 
47         if(thread->running())
48         {
49                 thread->window_lock->lock("New::handle_event");
50                 if(thread->nwindow)
51                 {
52                         thread->nwindow->lock_window("New::handle_event");
53                         thread->nwindow->raise_window();
54                         thread->nwindow->unlock_window();
55                 }
56                 thread->window_lock->unlock();
57                 return 1;
58         }
59         mwindow->edl->save_defaults(mwindow->defaults);
60         create_new_edl();
61         thread->start(); 
63         return 1;
66 void New::create_new_edl()
68         new_edl = new EDL;
69         new_edl->create_objects();
70         new_edl->load_defaults(mwindow->defaults);
74 int New::create_new_project()
76         mwindow->cwindow->playback_engine->que->send_command(STOP,
77                 CHANGE_NONE, 
78                 0,
79                 0);
80         mwindow->vwindow->playback_engine->que->send_command(STOP,
81                 CHANGE_NONE, 
82                 0,
83                 0);
84         mwindow->cwindow->playback_engine->interrupt_playback(0);
85         mwindow->vwindow->playback_engine->interrupt_playback(0);
87         mwindow->gui->lock_window();
89         new_edl->session->boundaries();
90         new_edl->create_default_tracks();
92         mwindow->set_filename("");
93         mwindow->undo->update_undo(_("New"), LOAD_ALL);
95         mwindow->hide_plugins();
96         delete mwindow->edl;
97         mwindow->edl = new_edl;
98         mwindow->save_defaults();
100 // Load file sequence
101         mwindow->update_project(LOAD_REPLACE);
102         mwindow->session->changes_made = 0;
103         mwindow->gui->unlock_window();
104         return 0;
107 NewThread::NewThread(MWindow *mwindow, New *new_project)
108  : Thread()
110         this->mwindow = mwindow;
111         this->new_project = new_project;
112         window_lock = new Mutex("NewThread::window_lock");
115 NewThread::~NewThread()
117         delete window_lock;
121 void NewThread::run()
123         int result = 0;
124         load_defaults();
126         int x = mwindow->gui->get_root_w(0, 1) / 2 - WIDTH / 2;
127         int y = mwindow->gui->get_root_h(1) / 2 - HEIGHT / 2;
129         window_lock->lock("NewThread::run 1\n");
130         nwindow = new NewWindow(mwindow, this, x, y);
131         nwindow->create_objects();
132         window_lock->unlock();
134         result = nwindow->run_window();
136         window_lock->lock("NewThread::run 2\n");
137         delete nwindow; 
138         nwindow = 0;
139         window_lock->unlock();
141         new_project->new_edl->save_defaults(mwindow->defaults);
142         mwindow->defaults->save();
144         if(result)
145         {
146 // Aborted
147                 delete new_project->new_edl;
148         }
149         else
150         {
151 //printf("NewThread::run 4\n");
152                 new_project->create_new_project();
153 //printf("NewThread::run 5\n");
154         }
157 int NewThread::load_defaults()
159         auto_aspect = mwindow->defaults->get("AUTOASPECT", 0);
160         return 0;
163 int NewThread::save_defaults()
165         mwindow->defaults->update("AUTOASPECT", auto_aspect);
166         return 0;
169 int NewThread::update_aspect()
171         if(auto_aspect)
172         {
173                 char string[BCTEXTLEN];
174                 mwindow->create_aspect_ratio(new_project->new_edl->session->aspect_w, 
175                         new_project->new_edl->session->aspect_h, 
176                         new_project->new_edl->session->output_w, 
177                         new_project->new_edl->session->output_h);
178                 sprintf(string, "%.02f", new_project->new_edl->session->aspect_w);
179                 nwindow->aspect_w_text->update(string);
180                 sprintf(string, "%.02f", new_project->new_edl->session->aspect_h);
181                 nwindow->aspect_h_text->update(string);
182         }
183         return 0;
189 #if 0
190 N_("Cinelerra: New Project");
191 #endif
193 NewWindow::NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y)
194  : BC_Window(_(PROGRAM_NAME ": New Project"), 
195                 x,
196                 y,
197                 WIDTH, 
198                 HEIGHT,
199                 -1,
200                 -1,
201                 0,
202                 0,
203                 1)
205         this->mwindow = mwindow;
206         this->new_thread = new_thread;
207         this->new_edl = new_thread->new_project->new_edl;
208         format_presets = 0;
211 NewWindow::~NewWindow()
213         if(format_presets) delete format_presets;
216 int NewWindow::create_objects()
218         int x = 10, y = 10, x1, y1;
219         BC_TextBox *textbox;
221         mwindow->theme->draw_new_bg(this);
223         add_subwindow(new BC_Title(x, y, _("Parameters for the new project:")));
224         y += 20;
226         format_presets = new NewPresets(mwindow,
227                 this, 
228                 x, 
229                 y);
230         format_presets->create_objects();
231         x = format_presets->x;
232         y = format_presets->y;
236         y += 40;
237         y1 = y;
238         add_subwindow(new BC_Title(x, y, _("Audio"), LARGEFONT));
239         y += 30;
241         x1 = x;
242         add_subwindow(new BC_Title(x1, y, _("Tracks:")));
243         x1 += 100;
244         add_subwindow(atracks = new NewATracks(this, "", x1, y));
245         x1 += atracks->get_w();
246         add_subwindow(new NewATracksTumbler(this, x1, y));
247         y += atracks->get_h() + 5;
249         x1 = x;
250         add_subwindow(new BC_Title(x1, y, _("Channels:")));
251         x1 += 100;
252         add_subwindow(achannels = new NewAChannels(this, "", x1, y));
253         x1 += achannels->get_w();
254         add_subwindow(new NewAChannelsTumbler(this, x1, y));
255         y += achannels->get_h() + 5;
257         x1 = x;
258         add_subwindow(new BC_Title(x1, y, _("Samplerate:")));
259         x1 += 100;
260         add_subwindow(sample_rate = new NewSampleRate(this, "", x1, y));
261         x1 += sample_rate->get_w();
262         add_subwindow(new SampleRatePulldown(mwindow, sample_rate, x1, y));
263         
264         x += 250;
265         y = y1;
266         add_subwindow(new BC_Title(x, y, _("Video"), LARGEFONT));
267         y += 30;
268         x1 = x;
269         add_subwindow(new BC_Title(x1, y, _("Tracks:")));
270         x1 += 100;
271         add_subwindow(vtracks = new NewVTracks(this, "", x1, y));
272         x1 += vtracks->get_w();
273         add_subwindow(new NewVTracksTumbler(this, x1, y));
274         y += vtracks->get_h() + 5;
276 //      x1 = x;
277 //      add_subwindow(new BC_Title(x1, y, _("Channels:")));
278 //      x1 += 100;
279 //      add_subwindow(vchannels = new NewVChannels(this, "", x1, y));
280 //      x1 += vchannels->get_w();
281 //      add_subwindow(new NewVChannelsTumbler(this, x1, y));
282 //      y += vchannels->get_h() + 5;
283         x1 = x;
284         add_subwindow(new BC_Title(x1, y, _("Framerate:")));
285         x1 += 100;
286         add_subwindow(frame_rate = new NewFrameRate(this, "", x1, y));
287         x1 += frame_rate->get_w();
288         add_subwindow(new FrameRatePulldown(mwindow, frame_rate, x1, y));
289         y += frame_rate->get_h() + 5;
291 //      x1 = x;
292 //      add_subwindow(new BC_Title(x1, y, _("Canvas size:")));
293 //      x1 += 100;
294 //      add_subwindow(canvas_w_text = new NewTrackW(this, x1, y));
295 //      x1 += canvas_w_text->get_w() + 2;
296 //      add_subwindow(new BC_Title(x1, y, "x"));
297 //      x1 += 10;
298 //      add_subwindow(canvas_h_text = new NewTrackH(this, x1, y));
299 //      x1 += canvas_h_text->get_w();
300 //      add_subwindow(new FrameSizePulldown(mwindow, 
301 //              canvas_w_text, 
302 //              canvas_h_text, 
303 //              x1, 
304 //              y));
305 //      x1 += 100;
306 //      add_subwindow(new NewCloneToggle(mwindow, this, x1, y));
307 //      y += canvas_h_text->get_h() + 5;
309         x1 = x;
310         add_subwindow(new BC_Title(x1, y, _("Canvas size:")));
311         x1 += 100;
312         add_subwindow(output_w_text = new NewOutputW(this, x1, y));
313         x1 += output_w_text->get_w() + 2;
314         add_subwindow(new BC_Title(x1, y, "x"));
315         x1 += 10;
316         add_subwindow(output_h_text = new NewOutputH(this, x1, y));
317         x1 += output_h_text->get_w();
318         add_subwindow(new FrameSizePulldown(mwindow, 
319                 output_w_text, 
320                 output_h_text, 
321                 x1, 
322                 y));
323         y += output_h_text->get_h() + 5;
325         x1 = x;
326         add_subwindow(new BC_Title(x1, y, _("Aspect ratio:")));
327         x1 += 100;
328         add_subwindow(aspect_w_text = new NewAspectW(this, "", x1, y));
329         x1 += aspect_w_text->get_w() + 2;
330         add_subwindow(new BC_Title(x1, y, ":"));
331         x1 += 10;
332         add_subwindow(aspect_h_text = new NewAspectH(this, "", x1, y));
333         x1 += aspect_h_text->get_w();
334         add_subwindow(new AspectPulldown(mwindow, 
335                 aspect_w_text, 
336                 aspect_h_text, 
337                 x1, 
338                 y));
340         x1 = aspect_w_text->get_x();
341         y += aspect_w_text->get_h() + 5;
342         add_subwindow(new NewAspectAuto(this, x1, y));
343         y += 40;
344         add_subwindow(new BC_Title(x, y, _("Color model:")));
345         add_subwindow(textbox = new BC_TextBox(x + 100, y, 200, 1, ""));
346         add_subwindow(new ColormodelPulldown(mwindow, 
347                 textbox, 
348                 &new_edl->session->color_model,
349                 x + 100 + textbox->get_w(),
350                 y));
351         y += textbox->get_h() + 5;
353         // --------------------
354         add_subwindow(new BC_Title(x, y, _("Interlace mode:")));
355         add_subwindow(textbox = new BC_TextBox(x + 100, y, 140, 1, ""));
356         add_subwindow(new InterlacemodePulldown(mwindow, 
357                 textbox, 
358                 &new_edl->session->interlace_mode,
359                 (ArrayList<BC_ListBoxItem*>*)&mwindow->interlace_project_modes,
360                 x + 100 + textbox->get_w(), 
361                 y)); 
362         y += textbox->get_h() + 5;
364         add_subwindow(new BC_OKButton(this, 
365                 mwindow->theme->get_image_set("new_ok_images")));
366         add_subwindow(new BC_CancelButton(this, 
367                 mwindow->theme->get_image_set("new_cancel_images")));
368         flash();
369         update();
370         show_window();
371         return 0;
374 int NewWindow::update()
376         char string[BCTEXTLEN];
377         atracks->update((int64_t)new_edl->session->audio_tracks);
378         achannels->update((int64_t)new_edl->session->audio_channels);
379         sample_rate->update((int64_t)new_edl->session->sample_rate);
380         vtracks->update((int64_t)new_edl->session->video_tracks);
381         frame_rate->update((float)new_edl->session->frame_rate);
382         output_w_text->update((int64_t)new_edl->session->output_w);
383         output_h_text->update((int64_t)new_edl->session->output_h);
384         aspect_w_text->update((float)new_edl->session->aspect_w);
385         aspect_h_text->update((float)new_edl->session->aspect_h);
386         return 0;
395 NewPresets::NewPresets(MWindow *mwindow, NewWindow *gui, int x, int y)
396  : FormatPresets(mwindow, gui, 0, x, y)
400 NewPresets::~NewPresets()
404 int NewPresets::handle_event()
406         new_gui->update();
407         return 1;
410 EDL* NewPresets::get_edl()
412         return new_gui->new_edl;
417 NewATracks::NewATracks(NewWindow *nwindow, char *text, int x, int y)
418  : BC_TextBox(x, y, 90, 1, text)
420         this->nwindow = nwindow;
423 int NewATracks::handle_event()
425         nwindow->new_edl->session->audio_tracks = atol(get_text());
426         return 1;
429 NewATracksTumbler::NewATracksTumbler(NewWindow *nwindow, int x, int y)
430  : BC_Tumbler(x, y)
432         this->nwindow = nwindow;
434 int NewATracksTumbler::handle_up_event()
436         nwindow->new_edl->session->audio_tracks++;
437         nwindow->new_edl->boundaries();
438         nwindow->update();
439         return 1;
441 int NewATracksTumbler::handle_down_event()
443         nwindow->new_edl->session->audio_tracks--;
444         nwindow->new_edl->boundaries();
445         nwindow->update();
446         return 1;
449 NewAChannels::NewAChannels(NewWindow *nwindow, char *text, int x, int y)
450  : BC_TextBox(x, y, 90, 1, text)
452         this->nwindow = nwindow;
455 int NewAChannels::handle_event()
457         nwindow->new_edl->session->audio_channels = atol(get_text());
458         return 1;
461 NewAChannelsTumbler::NewAChannelsTumbler(NewWindow *nwindow, int x, int y)
462  : BC_Tumbler(x, y)
464         this->nwindow = nwindow;
466 int NewAChannelsTumbler::handle_up_event()
468         nwindow->new_edl->session->audio_channels++;
469         nwindow->new_edl->boundaries();
470         nwindow->update();
471         return 1;
473 int NewAChannelsTumbler::handle_down_event()
475         nwindow->new_edl->session->audio_channels--;
476         nwindow->new_edl->boundaries();
477         nwindow->update();
478         return 1;
482 NewSampleRate::NewSampleRate(NewWindow *nwindow, char *text, int x, int y)
483  : BC_TextBox(x, y, 90, 1, text)
485         this->nwindow = nwindow;
488 int NewSampleRate::handle_event()
490         nwindow->new_edl->session->sample_rate = atol(get_text());
491         return 1;
494 SampleRatePulldown::SampleRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y)
495  : BC_ListBox(x,
496         y,
497         100,
498         200,
499         LISTBOX_TEXT,
500         &mwindow->theme->sample_rates,
501         0,
502         0,
503         1,
504         0,
505         1)
507         this->mwindow = mwindow;
508         this->output = output;
510 int SampleRatePulldown::handle_event()
512         char *text = get_selection(0, 0)->get_text();
513         output->update(text);
514         output->handle_event();
515         return 1;
532 NewVTracks::NewVTracks(NewWindow *nwindow, char *text, int x, int y)
533  : BC_TextBox(x, y, 90, 1, text)
535         this->nwindow = nwindow;
538 int NewVTracks::handle_event()
540         nwindow->new_edl->session->video_tracks = atol(get_text());
541         return 1;
544 NewVTracksTumbler::NewVTracksTumbler(NewWindow *nwindow, int x, int y)
545  : BC_Tumbler(x, y)
547         this->nwindow = nwindow;
549 int NewVTracksTumbler::handle_up_event()
551         nwindow->new_edl->session->video_tracks++;
552         nwindow->new_edl->boundaries();
553         nwindow->update();
554         return 1;
556 int NewVTracksTumbler::handle_down_event()
558         nwindow->new_edl->session->video_tracks--;
559         nwindow->new_edl->boundaries();
560         nwindow->update();
561         return 1;
564 NewVChannels::NewVChannels(NewWindow *nwindow, char *text, int x, int y)
565  : BC_TextBox(x, y, 90, 1, text)
567         this->nwindow = nwindow;
570 int NewVChannels::handle_event()
572         nwindow->new_edl->session->video_channels = atol(get_text());
573         return 1;
576 NewVChannelsTumbler::NewVChannelsTumbler(NewWindow *nwindow, int x, int y)
577  : BC_Tumbler(x, y)
579         this->nwindow = nwindow;
581 int NewVChannelsTumbler::handle_up_event()
583         nwindow->new_edl->session->video_channels++;
584         nwindow->new_edl->boundaries();
585         nwindow->update();
586         return 1;
588 int NewVChannelsTumbler::handle_down_event()
590         nwindow->new_edl->session->video_channels--;
591         nwindow->new_edl->boundaries();
592         nwindow->update();
593         return 1;
596 NewFrameRate::NewFrameRate(NewWindow *nwindow, char *text, int x, int y)
597  : BC_TextBox(x, y, 90, 1, text)
599         this->nwindow = nwindow;
602 int NewFrameRate::handle_event()
604         nwindow->new_edl->session->frame_rate = Units::atoframerate(get_text());
605         return 1;
608 FrameRatePulldown::FrameRatePulldown(MWindow *mwindow, 
609         BC_TextBox *output, 
610         int x, 
611         int y)
612  : BC_ListBox(x,
613         y,
614         100,
615         200,
616         LISTBOX_TEXT,
617         &mwindow->theme->frame_rates,
618         0,
619         0,
620         1,
621         0,
622         1)
624         this->mwindow = mwindow;
625         this->output = output;
627 int FrameRatePulldown::handle_event()
629         char *text = get_selection(0, 0)->get_text();
630         output->update(text);
631         output->handle_event();
632         return 1;
635 FrameSizePulldown::FrameSizePulldown(MWindow *mwindow, 
636                 BC_TextBox *output_w, 
637                 BC_TextBox *output_h, 
638                 int x, 
639                 int y)
640  : BC_ListBox(x,
641         y,
642         100,
643         200,
644         LISTBOX_TEXT,
645         &mwindow->theme->frame_sizes,
646         0,
647         0,
648         1,
649         0,
650         1)
652         this->mwindow = mwindow;
653         this->output_w = output_w;
654         this->output_h = output_h;
656 int FrameSizePulldown::handle_event()
658         char *text = get_selection(0, 0)->get_text();
659         char string[BCTEXTLEN];
660         int64_t w, h;
661         char *ptr;
662         
663         strcpy(string, text);
664         ptr = strrchr(string, 'x');
665         if(ptr)
666         {
667                 ptr++;
668                 h = atol(ptr);
669                 
670                 *--ptr = 0;
671                 w = atol(string);
672                 output_w->update(w);
673                 output_h->update(h);
674                 output_w->handle_event();
675                 output_h->handle_event();
676         }
677         return 1;
680 NewOutputW::NewOutputW(NewWindow *nwindow, int x, int y)
681  : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_w)
683         this->nwindow = nwindow;
685 int NewOutputW::handle_event()
687         nwindow->new_edl->session->output_w = MAX(1,atol(get_text()));
688         nwindow->new_thread->update_aspect();
689         return 1;
692 NewOutputH::NewOutputH(NewWindow *nwindow, int x, int y)
693  : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_h)
695         this->nwindow = nwindow;
697 int NewOutputH::handle_event()
699         nwindow->new_edl->session->output_h = MAX(1, atol(get_text()));
700         nwindow->new_thread->update_aspect();
701         return 1;
704 NewAspectW::NewAspectW(NewWindow *nwindow, char *text, int x, int y)
705  : BC_TextBox(x, y, 70, 1, text)
707         this->nwindow = nwindow;
710 int NewAspectW::handle_event()
712         nwindow->new_edl->session->aspect_w = atof(get_text());
713         return 1;
716 NewAspectH::NewAspectH(NewWindow *nwindow, char *text, int x, int y)
717  : BC_TextBox(x, y, 70, 1, text)
719         this->nwindow = nwindow;
722 int NewAspectH::handle_event()
724         nwindow->new_edl->session->aspect_h = atof(get_text());
725         return 1;
728 AspectPulldown::AspectPulldown(MWindow *mwindow, 
729                 BC_TextBox *output_w, 
730                 BC_TextBox *output_h, 
731                 int x, 
732                 int y)
733  : BC_ListBox(x,
734         y,
735         100,
736         200,
737         LISTBOX_TEXT,
738         &mwindow->theme->aspect_ratios,
739         0,
740         0,
741         1,
742         0,
743         1)
745         this->mwindow = mwindow;
746         this->output_w = output_w;
747         this->output_h = output_h;
749 int AspectPulldown::handle_event()
751         char *text = get_selection(0, 0)->get_text();
752         char string[BCTEXTLEN];
753         float w, h;
754         char *ptr;
755         
756         strcpy(string, text);
757         ptr = strrchr(string, ':');
758         if(ptr)
759         {
760                 ptr++;
761                 h = atof(ptr);
762                 
763                 *--ptr = 0;
764                 w = atof(string);
765                 output_w->update(w);
766                 output_h->update(h);
767                 output_w->handle_event();
768                 output_h->handle_event();
769         }
770         return 1;
773 ColormodelItem::ColormodelItem(char *text, int value)
774  : BC_ListBoxItem(text)
776         this->value = value;
779 ColormodelPulldown::ColormodelPulldown(MWindow *mwindow, 
780                 BC_TextBox *output_text, 
781                 int *output_value,
782                 int x, 
783                 int y)
784  : BC_ListBox(x,
785         y,
786         200,
787         150,
788         LISTBOX_TEXT,
789         (ArrayList<BC_ListBoxItem*>*)&mwindow->colormodels,
790         0,
791         0,
792         1,
793         0,
794         1)
796         this->mwindow = mwindow;
797         this->output_text = output_text;
798         this->output_value = output_value;
799         output_text->update(colormodel_to_text());
802 int ColormodelPulldown::handle_event()
804         output_text->update(get_selection(0, 0)->get_text());
805         *output_value = ((ColormodelItem*)get_selection(0, 0))->value;
806         return 1;
809 char* ColormodelPulldown::colormodel_to_text()
811         for(int i = 0; i < mwindow->colormodels.total; i++)
812                 if(mwindow->colormodels.values[i]->value == *output_value) 
813                         return mwindow->colormodels.values[i]->get_text();
814         return "Unknown";
817 InterlacemodeItem::InterlacemodeItem(char *text, int value)
818  : BC_ListBoxItem(text)
820         this->value = value;
823 InterlacemodePulldown::InterlacemodePulldown(MWindow *mwindow, 
824                 BC_TextBox *output_text,
825                 int *output_value,
826                 ArrayList<BC_ListBoxItem*> *data,
827                 int x, 
828                 int y)
829  : BC_ListBox(x,
830         y,
831         200,
832         150,
833         LISTBOX_TEXT,
834         data,
835         0,
836         0,
837         1,
838         0,
839         1)
841         char string[BCTEXTLEN];
842         this->mwindow = mwindow;
843         this->output_text = output_text;
844         this->output_value = output_value;
845         output_text->update(interlacemode_to_text());
848 int InterlacemodePulldown::handle_event()
850         output_text->update(get_selection(0, 0)->get_text());
851         *output_value = ((InterlacemodeItem*)get_selection(0, 0))->value;
852         return 1;
855 char* InterlacemodePulldown::interlacemode_to_text()
857         ilacemode_to_text(this->string,*output_value);
858         return (this->string);
861 NewAspectAuto::NewAspectAuto(NewWindow *nwindow, int x, int y)
862  : BC_CheckBox(x, y, nwindow->new_thread->auto_aspect, _("Auto aspect ratio"))
864         this->nwindow = nwindow;
866 NewAspectAuto::~NewAspectAuto()
869 int NewAspectAuto::handle_event()
871         nwindow->new_thread->auto_aspect = get_value();
872         nwindow->new_thread->update_aspect();
873         return 1;
877 #if 0
879 NewCloneToggle::NewCloneToggle(MWindow *mwindow, NewWindow *nwindow, int x, int y)
880  : BC_Toggle(x, 
881         y, 
882         mwindow->theme->chain_data, 
883         nwindow->new_thread->auto_sizes,
884         "",
885         0, 
886         0, 
887         0)
889         this->mwindow = mwindow;
890         this->nwindow = nwindow;
893 int NewCloneToggle::handle_event()
895         nwindow->canvas_w_text->update((int64_t)nwindow->new_edl->session->track_w);
896         nwindow->canvas_h_text->update((int64_t)nwindow->new_edl->session->track_h);
897         nwindow->new_edl->session->output_w = nwindow->new_edl->session->track_w;
898         nwindow->new_edl->session->output_h = nwindow->new_edl->session->track_h;
899         nwindow->new_thread->update_aspect();
900         return 1;
903 #endif