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