4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
23 #include "bcdisplayinfo.h"
29 #include "edlsession.h"
31 #include "indexable.h"
33 #include "localsession.h"
34 #include "mainsession.h"
35 #include "meterpanel.h"
37 #include "mwindowgui.h"
40 MainSession::MainSession(MWindow *mwindow)
42 this->mwindow = mwindow;
45 // playback_cursor_visible = 0;
46 // is_playing_back = 0;
47 track_highlighted = 0;
48 plugin_highlighted = 0;
49 pluginset_highlighted = 0;
51 current_operation = NO_OPERATION;
52 drag_pluginservers = new ArrayList<PluginServer*>;
54 drag_assets = new ArrayList<Indexable*>;
55 drag_auto_gang = new ArrayList<Auto*>;
56 drag_clips = new ArrayList<EDL*>;
57 drag_edits = new ArrayList<Edit*>;
61 drag_group_position = 0;
62 drag_group_first_track = 0;
69 selected_zwindow = -1;
70 actual_frame_rate = 0;
82 drag_origin_x = drag_origin_y = 0;
83 drag_start_percentage = 0;
84 drag_start_position = 0;
85 cwindow_output_x = cwindow_output_y = 0;
86 batchrender_x = batchrender_y = batchrender_w = batchrender_h = 0;
87 lwindow_x = lwindow_y = lwindow_w = lwindow_h = 0;
88 mwindow_x = mwindow_y = mwindow_w = mwindow_h = 0;
89 vwindow_x = vwindow_y = vwindow_w = vwindow_h = 0;
90 cwindow_x = cwindow_y = cwindow_w = cwindow_h = 0;
91 ctool_x = ctool_y = 0;
92 awindow_x = awindow_y = awindow_w = awindow_h = 0;
93 bwindow_w = bwindow_h = 0;
94 rmonitor_x = rmonitor_y = rmonitor_w = rmonitor_h = 0;
95 rwindow_x = rwindow_y = rwindow_w = rwindow_h = 0;
96 gwindow_x = gwindow_y = 0;
97 cswindow_x = cswindow_y = cswindow_w = cswindow_h = 0;
98 swindow_x = swindow_y = swindow_w = swindow_h = 0;
99 ewindow_w = ewindow_h = 0;
100 channels_x = channels_y = 0;
101 picture_x = picture_y = 0;
102 scope_x = scope_y = scope_w = scope_h = 0;
103 histogram_x = histogram_y = histogram_w = histogram_h = 0;
116 show_vwindow = show_awindow = show_cwindow = show_gwindow = show_lwindow = 0;
117 plugindialog_w = plugindialog_h = 0;
118 // presetdialog_w = presetdialog_h = 0;
119 keyframedialog_w = keyframedialog_h = 0;
120 keyframedialog_column1 = 0;
121 keyframedialog_column2 = 0;
122 keyframedialog_all = 0;
123 menueffect_w = menueffect_h = 0;
124 transitiondialog_w = transitiondialog_h = 0;
127 MainSession::~MainSession()
129 delete drag_pluginservers;
131 delete drag_auto_gang;
135 drag_group->remove_user();
138 void MainSession::boundaries()
140 lwindow_x = MAX(0, lwindow_x);
141 lwindow_y = MAX(0, lwindow_y);
142 mwindow_x = MAX(0, mwindow_x);
143 mwindow_y = MAX(0, mwindow_y);
144 cwindow_x = MAX(0, cwindow_x);
145 cwindow_y = MAX(0, cwindow_y);
146 vwindow_x = MAX(0, vwindow_x);
147 vwindow_y = MAX(0, vwindow_y);
148 awindow_x = MAX(0, awindow_x);
149 awindow_y = MAX(0, awindow_y);
150 gwindow_x = MAX(0, gwindow_x);
151 gwindow_y = MAX(0, gwindow_y);
152 rwindow_x = MAX(0, rwindow_x);
153 rwindow_y = MAX(0, rwindow_y);
154 rmonitor_x = MAX(0, rmonitor_x);
155 rmonitor_y = MAX(0, rmonitor_y);
156 CLAMP(cwindow_controls, 0, 1);
159 void MainSession::save_x11_host(int play_config, const char *x11_host)
161 strcpy(!play_config ? a_x11_host : b_x11_host, x11_host);
164 // set default x11 host, window_config, return screens
165 int MainSession::set_default_x11_host(int win_config)
167 if( win_config < 0 ) win_config = window_config;
168 const char *x11_host = win_config!=1 ? a_x11_host : b_x11_host;
169 BC_DisplayInfo display_info(x11_host,0);
170 int screen = display_info.get_screen();
171 if( screen < 0 && strcmp(a_x11_host, b_x11_host) ) {
172 win_config = win_config==1 ? 0 : 1;
173 x11_host = win_config!=1 ? a_x11_host : b_x11_host;
174 display_info.init_window(x11_host,0);
175 screen = display_info.get_screen();
179 display_info.init_window(x11_host,1);
182 if( display_info.get_screen_count() > 1 )
183 screens = strcmp(a_x11_host, b_x11_host) != 0 ? 2 : 1;
184 window_config = win_config;
185 BC_Window::set_default_x11_host(x11_host);
189 void MainSession::default_window_positions(int window_config)
191 // 0 - all windows on a, playback_config a
192 // 1 - all windows on b, playback_config b
193 // 2 - all windows on a, except composer on b, playback_config b
194 int screens = set_default_x11_host(window_config);
195 mwindow->set_screens(screens);
197 BC_DisplayInfo display_info(BC_Window::get_default_x11_host());
198 // Get defaults based on root window size
201 int root_w = display_info.get_root_w();
202 int root_h = display_info.get_root_h();
204 int border_left = display_info.get_left_border();
205 int border_right = display_info.get_right_border();
206 int border_top = display_info.get_top_border();
207 int border_bottom = display_info.get_bottom_border();
209 int dual_head = screens > 1 ? 1 : 0;
210 int left_w = 0, left_h = 0, right_w = 0;
211 int xin_screens = display_info.get_xinerama_screens();
212 if( xin_screens > 1 ) {
215 for( int s=0; s<xin_screens; ++s ) {
216 if( display_info.xinerama_geometry(s, x, y, w, h) )
219 left_w = w; left_h = h;
225 for( int s=0; s<xin_screens; ++s ) {
226 if( display_info.xinerama_geometry(s, x, y, w, h) )
228 if( !y && x >= left_w && x < min_x ) {
234 if( window_config == 1 ) {
244 // Wider than 16:9, narrower than dual head
245 else if( screens < 2 && (float)root_w / root_h > 1.8 ) {
248 case 600: right_w = 800; break;
249 case 720: right_w = 1280; break;
250 case 1024: right_w = 1280; break;
251 case 1200: right_w = 1600; break;
252 case 1080: right_w = 1920; break;
258 if( window_config == 1 ) {
259 root_x = root_w - right_w;
263 // use same aspect ratio to compute left height
265 root_h = (root_w*root_h) / right_w;
272 vwindow_w = root_w / 2 - border_left - border_right;
273 vwindow_h = root_h * 6 / 10 - border_top - border_bottom;
275 int b_root_w = root_w;
276 int b_root_h = root_h;
277 if( !dual_head || window_config != 2 ) {
278 cwindow_x = root_x + root_w / 2;
280 cwindow_w = vwindow_w;
281 cwindow_h = vwindow_h;
284 // Get defaults based on root window size
285 BC_DisplayInfo b_display_info(b_x11_host);
286 b_root_w = b_display_info.get_root_w();
287 b_root_h = b_display_info.get_root_h();
290 cwindow_w = b_root_w-xS(100);
291 cwindow_h = b_root_h-yS(100);
294 ctool_x = cwindow_x + cwindow_w / 2;
295 ctool_y = cwindow_y + cwindow_h / 2;
298 mwindow_y = vwindow_y + vwindow_h + border_top + border_bottom;
299 mwindow_w = root_w * 2 / 3 - border_left - border_right;
300 mwindow_h = root_h - mwindow_y - border_top - border_bottom;
302 awindow_x = mwindow_x + border_left + border_right + mwindow_w;
303 awindow_y = mwindow_y;
304 awindow_w = root_x + root_w - awindow_x - border_left - border_right;
305 awindow_h = mwindow_h;
323 histogram_w = xS(320);
324 histogram_h = yS(480);
339 lwindow_w = MeterPanel::get_meters_width(mwindow->theme,
340 mwindow->edl->session->audio_channels,
346 lwindow_x = root_w - lwindow_w;
347 lwindow_h = mwindow_y;
356 cswindow_w = xS(1280);
357 cswindow_h = yS(600);
359 if( !dual_head || window_config != 2 ) {
360 rmonitor_x = rwindow_x + rwindow_w + xS(10);
361 rmonitor_y = rwindow_y;
362 rmonitor_w = root_x + root_w - rmonitor_x;
363 rmonitor_h = rwindow_h;
366 rmonitor_x = cswindow_x = xS(50);
367 rmonitor_y = cswindow_y = yS(50);
368 rmonitor_w = b_root_w-xS(100);
369 rmonitor_h = b_root_h-yS(100);
370 if( cswindow_w < rmonitor_w ) cswindow_w = rmonitor_w;
371 if( cswindow_h < rmonitor_h ) cswindow_h = rmonitor_h;
379 batchrender_w = xS(750);
380 batchrender_h = yS(400);
381 batchrender_x = root_w / 2 - batchrender_w / 2;
382 batchrender_y = root_h / 2 - batchrender_h / 2;
385 int MainSession::load_defaults(BC_Hash *defaults)
387 // Setup main windows
388 char *a_host = defaults->get("A_X11_HOST", a_x11_host);
389 if( a_host != a_x11_host )
390 strcpy(a_x11_host, defaults->get("A_X11_HOST", a_x11_host));
391 char *b_host = defaults->get("B_X11_HOST", b_x11_host);
392 if( b_host != b_x11_host )
393 strcpy(b_x11_host, defaults->get("B_X11_HOST", b_x11_host));
394 window_config = defaults->get("WINDOW_CONFIG", window_config);
395 default_window_positions(window_config);
397 vwindow_x = defaults->get("VWINDOW_X", vwindow_x);
398 vwindow_y = defaults->get("VWINDOW_Y", vwindow_y);
399 vwindow_w = defaults->get("VWINDOW_W", vwindow_w);
400 vwindow_h = defaults->get("VWINDOW_H", vwindow_h);
403 cwindow_x = defaults->get("CWINDOW_X", cwindow_x);
404 cwindow_y = defaults->get("CWINDOW_Y", cwindow_y);
405 cwindow_w = defaults->get("CWINDOW_W", cwindow_w);
406 cwindow_h = defaults->get("CWINDOW_H", cwindow_h);
408 ctool_x = defaults->get("CTOOL_X", ctool_x);
409 ctool_y = defaults->get("CTOOL_Y", ctool_y);
411 gwindow_x = defaults->get("GWINDOW_X", gwindow_x);
412 gwindow_y = defaults->get("GWINDOW_Y", gwindow_y);
414 mwindow_x = defaults->get("MWINDOW_X", mwindow_x);
415 mwindow_y = defaults->get("MWINDOW_Y", mwindow_y);
416 mwindow_w = defaults->get("MWINDOW_W", mwindow_w);
417 mwindow_h = defaults->get("MWINDOW_H", mwindow_h);
419 lwindow_x = defaults->get("LWINDOW_X", lwindow_x);
420 lwindow_y = defaults->get("LWINDOW_Y", lwindow_y);
421 lwindow_w = defaults->get("LWINDOW_W", lwindow_w);
422 lwindow_h = defaults->get("LWINDOW_H", lwindow_h);
425 awindow_x = defaults->get("AWINDOW_X", awindow_x);
426 awindow_y = defaults->get("AWINDOW_Y", awindow_y);
427 awindow_w = defaults->get("AWINDOW_W", awindow_w);
428 awindow_h = defaults->get("AWINDOW_H", awindow_h);
430 ewindow_w = defaults->get("EWINDOW_W", ewindow_w);
431 ewindow_h = defaults->get("EWINDOW_H", ewindow_h);
433 channels_x = defaults->get("CHANNELS_X", channels_x);
434 channels_y = defaults->get("CHANNELS_Y", channels_y);
435 picture_x = defaults->get("PICTURE_X", picture_x);
436 picture_y = defaults->get("PICTURE_Y", picture_y);
437 scope_x = defaults->get("SCOPE_X", scope_x);
438 scope_y = defaults->get("SCOPE_Y", scope_y);
439 scope_w = defaults->get("SCOPE_W", scope_w);
440 scope_h = defaults->get("SCOPE_H", scope_h);
441 histogram_x = defaults->get("HISTOGRAM_X", histogram_x);
442 histogram_y = defaults->get("HISTOGRAM_Y", histogram_y);
443 histogram_w = defaults->get("HISTOGRAM_W", histogram_w);
444 histogram_h = defaults->get("HISTOGRAM_H", histogram_h);
445 record_scope = defaults->get("RECORD_SCOPE", record_scope);
446 use_hist = defaults->get("USE_HIST", use_hist);
447 use_wave = defaults->get("USE_WAVE", use_wave);
448 use_vector = defaults->get("USE_VECTOR", use_vector);
449 use_hist_parade = defaults->get("USE_HIST_PARADE", use_hist_parade);
450 use_wave_parade = defaults->get("USE_WAVE_PARADE", use_wave_parade);
451 use_wave_gain = defaults->get("USE_WAVE_GAIN", use_wave_gain);
452 use_vect_gain = defaults->get("USE_VECT_GAIN", use_vect_gain);
453 use_smooth = defaults->get("USE_SMOOTH", use_smooth);
454 use_refresh = defaults->get("USE_REFRESH", use_refresh);
455 use_release = defaults->get("USE_RELEASE", use_release);
456 use_graticule = defaults->get("USE_GRATICULE", use_graticule);
458 //printf("MainSession::load_defaults 1\n");
461 afolders_w = defaults->get("ABINS_W", xS(200));
463 bwindow_w = defaults->get("BWINDOW_W", bwindow_w);
464 bwindow_h = defaults->get("BWINDOW_H", bwindow_h);
466 rwindow_x = defaults->get("RWINDOW_X", rwindow_x);
467 rwindow_y = defaults->get("RWINDOW_Y", rwindow_y);
468 rwindow_w = defaults->get("RWINDOW_W", rwindow_w);
469 rwindow_h = defaults->get("RWINDOW_H", rwindow_h);
471 cswindow_x = defaults->get("CSWINDOW_X", cswindow_x);
472 cswindow_y = defaults->get("CSWINDOW_Y", cswindow_y);
473 cswindow_w = defaults->get("CSWINDOW_W", cswindow_w);
474 cswindow_h = defaults->get("CSWINDOW_H", cswindow_h);
476 swindow_x = defaults->get("SWINDOW_X", swindow_x);
477 swindow_y = defaults->get("SWINDOW_Y", swindow_y);
478 swindow_w = defaults->get("SWINDOW_W", swindow_w);
479 swindow_h = defaults->get("SWINDOW_H", swindow_h);
481 rmonitor_x = defaults->get("RMONITOR_X", rmonitor_x);
482 rmonitor_y = defaults->get("RMONITOR_Y", rmonitor_y);
483 rmonitor_w = defaults->get("RMONITOR_W", rmonitor_w);
484 rmonitor_h = defaults->get("RMONITOR_H", rmonitor_h);
486 batchrender_x = defaults->get("BATCHRENDER_X", batchrender_x);
487 batchrender_y = defaults->get("BATCHRENDER_Y", batchrender_y);
488 batchrender_w = defaults->get("BATCHRENDER_W", batchrender_w);
489 batchrender_h = defaults->get("BATCHRENDER_H", batchrender_h);
491 show_vwindow = defaults->get("SHOW_VWINDOW", 1);
492 show_awindow = defaults->get("SHOW_AWINDOW", 1);
493 show_cwindow = defaults->get("SHOW_CWINDOW", 1);
494 show_lwindow = defaults->get("SHOW_LWINDOW", 0);
495 show_gwindow = defaults->get("SHOW_GWINDOW", 0);
497 cwindow_controls = defaults->get("CWINDOW_CONTROLS", cwindow_controls);
499 plugindialog_w = defaults->get("PLUGINDIALOG_W", xS(510));
500 plugindialog_h = defaults->get("PLUGINDIALOG_H", yS(415));
501 // presetdialog_w = defaults->get("PRESETDIALOG_W", xS(510));
502 // presetdialog_h = defaults->get("PRESETDIALOG_H", yS(415));
503 keyframedialog_w = defaults->get("KEYFRAMEDIALOG_W", xS(320));
504 keyframedialog_h = defaults->get("KEYFRAMEDIALOG_H", yS(415));
505 keyframedialog_column1 = defaults->get("KEYFRAMEDIALOG_COLUMN1", xS(150));
506 keyframedialog_column2 = defaults->get("KEYFRAMEDIALOG_COLUMN2", xS(100));
507 keyframedialog_all = defaults->get("KEYFRAMEDIALOG_ALL", 0);
508 menueffect_w = defaults->get("MENUEFFECT_W", xS(580));
509 menueffect_h = defaults->get("MENUEFFECT_H", yS(350));
510 transitiondialog_w = defaults->get("TRANSITIONDIALOG_W", xS(320));
511 transitiondialog_h = defaults->get("TRANSITIONDIALOG_H", yS(512));
513 current_tip = defaults->get("CURRENT_TIP", current_tip);
514 actual_frame_rate = defaults->get("ACTUAL_FRAME_RATE", (float)-1);
515 title_bar_alpha = defaults->get("TITLE_BAR_ALPHA", (float)1);
521 int MainSession::save_defaults(BC_Hash *defaults)
523 defaults->update("A_X11_HOST", a_x11_host);
524 defaults->update("B_X11_HOST", b_x11_host);
525 defaults->update("WINDOW_CONFIG", window_config);
527 defaults->update("MWINDOW_X", mwindow_x);
528 defaults->update("MWINDOW_Y", mwindow_y);
529 defaults->update("MWINDOW_W", mwindow_w);
530 defaults->update("MWINDOW_H", mwindow_h);
532 defaults->update("LWINDOW_X", lwindow_x);
533 defaults->update("LWINDOW_Y", lwindow_y);
534 defaults->update("LWINDOW_W", lwindow_w);
535 defaults->update("LWINDOW_H", lwindow_h);
537 defaults->update("VWINDOW_X", vwindow_x);
538 defaults->update("VWINDOW_Y", vwindow_y);
539 defaults->update("VWINDOW_W", vwindow_w);
540 defaults->update("VWINDOW_H", vwindow_h);
542 defaults->update("CWINDOW_X", cwindow_x);
543 defaults->update("CWINDOW_Y", cwindow_y);
544 defaults->update("CWINDOW_W", cwindow_w);
545 defaults->update("CWINDOW_H", cwindow_h);
547 defaults->update("CTOOL_X", ctool_x);
548 defaults->update("CTOOL_Y", ctool_y);
550 defaults->update("GWINDOW_X", gwindow_x);
551 defaults->update("GWINDOW_Y", gwindow_y);
553 defaults->update("AWINDOW_X", awindow_x);
554 defaults->update("AWINDOW_Y", awindow_y);
555 defaults->update("AWINDOW_W", awindow_w);
556 defaults->update("AWINDOW_H", awindow_h);
558 defaults->update("BWINDOW_W", bwindow_w);
559 defaults->update("BWINDOW_H", bwindow_h);
561 defaults->update("EWINDOW_W", ewindow_w);
562 defaults->update("EWINDOW_H", ewindow_h);
564 defaults->update("CHANNELS_X", channels_x);
565 defaults->update("CHANNELS_Y", channels_y);
566 defaults->update("PICTURE_X", picture_x);
567 defaults->update("PICTURE_Y", picture_y);
568 defaults->update("SCOPE_X", scope_x);
569 defaults->update("SCOPE_Y", scope_y);
570 defaults->update("SCOPE_W", scope_w);
571 defaults->update("SCOPE_H", scope_h);
572 defaults->update("HISTOGRAM_X", histogram_x);
573 defaults->update("HISTOGRAM_Y", histogram_y);
574 defaults->update("HISTOGRAM_W", histogram_w);
575 defaults->update("HISTOGRAM_H", histogram_h);
576 defaults->update("RECORD_SCOPE", record_scope);
577 defaults->update("USE_HIST", use_hist);
578 defaults->update("USE_WAVE", use_wave);
579 defaults->update("USE_VECTOR", use_vector);
580 defaults->update("USE_HIST_PARADE", use_hist_parade);
581 defaults->update("USE_WAVE_PARADE", use_wave_parade);
582 defaults->update("USE_WAVE_GAIN", use_wave_gain);
583 defaults->update("USE_VECT_GAIN", use_vect_gain);
584 defaults->update("USE_SMOOTH", use_smooth);
585 defaults->update("USE_REFRESH", use_refresh);
586 defaults->update("USE_RELEASE", use_release);
587 defaults->update("USE_GRATICULE", use_graticule);
589 defaults->update("ABINS_W", afolders_w);
591 defaults->update("RMONITOR_X", rmonitor_x);
592 defaults->update("RMONITOR_Y", rmonitor_y);
593 defaults->update("RMONITOR_W", rmonitor_w);
594 defaults->update("RMONITOR_H", rmonitor_h);
596 defaults->update("RWINDOW_X", rwindow_x);
597 defaults->update("RWINDOW_Y", rwindow_y);
598 defaults->update("RWINDOW_W", rwindow_w);
599 defaults->update("RWINDOW_H", rwindow_h);
601 defaults->update("CSWINDOW_X", cswindow_x);
602 defaults->update("CSWINDOW_Y", cswindow_y);
603 defaults->update("CSWINDOW_W", cswindow_w);
604 defaults->update("CSWINDOW_H", cswindow_h);
606 defaults->update("SWINDOW_X", swindow_x);
607 defaults->update("SWINDOW_Y", swindow_y);
608 defaults->update("SWINDOW_W", swindow_w);
609 defaults->update("SWINDOW_H", swindow_h);
611 defaults->update("BATCHRENDER_X", batchrender_x);
612 defaults->update("BATCHRENDER_Y", batchrender_y);
613 defaults->update("BATCHRENDER_W", batchrender_w);
614 defaults->update("BATCHRENDER_H", batchrender_h);
616 defaults->update("SHOW_VWINDOW", show_vwindow);
617 defaults->update("SHOW_AWINDOW", show_awindow);
618 defaults->update("SHOW_CWINDOW", show_cwindow);
619 defaults->update("SHOW_LWINDOW", show_lwindow);
620 defaults->update("SHOW_GWINDOW", show_gwindow);
622 defaults->update("CWINDOW_CONTROLS", cwindow_controls);
624 defaults->update("PLUGINDIALOG_W", plugindialog_w);
625 defaults->update("PLUGINDIALOG_H", plugindialog_h);
626 // defaults->update("PRESETDIALOG_W", presetdialog_w);
627 // defaults->update("PRESETDIALOG_H", presetdialog_h);
628 defaults->update("KEYFRAMEDIALOG_W", keyframedialog_w);
629 defaults->update("KEYFRAMEDIALOG_H", keyframedialog_h);
630 defaults->update("KEYFRAMEDIALOG_COLUMN1", keyframedialog_column1);
631 defaults->update("KEYFRAMEDIALOG_COLUMN2", keyframedialog_column2);
632 defaults->update("KEYFRAMEDIALOG_ALL", keyframedialog_all);
634 defaults->update("MENUEFFECT_W", menueffect_w);
635 defaults->update("MENUEFFECT_H", menueffect_h);
637 defaults->update("TRANSITIONDIALOG_W", transitiondialog_w);
638 defaults->update("TRANSITIONDIALOG_H", transitiondialog_h);
640 defaults->update("ACTUAL_FRAME_RATE", actual_frame_rate);
641 defaults->update("TITLE_BAR_ALPHA", title_bar_alpha);
642 defaults->update("CURRENT_TIP", current_tip);
648 Track *MainSession::drag_handle_track()
651 switch( current_operation ) {
652 case DRAG_EDITHANDLE1:
653 case DRAG_EDITHANDLE2:
654 track = drag_edit->edits->track;
656 case DRAG_PLUGINHANDLE1:
657 case DRAG_PLUGINHANDLE2:
658 track = drag_plugin->edits->track;
664 void MainSession::update_clip_number()
667 for( int i=mwindow->edl->clips.size(); --i>=0; ) {
668 EDL *clip_edl = mwindow->edl->clips[i];
670 if( sscanf(clip_edl->local_session->clip_title,_("Clip %d"),&no) == 1 )
671 if( no > clip_no ) clip_no = no;
673 clip_number = clip_no+1;
676 int MainSession::load_file(const char *path)
679 FILE *fp = fopen(path,"r");
682 defaults.load_file(fp);
683 load_defaults(&defaults);
690 int MainSession::save_file(const char *path)
693 FILE *fp = fopen(path,"w");
696 save_defaults(&defaults);
697 defaults.save_file(fp);