r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / timebar.C
blob04f00b200e742602fd3a37e9b0a971d1b02108dd
1 #include "clip.h"
2 #include "cplayback.h"
3 #include "cursors.h"
4 #include "cwindow.h"
5 #include "edl.h"
6 #include "edlsession.h"
7 #include "filexml.h"
8 #include "fonts.h"
9 #include "labels.h"
10 #include "localsession.h"
11 #include "mbuttons.h"
12 #include "mwindow.h"
13 #include "mwindowgui.h"
14 #include "patchbay.h"
15 #include "preferences.h"
16 #include "recordlabel.h"
17 #include "localsession.h"
18 #include "mainsession.h"
19 #include "theme.h"
20 #include "timebar.h"
21 #include "trackcanvas.h"
22 #include "tracks.h"
23 #include "transportque.h"
24 #include "units.h"
25 #include "vframe.h"
26 #include "vwindow.h"
27 #include "vwindowgui.h"
28 #include "zoombar.h"
31 LabelGUI::LabelGUI(MWindow *mwindow, 
32         TimeBar *timebar, 
33         int64_t pixel, 
34         int y, 
35         double position,
36         VFrame **data)
37  : BC_Toggle(translate_pixel(mwindow, pixel), 
38                 y, 
39                 data ? data : mwindow->theme->label_toggle,
40                 0)
42         this->mwindow = mwindow;
43         this->timebar = timebar;
44         this->gui = 0;
45         this->pixel = pixel;
46         this->position = position;
49 LabelGUI::~LabelGUI()
53 int LabelGUI::get_y(MWindow *mwindow, TimeBar *timebar)
55 //      if(timebar)
56 //              return 0;
57 //      else
59                 return timebar->get_h() - 
60                         mwindow->theme->label_toggle[0]->get_h();
63 int LabelGUI::translate_pixel(MWindow *mwindow, int pixel)
65         int result = pixel - mwindow->theme->label_toggle[0]->get_w() / 2;
66         return result;
69 void LabelGUI::reposition()
71         reposition_window(translate_pixel(mwindow, pixel), BC_Toggle::get_y());
74 int LabelGUI::handle_event()
76 //      update(1);
77         timebar->select_label(position);
78         return 1;
88 InPointGUI::InPointGUI(MWindow *mwindow, 
89         TimeBar *timebar, 
90         int64_t pixel, 
91         double position)
92  : LabelGUI(mwindow, 
93         timebar, 
94         pixel, 
95         get_y(mwindow, timebar), 
96         position, 
97         mwindow->theme->in_point)
99 //printf("InPointGUI::InPointGUI %d %d\n", pixel, get_y(mwindow, timebar));
101 InPointGUI::~InPointGUI()
104 int InPointGUI::get_y(MWindow *mwindow, TimeBar *timebar)
106         int result;
107         result = timebar->get_h() - 
108                 mwindow->theme->in_point[0]->get_h();
109         return result;
113 OutPointGUI::OutPointGUI(MWindow *mwindow, 
114         TimeBar *timebar, 
115         int64_t pixel, 
116         double position)
117  : LabelGUI(mwindow, 
118         timebar, 
119         pixel, 
120         get_y(mwindow, timebar), 
121         position, 
122         mwindow->theme->out_point)
124 //printf("OutPointGUI::OutPointGUI %d %d\n", pixel, get_y(mwindow, timebar));
126 OutPointGUI::~OutPointGUI()
129 int OutPointGUI::get_y(MWindow *mwindow, TimeBar *timebar)
131         return timebar->get_h() - 
132                 mwindow->theme->out_point[0]->get_h();
136 PresentationGUI::PresentationGUI(MWindow *mwindow, 
137         TimeBar *timebar, 
138         int64_t pixel, 
139         double position)
140  : LabelGUI(mwindow, timebar, pixel, get_y(mwindow, timebar), position)
143 PresentationGUI::~PresentationGUI()
153 TimeBar::TimeBar(MWindow *mwindow, 
154         BC_WindowBase *gui,
155         int x, 
156         int y,
157         int w,
158         int h)
159  : BC_SubWindow(x, y, w, h)
161 //printf("TimeBar::TimeBar %d %d %d %d\n", x, y, w, h);
162         this->gui = gui;
163         this->mwindow = mwindow;
166 TimeBar::~TimeBar()
168         if(in_point) delete in_point;
169         if(out_point) delete out_point;
170         labels.remove_all_objects();
171         presentations.remove_all_objects();
174 int TimeBar::create_objects()
176         in_point = 0;
177         out_point = 0;
178         current_operation = TIMEBAR_NONE;
179         update();
180         return 0;
184 int64_t TimeBar::position_to_pixel(double position)
186         get_edl_length();
187         return (int64_t)(position / time_per_pixel);
191 void TimeBar::update_labels()
193         int output = 0;
194         EDL *edl = get_edl();
196 //printf("TimeBar::update_labels 1\n");
197         if(edl)
198         {
199                 for(Label *current = edl->labels->first;
200                         current;
201                         current = NEXT)
202                 {
203 //printf("TimeBar::update_labels 1 %p\n", current);
204                         int64_t pixel = position_to_pixel(current->position);
205 //printf("TimeBar::update_labels 2 %d\n", pixel);
207                         if(pixel >= 0 && pixel < get_w())
208                         {
209 //printf("TimeBar::update_labels 3\n");
210 // Create new label
211                                 if(output >= labels.total)
212                                 {
213                                         LabelGUI *new_label;
214                                         add_subwindow(new_label = 
215                                                 new LabelGUI(mwindow, 
216                                                         this, 
217                                                         pixel, 
218                                                         LabelGUI::get_y(mwindow, this), 
219                                                         current->position));
220                                         new_label->set_cursor(ARROW_CURSOR);
221                                         labels.append(new_label);
222                                 }
223                                 else
224 // Reposition old label
225                                 {
226                                         LabelGUI *gui = labels.values[output];
227                                         if(gui->pixel != pixel)
228                                         {
229                                                 gui->pixel = pixel;
230                                                 gui->reposition();
231 //printf("TimeBar::update_labels 4 %d\n", pixel);
232                                         }
233                                         else
234                                         {
235                                                 gui->draw_face();
236                                         }
238                                         labels.values[output]->position = current->position;
239                                 }
241                                 if(edl->local_session->selectionstart <= current->position &&
242                                         edl->local_session->selectionend >= current->position)
243                                         labels.values[output]->update(1);
244                                 else
245                                 if(labels.values[output]->get_value())
246                                         labels.values[output]->update(0);
248                                 output++;
249                         }
250                 }
251         }
253 // Delete excess labels
254         while(labels.total > output)
255         {
256 //printf("TimeBar::update_labels 9\n");
257                 labels.remove_object();
258         }
259 //printf("TimeBar::update_labels 10\n");
262 void TimeBar::update_highlights()
264         for(int i = 0; i < labels.total; i++)
265         {
266                 LabelGUI *label = labels.values[i];
267                 if(mwindow->edl->equivalent(label->position, mwindow->edl->local_session->selectionstart) ||
268                         mwindow->edl->equivalent(label->position, mwindow->edl->local_session->selectionend))
269                 {
270                         if(!label->get_value()) label->update(1);
271                 }
272                 else
273                         if(label->get_value()) label->update(0);
274         }
276         if(mwindow->edl->equivalent(mwindow->edl->local_session->in_point, mwindow->edl->local_session->selectionstart) ||
277                 mwindow->edl->equivalent(mwindow->edl->local_session->in_point, mwindow->edl->local_session->selectionend))
278         {
279                 if(in_point) in_point->update(1);
280         }
281         else
282                 if(in_point) in_point->update(0);
284         if(mwindow->edl->equivalent(mwindow->edl->local_session->out_point, mwindow->edl->local_session->selectionstart) ||
285                 mwindow->edl->equivalent(mwindow->edl->local_session->out_point, mwindow->edl->local_session->selectionend))
286         {
287                 if(out_point) out_point->update(1);
288         }
289         else
290                 if(out_point) out_point->update(0);
293 void TimeBar::update_points()
295         EDL *edl = get_edl();
296         int64_t pixel;
298         if(edl) pixel = position_to_pixel(edl->local_session->in_point);
299 //printf("TimeBar::update_points 1 %d\n", pixel);
302         if(in_point)
303         {
304                 if(edl && 
305                         edl->local_session->in_point >= 0 && 
306                         pixel >= 0 && 
307                         pixel < get_w())
308                 {
309                         if(edl->local_session->in_point != in_point->position ||
310                                 in_point->pixel != pixel)
311                         {
312                                 in_point->pixel = pixel;
313                                 in_point->position = edl->local_session->in_point;
314                                 in_point->reposition();
315                         }
316                         else
317                         {
318                                 in_point->draw_face();
319                         }
320                 }
321                 else
322                 {
323                         delete in_point;
324                         in_point = 0;
325                 }
326         }
327         else
328         if(edl && edl->local_session->in_point >= 0 && pixel >= 0 && pixel < get_w())
329         {
330 //printf("TimeBar::update_points 1 %p\n", edl);
331                 add_subwindow(in_point = new InPointGUI(mwindow, 
332                         this, 
333                         pixel, 
334                         edl->local_session->in_point));
335                 in_point->set_cursor(ARROW_CURSOR);
336 //printf("TimeBar::update_points 2\n");
337         }
339         if(edl) pixel = position_to_pixel(edl->local_session->out_point);
341 //printf("TimeBar::update_points 2 %d\n", pixel);
342         if(out_point)
343         {
344                 if(edl &&
345                         edl->local_session->out_point >= 0 && 
346                         pixel >= 0 && 
347                         pixel < get_w())
348                 {
349                         if(edl->local_session->out_point != out_point->position ||
350                                 out_point->pixel != pixel) 
351                         {
352                                 out_point->pixel = pixel;
353                                 out_point->position = edl->local_session->out_point;
354                                 out_point->reposition();
355                         }
356                         else
357                         {
358                                 out_point->draw_face();
359                         }
360                 }
361                 else
362                 {
363                         delete out_point;
364                         out_point = 0;
365                 }
366         }
367         else
368         if(edl && 
369                 edl->local_session->out_point >= 0 && 
370                 pixel >= 0 && pixel < get_w())
371         {
372                 add_subwindow(out_point = new OutPointGUI(mwindow, 
373                         this, 
374                         pixel, 
375                         edl->local_session->out_point));
376                 out_point->set_cursor(ARROW_CURSOR);
377         }
380 void TimeBar::update_presentations()
385 void TimeBar::update(int do_range, int do_others)
387         draw_time();
388 // Need to redo these when range is drawn to get the background updated.
389         update_labels();
390         update_points();
391         update_presentations();
392         flash();
397 int TimeBar::delete_project()
399 //      labels->delete_all();
400         return 0;
403 int TimeBar::save(FileXML *xml)
405 //      labels->save(xml);
406         return 0;
412 void TimeBar::draw_time()
416 EDL* TimeBar::get_edl()
418         return mwindow->edl;
423 void TimeBar::draw_range()
425         int x1 = 0, x2 = 0;
426         if(get_edl())
427         {
428                 get_preview_pixels(x1, x2);
430 //printf("TimeBar::draw_range %f %d %d\n", edl_length, x1, x2);
431                 draw_3segmenth(0, 0, x1, mwindow->theme->timebar_view_data);
432                 draw_top_background(get_parent(), x1, 0, x2 - x1, get_h());
433                 draw_3segmenth(x2, 0, get_w() - x2, mwindow->theme->timebar_view_data);
435                 set_color(BLACK);
436                 draw_line(x1, 0, x1, get_h());
437                 draw_line(x2, 0, x2, get_h());
438                 
439                 EDL *edl;
440                 if(edl = get_edl())
441                 {
442                         int64_t pixel = position_to_pixel(edl->local_session->selectionstart);
443 // Draw insertion point position if this timebar beint64_ts to a window which 
444 // has something other than the master EDL.
445 //printf("TimeBar::draw_range %f\n", edl->local_session->selectionstart);
446                         set_color(RED);
447                         draw_line(pixel, 0, pixel, get_h());
448                 }
449         }
450         else
451                 draw_top_background(get_parent(), 0, 0, get_w(), get_h());
454 void TimeBar::select_label(double position)
460 int TimeBar::draw()
462         return 0;
465 void TimeBar::get_edl_length()
467         edl_length = 0;
469         if(get_edl())
470         {
471 //printf("TimeBar::get_edl_length 1 %f\n", get_edl()->tracks->total_playable_length());
472                 edl_length = get_edl()->tracks->total_playable_length();
473         }
475 //printf("TimeBar::get_edl_length 2\n");
476         if(!EQUIV(edl_length, 0))
477         {
478 //printf("TimeBar::get_edl_length 3\n");
479                 time_per_pixel = edl_length / get_w();
480 //printf("TimeBar::get_edl_length 4\n");
481         }
482         else
483         {
484                 time_per_pixel = 0;
485         }
486 //printf("TimeBar::get_edl_length 5\n");
489 int TimeBar::get_preview_pixels(int &x1, int &x2)
491         x1 = 0;
492         x2 = 0;
494         get_edl_length();
496         if(get_edl())
497         {
498                 if(!EQUIV(edl_length, 0))
499                 {
500                         if(get_edl()->local_session->preview_end <= 0 ||
501                                 get_edl()->local_session->preview_end > edl_length)
502                                 get_edl()->local_session->preview_end = edl_length;
503                         if(get_edl()->local_session->preview_start > 
504                                 get_edl()->local_session->preview_end)
505                                 get_edl()->local_session->preview_start = 0;
506                         x1 = (int)(get_edl()->local_session->preview_start / time_per_pixel);
507                         x2 = (int)(get_edl()->local_session->preview_end / time_per_pixel);
508                 }
509                 else
510                 {
511                         x1 = 0;
512                         x2 = get_w();
513                 }
514         }
515 // printf("TimeBar::get_preview_pixels %f %f %d %d\n", 
516 //      get_edl()->local_session->preview_start,
517 //      get_edl()->local_session->preview_end,
518 //      x1, 
519 //      x2);
520         return 0;
524 int TimeBar::test_preview(int buttonpress)
526         int result = 0;
527         int x1, x2;
529         get_preview_pixels(x1, x2);
530 //printf("TimeBar::test_preview %d %d %d\n", x1, x2, get_cursor_x());
532         if(get_edl())
533         {
534 // Inside left handle
535                 if(cursor_inside() &&
536                         get_cursor_x() >= x1 - HANDLE_W &&
537                         get_cursor_x() < x1 + HANDLE_W &&
538 // Ignore left handle if both handles are up against the left side
539                         x2 > HANDLE_W)
540                 {
541                         if(buttonpress)
542                         {
543                                 current_operation = TIMEBAR_DRAG_LEFT;
544                                 start_position = get_edl()->local_session->preview_start;
545                                 start_cursor_x = get_cursor_x();
546                                 result = 1;
547                         }
548                         else
549                         if(get_cursor() != LEFT_CURSOR)
550                         {
551                                 result = 1;
552                                 set_cursor(LEFT_CURSOR);
553                         }
554                 }
555                 else
556 // Inside right handle
557                 if(cursor_inside() &&
558                         get_cursor_x() >= x2 - HANDLE_W &&
559                         get_cursor_x() < x2 + HANDLE_W &&
560 // Ignore right handle if both handles are up against the right side
561                         x1 < get_w() - HANDLE_W)
562                 {
563                         if(buttonpress)
564                         {
565                                 current_operation = TIMEBAR_DRAG_RIGHT;
566                                 start_position = get_edl()->local_session->preview_end;
567                                 start_cursor_x = get_cursor_x();
568                                 result = 1;
569                         }
570                         else
571                         if(get_cursor() != RIGHT_CURSOR)
572                         {
573                                 result = 1;
574                                 set_cursor(RIGHT_CURSOR);
575                         }
576                 }
577                 else
578                 if(cursor_inside() &&
579                         get_cursor_x() >= x1 &&
580                         get_cursor_x() < x2)
581                 {
582                         if(buttonpress)
583                         {
584                                 current_operation = TIMEBAR_DRAG_CENTER;
585                                 starting_start_position = get_edl()->local_session->preview_start;
586                                 starting_end_position = get_edl()->local_session->preview_end;
587                                 start_cursor_x = get_cursor_x();
588                                 result = 1;
589                         }
590                         else
591                         {
592                                 result = 1;
593                                 set_cursor(HSEPARATE_CURSOR);
594                         }
595                 }
596                 else
597                 {
598 // Trap all buttonpresses inside timebar
599                         if(cursor_inside() && buttonpress)
600                                 result = 1;
602                         if(get_cursor() == LEFT_CURSOR ||
603                                 get_cursor() == RIGHT_CURSOR)
604                         {
605                                 result = 1;
606                                 set_cursor(ARROW_CURSOR);
607                         }
608                 }
609         }
613         return result;
616 int TimeBar::move_preview(int &redraw)
618         int result = 0;
620         if(current_operation == TIMEBAR_DRAG_LEFT)
621         {
622                 get_edl()->local_session->preview_start = 
623                         start_position + 
624                         time_per_pixel * (get_cursor_x() - start_cursor_x);
625                 CLAMP(get_edl()->local_session->preview_start, 
626                         0, 
627                         get_edl()->local_session->preview_end);
628                 result = 1;
629         }
630         else
631         if(current_operation == TIMEBAR_DRAG_RIGHT)
632         {
633                 get_edl()->local_session->preview_end = 
634                         start_position + 
635                         time_per_pixel * (get_cursor_x() - start_cursor_x);
636                 CLAMP(get_edl()->local_session->preview_end, 
637                         get_edl()->local_session->preview_start, 
638                         edl_length);
639                 result = 1;
640         }
641         else
642         if(current_operation == TIMEBAR_DRAG_CENTER)
643         {
644                 get_edl()->local_session->preview_start = 
645                         starting_start_position +
646                         time_per_pixel * (get_cursor_x() - start_cursor_x);
647                 get_edl()->local_session->preview_end = 
648                         starting_end_position +
649                         time_per_pixel * (get_cursor_x() - start_cursor_x);
650                 if(get_edl()->local_session->preview_start < 0)
651                 {
652                         get_edl()->local_session->preview_end -= get_edl()->local_session->preview_start;
653                         get_edl()->local_session->preview_start = 0;
654                 }
655                 else
656                 if(get_edl()->local_session->preview_end > edl_length)
657                 {
658                         get_edl()->local_session->preview_start -= get_edl()->local_session->preview_end - edl_length;
659                         get_edl()->local_session->preview_end = edl_length;
660                 }
661                 result = 1;
662         }
664 //printf("TimeBar::move_preview %f %f\n", get_edl()->local_session->preview_start, get_edl()->local_session->preview_end);
666         if(result)
667         {
668                 update_preview();
669                 redraw = 1;
670         }
672         return result;
675 void TimeBar::update_preview()
679 int TimeBar::samplemovement()
681         return 0;
684 void TimeBar::stop_playback()
688 int TimeBar::button_press_event()
690 //printf("TimeBar::button_press_event 1\n");
691         if(is_event_win() && cursor_inside())
692         {
693 // Change time format
694                 if(ctrl_down())
695                 {
696                         mwindow->next_time_format();
697                         return 1;
698                 }
699                 else
700                 if(test_preview(1))
701                 {
702                 }
703                 else
704                 {
705                         stop_playback();
707 // Select region between two labels
708                         if(get_double_click())
709                         {
710                                 double position = (double)get_cursor_x() * 
711                                         mwindow->edl->local_session->zoom_sample / 
712                                         mwindow->edl->session->sample_rate + 
713                                         (double)mwindow->edl->local_session->view_start *
714                                         mwindow->edl->local_session->zoom_sample / 
715                                         mwindow->edl->session->sample_rate;
716 // Test labels
717                                 select_region(position);
718                                 return 1;
719                         }
720                         else
721         // Reposition highlight cursor
722                         if(is_event_win() && cursor_inside())
723                         {
724         //printf("TimeBar::button_press_event 4\n");
725                                 update_cursor();
726         //printf("TimeBar::button_press_event 5\n");
727                                 mwindow->gui->canvas->activate();
728         //printf("TimeBar::button_press_event 6\n");
729                                 return 1;
730                         }
731                 }
732         }
733         return 0;
736 int TimeBar::repeat_event(int64_t duration)
738         if(!mwindow->gui->canvas->drag_scroll) return 0;
739         if(duration != BC_WindowBase::get_resources()->scroll_repeat) return 0;
741         int distance = 0;
742         int x_movement = 0;
743         int relative_cursor_x = mwindow->gui->canvas->get_relative_cursor_x();
744         if(current_operation == TIMEBAR_DRAG)
745         {
746                 if(relative_cursor_x >= mwindow->gui->canvas->get_w())
747                 {
748                         distance = relative_cursor_x - mwindow->gui->canvas->get_w();
749                         x_movement = 1;
750                 }
751                 else
752                 if(relative_cursor_x < 0)
753                 {
754                         distance = relative_cursor_x;
755                         x_movement = 1;
756                 }
760                 if(x_movement)
761                 {
762                         update_cursor();
763                         mwindow->samplemovement(mwindow->edl->local_session->view_start + 
764                                 distance);
765                 }
766                 return 1;
767         }
768         return 0;
771 int TimeBar::cursor_motion_event()
773         int result = 0;
774         int redraw = 0;
776         switch(current_operation)
777         {
778                 case TIMEBAR_DRAG:
779                 {
780                         update_cursor();
781 // printf("TimeBar::cursor_motion_event %d %d %d\n", 
782 // get_cursor_x(), 
783 // 0, 
784 // get_w());
785                         int relative_cursor_x = mwindow->gui->canvas->get_relative_cursor_x();
786                         if(relative_cursor_x >= mwindow->gui->canvas->get_w() || 
787                                 relative_cursor_x < 0)
788                         {
789                                 mwindow->gui->canvas->start_dragscroll();
790                         }
791                         else
792                         if(relative_cursor_x < mwindow->gui->canvas->get_w() && 
793                                 relative_cursor_x >= 0)
794                         {
795                                 mwindow->gui->canvas->stop_dragscroll();
796                         }
797                         result = 1;
798                         break;
799                 }
802                 case TIMEBAR_DRAG_LEFT:
803                 case TIMEBAR_DRAG_RIGHT:
804                 case TIMEBAR_DRAG_CENTER:
805                         result = move_preview(redraw);
806                         break;
808                 default:
809                         result = test_preview(0);
810                         break;
811         }
813         if(redraw)
814         {
815                 update();
816         }
818         return result;
821 int TimeBar::button_release_event()
823 //printf("TimeBar::button_release_event %d\n", current_operation);
824         int result = 0;
825         switch(current_operation)
826         {
827                 case TIMEBAR_DRAG:
828                         mwindow->gui->canvas->stop_dragscroll();
829                         current_operation = TIMEBAR_NONE;
830                         result = 1;
831                         break;
833                 default:
834                         if(current_operation != TIMEBAR_NONE)
835                         {
836                                 current_operation = TIMEBAR_NONE;
837                                 result = 1;
838                         }
839                         break;
840         }
841         return result;
844 // Update the selection cursor during a dragging operation
845 void TimeBar::update_cursor()
847         double position = (double)get_cursor_x() * 
848                 mwindow->edl->local_session->zoom_sample / 
849                 mwindow->edl->session->sample_rate + 
850                 (double)mwindow->edl->local_session->view_start * 
851                 mwindow->edl->local_session->zoom_sample / 
852                 mwindow->edl->session->sample_rate;
853         
854         position = mwindow->edl->align_to_frame(position, 0);
855         position = MAX(0, position);
856         current_operation = TIMEBAR_DRAG;
858         mwindow->select_point(position);
859         update_highlights();
863 int TimeBar::select_region(double position)
865         Label *start = 0, *end = 0, *current;
866         for(current = mwindow->edl->labels->first; current; current = NEXT)
867         {
868                 if(current->position > position)
869                 {
870                         end = current;
871                         break;
872                 }
873         }
875         for(current = mwindow->edl->labels->last ; current; current = PREVIOUS)
876         {
877                 if(current->position <= position)
878                 {
879                         start = current;
880                         break;
881                 }
882         }
884 // Select region
885         if(end != start)
886         {
887                 if(!start)
888                         mwindow->edl->local_session->selectionstart = 0;
889                 else
890                         mwindow->edl->local_session->selectionstart = start->position;
892                 if(!end)
893                         mwindow->edl->local_session->selectionend = mwindow->edl->tracks->total_length();
894                 else
895                         mwindow->edl->local_session->selectionend = end->position;
896         }
897         else
898         if(end || start)
899         {
900                 mwindow->edl->local_session->selectionstart = 
901                         mwindow->edl->local_session->selectionend = 
902                         start->position;
903         }
905 // Que the CWindow
906         mwindow->cwindow->update(1, 0, 0);
907         mwindow->gui->cursor->hide();
908         mwindow->gui->cursor->draw();
909         mwindow->gui->canvas->flash();
910         mwindow->gui->canvas->activate();
911         mwindow->gui->zoombar->update();
912         update_highlights();
913         return 0;
916 int TimeBar::copy(int64_t start, int64_t end, FileXML *xml)
918 //      labels->copy(start, end, xml);
919         return 0;
922 int TimeBar::paste(int64_t start, int64_t end, int64_t sample_length, FileXML *xml)
924 //      labels->paste(start, end, sample_length, xml);
925         return 0;
928 int TimeBar::paste_output(int64_t startproject, int64_t endproject, int64_t startsource, int64_t endsource, RecordLabels *new_labels)
930 //      labels->paste_output(startproject, endproject, startsource, endsource, new_labels);
931         return 0;
934 int TimeBar::clear(int64_t start, int64_t end)
936 //labels->clear(start, end);    
937         return 0;
940 int TimeBar::paste_silence(int64_t start, int64_t end)
942 //labels->paste_silence(start, end);    
943         return 0;
946 int TimeBar::modify_handles(int64_t oldposition, int64_t newposition, int currentend)
948 //labels->modify_handles(oldposition, newposition, currentend);         
949         return 0;
955 int TimeBar::delete_arrows()
957         return 0;