4 * Copyright (C) 1997-2014 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
22 #include "automation.h"
25 #include "cplayback.h"
27 #include "cwindowgui.h"
30 #include "edlsession.h"
31 #include "gwindowgui.h"
34 #include "localsession.h"
35 #include "maincursor.h"
37 #include "mainsession.h"
40 #include "mwindowgui.h"
42 #include "playbackengine.h"
44 #include "pluginset.h"
45 #include "resourcethread.h"
46 #include "samplescroll.h"
48 #include "trackcanvas.h"
51 #include "transportque.h"
55 void MWindow::update_plugins()
57 // Show plugins which are visible and hide plugins which aren't
58 // Update plugin pointers in plugin servers
62 int MWindow::expand_sample()
66 if(edl->local_session->zoom_sample < 0x100000)
68 edl->local_session->zoom_sample *= 2;
69 gui->zoombar->sample_zoom->update(edl->local_session->zoom_sample);
70 zoom_sample(edl->local_session->zoom_sample);
76 int MWindow::zoom_in_sample()
80 if(edl->local_session->zoom_sample > 1)
82 edl->local_session->zoom_sample /= 2;
83 gui->zoombar->sample_zoom->update(edl->local_session->zoom_sample);
84 zoom_sample(edl->local_session->zoom_sample);
90 int MWindow::zoom_sample(int64_t zoom_sample)
92 CLAMP(zoom_sample, 1, 0x100000);
93 edl->local_session->zoom_sample = zoom_sample;
96 TimelinePane *pane = gui->get_focused_pane();
97 samplemovement(edl->local_session->view_start[pane->number], pane->number);
101 void MWindow::find_cursor()
103 TimelinePane *pane = gui->get_focused_pane();
104 edl->local_session->view_start[pane->number] =
105 Units::round((edl->local_session->get_selectionend(1) +
106 edl->local_session->get_selectionstart(1)) /
108 edl->session->sample_rate /
109 edl->local_session->zoom_sample -
110 (double)pane->canvas->get_w() /
113 if(edl->local_session->view_start[pane->number] < 0)
114 edl->local_session->view_start[pane->number] = 0;
118 void MWindow::fit_selection()
120 if(EQUIV(edl->local_session->get_selectionstart(1),
121 edl->local_session->get_selectionend(1)))
123 double total_samples = edl->tracks->total_length() *
124 edl->session->sample_rate;
125 TimelinePane *pane = gui->get_focused_pane();
126 for(edl->local_session->zoom_sample = 1;
127 pane->canvas->get_w() * edl->local_session->zoom_sample < total_samples;
128 edl->local_session->zoom_sample *= 2)
133 double total_samples = (edl->local_session->get_selectionend(1) -
134 edl->local_session->get_selectionstart(1)) *
135 edl->session->sample_rate;
136 TimelinePane *pane = gui->get_focused_pane();
137 for(edl->local_session->zoom_sample = 1;
138 pane->canvas->get_w() * edl->local_session->zoom_sample < total_samples;
139 edl->local_session->zoom_sample *= 2)
143 edl->local_session->zoom_sample = MIN(0x100000,
144 edl->local_session->zoom_sample);
145 zoom_sample(edl->local_session->zoom_sample);
149 void MWindow::fit_autos(int all)
151 float min = 0, max = 0;
155 if(EQUIV(edl->local_session->get_selectionstart(1),
156 edl->local_session->get_selectionend(1)))
159 end = edl->tracks->total_length();
162 // Test autos in highlighting only
164 start = edl->local_session->get_selectionstart(1);
165 end = edl->local_session->get_selectionend(1);
168 int forstart = edl->local_session->zoombar_showautotype;
169 int forend = edl->local_session->zoombar_showautotype + 1;
173 forend = AUTOGROUPTYPE_COUNT;
176 for (int i = forstart; i < forend; i++)
178 // Adjust min and max
179 edl->tracks->get_automation_extents(&min, &max, start, end, i);
180 //printf("MWindow::fit_autos %d %f %f results in ", i, min, max);
182 float range = max - min;
185 case AUTOGROUPTYPE_AUDIO_FADE:
187 min = MIN(min, edl->local_session->automation_mins[i]);
188 max = MAX(max, edl->local_session->automation_maxs[i]);
189 if( min >= max-0.1 ) { min = -80.0; min = 6.0; }
192 case AUTOGROUPTYPE_VIDEO_FADE:
194 min = MIN(min, edl->local_session->automation_mins[i]);
195 max = MAX(max, edl->local_session->automation_maxs[i]);
196 if( min >= max-0.1 ) { min = 0.0; min = 100.0; }
199 case AUTOGROUPTYPE_ZOOM:
201 min = floor(min*50)/100;
202 max = floor(max*200)/100;
205 case AUTOGROUPTYPE_SPEED:
207 min = floor(min*5)/100;
208 max = floor(max*300)/100;
211 case AUTOGROUPTYPE_X:
212 case AUTOGROUPTYPE_Y:
214 float scale = bmin(edl->session->output_w, edl->session->output_h);
215 min = floor((min+max)/2) - 0.5*scale;
216 max = floor((min+max)/2) + 0.5*scale;
220 //printf("%f %f\n", min, max);
221 if (!Automation::autogrouptypes_fixedrange[i])
223 edl->local_session->automation_mins[i] = min;
224 edl->local_session->automation_maxs[i] = max;
228 // Show range in zoombar
229 gui->zoombar->update();
232 gui->draw_overlays(1);
236 void MWindow::change_currentautorange(int autogrouptype, int increment, int changemax)
240 val = edl->local_session->automation_maxs[autogrouptype];
242 val = edl->local_session->automation_mins[autogrouptype];
247 switch (autogrouptype) {
248 case AUTOGROUPTYPE_AUDIO_FADE:
251 case AUTOGROUPTYPE_VIDEO_FADE:
254 case AUTOGROUPTYPE_ZOOM:
255 case AUTOGROUPTYPE_SPEED:
261 case AUTOGROUPTYPE_X:
262 case AUTOGROUPTYPE_Y:
263 val = floor(val + 50);
269 switch (autogrouptype) {
270 case AUTOGROUPTYPE_AUDIO_FADE:
273 case AUTOGROUPTYPE_VIDEO_FADE:
276 case AUTOGROUPTYPE_ZOOM:
277 case AUTOGROUPTYPE_SPEED:
278 if (val > 0) val = val/2;
280 case AUTOGROUPTYPE_X:
281 case AUTOGROUPTYPE_Y:
287 AUTOMATIONVIEWCLAMPS(val, autogrouptype);
290 if (val > edl->local_session->automation_mins[autogrouptype])
291 edl->local_session->automation_maxs[autogrouptype] = val;
295 if (val < edl->local_session->automation_maxs[autogrouptype])
296 edl->local_session->automation_mins[autogrouptype] = val;
300 void MWindow::update_autorange(int type, int increment, int use_max)
302 gui->lock_window("MWindow::update_autorange");
303 int group = Automation::autogrouptype(type, 0);
304 change_currentautorange(group, increment, use_max);
305 int color = GWindowGUI::auto_colors[type];
306 gui->zoombar->update_autozoom(group, color);
307 gui->draw_overlays(0);
308 gui->update_patchbay();
309 gui->flash_canvas(1);
310 gui->unlock_window();
313 void MWindow::expand_autos(int changeall, int domin, int domax)
316 for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
317 if (domin) change_currentautorange(i, 1, 0);
318 if (domax) change_currentautorange(i, 1, 1);
322 if (domin) change_currentautorange(edl->local_session->zoombar_showautotype, 1, 0);
323 if (domax) change_currentautorange(edl->local_session->zoombar_showautotype, 1, 1);
325 gui->zoombar->update_autozoom();
326 gui->draw_overlays(0);
327 gui->update_patchbay();
328 gui->flash_canvas(1);
331 void MWindow::shrink_autos(int changeall, int domin, int domax)
334 for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
335 if (domin) change_currentautorange(i, 0, 0);
336 if (domax) change_currentautorange(i, 0, 1);
340 if (domin) change_currentautorange(edl->local_session->zoombar_showautotype, 0, 0);
341 if (domax) change_currentautorange(edl->local_session->zoombar_showautotype, 0, 1);
343 gui->zoombar->update_autozoom();
344 gui->draw_overlays(0);
345 gui->update_patchbay();
346 gui->flash_canvas(1);
350 void MWindow::zoom_autos(float min, float max)
352 int i = edl->local_session->zoombar_showautotype;
353 edl->local_session->automation_mins[i] = min;
354 edl->local_session->automation_maxs[i] = max;
355 gui->zoombar->update_autozoom();
356 gui->draw_overlays(1);
360 void MWindow::zoom_amp(int64_t zoom_amp)
362 edl->local_session->zoom_y = zoom_amp;
363 gui->draw_canvas(0, 0);
364 gui->flash_canvas(0);
365 gui->update_patchbay();
369 void MWindow::zoom_atrack(int64_t zoom)
371 int64_t old_zoom = edl->local_session->zoom_atrack;
372 CLAMP(zoom, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM);
373 edl->local_session->zoom_atrack = zoom;
375 edl->local_session->zoom_atrack = zoom;
376 for( Track *track= edl->tracks->first; track; track=track->next ) {
377 if( track->data_type != TRACK_AUDIO ) continue;
378 track->data_h = zoom;
380 // shift row position
381 for( int i=0; i<TOTAL_PANES; ++i ) edl->local_session->track_start[i] =
382 (edl->local_session->track_start[i] * zoom) / old_zoom;
383 edl->tracks->update_y_pixels(theme);
384 gui->draw_trackmovement();
387 void MWindow::zoom_vtrack(int64_t zoom)
389 int64_t old_zoom = edl->local_session->zoom_vtrack;
390 CLAMP(zoom, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM);
391 edl->local_session->zoom_vtrack = zoom;
393 for( Track *track= edl->tracks->first; track; track=track->next ) {
394 if( track->data_type != TRACK_VIDEO ) continue;
395 track->data_h = zoom;
397 // shift row position
398 for( int i=0; i<TOTAL_PANES; ++i ) edl->local_session->track_start[i] =
399 (edl->local_session->track_start[i] * zoom) / old_zoom;
400 edl->tracks->update_y_pixels(theme);
401 gui->draw_trackmovement();
404 void MWindow::trackmovement(int offset, int pane_number)
406 edl->local_session->track_start[pane_number] += offset;
407 if(edl->local_session->track_start[pane_number] < 0)
408 edl->local_session->track_start[pane_number] = 0;
410 if(pane_number == TOP_RIGHT_PANE ||
411 pane_number == TOP_LEFT_PANE)
413 edl->local_session->track_start[TOP_LEFT_PANE] =
414 edl->local_session->track_start[TOP_RIGHT_PANE] =
415 edl->local_session->track_start[pane_number];
418 if(pane_number == BOTTOM_RIGHT_PANE ||
419 pane_number == BOTTOM_LEFT_PANE)
421 edl->local_session->track_start[BOTTOM_LEFT_PANE] =
422 edl->local_session->track_start[BOTTOM_RIGHT_PANE] =
423 edl->local_session->track_start[pane_number];
427 edl->tracks->update_y_pixels(theme);
428 gui->draw_trackmovement();
431 void MWindow::move_up(int64_t distance)
433 TimelinePane *pane = gui->get_focused_pane();
434 if(distance == 0) distance = pane->canvas->get_h() / 10;
435 trackmovement(-distance, pane->number);
438 void MWindow::move_down(int64_t distance)
440 TimelinePane *pane = gui->get_focused_pane();
441 if(distance == 0) distance = pane->canvas->get_h() / 10;
442 trackmovement(distance, pane->number);
445 int MWindow::goto_end()
447 TimelinePane *pane = gui->get_focused_pane();
448 int64_t old_view_start = edl->local_session->view_start[pane->number];
450 if( edl->tracks->total_length() > (double)pane->canvas->get_w() *
451 edl->local_session->zoom_sample / edl->session->sample_rate ) {
452 edl->local_session->view_start[pane->number] =
453 Units::round(edl->tracks->total_length() *
454 edl->session->sample_rate /
455 edl->local_session->zoom_sample -
456 pane->canvas->get_w() /
461 edl->local_session->view_start[pane->number] = 0;
464 if(gui->shift_down())
466 edl->local_session->set_selectionend(edl->tracks->total_length());
470 edl->local_session->set_selectionstart(edl->tracks->total_length());
471 edl->local_session->set_selectionend(edl->tracks->total_length());
474 if(edl->local_session->view_start[pane->number] != old_view_start)
476 samplemovement(edl->local_session->view_start[pane->number], pane->number);
477 gui->draw_samplemovement();
480 update_plugin_guis();
482 gui->update_patchbay();
483 gui->update_cursor();
484 gui->activate_timeline();
485 gui->zoombar->update();
486 gui->update_timebar(1);
487 cwindow->update(1, 0, 0, 0, 1);
491 int MWindow::goto_start()
493 TimelinePane *pane = gui->get_focused_pane();
494 int64_t old_view_start = edl->local_session->view_start[pane->number];
496 edl->local_session->view_start[pane->number] = 0;
497 if(gui->shift_down())
499 edl->local_session->set_selectionstart(0);
503 edl->local_session->set_selectionstart(0);
504 edl->local_session->set_selectionend(0);
507 if(edl->local_session->view_start[pane->number] != old_view_start)
509 samplemovement(edl->local_session->view_start[pane->number], pane->number);
510 gui->draw_samplemovement();
513 update_plugin_guis();
514 gui->update_patchbay();
515 gui->update_cursor();
516 gui->activate_timeline();
517 gui->zoombar->update();
518 gui->update_timebar(1);
519 cwindow->update(1, 0, 0, 0, 1);
523 int MWindow::goto_position(double position)
525 position = edl->align_to_frame(position, 0);
526 if( position < 0 ) position = 0;
527 select_point(position);
528 gui->activate_timeline();
532 int MWindow::samplemovement(int64_t view_start, int pane_number)
534 if( view_start < 0 ) view_start = 0;
535 edl->local_session->view_start[pane_number] = view_start;
536 if(edl->local_session->view_start[pane_number] < 0)
537 edl->local_session->view_start[pane_number] = 0;
539 if(pane_number == TOP_LEFT_PANE ||
540 pane_number == BOTTOM_LEFT_PANE)
542 edl->local_session->view_start[TOP_LEFT_PANE] =
543 edl->local_session->view_start[BOTTOM_LEFT_PANE] =
544 edl->local_session->view_start[pane_number];
548 edl->local_session->view_start[TOP_RIGHT_PANE] =
549 edl->local_session->view_start[BOTTOM_RIGHT_PANE] =
550 edl->local_session->view_start[pane_number];
553 gui->draw_samplemovement();
558 int MWindow::move_left(int64_t distance)
560 TimelinePane *pane = gui->get_focused_pane();
562 distance = pane->canvas->get_w() / 10;
563 edl->local_session->view_start[pane->number] -= distance;
564 samplemovement(edl->local_session->view_start[pane->number],
569 int MWindow::move_right(int64_t distance)
571 TimelinePane *pane = gui->get_focused_pane();
573 distance = pane->canvas->get_w() / 10;
574 edl->local_session->view_start[pane->number] += distance;
575 samplemovement(edl->local_session->view_start[pane->number],
580 void MWindow::select_all()
582 if( edl->local_session->get_selectionstart(1) == 0 &&
583 edl->local_session->get_selectionend(1) == edl->tracks->total_length() )
584 edl->local_session->set_selectionend(0);
586 edl->local_session->set_selectionstart(0);
587 edl->local_session->set_selectionend(edl->tracks->total_length());
589 gui->update(0, NORMAL_DRAW, 1, 1, 0, 1, 0);
590 gui->activate_timeline();
591 cwindow->update(1, 0, 0, 0, 1);
592 update_plugin_guis();
595 int MWindow::next_label(int shift_down)
597 double position = edl->local_session->get_selectionend(1);
598 double total_length = edl->tracks->total_length();
599 Label *current = edl->labels->next_label(position);
600 double new_position = current ? current->position : total_length;
601 // last playback endpoints as fake label positions
602 double playback_start = edl->local_session->playback_start;
603 double playback_end = edl->local_session->playback_end;
604 if( playback_start > position && playback_start < new_position )
605 new_position = playback_start;
606 else if( playback_end > position && playback_end < new_position )
607 new_position = playback_end;
608 if( new_position > total_length )
609 new_position = total_length;
610 edl->local_session->set_selectionend(new_position);
611 //printf("MWindow::next_edit_handle %d\n", shift_down);
613 edl->local_session->set_selectionstart(new_position);
614 return find_selection(new_position);
617 int MWindow::prev_label(int shift_down)
619 double position = edl->local_session->get_selectionstart(1);
620 Label *current = edl->labels->prev_label(position);
621 double new_position = current ? current->position : 0;
622 // last playback endpoints as fake label positions
623 double playback_start = edl->local_session->playback_start;
624 double playback_end = edl->local_session->playback_end;
625 if( playback_end < position && playback_end > new_position )
626 new_position = playback_end;
627 else if( playback_start < position && playback_start > new_position )
628 new_position = playback_start;
629 if( new_position < 0 )
631 edl->local_session->set_selectionstart(new_position);
632 //printf("MWindow::next_edit_handle %d\n", shift_down);
634 edl->local_session->set_selectionend(new_position);
635 return find_selection(new_position);
638 int MWindow::next_edit_handle(int shift_down)
640 double position = edl->local_session->get_selectionend(1);
641 double new_position = edl->next_edit(position);
642 double total_length = edl->tracks->total_length();
643 if( new_position >= total_length )
644 new_position = total_length;
645 edl->local_session->set_selectionend(new_position);
646 //printf("MWindow::next_edit_handle %d\n", shift_down);
648 edl->local_session->set_selectionstart(new_position);
649 return find_selection(new_position);
652 int MWindow::prev_edit_handle(int shift_down)
654 double position = edl->local_session->get_selectionstart(1);
655 double new_position = edl->prev_edit(position);
656 if( new_position < 0 )
658 edl->local_session->set_selectionstart(new_position);
660 edl->local_session->set_selectionend(new_position);
661 return find_selection(new_position);
664 int MWindow::nearest_plugin_keyframe(int shift_down, int dir)
666 KeyFrame *keyframe = 0;
667 double start = edl->local_session->get_selectionstart(1);
668 double end = edl->local_session->get_selectionend(1);
669 double position = dir == PLAY_FORWARD ? end : start;
670 double new_position = dir == PLAY_FORWARD ? start : end;
671 for( Track *track=edl->tracks->first; track; track=track->next ) {
672 if( !track->is_armed() ) continue;
673 for( int i=0; i<track->plugin_set.size(); ++i ) {
674 PluginSet *plugin_set = track->plugin_set[i];
675 int64_t pos = track->to_units(position, 0);
676 KeyFrame *key = plugin_set->nearest_keyframe(pos, dir);
678 double key_position = track->from_units(key->position);
679 if( keyframe && (dir == PLAY_FORWARD ?
680 key_position >= new_position :
681 new_position >= key_position ) ) continue;
682 keyframe = key; new_position = key_position;
686 new_position = keyframe ?
687 keyframe->autos->track->from_units(keyframe->position) :
688 dir == PLAY_FORWARD ? edl->tracks->total_length() : 0;
691 start = end = new_position;
692 else if( dir == PLAY_FORWARD )
695 start = new_position;
697 edl->local_session->set_selectionstart(start);
698 edl->local_session->set_selectionend(end);
699 return find_selection(new_position);
702 int MWindow::nearest_auto_keyframe(int shift_down, int dir)
705 double start = edl->local_session->get_selectionstart(1);
706 double end = edl->local_session->get_selectionend(1);
707 double position = dir == PLAY_FORWARD ? end : start;
708 double new_position = dir == PLAY_FORWARD ? start : end;
709 for( Track *track=edl->tracks->first; track; track=track->next ) {
710 if( !track->is_armed() ) continue;
711 int64_t pos = track->to_units(position, 0);
712 for( int i=0; i<AUTOMATION_TOTAL; ++i ) {
713 Autos *autos = track->automation->autos[i];
714 if( !autos ) continue;
715 Auto *key = dir == PLAY_FORWARD ?
716 autos->nearest_after(pos) :
717 autos->nearest_before(pos);
719 double key_position = track->from_units(key->position);
720 if( keyframe && (dir == PLAY_FORWARD ?
721 key_position >= new_position :
722 new_position >= key_position ) ) continue;
723 keyframe = key; new_position = key_position;
727 new_position = keyframe ?
728 keyframe->autos->track->from_units(keyframe->position) :
729 dir == PLAY_FORWARD ? edl->tracks->total_length() : 0;
732 start = end = new_position;
733 else if( dir == PLAY_FORWARD )
736 start = new_position;
738 edl->local_session->set_selectionstart(start);
739 edl->local_session->set_selectionend(end);
740 return find_selection(new_position);
743 int MWindow::find_selection(double position, int scroll_display)
745 update_plugin_guis();
746 TimelinePane *pane = gui->get_focused_pane();
747 double pixel_zoom = (double)edl->session->sample_rate / edl->local_session->zoom_sample;
748 if( !scroll_display ) {
749 double timeline_start = edl->local_session->view_start[pane->number] / pixel_zoom;
750 double timeline_end = timeline_start + pane->canvas->time_visible();
751 if( position >= timeline_end || position < timeline_start )
754 if( scroll_display ) {
755 samplemovement((int64_t)(position * pixel_zoom - pane->canvas->get_w() / 2), pane->number);
756 cwindow->update(1, 0, 0, 0, 0);
759 gui->update_patchbay();
760 gui->update_timebar(0);
763 gui->zoombar->update();
764 gui->flash_canvas(1);
765 cwindow->update(1, 0, 0, 0, 1);
770 double MWindow::get_position()
772 return edl->local_session->get_selectionstart(1);
775 void MWindow::set_position(double position)
777 if( position != get_position() ) {
778 if( position < 0 ) position = 0;
779 edl->local_session->set_selectionstart(position);
780 edl->local_session->set_selectionend(position);
783 gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0);
784 gui->unlock_window();
785 cwindow->update(1, 0, 0, 0, 0);
790 double MWindow::get_timecode_offset()
792 return edl->session->timecode_offset;
795 void MWindow::set_timecode_offset(double offset)
797 edl->session->time_format = TIME_TIMECODE;
798 edl->session->timecode_offset = offset;
800 gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0);
801 gui->unlock_window();
802 cwindow->update(1, 0, 0, 0, 0);
806 int MWindow::expand_y()
808 int result = edl->local_session->zoom_y * 2;
809 result = MIN(result, MAX_AMP_ZOOM);
811 gui->zoombar->update();
815 int MWindow::zoom_in_y()
817 int result = edl->local_session->zoom_y / 2;
818 result = MAX(result, MIN_AMP_ZOOM);
820 gui->zoombar->update();
824 int MWindow::expand_t()
826 int zoom = edl->local_session->zoom_atrack * 2;
827 zoom = MIN(zoom, MAX_TRACK_ZOOM);
829 zoom = edl->local_session->zoom_vtrack * 2;
830 zoom = MIN(zoom, MAX_TRACK_ZOOM);
832 gui->zoombar->update();
836 int MWindow::zoom_in_t()
838 int zoom = edl->local_session->zoom_atrack / 2;
839 zoom = MAX(zoom, MIN_TRACK_ZOOM);
841 zoom = edl->local_session->zoom_vtrack / 2;
842 zoom = MAX(zoom, MIN_TRACK_ZOOM);
844 gui->zoombar->update();
848 void MWindow::split_x()
850 gui->resource_thread->stop_draw(1);
852 if(gui->pane[TOP_RIGHT_PANE])
854 gui->delete_x_pane(theme->mcanvas_w);
855 edl->local_session->x_pane = -1;
859 gui->create_x_pane(theme->mcanvas_w / 2);
860 edl->local_session->x_pane = theme->mcanvas_w / 2;
863 gui->mainmenu->update_toggles(0);
864 gui->update_pane_dividers();
865 gui->update_cursor();
866 gui->draw_samplemovement();
867 // required to get new widgets to appear
870 gui->resource_thread->start_draw();
873 void MWindow::split_y()
875 gui->resource_thread->stop_draw(1);
876 if(gui->pane[BOTTOM_LEFT_PANE])
878 gui->delete_y_pane(theme->mcanvas_h);
879 edl->local_session->y_pane = -1;
883 gui->create_y_pane(theme->mcanvas_h / 2);
884 edl->local_session->y_pane = theme->mcanvas_h / 2;
887 gui->mainmenu->update_toggles(0);
888 gui->update_pane_dividers();
889 gui->update_cursor();
890 gui->draw_trackmovement();
891 // required to get new widgets to appear
893 gui->resource_thread->start_draw();