remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / cinelerra / zoombar.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "apatchgui.inc"
23 #include "clip.h"
24 #include "edl.h"
25 #include "edlsession.h"
26 #include "language.h"
27 #include "localsession.h"
28 #include "maincursor.h"
29 #include "mwindow.h"
30 #include "mwindowgui.h"
31 #include "mainsession.h"
32 #include "mtimebar.h"
33 #include "preferences.h"
34 #include "theme.h"
35 #include "trackcanvas.h"
36 #include "tracks.h"
37 #include "units.h"
38 #include "vpatchgui.inc"
39 #include "zoombar.h"
40
41
42
43
44 ZoomBar::ZoomBar(MWindow *mwindow, MWindowGUI *gui)
45  : BC_SubWindow(mwindow->theme->mzoom_x,
46         mwindow->theme->mzoom_y,
47         mwindow->theme->mzoom_w,
48         mwindow->theme->mzoom_h)
49 {
50         this->gui = gui;
51         this->mwindow = mwindow;
52         old_position = 0;
53 }
54
55 ZoomBar::~ZoomBar()
56 {
57         delete sample_zoom;
58         delete amp_zoom;
59         delete track_zoom;
60 }
61
62 void ZoomBar::create_objects()
63 {
64         int x = 3;
65         int y = get_h() / 2 -
66                 mwindow->theme->get_image_set("zoombar_menu", 0)[0]->get_h() / 2;
67
68         draw_top_background(get_parent(), 0, 0, get_w(), get_h());
69         sample_zoom = new SampleZoomPanel(mwindow, this, x, y);
70         sample_zoom->set_menu_images(mwindow->theme->get_image_set("zoombar_menu", 0));
71         sample_zoom->set_tumbler_images(mwindow->theme->get_image_set("zoombar_tumbler", 0));
72         sample_zoom->create_objects();
73         sample_zoom->zoom_text->set_tooltip(_("Duration visible in the timeline"));
74         sample_zoom->zoom_tumbler->set_tooltip(_("Duration visible in the timeline"));
75         x += sample_zoom->get_w();
76         amp_zoom = new AmpZoomPanel(mwindow, this, x, y);
77         amp_zoom->set_menu_images(mwindow->theme->get_image_set("zoombar_menu", 0));
78         amp_zoom->set_tumbler_images(mwindow->theme->get_image_set("zoombar_tumbler", 0));
79         amp_zoom->create_objects();
80         amp_zoom->zoom_text->set_tooltip(_("Audio waveform scale"));
81         amp_zoom->zoom_tumbler->set_tooltip(_("Audio waveform scale"));
82         x += amp_zoom->get_w();
83         track_zoom = new TrackZoomPanel(mwindow, this, x, y);
84         track_zoom->set_menu_images(mwindow->theme->get_image_set("zoombar_menu", 0));
85         track_zoom->set_tumbler_images(mwindow->theme->get_image_set("zoombar_tumbler", 0));
86         track_zoom->create_objects();
87         track_zoom->zoom_text->set_tooltip(_("Height of tracks in the timeline"));
88         track_zoom->zoom_tumbler->set_tooltip(_("Height of tracks in the timeline"));
89         x += track_zoom->get_w() + 10;
90
91         int wid = 120;
92         for( int i=AUTOGROUPTYPE_AUDIO_FADE; i<=AUTOGROUPTYPE_Y; ++i ) {
93                 int ww = BC_GenericButton::calculate_w(this, AutoTypeMenu::to_text(i));
94                 if( ww > wid ) wid = ww;
95         }
96         add_subwindow(auto_type = new AutoTypeMenu(mwindow, this, x, y, wid));
97         auto_type->create_objects();
98         x += auto_type->get_w() + 10;
99 #define DEFAULT_TEXT "000.00 to 000.00"
100         add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y, 0));
101         x += auto_zoom->get_w();
102         add_subwindow(auto_zoom_text = new ZoomTextBox(
103                 mwindow,
104                 this,
105                 x,
106                 y,
107                 DEFAULT_TEXT));
108         x += auto_zoom_text->get_w() + 5;
109         add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y, 1));
110         update_autozoom();
111         x += auto_zoom->get_w() + 5;
112
113         add_subwindow(from_value = new FromTextBox(mwindow, this, x, y));
114         x += from_value->get_w() + 5;
115         add_subwindow(length_value = new LengthTextBox(mwindow, this, x, y));
116         x += length_value->get_w() + 5;
117         add_subwindow(to_value = new ToTextBox(mwindow, this, x, y));
118         x += to_value->get_w() + 5;
119
120         update_formatting(from_value);
121         update_formatting(length_value);
122         update_formatting(to_value);
123
124         add_subwindow(playback_value = new BC_Title(x, 100, "--", MEDIUMFONT, RED));
125
126         add_subwindow(zoom_value = new BC_Title(x, 100, "--", MEDIUMFONT, BLACK));
127         update();
128 }
129
130
131 void ZoomBar::update_formatting(BC_TextBox *dst)
132 {
133         dst->set_separators(
134                 Units::format_to_separators(mwindow->edl->session->time_format));
135 }
136
137 void ZoomBar::resize_event()
138 {
139         reposition_window(mwindow->theme->mzoom_x,
140                 mwindow->theme->mzoom_y,
141                 mwindow->theme->mzoom_w,
142                 mwindow->theme->mzoom_h);
143
144         draw_top_background(get_parent(), 0, 0, get_w(), get_h());
145         int x = 3, y = 1;
146         if (sample_zoom) delete sample_zoom;
147         sample_zoom = new SampleZoomPanel(mwindow, this, x, y);
148         sample_zoom->set_menu_images(mwindow->theme->get_image_set("zoombar_menu", 0));
149         sample_zoom->set_tumbler_images(mwindow->theme->get_image_set("zoombar_tumbler", 0));
150         sample_zoom->create_objects();
151 //      x += sample_zoom->get_w();
152 //      amp_zoom->reposition_window(x, y);
153 //      x += amp_zoom->get_w();
154 //      track_zoom->reposition_window(x, y);
155         flash();
156 }
157
158 void ZoomBar::redraw_time_dependancies()
159 {
160 // Recalculate sample zoom menu
161         sample_zoom->update_menu();
162         sample_zoom->update(mwindow->edl->local_session->zoom_sample);
163         update_formatting(from_value);
164         update_formatting(length_value);
165         update_formatting(to_value);
166         update_autozoom();
167         update_clocks();
168 }
169
170 int ZoomBar::draw()
171 {
172         update();
173         return 0;
174 }
175
176 void ZoomBar::update_autozoom()
177 {
178         char string[BCTEXTLEN];
179         int autogroup_type = mwindow->edl->local_session->zoombar_showautotype;
180         switch( autogroup_type ) {
181         case AUTOGROUPTYPE_AUDIO_FADE:
182         case AUTOGROUPTYPE_VIDEO_FADE:
183                 sprintf(string, "%0.01f to %0.01f\n",
184                         mwindow->edl->local_session->automation_mins[autogroup_type],
185                         mwindow->edl->local_session->automation_maxs[autogroup_type]);
186                 break;
187         case AUTOGROUPTYPE_ZOOM:
188         case AUTOGROUPTYPE_SPEED:
189                 sprintf(string, "%0.03f to %0.03f\n",
190                         mwindow->edl->local_session->automation_mins[autogroup_type],
191                         mwindow->edl->local_session->automation_maxs[autogroup_type]);
192                 break;
193         case AUTOGROUPTYPE_X:
194         case AUTOGROUPTYPE_Y:
195                 sprintf(string, "%0.0f to %.0f\n",
196                         mwindow->edl->local_session->automation_mins[autogroup_type],
197                         mwindow->edl->local_session->automation_maxs[autogroup_type]);
198                 break;
199         }
200         auto_zoom_text->update(string);
201         const char *group_name = AutoTypeMenu::to_text(autogroup_type);
202         auto_type->set_text(group_name);
203 }
204
205 int ZoomBar::update()
206 {
207         sample_zoom->update(mwindow->edl->local_session->zoom_sample);
208         amp_zoom->update(mwindow->edl->local_session->zoom_y);
209         track_zoom->update(mwindow->edl->local_session->zoom_track);
210         update_autozoom();
211         update_clocks();
212         return 0;
213 }
214
215 int ZoomBar::update_clocks()
216 {
217         from_value->update_position(mwindow->edl->local_session->get_selectionstart(1));
218         length_value->update_position(mwindow->edl->local_session->get_selectionend(1) -
219                 mwindow->edl->local_session->get_selectionstart(1));
220         to_value->update_position(mwindow->edl->local_session->get_selectionend(1));
221         return 0;
222 }
223
224 int ZoomBar::update_playback(int64_t new_position)
225 {
226         if(new_position != old_position)
227         {
228                 Units::totext(string,
229                                 new_position,
230                                 mwindow->edl->session->sample_rate,
231                                 mwindow->edl->session->time_format,
232                                 mwindow->edl->session->frame_rate,
233                                 mwindow->edl->session->frames_per_foot);
234                 playback_value->update(string);
235                 old_position = new_position;
236         }
237         return 0;
238 }
239
240 int ZoomBar::resize_event(int w, int h)
241 {
242 // don't change anything but y and width
243         reposition_window(0, h - this->get_h(), w, this->get_h());
244         return 0;
245 }
246
247
248 // Values for which_one
249 #define SET_FROM 1
250 #define SET_LENGTH 2
251 #define SET_TO 3
252
253
254 int ZoomBar::set_selection(int which_one)
255 {
256         double start_position = mwindow->edl->local_session->get_selectionstart(1);
257         double end_position = mwindow->edl->local_session->get_selectionend(1);
258         double length = end_position - start_position;
259
260 // Fix bogus results
261
262         switch(which_one)
263         {
264                 case SET_LENGTH:
265                         start_position = Units::text_to_seconds(from_value->get_text(),
266                                 mwindow->edl->session->sample_rate,
267                                 mwindow->edl->session->time_format,
268                                 mwindow->edl->session->frame_rate,
269                                 mwindow->edl->session->frames_per_foot);
270                         length = Units::text_to_seconds(length_value->get_text(),
271                                 mwindow->edl->session->sample_rate,
272                                 mwindow->edl->session->time_format,
273                                 mwindow->edl->session->frame_rate,
274                                 mwindow->edl->session->frames_per_foot);
275                         end_position = start_position + length;
276
277                         if(end_position < start_position)
278                         {
279                                 start_position = end_position;
280                                 mwindow->edl->local_session->set_selectionend(
281                                         mwindow->edl->local_session->get_selectionstart(1));
282                         }
283                         break;
284
285                 case SET_FROM:
286                         start_position = Units::text_to_seconds(from_value->get_text(),
287                                 mwindow->edl->session->sample_rate,
288                                 mwindow->edl->session->time_format,
289                                 mwindow->edl->session->frame_rate,
290                                 mwindow->edl->session->frames_per_foot);
291                         end_position = Units::text_to_seconds(to_value->get_text(),
292                                 mwindow->edl->session->sample_rate,
293                                 mwindow->edl->session->time_format,
294                                 mwindow->edl->session->frame_rate,
295                                 mwindow->edl->session->frames_per_foot);
296
297                         if(end_position < start_position)
298                         {
299                                 end_position = start_position;
300                                 mwindow->edl->local_session->set_selectionend(
301                                         mwindow->edl->local_session->get_selectionstart(1));
302                         }
303                         break;
304
305                 case SET_TO:
306                         start_position = Units::text_to_seconds(from_value->get_text(),
307                                 mwindow->edl->session->sample_rate,
308                                 mwindow->edl->session->time_format,
309                                 mwindow->edl->session->frame_rate,
310                                 mwindow->edl->session->frames_per_foot);
311                         end_position = Units::text_to_seconds(to_value->get_text(),
312                                 mwindow->edl->session->sample_rate,
313                                 mwindow->edl->session->time_format,
314                                 mwindow->edl->session->frame_rate,
315                                 mwindow->edl->session->frames_per_foot);
316
317                         if(end_position < start_position)
318                         {
319                                 start_position = end_position;
320                                 mwindow->edl->local_session->set_selectionend(
321                                         mwindow->edl->local_session->get_selectionstart(1));
322                         }
323                         break;
324         }
325
326         mwindow->edl->local_session->set_selectionstart(
327                 mwindow->edl->align_to_frame(start_position, 1));
328         mwindow->edl->local_session->set_selectionend(
329                 mwindow->edl->align_to_frame(end_position, 1));
330
331
332         mwindow->gui->update_timebar_highlights();
333         mwindow->gui->hide_cursor(1);
334         mwindow->gui->show_cursor(1);
335         update();
336         mwindow->sync_parameters(CHANGE_PARAMS);
337         mwindow->gui->flash_canvas(1);
338
339         return 0;
340 }
341
342
343
344
345
346
347
348
349
350
351
352
353 SampleZoomPanel::SampleZoomPanel(MWindow *mwindow,
354         ZoomBar *zoombar,
355         int x,
356         int y)
357  : ZoomPanel(mwindow,
358         zoombar,
359         mwindow->edl->local_session->zoom_sample,
360         x,
361         y,
362         110,
363         MIN_ZOOM_TIME,
364         MAX_ZOOM_TIME,
365         ZOOM_TIME)
366 {
367         this->mwindow = mwindow;
368         this->zoombar = zoombar;
369 }
370 int SampleZoomPanel::handle_event()
371 {
372         mwindow->zoom_sample((int64_t)get_value());
373         return 1;
374 }
375
376
377 AmpZoomPanel::AmpZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
378  : ZoomPanel(mwindow,
379         zoombar,
380         mwindow->edl->local_session->zoom_y,
381         x,
382         y,
383         80,
384         MIN_AMP_ZOOM,
385         MAX_AMP_ZOOM,
386         ZOOM_LONG)
387 {
388         this->mwindow = mwindow;
389         this->zoombar = zoombar;
390 }
391 int AmpZoomPanel::handle_event()
392 {
393         mwindow->zoom_amp((int64_t)get_value());
394         return 1;
395 }
396
397 TrackZoomPanel::TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
398  : ZoomPanel(mwindow,
399         zoombar,
400         mwindow->edl->local_session->zoom_track,
401         x,
402         y,
403         70,
404         MIN_TRACK_ZOOM,
405         MAX_TRACK_ZOOM,
406         ZOOM_LONG)
407 {
408         this->mwindow = mwindow;
409         this->zoombar = zoombar;
410 }
411 int TrackZoomPanel::handle_event()
412 {
413         mwindow->zoom_track((int64_t)get_value());
414         zoombar->amp_zoom->update(mwindow->edl->local_session->zoom_y);
415         return 1;
416 }
417
418
419
420
421 AutoZoom::AutoZoom(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int changemax)
422  : BC_Tumbler(x,
423         y,
424         mwindow->theme->get_image_set("zoombar_tumbler"))
425 {
426         this->mwindow = mwindow;
427         this->zoombar = zoombar;
428         this->changemax = changemax;
429         if (changemax)
430                 set_tooltip(_("Automation range maximum"));
431         else
432                 set_tooltip(_("Automation range minimum"));
433 }
434
435 int AutoZoom::handle_up_event()
436 {
437         mwindow->change_currentautorange(mwindow->edl->local_session->zoombar_showautotype,1,changemax);
438
439         mwindow->gui->zoombar->update_autozoom();
440         mwindow->gui->draw_overlays(0);
441         mwindow->gui->update_patchbay();
442         mwindow->gui->flash_canvas(1);
443         return 1;
444 }
445
446 int AutoZoom::handle_down_event()
447 {
448         mwindow->change_currentautorange(mwindow->edl->local_session->zoombar_showautotype,0,changemax);
449
450         mwindow->gui->zoombar->update_autozoom();
451         mwindow->gui->draw_overlays(0);
452         mwindow->gui->update_patchbay();
453         mwindow->gui->flash_canvas(1);
454         return 1;
455 }
456
457
458
459 AutoTypeMenu::AutoTypeMenu(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int wid)
460         : BC_PopupMenu(x, y, wid, to_text(mwindow->edl->local_session->zoombar_showautotype), 1)
461 {
462         this->mwindow = mwindow;
463         this->zoombar = zoombar;
464         set_tooltip(_("Automation Type"));
465 }
466
467 void AutoTypeMenu::create_objects()
468 {
469         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_AUDIO_FADE)));
470         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_VIDEO_FADE)));
471         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_ZOOM)));
472         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_SPEED)));
473         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_X)));
474         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_Y)));
475 }
476
477 const char* AutoTypeMenu::to_text(int mode)
478 {
479         switch(mode) {
480         case AUTOGROUPTYPE_AUDIO_FADE: return _("Audio Fade:");
481         case AUTOGROUPTYPE_VIDEO_FADE: return _("Video Fade:");
482         case AUTOGROUPTYPE_ZOOM: return _("Zoom:");
483         case AUTOGROUPTYPE_SPEED: return _("Speed:");
484         case AUTOGROUPTYPE_X: return "X:";
485         case AUTOGROUPTYPE_Y: return "Y:";
486         }
487         return "??";
488 }
489
490 int AutoTypeMenu::from_text(char *text)
491 {
492         if(!strcmp(text, to_text(AUTOGROUPTYPE_AUDIO_FADE))) return AUTOGROUPTYPE_AUDIO_FADE;
493         if(!strcmp(text, to_text(AUTOGROUPTYPE_VIDEO_FADE))) return AUTOGROUPTYPE_VIDEO_FADE;
494         if(!strcmp(text, to_text(AUTOGROUPTYPE_ZOOM))) return AUTOGROUPTYPE_ZOOM;
495         if(!strcmp(text, to_text(AUTOGROUPTYPE_SPEED))) return AUTOGROUPTYPE_SPEED;
496         if(!strcmp(text, to_text(AUTOGROUPTYPE_X))) return AUTOGROUPTYPE_X;
497         if(!strcmp(text, to_text(AUTOGROUPTYPE_Y))) return AUTOGROUPTYPE_Y;
498         return AUTOGROUPTYPE_INT255;
499 }
500
501 int AutoTypeMenu::handle_event()
502 {
503         mwindow->edl->local_session->zoombar_showautotype = from_text(this->get_text());
504         this->zoombar->update_autozoom();
505         return 1;
506 }
507
508
509 ZoomTextBox::ZoomTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y, const char *text)
510  : BC_TextBox(x, y, 130, 1, text)
511 {
512         this->mwindow = mwindow;
513         this->zoombar = zoombar;
514         set_tooltip(_("Automation range"));
515 }
516
517 int ZoomTextBox::button_press_event()
518 {
519         if (!(get_buttonpress() == 4 || get_buttonpress() == 5)) {
520                 BC_TextBox::button_press_event();
521                 return 0;
522         }
523         if (!is_event_win()) return 0;
524
525         int changemax = 1;
526         if (get_relative_cursor_x() < get_w()/2)
527                 changemax = 0;
528
529         // increment
530         if (get_buttonpress() == 4)
531                 mwindow->change_currentautorange(mwindow->edl->local_session->zoombar_showautotype, 1, changemax);
532
533         // decrement
534         if (get_buttonpress() == 5)
535                 mwindow->change_currentautorange(mwindow->edl->local_session->zoombar_showautotype, 0, changemax);
536
537         mwindow->gui->zoombar->update_autozoom();
538         mwindow->gui->draw_overlays(0);
539         mwindow->gui->update_patchbay();
540         mwindow->gui->flash_canvas(1);
541         return 1;
542 }
543
544 int ZoomTextBox::handle_event()
545 {
546         float min, max;
547         if (sscanf(this->get_text(),"%f to%f",&min, &max) == 2)
548         {
549                 AUTOMATIONVIEWCLAMPS(min, mwindow->edl->local_session->zoombar_showautotype);
550                 AUTOMATIONVIEWCLAMPS(max, mwindow->edl->local_session->zoombar_showautotype);
551                 if (max > min)
552                 {
553                         mwindow->edl->local_session->automation_mins[mwindow->edl->local_session->zoombar_showautotype] = min;
554                         mwindow->edl->local_session->automation_maxs[mwindow->edl->local_session->zoombar_showautotype] = max;
555                         mwindow->gui->zoombar->update_autozoom();
556                         mwindow->gui->draw_overlays(0);
557                         mwindow->gui->update_patchbay();
558                         mwindow->gui->flash_canvas(1);
559                 }
560         }
561         // TODO: Make the text turn red when it's a bad range..
562         return 0;
563 }
564
565
566
567
568
569 FromTextBox::FromTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
570  : BC_TextBox(x, y, 90, 1, "")
571 {
572         this->mwindow = mwindow;
573         this->zoombar = zoombar;
574         set_tooltip(_("Selection start time"));
575 }
576
577 int FromTextBox::handle_event()
578 {
579         if(get_keypress() == 13)
580         {
581                 zoombar->set_selection(SET_FROM);
582                 return 1;
583         }
584         return 0;
585 }
586
587 int FromTextBox::update_position(double new_position)
588 {
589         new_position += mwindow->edl->session->get_frame_offset() /
590                                                  mwindow->edl->session->frame_rate;;
591         Units::totext(string,
592                 new_position,
593                 mwindow->edl->session->time_format,
594                 mwindow->edl->session->sample_rate,
595                 mwindow->edl->session->frame_rate,
596                 mwindow->edl->session->frames_per_foot);
597 //printf("FromTextBox::update_position %f %s\n", new_position, string);
598         update(string);
599         return 0;
600 }
601
602
603
604
605
606
607 LengthTextBox::LengthTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
608  : BC_TextBox(x, y, 90, 1, "")
609 {
610         this->mwindow = mwindow;
611         this->zoombar = zoombar;
612         set_tooltip(_("Selection length"));
613 }
614
615 int LengthTextBox::handle_event()
616 {
617         if(get_keypress() == 13)
618         {
619                 zoombar->set_selection(SET_LENGTH);
620                 return 1;
621         }
622         return 0;
623 }
624
625 int LengthTextBox::update_position(double new_position)
626 {
627         Units::totext(string,
628                 new_position,
629                 mwindow->edl->session->time_format,
630                 mwindow->edl->session->sample_rate,
631                 mwindow->edl->session->frame_rate,
632                 mwindow->edl->session->frames_per_foot);
633         update(string);
634         return 0;
635 }
636
637
638
639
640
641 ToTextBox::ToTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
642  : BC_TextBox(x, y, 90, 1, "")
643 {
644         this->mwindow = mwindow;
645         this->zoombar = zoombar;
646         set_tooltip(_("Selection end time"));
647 }
648
649 int ToTextBox::handle_event()
650 {
651         if(get_keypress() == 13)
652         {
653                 zoombar->set_selection(SET_TO);
654                 return 1;
655         }
656         return 0;
657 }
658
659 int ToTextBox::update_position(double new_position)
660 {
661         new_position += mwindow->edl->session->get_frame_offset() /
662                                                  mwindow->edl->session->frame_rate;
663         Units::totext(string,
664                 new_position,
665                 mwindow->edl->session->time_format,
666                 mwindow->edl->session->sample_rate,
667                 mwindow->edl->session->frame_rate,
668                 mwindow->edl->session->frames_per_foot);
669         update(string);
670         return 0;
671 }