4 * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
5 * Copyright (C) 2003-2016 Cinelerra CV contributors
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "automation.h"
26 #include "cplayback.h"
28 #include "cwindowgui.h"
31 #include "edlsession.h"
32 #include "gwindowgui.h"
35 #include "localsession.h"
36 #include "maincursor.h"
38 #include "mainsession.h"
41 #include "mwindowgui.h"
43 #include "playbackengine.h"
45 #include "pluginset.h"
46 #include "resourcethread.h"
47 #include "samplescroll.h"
49 #include "trackcanvas.h"
52 #include "transportque.h"
56 void MWindow::update_plugins()
58 // Show plugins which are visible and hide plugins which aren't
59 // Update plugin pointers in plugin servers
63 int MWindow::expand_sample()
67 if(edl->local_session->zoom_sample < 0x100000)
69 edl->local_session->zoom_sample *= 2;
70 gui->zoombar->sample_zoom->update(edl->local_session->zoom_sample);
71 zoom_sample(edl->local_session->zoom_sample);
77 int MWindow::zoom_in_sample()
81 if(edl->local_session->zoom_sample > 1)
83 edl->local_session->zoom_sample /= 2;
84 gui->zoombar->sample_zoom->update(edl->local_session->zoom_sample);
85 zoom_sample(edl->local_session->zoom_sample);
91 int MWindow::zoom_sample(int64_t zoom_sample)
93 CLAMP(zoom_sample, 1, 0x100000);
94 edl->local_session->zoom_sample = zoom_sample;
97 TimelinePane *pane = gui->get_focused_pane();
98 samplemovement(edl->local_session->view_start[pane->number], pane->number);
102 void MWindow::find_cursor()
104 TimelinePane *pane = gui->get_focused_pane();
105 edl->local_session->view_start[pane->number] =
106 Units::round((edl->local_session->get_selectionend(1) +
107 edl->local_session->get_selectionstart(1)) /
109 edl->session->sample_rate /
110 edl->local_session->zoom_sample -
111 (double)pane->canvas->get_w() /
114 if(edl->local_session->view_start[pane->number] < 0)
115 edl->local_session->view_start[pane->number] = 0;
119 void MWindow::fit_selection()
121 if(EQUIV(edl->local_session->get_selectionstart(1),
122 edl->local_session->get_selectionend(1)))
124 double total_samples = edl->tracks->total_length() *
125 edl->session->sample_rate;
126 TimelinePane *pane = gui->get_focused_pane();
127 for(edl->local_session->zoom_sample = 1;
128 pane->canvas->get_w() * edl->local_session->zoom_sample < total_samples;
129 edl->local_session->zoom_sample *= 2)
134 double total_samples = (edl->local_session->get_selectionend(1) -
135 edl->local_session->get_selectionstart(1)) *
136 edl->session->sample_rate;
137 TimelinePane *pane = gui->get_focused_pane();
138 for(edl->local_session->zoom_sample = 1;
139 pane->canvas->get_w() * edl->local_session->zoom_sample < total_samples;
140 edl->local_session->zoom_sample *= 2)
144 edl->local_session->zoom_sample = MIN(0x100000,
145 edl->local_session->zoom_sample);
146 zoom_sample(edl->local_session->zoom_sample);
150 void MWindow::fit_autos(int all)
152 float min = 0, max = 0;
156 if(EQUIV(edl->local_session->get_selectionstart(1),
157 edl->local_session->get_selectionend(1)))
160 end = edl->tracks->total_length();
163 // Test autos in highlighting only
165 start = edl->local_session->get_selectionstart(1);
166 end = edl->local_session->get_selectionend(1);
169 int forstart = edl->local_session->zoombar_showautotype;
170 int forend = edl->local_session->zoombar_showautotype + 1;
174 forend = AUTOGROUPTYPE_COUNT;
177 for (int i = forstart; i < forend; i++)
179 // Adjust min and max
180 edl->tracks->get_automation_extents(&min, &max, start, end, i);
181 //printf("MWindow::fit_autos %d %f %f results in ", i, min, max);
183 float range = max - min;
186 case AUTOGROUPTYPE_AUDIO_FADE:
188 min = MIN(min, edl->local_session->automation_mins[i]);
189 max = MAX(max, edl->local_session->automation_maxs[i]);
190 if( min >= max-0.1 ) { min = -80.0; min = 6.0; }
193 case AUTOGROUPTYPE_VIDEO_FADE:
195 min = MIN(min, edl->local_session->automation_mins[i]);
196 max = MAX(max, edl->local_session->automation_maxs[i]);
197 if( min >= max-0.1 ) { min = 0.0; min = 100.0; }
200 case AUTOGROUPTYPE_ZOOM:
202 min = floor(min*50)/100;
203 max = floor(max*200)/100;
206 case AUTOGROUPTYPE_SPEED:
208 min = floor(min*5)/100;
209 max = floor(max*300)/100;
212 case AUTOGROUPTYPE_X:
213 case AUTOGROUPTYPE_Y:
215 float scale = bmin(edl->session->output_w, edl->session->output_h);
216 min = floor((min+max)/2) - 0.5*scale;
217 max = floor((min+max)/2) + 0.5*scale;
221 //printf("%f %f\n", min, max);
222 if (!Automation::autogrouptypes_fixedrange[i])
224 edl->local_session->automation_mins[i] = min;
225 edl->local_session->automation_maxs[i] = max;
229 // Show range in zoombar
230 gui->zoombar->update();
233 gui->draw_overlays(1);
237 void MWindow::change_currentautorange(int autogrouptype, int increment, int changemax)
241 val = edl->local_session->automation_maxs[autogrouptype];
243 val = edl->local_session->automation_mins[autogrouptype];
248 switch (autogrouptype) {
249 case AUTOGROUPTYPE_AUDIO_FADE:
252 case AUTOGROUPTYPE_VIDEO_FADE:
255 case AUTOGROUPTYPE_ZOOM:
256 case AUTOGROUPTYPE_SPEED:
262 case AUTOGROUPTYPE_X:
263 case AUTOGROUPTYPE_Y:
264 val = floor(val + 50);
270 switch (autogrouptype) {
271 case AUTOGROUPTYPE_AUDIO_FADE:
274 case AUTOGROUPTYPE_VIDEO_FADE:
277 case AUTOGROUPTYPE_ZOOM:
278 case AUTOGROUPTYPE_SPEED:
279 if (val > 0) val = val/2;
281 case AUTOGROUPTYPE_X:
282 case AUTOGROUPTYPE_Y:
288 AUTOMATIONVIEWCLAMPS(val, autogrouptype);
291 if (val > edl->local_session->automation_mins[autogrouptype])
292 edl->local_session->automation_maxs[autogrouptype] = val;
296 if (val < edl->local_session->automation_maxs[autogrouptype])
297 edl->local_session->automation_mins[autogrouptype] = val;
301 void MWindow::update_autorange(int type, int increment, int use_max)
303 gui->lock_window("MWindow::update_autorange");
304 int group = Automation::autogrouptype(type, 0);
305 change_currentautorange(group, increment, use_max);
306 int color = GWindowGUI::auto_colors[type];
307 gui->zoombar->update_autozoom(group, color);
308 gui->draw_overlays(0);
309 gui->update_patchbay();
310 gui->flash_canvas(1);
311 gui->unlock_window();
314 void MWindow::expand_autos(int changeall, int domin, int domax)
317 for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
318 if (domin) change_currentautorange(i, 1, 0);
319 if (domax) change_currentautorange(i, 1, 1);
323 if (domin) change_currentautorange(edl->local_session->zoombar_showautotype, 1, 0);
324 if (domax) change_currentautorange(edl->local_session->zoombar_showautotype, 1, 1);
326 gui->zoombar->update_autozoom();
327 gui->draw_overlays(0);
328 gui->update_patchbay();
329 gui->flash_canvas(1);
332 void MWindow::shrink_autos(int changeall, int domin, int domax)
335 for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
336 if (domin) change_currentautorange(i, 0, 0);
337 if (domax) change_currentautorange(i, 0, 1);
341 if (domin) change_currentautorange(edl->local_session->zoombar_showautotype, 0, 0);
342 if (domax) change_currentautorange(edl->local_session->zoombar_showautotype, 0, 1);
344 gui->zoombar->update_autozoom();
345 gui->draw_overlays(0);
346 gui->update_patchbay();
347 gui->flash_canvas(1);
351 void MWindow::zoom_autos(float min, float max)
353 int i = edl->local_session->zoombar_showautotype;
354 edl->local_session->automation_mins[i] = min;
355 edl->local_session->automation_maxs[i] = max;
356 gui->zoombar->update_autozoom();
357 gui->draw_overlays(1);
361 void MWindow::zoom_amp(int64_t zoom_amp)
363 edl->local_session->zoom_y = zoom_amp;
364 gui->draw_canvas(0, 0);
365 gui->flash_canvas(0);
366 gui->update_patchbay();
370 void MWindow::zoom_atrack(int64_t zoom)
372 int64_t old_zoom = edl->local_session->zoom_atrack;
373 CLAMP(zoom, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM);
374 edl->local_session->zoom_atrack = zoom;
376 edl->local_session->zoom_atrack = zoom;
377 for( Track *track= edl->tracks->first; track; track=track->next ) {
378 if( track->data_type != TRACK_AUDIO ) continue;
379 track->data_h = zoom;
381 // shift row position
382 for( int i=0; i<TOTAL_PANES; ++i ) edl->local_session->track_start[i] =
383 (edl->local_session->track_start[i] * zoom) / old_zoom;
384 edl->tracks->update_y_pixels(theme);
385 gui->draw_trackmovement();
388 void MWindow::zoom_vtrack(int64_t zoom)
390 int64_t old_zoom = edl->local_session->zoom_vtrack;
391 CLAMP(zoom, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM);
392 edl->local_session->zoom_vtrack = zoom;
394 for( Track *track= edl->tracks->first; track; track=track->next ) {
395 if( track->data_type != TRACK_VIDEO ) continue;
396 track->data_h = zoom;
398 // shift row position
399 for( int i=0; i<TOTAL_PANES; ++i ) edl->local_session->track_start[i] =
400 (edl->local_session->track_start[i] * zoom) / old_zoom;
401 edl->tracks->update_y_pixels(theme);
402 gui->draw_trackmovement();
405 void MWindow::trackmovement(int offset, int pane_number)
407 edl->local_session->track_start[pane_number] += offset;
408 if(edl->local_session->track_start[pane_number] < 0)
409 edl->local_session->track_start[pane_number] = 0;
411 if(pane_number == TOP_RIGHT_PANE ||
412 pane_number == TOP_LEFT_PANE)
414 edl->local_session->track_start[TOP_LEFT_PANE] =
415 edl->local_session->track_start[TOP_RIGHT_PANE] =
416 edl->local_session->track_start[pane_number];
419 if(pane_number == BOTTOM_RIGHT_PANE ||
420 pane_number == BOTTOM_LEFT_PANE)
422 edl->local_session->track_start[BOTTOM_LEFT_PANE] =
423 edl->local_session->track_start[BOTTOM_RIGHT_PANE] =
424 edl->local_session->track_start[pane_number];
428 edl->tracks->update_y_pixels(theme);
429 gui->draw_trackmovement();
432 void MWindow::move_up(int64_t distance)
434 TimelinePane *pane = gui->get_focused_pane();
435 if(distance == 0) distance = pane->canvas->get_h() / 10;
436 trackmovement(-distance, pane->number);
439 void MWindow::move_down(int64_t distance)
441 TimelinePane *pane = gui->get_focused_pane();
442 if(distance == 0) distance = pane->canvas->get_h() / 10;
443 trackmovement(distance, pane->number);
446 int MWindow::goto_end()
448 TimelinePane *pane = gui->get_focused_pane();
449 int64_t old_view_start = edl->local_session->view_start[pane->number];
451 if( edl->tracks->total_length() > (double)pane->canvas->get_w() *
452 edl->local_session->zoom_sample / edl->session->sample_rate ) {
453 edl->local_session->view_start[pane->number] =
454 Units::round(edl->tracks->total_length() *
455 edl->session->sample_rate /
456 edl->local_session->zoom_sample -
457 pane->canvas->get_w() /
462 edl->local_session->view_start[pane->number] = 0;
465 if(gui->shift_down())
467 edl->local_session->set_selectionend(edl->tracks->total_length());
471 edl->local_session->set_selectionstart(edl->tracks->total_length());
472 edl->local_session->set_selectionend(edl->tracks->total_length());
475 if(edl->local_session->view_start[pane->number] != old_view_start)
477 samplemovement(edl->local_session->view_start[pane->number], pane->number);
478 gui->draw_samplemovement();
481 update_plugin_guis();
483 gui->update_patchbay();
484 gui->update_cursor();
485 gui->activate_timeline();
486 gui->zoombar->update();
487 gui->update_timebar(1);
488 cwindow->update(1, 0, 0, 0, 1);
492 int MWindow::goto_start()
494 TimelinePane *pane = gui->get_focused_pane();
495 int64_t old_view_start = edl->local_session->view_start[pane->number];
497 edl->local_session->view_start[pane->number] = 0;
498 if(gui->shift_down())
500 edl->local_session->set_selectionstart(0);
504 edl->local_session->set_selectionstart(0);
505 edl->local_session->set_selectionend(0);
508 if(edl->local_session->view_start[pane->number] != old_view_start)
510 samplemovement(edl->local_session->view_start[pane->number], pane->number);
511 gui->draw_samplemovement();
514 update_plugin_guis();
515 gui->update_patchbay();
516 gui->update_cursor();
517 gui->activate_timeline();
518 gui->zoombar->update();
519 gui->update_timebar(1);
520 cwindow->update(1, 0, 0, 0, 1);
524 int MWindow::goto_position(double position)
526 position = edl->align_to_frame(position, 0);
527 if( position < 0 ) position = 0;
528 select_point(position);
529 gui->activate_timeline();
533 int MWindow::samplemovement(int64_t view_start, int pane_number)
535 if( view_start < 0 ) view_start = 0;
536 edl->local_session->view_start[pane_number] = view_start;
537 if(edl->local_session->view_start[pane_number] < 0)
538 edl->local_session->view_start[pane_number] = 0;
540 if(pane_number == TOP_LEFT_PANE ||
541 pane_number == BOTTOM_LEFT_PANE)
543 edl->local_session->view_start[TOP_LEFT_PANE] =
544 edl->local_session->view_start[BOTTOM_LEFT_PANE] =
545 edl->local_session->view_start[pane_number];
549 edl->local_session->view_start[TOP_RIGHT_PANE] =
550 edl->local_session->view_start[BOTTOM_RIGHT_PANE] =
551 edl->local_session->view_start[pane_number];
554 gui->draw_samplemovement();
559 int MWindow::move_left(int64_t distance)
561 TimelinePane *pane = gui->get_focused_pane();
563 distance = pane->canvas->get_w() / 10;
564 edl->local_session->view_start[pane->number] -= distance;
565 samplemovement(edl->local_session->view_start[pane->number],
570 int MWindow::move_right(int64_t distance)
572 TimelinePane *pane = gui->get_focused_pane();
574 distance = pane->canvas->get_w() / 10;
575 edl->local_session->view_start[pane->number] += distance;
576 samplemovement(edl->local_session->view_start[pane->number],
581 void MWindow::select_all()
583 if( edl->local_session->get_selectionstart(1) == 0 &&
584 edl->local_session->get_selectionend(1) == edl->tracks->total_length() )
585 edl->local_session->set_selectionend(0);
587 edl->local_session->set_selectionstart(0);
588 edl->local_session->set_selectionend(edl->tracks->total_length());
590 gui->update(0, NORMAL_DRAW, 1, 1, 0, 1, 0);
591 gui->activate_timeline();
592 cwindow->update(1, 0, 0, 0, 1);
593 update_plugin_guis();
596 int MWindow::next_label(int shift_down)
598 double position = edl->local_session->get_selectionend(1);
599 double total_length = edl->tracks->total_length();
600 Label *current = edl->labels->next_label(position);
601 double new_position = current ? current->position : total_length;
602 // last playback endpoints as fake label positions
603 double playback_start = edl->local_session->playback_start;
604 double playback_end = edl->local_session->playback_end;
605 if( playback_start > position && playback_start < new_position )
606 new_position = playback_start;
607 else if( playback_end > position && playback_end < new_position )
608 new_position = playback_end;
609 if( new_position > total_length )
610 new_position = total_length;
611 edl->local_session->set_selectionend(new_position);
612 //printf("MWindow::next_edit_handle %d\n", shift_down);
614 edl->local_session->set_selectionstart(new_position);
615 return find_selection(new_position);
618 int MWindow::prev_label(int shift_down)
620 double position = edl->local_session->get_selectionstart(1);
621 Label *current = edl->labels->prev_label(position);
622 double new_position = current ? current->position : 0;
623 // last playback endpoints as fake label positions
624 double playback_start = edl->local_session->playback_start;
625 double playback_end = edl->local_session->playback_end;
626 if( playback_end < position && playback_end > new_position )
627 new_position = playback_end;
628 else if( playback_start < position && playback_start > new_position )
629 new_position = playback_start;
630 if( new_position < 0 )
632 edl->local_session->set_selectionstart(new_position);
633 //printf("MWindow::next_edit_handle %d\n", shift_down);
635 edl->local_session->set_selectionend(new_position);
636 return find_selection(new_position);
639 int MWindow::next_edit_handle(int shift_down)
641 double position = edl->local_session->get_selectionend(1);
642 double new_position = edl->next_edit(position);
643 double total_length = edl->tracks->total_length();
644 if( new_position >= total_length )
645 new_position = total_length;
646 edl->local_session->set_selectionend(new_position);
647 //printf("MWindow::next_edit_handle %d\n", shift_down);
649 edl->local_session->set_selectionstart(new_position);
650 return find_selection(new_position);
653 int MWindow::prev_edit_handle(int shift_down)
655 double position = edl->local_session->get_selectionstart(1);
656 double new_position = edl->prev_edit(position);
657 if( new_position < 0 )
659 edl->local_session->set_selectionstart(new_position);
661 edl->local_session->set_selectionend(new_position);
662 return find_selection(new_position);
665 int MWindow::nearest_plugin_keyframe(int shift_down, int dir)
667 KeyFrame *keyframe = 0;
668 double start = edl->local_session->get_selectionstart(1);
669 double end = edl->local_session->get_selectionend(1);
670 double position = dir == PLAY_FORWARD ? end : start;
671 double new_position = dir == PLAY_FORWARD ? start : end;
672 for( Track *track=edl->tracks->first; track; track=track->next ) {
673 if( !track->is_armed() ) continue;
674 for( int i=0; i<track->plugin_set.size(); ++i ) {
675 PluginSet *plugin_set = track->plugin_set[i];
676 int64_t pos = track->to_units(position, 0);
677 KeyFrame *key = plugin_set->nearest_keyframe(pos, dir);
679 double key_position = track->from_units(key->position);
680 if( keyframe && (dir == PLAY_FORWARD ?
681 key_position >= new_position :
682 new_position >= key_position ) ) continue;
683 keyframe = key; new_position = key_position;
687 new_position = keyframe ?
688 keyframe->autos->track->from_units(keyframe->position) :
689 dir == PLAY_FORWARD ? edl->tracks->total_length() : 0;
692 start = end = new_position;
693 else if( dir == PLAY_FORWARD )
696 start = new_position;
698 edl->local_session->set_selectionstart(start);
699 edl->local_session->set_selectionend(end);
700 return find_selection(new_position);
703 int MWindow::nearest_auto_keyframe(int shift_down, int dir)
706 double start = edl->local_session->get_selectionstart(1);
707 double end = edl->local_session->get_selectionend(1);
708 double position = dir == PLAY_FORWARD ? end : start;
709 double new_position = dir == PLAY_FORWARD ? start : end;
710 for( Track *track=edl->tracks->first; track; track=track->next ) {
711 if( !track->is_armed() ) continue;
712 int64_t pos = track->to_units(position, 0);
713 for( int i=0; i<AUTOMATION_TOTAL; ++i ) {
714 Autos *autos = track->automation->autos[i];
715 if( !autos ) continue;
716 Auto *key = dir == PLAY_FORWARD ?
717 autos->nearest_after(pos) :
718 autos->nearest_before(pos);
720 double key_position = track->from_units(key->position);
721 if( keyframe && (dir == PLAY_FORWARD ?
722 key_position >= new_position :
723 new_position >= key_position ) ) continue;
724 keyframe = key; new_position = key_position;
728 new_position = keyframe ?
729 keyframe->autos->track->from_units(keyframe->position) :
730 dir == PLAY_FORWARD ? edl->tracks->total_length() : 0;
733 start = end = new_position;
734 else if( dir == PLAY_FORWARD )
737 start = new_position;
739 edl->local_session->set_selectionstart(start);
740 edl->local_session->set_selectionend(end);
741 return find_selection(new_position);
744 int MWindow::find_selection(double position, int scroll_display)
746 update_plugin_guis();
747 TimelinePane *pane = gui->get_focused_pane();
748 double pixel_zoom = (double)edl->session->sample_rate / edl->local_session->zoom_sample;
749 if( !scroll_display ) {
750 double timeline_start = edl->local_session->view_start[pane->number] / pixel_zoom;
751 double timeline_end = timeline_start + pane->canvas->time_visible();
752 if( position >= timeline_end || position < timeline_start )
755 if( scroll_display ) {
756 samplemovement((int64_t)(position * pixel_zoom - pane->canvas->get_w() / 2), pane->number);
757 cwindow->update(1, 0, 0, 0, 0);
760 gui->update_patchbay();
761 gui->update_timebar(0);
764 gui->zoombar->update();
765 gui->flash_canvas(1);
766 cwindow->update(1, 0, 0, 0, 1);
771 double MWindow::get_position()
773 return edl->local_session->get_selectionstart(1);
776 void MWindow::set_position(double position)
778 if( position != get_position() ) {
779 if( position < 0 ) position = 0;
780 edl->local_session->set_selectionstart(position);
781 edl->local_session->set_selectionend(position);
784 gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0);
785 gui->unlock_window();
786 cwindow->update(1, 0, 0, 0, 0);
791 double MWindow::get_timecode_offset()
793 return edl->session->timecode_offset;
796 void MWindow::set_timecode_offset(double offset)
798 edl->session->time_format = TIME_TIMECODE;
799 edl->session->timecode_offset = offset;
801 gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0);
802 gui->unlock_window();
803 cwindow->update(1, 0, 0, 0, 0);
807 int MWindow::expand_y()
809 int result = edl->local_session->zoom_y * 2;
810 result = MIN(result, MAX_AMP_ZOOM);
812 gui->zoombar->update();
816 int MWindow::zoom_in_y()
818 int result = edl->local_session->zoom_y / 2;
819 result = MAX(result, MIN_AMP_ZOOM);
821 gui->zoombar->update();
825 int MWindow::expand_t()
827 int zoom = edl->local_session->zoom_atrack * 2;
828 zoom = MIN(zoom, MAX_TRACK_ZOOM);
830 zoom = edl->local_session->zoom_vtrack * 2;
831 zoom = MIN(zoom, MAX_TRACK_ZOOM);
833 gui->zoombar->update();
837 int MWindow::zoom_in_t()
839 int zoom = edl->local_session->zoom_atrack / 2;
840 zoom = MAX(zoom, MIN_TRACK_ZOOM);
842 zoom = edl->local_session->zoom_vtrack / 2;
843 zoom = MAX(zoom, MIN_TRACK_ZOOM);
845 gui->zoombar->update();
849 void MWindow::split_x()
851 gui->resource_thread->stop_draw(1);
853 if(gui->pane[TOP_RIGHT_PANE])
855 gui->delete_x_pane(theme->mcanvas_w);
856 edl->local_session->x_pane = -1;
860 gui->create_x_pane(theme->mcanvas_w / 2);
861 edl->local_session->x_pane = theme->mcanvas_w / 2;
864 gui->mainmenu->update_toggles(0);
865 gui->update_pane_dividers();
866 gui->update_cursor();
867 gui->draw_samplemovement();
868 // required to get new widgets to appear
871 gui->resource_thread->start_draw();
874 void MWindow::split_y()
876 gui->resource_thread->stop_draw(1);
877 if(gui->pane[BOTTOM_LEFT_PANE])
879 gui->delete_y_pane(theme->mcanvas_h);
880 edl->local_session->y_pane = -1;
884 gui->create_y_pane(theme->mcanvas_h / 2);
885 edl->local_session->y_pane = theme->mcanvas_h / 2;
888 gui->mainmenu->update_toggles(0);
889 gui->update_pane_dividers();
890 gui->update_cursor();
891 gui->draw_trackmovement();
892 // required to get new widgets to appear
894 gui->resource_thread->start_draw();