Commit Graph

63 Commits

Author SHA1 Message Date
Paul Davis aaff07f2c9 editor cursors: fix position computation
The cairo 0.5 pixel offset for odd-width lines is handled by Canvas::Line and is not
needed in the EditorCursor code
2023-09-15 17:34:30 -06:00
Paul Davis ec7d502959 cairo single pixel line offset fix, part 2
This will need careful visual inspection of the items drawn by the
affected code to make sure they are still precisely as intended
2023-07-17 20:55:13 -06:00
luz paz 58e5ee6051
Fix pointer typo (callbck->callback) 2022-04-09 02:25:59 +02:00
Paul Davis 44e67c3566 small API change to provide (debug) name to canvas cursor items 2021-08-13 12:51:36 -06:00
Robin Gareus 4050ca5633
Update GPL boilerplate and (C)
Copyright-holder and year information is extracted from git log.

git history begins in 2005. So (C) from 1998..2005 is lost. Also some
(C) assignment of commits where the committer didn't use --author.
2019-08-03 15:53:15 +02:00
Ben Loftis 8584ea75d1 Cairo-fix cursor lines so they align perfectly with Rulers, Grids, and region edges. 2018-02-10 07:51:28 -06:00
Paul Davis 30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Robin Gareus 601c317d70 Clean up library inheritance (colors.h, utils.h)
make libwidget independent of libcanvas.
Confine basics to pbd and gtkmm2ext.
2017-07-17 21:06:04 +02:00
Robin Gareus 22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis 4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
Robin Gareus 85e701880b redraw playhead only if pixel position changed. 2015-04-08 12:31:44 +02:00
David Robillard b759fd5879 Put playhead on top of everything.
Achieve this by adding a new hscroll group just for cursors.

That requires a slightly smarter window_to_canvas() to deal with overlapping
sensitive scroll groups.  New rule is that scroll groups can overlap, but the
most sensitive one found from the top down will be chosen to translate
coordinates.  This basically means don't overlap scroll groups with different
sensitivities.

In the presence of scroll groups, having a canvas-wide window_to_canvas()
and/or canvas_to_window() fundamentally makes no sense.  At some point in the
glorious future we should kill those and use only item-relative coordinate
translation.
2015-01-16 19:13:56 -05:00
Paul Davis 764a8b9475 fix indentation 2014-12-11 09:04:26 -05:00
GZharun 8962adab4e [Summary] Fixed issue with shifted playhead polygon when new session is created 2014-12-11 08:53:26 -05:00
David Robillard 16947f751b Remove dead code. 2014-11-27 04:17:15 -05:00
Paul Davis 4685a15b1f add new variant of EditorCursor that creates an insensitive full-canvas-height line, and fix destructor leak 2014-07-07 08:16:57 -04:00
Paul Davis e8fc8aa992 new UI config var to allow playhead to be optionally draggable (default is: yes, it can be dragged) 2014-06-30 16:32:38 -04:00
Robin Gareus a3c378cf62 move utility functions into a dedicated namespace 2014-06-25 21:47:54 +02:00
Paul Davis 0796ccfb65 use newly factored canvas in gtk2_ardour 2014-06-21 11:44:22 -04:00
Paul Davis da7a860256 remove useless groups from timebar area, clarify scroll group naming in editor 2014-06-03 16:11:24 -04:00
Paul Davis 5696199daf remove timebar canvas and just use a single canvas instead. This is just part one - lots of minor fixes to be done 2014-06-03 16:10:27 -04:00
Paul Davis 6019f06bdf different approach to independent scrolling, involving ArdourCanvas::ScrollGroup
The idea now is that a scroll group item can be added to the canvas which will causes its children to scroll in either or both
directions (horizontal or vertical). There are few complications: the position() of the ScrollGroup is ambiguous depending
on whether you want it with scroll taken into account or not, so Item::canvas_position() was added, which defaults to
the same value as Item::position() but is overridden by ScrollGroup to return the position independent of scrolling. This
method is used when translating between item/canvas/window coordinate systems.

