rework keyframe hide popup, keyframe auto render, textbox set_selection wide text
[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         add_subwindow(auto_type = new AutoTypeMenu(mwindow, this, x, y));
92         auto_type->create_objects();
93         x += auto_type->get_w() + 10;
94 #define DEFAULT_TEXT "000.00 to 000.00"
95         add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y, 0));
96         x += auto_zoom->get_w();
97         add_subwindow(auto_zoom_text = new ZoomTextBox(
98                 mwindow, 
99                 this, 
100                 x, 
101                 y,
102                 DEFAULT_TEXT));
103         x += auto_zoom_text->get_w() + 5;
104         add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y, 1));
105         update_autozoom();
106         x += auto_zoom->get_w() + 5;
107
108         add_subwindow(from_value = new FromTextBox(mwindow, this, x, y));
109         x += from_value->get_w() + 5;
110         add_subwindow(length_value = new LengthTextBox(mwindow, this, x, y));
111         x += length_value->get_w() + 5;
112         add_subwindow(to_value = new ToTextBox(mwindow, this, x, y));
113         x += to_value->get_w() + 5;
114
115         update_formatting(from_value);
116         update_formatting(length_value);
117         update_formatting(to_value);
118
119         add_subwindow(playback_value = new BC_Title(x, 100, "--", MEDIUMFONT, RED));
120
121         add_subwindow(zoom_value = new BC_Title(x, 100, "--", MEDIUMFONT, BLACK));
122         update();
123 }
124
125
126 void ZoomBar::update_formatting(BC_TextBox *dst)
127 {
128         dst->set_separators(
129                 Units::format_to_separators(mwindow->edl->session->time_format));
130 }
131
132 void ZoomBar::resize_event()
133 {
134         reposition_window(mwindow->theme->mzoom_x,
135                 mwindow->theme->mzoom_y,
136                 mwindow->theme->mzoom_w,
137                 mwindow->theme->mzoom_h);
138
139         draw_top_background(get_parent(), 0, 0, get_w(), get_h());
140         int x = 3, y = 1;
141         if (sample_zoom) delete sample_zoom;
142         sample_zoom = new SampleZoomPanel(mwindow, this, x, y);
143         sample_zoom->set_menu_images(mwindow->theme->get_image_set("zoombar_menu", 0));
144         sample_zoom->set_tumbler_images(mwindow->theme->get_image_set("zoombar_tumbler", 0));
145         sample_zoom->create_objects();
146 //      x += sample_zoom->get_w();
147 //      amp_zoom->reposition_window(x, y);
148 //      x += amp_zoom->get_w();
149 //      track_zoom->reposition_window(x, y);
150         flash();
151 }
152
153 void ZoomBar::redraw_time_dependancies()
154 {
155 // Recalculate sample zoom menu
156         sample_zoom->update_menu();
157         sample_zoom->update(mwindow->edl->local_session->zoom_sample);
158         update_formatting(from_value);
159         update_formatting(length_value);
160         update_formatting(to_value);
161         update_autozoom();
162         update_clocks();
163 }
164
165 int ZoomBar::draw()
166 {
167         update();
168         return 0;
169 }
170
171 void ZoomBar::update_autozoom()
172 {
173         char string[BCTEXTLEN];
174         switch (mwindow->edl->local_session->zoombar_showautotype) {
175         case AUTOGROUPTYPE_AUDIO_FADE:
176         case AUTOGROUPTYPE_VIDEO_FADE:
177                 sprintf(string, "%0.01f to %0.01f\n", 
178                         mwindow->edl->local_session->automation_mins[mwindow->edl->local_session->zoombar_showautotype],
179                         mwindow->edl->local_session->automation_maxs[mwindow->edl->local_session->zoombar_showautotype]);
180                 break;
181         case AUTOGROUPTYPE_ZOOM:
182         case AUTOGROUPTYPE_SPEED:
183                 sprintf(string, "%0.03f to %0.03f\n", 
184                         mwindow->edl->local_session->automation_mins[mwindow->edl->local_session->zoombar_showautotype],
185                         mwindow->edl->local_session->automation_maxs[mwindow->edl->local_session->zoombar_showautotype]);
186                 break;
187         case AUTOGROUPTYPE_X:
188         case AUTOGROUPTYPE_Y:
189                 sprintf(string, "%0.0f to %.0f\n", 
190                         mwindow->edl->local_session->automation_mins[mwindow->edl->local_session->zoombar_showautotype],
191                         mwindow->edl->local_session->automation_maxs[mwindow->edl->local_session->zoombar_showautotype]);
192                 break;
193         }
194         auto_zoom_text->update(string);
195 }
196
197 int ZoomBar::update()
198 {
199         sample_zoom->update(mwindow->edl->local_session->zoom_sample);
200         amp_zoom->update(mwindow->edl->local_session->zoom_y);
201         track_zoom->update(mwindow->edl->local_session->zoom_track);
202         update_autozoom();
203         update_clocks();
204         return 0;
205 }
206
207 int ZoomBar::update_clocks()
208 {
209         from_value->update_position(mwindow->edl->local_session->get_selectionstart(1));
210         length_value->update_position(mwindow->edl->local_session->get_selectionend(1) - 
211                 mwindow->edl->local_session->get_selectionstart(1));
212         to_value->update_position(mwindow->edl->local_session->get_selectionend(1));
213         return 0;
214 }
215
216 int ZoomBar::update_playback(int64_t new_position)
217 {
218         if(new_position != old_position)
219         {
220                 Units::totext(string, 
221                                 new_position, 
222                                 mwindow->edl->session->sample_rate, 
223                                 mwindow->edl->session->time_format, 
224                                 mwindow->edl->session->frame_rate,
225                                 mwindow->edl->session->frames_per_foot);
226                 playback_value->update(string);
227                 old_position = new_position;
228         }
229         return 0;
230 }
231
232 int ZoomBar::resize_event(int w, int h)
233 {
234 // don't change anything but y and width
235         reposition_window(0, h - this->get_h(), w, this->get_h());
236         return 0;
237 }
238
239
240 // Values for which_one
241 #define SET_FROM 1
242 #define SET_LENGTH 2
243 #define SET_TO 3
244
245
246 int ZoomBar::set_selection(int which_one)
247 {
248         double start_position = mwindow->edl->local_session->get_selectionstart(1);
249         double end_position = mwindow->edl->local_session->get_selectionend(1);
250         double length = end_position - start_position;
251
252 // Fix bogus results
253
254         switch(which_one)
255         {
256                 case SET_LENGTH:
257                         start_position = Units::text_to_seconds(from_value->get_text(), 
258                                 mwindow->edl->session->sample_rate, 
259                                 mwindow->edl->session->time_format, 
260                                 mwindow->edl->session->frame_rate,
261                                 mwindow->edl->session->frames_per_foot);
262                         length = Units::text_to_seconds(length_value->get_text(), 
263                                 mwindow->edl->session->sample_rate, 
264                                 mwindow->edl->session->time_format, 
265                                 mwindow->edl->session->frame_rate,
266                                 mwindow->edl->session->frames_per_foot);
267                         end_position = start_position + length;
268
269                         if(end_position < start_position)
270                         {
271                                 start_position = end_position;
272                                 mwindow->edl->local_session->set_selectionend(
273                                         mwindow->edl->local_session->get_selectionstart(1));
274                         }
275                         break;
276
277                 case SET_FROM:
278                         start_position = Units::text_to_seconds(from_value->get_text(), 
279                                 mwindow->edl->session->sample_rate, 
280                                 mwindow->edl->session->time_format, 
281                                 mwindow->edl->session->frame_rate,
282                                 mwindow->edl->session->frames_per_foot);
283                         end_position = Units::text_to_seconds(to_value->get_text(), 
284                                 mwindow->edl->session->sample_rate, 
285                                 mwindow->edl->session->time_format, 
286                                 mwindow->edl->session->frame_rate,
287                                 mwindow->edl->session->frames_per_foot);
288
289                         if(end_position < start_position)
290                         {
291                                 end_position = start_position;
292                                 mwindow->edl->local_session->set_selectionend(
293                                         mwindow->edl->local_session->get_selectionstart(1));
294                         }
295                         break;
296
297                 case SET_TO:
298                         start_position = Units::text_to_seconds(from_value->get_text(), 
299                                 mwindow->edl->session->sample_rate, 
300                                 mwindow->edl->session->time_format, 
301                                 mwindow->edl->session->frame_rate,
302                                 mwindow->edl->session->frames_per_foot);
303                         end_position = Units::text_to_seconds(to_value->get_text(), 
304                                 mwindow->edl->session->sample_rate, 
305                                 mwindow->edl->session->time_format, 
306                                 mwindow->edl->session->frame_rate,
307                                 mwindow->edl->session->frames_per_foot);
308
309                         if(end_position < start_position)
310                         {
311                                 start_position = end_position;
312                                 mwindow->edl->local_session->set_selectionend(
313                                         mwindow->edl->local_session->get_selectionstart(1));
314                         }
315                         break;
316         }
317
318         mwindow->edl->local_session->set_selectionstart(
319                 mwindow->edl->align_to_frame(start_position, 1));
320         mwindow->edl->local_session->set_selectionend(
321                 mwindow->edl->align_to_frame(end_position, 1));
322
323
324         mwindow->gui->update_timebar_highlights();
325         mwindow->gui->hide_cursor(1);
326         mwindow->gui->show_cursor(1);
327         update();
328         mwindow->sync_parameters(CHANGE_PARAMS);
329         mwindow->gui->flash_canvas(1);
330
331         return 0;
332 }
333
334
335
336
337
338
339
340
341
342
343
344
345 SampleZoomPanel::SampleZoomPanel(MWindow *mwindow, 
346         ZoomBar *zoombar, 
347         int x, 
348         int y)
349  : ZoomPanel(mwindow, 
350         zoombar, 
351         mwindow->edl->local_session->zoom_sample, 
352         x, 
353         y, 
354         110, 
355         MIN_ZOOM_TIME, 
356         MAX_ZOOM_TIME, 
357         ZOOM_TIME)
358 {
359         this->mwindow = mwindow;
360         this->zoombar = zoombar;
361 }
362 int SampleZoomPanel::handle_event()
363 {
364         mwindow->zoom_sample((int64_t)get_value());
365         return 1;
366 }
367
368
369 AmpZoomPanel::AmpZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
370  : ZoomPanel(mwindow, 
371         zoombar, 
372         mwindow->edl->local_session->zoom_y, 
373         x, 
374         y, 
375         80,
376         MIN_AMP_ZOOM, 
377         MAX_AMP_ZOOM, 
378         ZOOM_LONG)
379 {
380         this->mwindow = mwindow;
381         this->zoombar = zoombar;
382 }
383 int AmpZoomPanel::handle_event()
384 {
385         mwindow->zoom_amp((int64_t)get_value());
386         return 1;
387 }
388
389 TrackZoomPanel::TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
390  : ZoomPanel(mwindow, 
391         zoombar, 
392         mwindow->edl->local_session->zoom_track, 
393         x, 
394         y, 
395         70,
396         MIN_TRACK_ZOOM, 
397         MAX_TRACK_ZOOM, 
398         ZOOM_LONG)
399 {
400         this->mwindow = mwindow;
401         this->zoombar = zoombar;
402 }
403 int TrackZoomPanel::handle_event()
404 {
405         mwindow->zoom_track((int64_t)get_value());
406         zoombar->amp_zoom->update(mwindow->edl->local_session->zoom_y);
407         return 1;
408 }
409
410
411
412
413 AutoZoom::AutoZoom(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int changemax)
414  : BC_Tumbler(x,
415         y,
416         mwindow->theme->get_image_set("zoombar_tumbler"))
417 {
418         this->mwindow = mwindow;
419         this->zoombar = zoombar;
420         this->changemax = changemax;
421         if (changemax)
422                 set_tooltip(_("Automation range maximum"));
423         else
424                 set_tooltip(_("Automation range minimum"));
425 }
426
427 int AutoZoom::handle_up_event()
428 {
429         mwindow->change_currentautorange(mwindow->edl->local_session->zoombar_showautotype,1,changemax);
430
431         mwindow->gui->zoombar->update_autozoom();
432         mwindow->gui->draw_overlays(0);
433         mwindow->gui->update_patchbay();
434         mwindow->gui->flash_canvas(1);
435         return 1;
436 }
437
438 int AutoZoom::handle_down_event()
439 {
440         mwindow->change_currentautorange(mwindow->edl->local_session->zoombar_showautotype,0,changemax);
441
442         mwindow->gui->zoombar->update_autozoom();
443         mwindow->gui->draw_overlays(0);
444         mwindow->gui->update_patchbay();
445         mwindow->gui->flash_canvas(1);
446         return 1;
447 }
448
449
450
451 AutoTypeMenu::AutoTypeMenu(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
452         : BC_PopupMenu(x, y, 120,to_text(mwindow->edl->local_session->zoombar_showautotype), 1)
453 {
454         this->mwindow = mwindow;
455         this->zoombar = zoombar;
456         set_tooltip(_("Automation Type"));
457 }
458
459 void AutoTypeMenu::create_objects()
460 {
461         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_AUDIO_FADE)));
462         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_VIDEO_FADE)));
463         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_ZOOM)));
464         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_SPEED)));
465         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_X)));
466         add_item(new BC_MenuItem(to_text(AUTOGROUPTYPE_Y)));
467 }
468
469 const char* AutoTypeMenu::to_text(int mode)
470 {
471         switch(mode) {
472         case AUTOGROUPTYPE_AUDIO_FADE: return _("Audio Fade:");
473         case AUTOGROUPTYPE_VIDEO_FADE: return _("Video Fade:");
474         case AUTOGROUPTYPE_ZOOM: return _("Zoom:");
475         case AUTOGROUPTYPE_SPEED: return _("Speed:");
476         case AUTOGROUPTYPE_X: return "X:";
477         case AUTOGROUPTYPE_Y: return "Y:";
478         }
479         return "??";
480 }
481
482 int AutoTypeMenu::from_text(char *text)
483 {
484         if(!strcmp(text, to_text(AUTOGROUPTYPE_AUDIO_FADE))) return AUTOGROUPTYPE_AUDIO_FADE;
485         if(!strcmp(text, to_text(AUTOGROUPTYPE_VIDEO_FADE))) return AUTOGROUPTYPE_VIDEO_FADE;
486         if(!strcmp(text, to_text(AUTOGROUPTYPE_ZOOM))) return AUTOGROUPTYPE_ZOOM;
487         if(!strcmp(text, to_text(AUTOGROUPTYPE_SPEED))) return AUTOGROUPTYPE_SPEED;
488         if(!strcmp(text, to_text(AUTOGROUPTYPE_X))) return AUTOGROUPTYPE_X;
489         if(!strcmp(text, to_text(AUTOGROUPTYPE_Y))) return AUTOGROUPTYPE_Y;
490         return AUTOGROUPTYPE_INT255;
491 }
492
493 int AutoTypeMenu::handle_event()
494 {
495         mwindow->edl->local_session->zoombar_showautotype = from_text(this->get_text());
496         this->zoombar->update_autozoom();
497         return 1;
498 }
499
500
501 ZoomTextBox::ZoomTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y, const char *text)
502  : BC_TextBox(x, y, 130, 1, text)
503 {
504         this->mwindow = mwindow;
505         this->zoombar = zoombar;
506         set_tooltip(_("Automation range"));
507 }
508
509 int ZoomTextBox::button_press_event()
510 {
511         if (!(get_buttonpress() == 4 || get_buttonpress() == 5)) {
512                 BC_TextBox::button_press_event();
513                 return 0;
514         }
515         if (!is_event_win()) return 0;
516
517         int changemax = 1;
518         if (get_relative_cursor_x() < get_w()/2)
519                 changemax = 0;
520
521         // increment
522         if (get_buttonpress() == 4)
523                 mwindow->change_currentautorange(mwindow->edl->local_session->zoombar_showautotype, 1, changemax);
524
525         // decrement
526         if (get_buttonpress() == 5)
527                 mwindow->change_currentautorange(mwindow->edl->local_session->zoombar_showautotype, 0, changemax);
528
529         mwindow->gui->zoombar->update_autozoom();
530         mwindow->gui->draw_overlays(0);
531         mwindow->gui->update_patchbay();
532         mwindow->gui->flash_canvas(1);
533         return 1;
534 }
535
536 int ZoomTextBox::handle_event()
537 {
538         float min, max;
539         if (sscanf(this->get_text(),"%f to%f",&min, &max) == 2)
540         {
541                 AUTOMATIONVIEWCLAMPS(min, mwindow->edl->local_session->zoombar_showautotype);
542                 AUTOMATIONVIEWCLAMPS(max, mwindow->edl->local_session->zoombar_showautotype);
543                 if (max > min) 
544                 {
545                         mwindow->edl->local_session->automation_mins[mwindow->edl->local_session->zoombar_showautotype] = min;
546                         mwindow->edl->local_session->automation_maxs[mwindow->edl->local_session->zoombar_showautotype] = max;
547                         mwindow->gui->zoombar->update_autozoom();
548                         mwindow->gui->draw_overlays(0);
549                         mwindow->gui->update_patchbay();
550                         mwindow->gui->flash_canvas(1);
551                 }
552         }
553         // TODO: Make the text turn red when it's a bad range..
554         return 0;
555 }
556
557
558
559
560
561 FromTextBox::FromTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
562  : BC_TextBox(x, y, 90, 1, "")
563 {
564         this->mwindow = mwindow;
565         this->zoombar = zoombar;
566         set_tooltip(_("Selection start time"));
567 }
568
569 int FromTextBox::handle_event()
570 {
571         if(get_keypress() == 13)
572         {
573                 zoombar->set_selection(SET_FROM);
574                 return 1;
575         }
576         return 0;
577 }
578
579 int FromTextBox::update_position(double new_position)
580 {
581         new_position += mwindow->edl->session->get_frame_offset() / 
582                                                  mwindow->edl->session->frame_rate;;
583         Units::totext(string, 
584                 new_position, 
585                 mwindow->edl->session->time_format, 
586                 mwindow->edl->session->sample_rate, 
587                 mwindow->edl->session->frame_rate,
588                 mwindow->edl->session->frames_per_foot);
589 //printf("FromTextBox::update_position %f %s\n", new_position, string);
590         update(string);
591         return 0;
592 }
593
594
595
596
597
598
599 LengthTextBox::LengthTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
600  : BC_TextBox(x, y, 90, 1, "")
601 {
602         this->mwindow = mwindow;
603         this->zoombar = zoombar;
604         set_tooltip(_("Selection length"));
605 }
606
607 int LengthTextBox::handle_event()
608 {
609         if(get_keypress() == 13)
610         {
611                 zoombar->set_selection(SET_LENGTH);
612                 return 1;
613         }
614         return 0;
615 }
616
617 int LengthTextBox::update_position(double new_position)
618 {
619         Units::totext(string, 
620                 new_position, 
621                 mwindow->edl->session->time_format, 
622                 mwindow->edl->session->sample_rate, 
623                 mwindow->edl->session->frame_rate,
624                 mwindow->edl->session->frames_per_foot);
625         update(string);
626         return 0;
627 }
628
629
630
631
632
633 ToTextBox::ToTextBox(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
634  : BC_TextBox(x, y, 90, 1, "")
635 {
636         this->mwindow = mwindow;
637         this->zoombar = zoombar;
638         set_tooltip(_("Selection end time"));
639 }
640
641 int ToTextBox::handle_event()
642 {
643         if(get_keypress() == 13)
644         {
645                 zoombar->set_selection(SET_TO);
646                 return 1;
647         }
648         return 0;
649 }
650
651 int ToTextBox::update_position(double new_position)
652 {
653         new_position += mwindow->edl->session->get_frame_offset() /
654                                                  mwindow->edl->session->frame_rate;
655         Units::totext(string, 
656                 new_position, 
657                 mwindow->edl->session->time_format, 
658                 mwindow->edl->session->sample_rate, 
659                 mwindow->edl->session->frame_rate,
660                 mwindow->edl->session->frames_per_foot);
661         update(string);
662         return 0;
663 }