~ubuntu-branches/ubuntu/lucid/ardour/lucid-proposed

« back to all changes in this revision

Viewing changes to gtk2_ardour/editor_canvas.cc

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2008-07-29 11:27:04 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20080729112704-x1rmgb4tjotjyu5u
Tags: 1:2.5-0ubuntu1
* New upstream release.
* debian/patches/s390-FTBFS.patch: Dropped, as it fails to apply, and
  Ubuntu doesn't concern itself with s390.
* debian/control:
  - Fix package description, thanks to the patch in Debian bug #485892.
  - Metadata cleanup and sync control/control.in files.
  - Add libaubio-dev to Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
using namespace Gtkmm2ext;
54
54
using namespace Editing;
55
55
 
56
 
/* XXX this is a hack. it ought to be the maximum value of an nframes_t */
 
56
/* XXX this is a hack. it ought to be the maximum value of an nframes64_t */
57
57
 
58
58
const double max_canvas_coordinate = (double) JACK_MAX_FRAMES;
59
59
 
205
205
 
206
206
        range_bar_drag_rect = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
207
207
        range_bar_drag_rect->property_outline_pixels() = 0;
208
 
        
 
208
        range_bar_drag_rect->hide ();
 
209
 
209
210
        transport_bar_drag_rect = new ArdourCanvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
210
211
        transport_bar_drag_rect->property_outline_pixels() = 0;
211
212
        transport_bar_drag_rect->hide ();
328
329
                full_canvas_height = height;
329
330
        }
330
331
 
331
 
        zoom_range_clock.set ((nframes_t) floor ((canvas_width * frames_per_unit)));
 
332
        zoom_range_clock.set ((nframes64_t) floor ((canvas_width * frames_per_unit)));
332
333
        playhead_cursor->set_position (playhead_cursor->current_frame);
333
334
 
334
335
        reset_hscrollbar_stepping ();
376
377
        }
377
378
 
378
379
        double last_canvas_unit =  max ((last_canvas_frame / frames_per_unit), canvas_width);
379
 
 
 
380
        //cerr << "Editor::reset_scrolling_region () lcf:fpu:cw:lcu " << last_canvas_frame << ":" << frames_per_unit << ":" << canvas_width << ":" << last_canvas_unit << endl;//DEBUG
380
381
        track_canvas->set_scroll_region (0.0, 0.0, last_canvas_unit, pos);
381
382
 
382
383
        // XXX what is the correct height value for the time canvas ? this overstates it
555
556
void
556
557
Editor::maybe_autoscroll (GdkEventMotion* event)
557
558
{
558
 
        nframes_t rightmost_frame = leftmost_frame + current_page_frames();
559
 
        nframes_t frame = drag_info.current_pointer_frame;
 
559
        nframes64_t rightmost_frame = leftmost_frame + current_page_frames();
 
560
        nframes64_t frame = drag_info.current_pointer_frame;
560
561
        bool startit = false;
561
562
        double vertical_pos = vertical_adjustment.get_value();
562
563
 
589
590
 
590
591
        }
591
592
 
 
593
        if (!allow_vertical_scroll) {
 
594
                autoscroll_y = 0;
 
595
        }
 
596
 
592
597
        if ((autoscroll_x != last_autoscroll_x) || (autoscroll_y != last_autoscroll_y) || (autoscroll_x == 0 && autoscroll_y == 0)) {
593
598
                stop_canvas_autoscroll ();
594
599
        }
610
615
bool
611
616
Editor::autoscroll_canvas ()
612
617
{
613
 
        nframes_t new_frame;
614
 
        nframes_t limit = max_frames - current_page_frames();
 
618
        nframes64_t new_frame;
 
619
        nframes64_t limit = max_frames - current_page_frames();
615
620
        GdkEventMotion ev;
616
 
        nframes_t target_frame;
 
621
        nframes64_t target_frame;
617
622
        double new_pixel;
618
623
        double target_pixel;
619
624
 
710
715
                        
711
716
                        /* after about a while, speed up a bit by changing the timeout interval */
712
717
                        
713
 
                        autoscroll_x_distance = (nframes_t) floor (current_page_frames()/30.0f);
 
718
                        autoscroll_x_distance = (nframes64_t) floor (current_page_frames()/30.0f);
714
719
                        
715
720
                } else if (autoscroll_cnt == 150) { /* 1.0 seconds */
716
721
                        
717
 
                        autoscroll_x_distance = (nframes_t) floor (current_page_frames()/20.0f);
 
722
                        autoscroll_x_distance = (nframes64_t) floor (current_page_frames()/20.0f);
718
723
                        
719
724
                } else if (autoscroll_cnt == 300) { /* 1.5 seconds */
720
725
                        
721
726
                        /* after about another while, speed up by increasing the shift per callback */
722
727
                        
723
 
                        autoscroll_x_distance =  (nframes_t) floor (current_page_frames()/10.0f);
 
728
                        autoscroll_x_distance =  (nframes64_t) floor (current_page_frames()/10.0f);
724
729
                        
725
730
                } 
726
731
        }
760
765
        autoscroll_active = true;
761
766
        autoscroll_x = dx;
762
767
        autoscroll_y = dy;
763
 
        autoscroll_x_distance = (nframes_t) floor (current_page_frames()/50.0);
 
768
        autoscroll_x_distance = (nframes64_t) floor (current_page_frames()/50.0);
764
769
        autoscroll_y_distance = fabs (dy * 5); /* pixels */
765
770
        autoscroll_cnt = 0;
766
771
        
832
837
void 
833
838
Editor::canvas_horizontally_scrolled ()
834
839
{
835
 
        nframes64_t time_origin = (nframes_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
 
840
        nframes64_t time_origin = (nframes64_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
836
841
 
837
842
        if (time_origin != leftmost_frame) {
838
843
                canvas_scroll_to (time_origin);
842
847
void
843
848
Editor::canvas_scroll_to (nframes64_t time_origin)
844
849
{
845
 
        leftmost_frame = time_origin;
846
 
        nframes_t rightmost_frame = leftmost_frame + current_page_frames ();
 
850
        leftmost_frame = time_origin;
 
851
 
 
852
        nframes64_t rightmost_frame = leftmost_frame + current_page_frames ();
847
853
 
848
854
        if (rightmost_frame > last_canvas_frame) {
849
855
                last_canvas_frame = rightmost_frame;