Note that the basic idea is that we MOVE the scroll group when a scroll happens. This mirrors what happens in the GnomeCanvas,
where Nick Mainsbridge came up with a great idea that allowed unification of the time bar and track canvases.
2014-06-03 16:10:27 -04:00
Paul Davis 937cb4fd2b convert canvas items that compose the playhead (EditorCursor, more generally) to pointers, since canvas items are owned by the group they belong to. This avoids a double-free during deletion 2014-02-12 15:13:11 -05:00
Paul Davis 23b3816651 remove unnecessary pixel placement stuff from editor cursor 2014-01-10 14:33:50 -05:00
Paul Davis a1f858d3b2 an awful lot of tweaks to drawing details 2013-06-24 16:28:53 -04:00
Paul Davis 298d0efc31 reduce playhead line width to 1.5 2013-04-25 16:04:33 -04:00
Paul Davis 05905d3ec8 thicken up playhead line (again?) 2013-04-20 16:11:40 -04:00
Paul Davis ec102f94e1 various work waveview amplitude mgmt; fix playhead cursor drag from timebar click 2013-04-17 15:22:09 -04:00
Paul Davis b9c94f6dbf remove all calls to Outline::set_outline_width (1) because this is "wrong" when using Cairo - the default is 0.5 and it can remain that way 2013-04-17 10:56:04 -04:00
Paul Davis d1a05240ef fix clamping of line and rect coordinates to avoid issues with cairo when drawing way outside a surface's dimensions; move various coordinate methods down to Canvas, because they don't require GTK information; make visible_area() a Canvas virtual method so that we don't have to cast to call it 2013-04-17 10:53:17 -04:00
Paul Davis 4258a34912 change all frame_to_pixel and pixel_to_frame to sample_to_pixel and pixel_to_sample 2013-04-12 11:15:45 -04:00
Paul Davis ecfd2a7455 remove all unit-based methods from (Public)Editor; rationalize Editor::event_frame() to clearly identify whether the passed-in GdkEvent has window units or canvas units (the latter will be true for all events that are handled by the canvas and then passed to Editor 2013-04-12 11:09:49 -04:00
Paul Davis 97da762c50 make size/shape of playhead cursor match gnomecanvas version 2013-04-10 10:24:17 -04:00
Paul Davis aaea166135 initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00
Carl Hetherington 2373c48da6 Revert shade on playhead cursor (SVN 13048).
git-svn-id: svn://localhost/ardour2/branches/3.0@13192 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-09-17 12:08:21 +00:00
Paul Davis 0f9dab42d9 add translucent "shade" to playhead cursor (may remove this in the future)
git-svn-id: svn://localhost/ardour2/branches/3.0@13048 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-17 13:02:57 +00:00
David Robillard 8b68ed57ec Fix some messed up code (spacey tabs).
(There is faar more of this... FIX YOUR EDITORS!)


git-svn-id: svn://localhost/ardour2/branches/3.0@8086 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-11-25 20:37:39 +00:00
Carl Hetherington 8fc660e76e Move mouse cursor stuff out of Editor into its own class.
git-svn-id: svn://localhost/ardour2/branches/3.0@8048 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-11-16 14:53:16 +00:00
Paul Davis ede4ecbb00 megaopus patch #2 for today: remove nframes64_t and sframes_t from source
git-svn-id: svn://localhost/ardour2/branches/3.0@7792 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-09-17 18:20:37 +00:00
Paul Davis 8687895abb remove using namespace sigc everywhere to ensure clarity over which bind/mem_fun is being used; make Config::map_parameters take a boost::function rather than a sigc::slot ; continue debugging crash caused by regionviews not tracking their Region's lifetime
git-svn-id: svn://localhost/ardour2/branches/3.0@6357 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-12 15:02:15 +00:00
Paul Davis 64dc5427e4 make all use of bind/mem_fun be explicitly sigc::
git-svn-id: svn://localhost/ardour2/branches/3.0@6354 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-11 23:29:48 +00:00
David Robillard bb9cc45cd2 Strip trailing whitespace and fix other whitespace errors (e.g. space/tab mixing). Whitespace changes only.
Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red.  I don't know the emacs equivalent...


git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-14 16:10:01 +00:00
Carl Hetherington 34930fc8cf Add a playhead marker to the summary.
git-svn-id: svn://localhost/ardour2/branches/3.0@5206 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-06-17 00:29:56 +00:00
Carl Hetherington 962efaf05e Pull dragging code out of the Editor class into its own hierarchy.
git-svn-id: svn://localhost/ardour2/branches/3.0@5113 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-30 18:25:59 +00:00
Paul Davis bc89fe0147 most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas.cc; builds and runs and does a few specific things but expect it to be buggy for a while yet
git-svn-id: svn://localhost/ardour2/branches/3.0@4313 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-12-12 14:43:24 +00:00
Nick Mainsbridge 9e4f8633f4 Don't defer Editor::track_canvas_size_allocated () (defer the timebar redrawing instead) + some performance improvements to said function, fix puzzling ineffective thinko wrt region movement, show/hide playhead more sensibly.
git-svn-id: svn://localhost/ardour2/branches/3.0@3771 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-20 09:06:49 +00:00
Paul Davis c86210a9d5 merge 2.0-ongoing into 3.0 @ 3581 - 3710
git-svn-id: svn://localhost/ardour2/branches/3.0@3712 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-10 21:27:39 +00:00
Paul Davis 68e943265e merge from 2.0-ongoing @ 3581
git-svn-id: svn://localhost/ardour2/branches/3.0@3711 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-10 15:03:30 +00:00
Doug McLain 934c2ec367 Add playhead and editcursor to ardour.colors and remove hard coded colors
git-svn-id: svn://localhost/ardour2/trunk@1561 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-03-08 16:41:38 +00:00
Paul Davis d6ef740e90 remove all lines to avoid recompiles after commits
git-svn-id: svn://localhost/ardour2/trunk@1488 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-02-22 18:36:03 +00:00