Commit graph

919 commits

Author SHA1 Message Date
Paul Davis
27c943f1dd new image cache design for waveviews, with various fixes.
Rather than maintain a set of images in a cache, when we no longer have the required waveform data, create a new image that is appropriately centered and extends to roughly twice the screen width (or the limits of the region's source file(s), as necessary)
2013-06-20 14:37:31 -04:00
Paul Davis
3604bf12a2 get wave drawing improved, but commit before i tear it all up and go back to a single cached image per waveview 2013-06-19 20:23:22 -04:00
Paul Davis
f9d30cf41a inching pretty close to fully working waves now 2013-06-19 14:44:08 -04:00
Paul Davis
79384aeb66 initial semi-working attempt at getting waveview cache to work correctly 2013-06-18 23:03:20 -04:00
Paul Davis
691be68ac2 fix rect redraw problems caused by intersection requiring the usual 0.5 expansion (though consider a more general fix for this at teh group level) 2013-06-18 13:46:24 -04:00
Paul Davis
77f5f4c4bf basically operational switch to canvas drawing coordinates, although text and waves don't work, and redraw areas are too small 2013-06-18 08:23:06 -04:00
Paul Davis
c358e77e1e move setup_outline_context() to a more sensible shared location 2013-05-02 18:21:35 -04:00
Paul Davis
41d68e780f do not trigger visual changes when Fill::set_* methods don't change anything 2013-04-26 14:19:16 -04:00
Paul Davis
f9a46e78d6 fix incorrect 3rd arg to AudioRegion::read_peaks() - was passing end, not cnt. Fixes waveforms at high zoom 2013-04-26 11:10:19 -04:00
Paul Davis
f8a37b197f tweak enter/leave code, remove debug output 2013-04-25 09:49:02 -04:00
Paul Davis
fd7ac62ca5 don't invalidate image cache for every regionr esize, only region start changes 2013-04-25 09:48:38 -04:00
Paul Davis
d0867e67e3 more tweaks for enter/leave events for canvas items 2013-04-24 22:57:23 -04:00
Paul Davis
737433c446 tweaks to improve enter/leave event handling - fixes at least some crashes caused by this stuff 2013-04-24 18:31:00 -04:00
Paul Davis
6f664c1f67 many pervasive changes primarily related to waveform drawing, particular content-dragging, colors, and more 2013-04-24 15:42:14 -04:00
Paul Davis
b36e085001 add back change lost during branch merging 2013-04-21 18:57:55 -04:00
Paul Davis
eb23bd8102 add Group::clear(), do not clear _canvas member of Item when unparented (only the parent is changed) 2013-04-21 15:35:20 -04:00
Paul Davis
b02a7445bf Revert "add Group::clear(), do not clear _canvas member of Item when unparented (only the parent is changed)"
This reverts commit a4df65a56f83823aba27432685977f420458a213.
2013-04-21 15:35:20 -04:00
Paul Davis
fca81c9a6a add Group::clear(), do not clear _canvas member of Item when unparented (only the parent is changed) 2013-04-21 15:35:20 -04:00
Robin Gareus
fee8de9787 Revert "cairo image crash debugging" and "initialize image data"
This reverts commit dfdb91b429
and commit 188d766757.

despite earlier assumptions the code is correct and there is
likely a memory corruption elsewhere.
2013-04-20 23:36:13 +02:00
Robin Gareus
dfdb91b429 cairo image crash debugging 2013-04-20 22:51:37 +02:00
Paul Davis
9a3bc39970 tweak event/leave event delivery so that it applies to items being deleted as well as motion events (hmm, needed for item addition too ...) 2013-04-20 16:11:40 -04:00
Robin Gareus
188d766757 initialize image data. 2013-04-20 22:07:43 +02:00
Paul Davis
0c170b0897 no create cached waveview images that span from render-start to cache-start, but always clamp the end to render-end, to avoid creating over-sized images 2013-04-19 10:53:52 -04:00
Paul Davis
907e7cd4af part two of ... add Canvas::Arc and derive Canvas::Circle from it 2013-04-18 21:29:13 -04:00
Paul Davis
8482ce14ce add Canvas::Arc and derive Canvas::Circle from it 2013-04-18 21:28:11 -04:00
Paul Davis
5bb213f53b add Canvas::Circle 2013-04-18 15:47:30 -04:00
Paul Davis
74126c48c0 expand bbox for Canvas::Line to get rid of artifacts caused when moving them around, as is done for Rectangle and others 2013-04-18 15:47:10 -04:00
Robin Gareus
b7aeb147f2 display waveform polarity correctly
* cairo's Y axis points downward -> invert phase display
* fix logarithmic view for value.max < 0
2013-04-18 10:25:35 +02:00
Paul Davis
3737f346ee Merge branch 'cairocanvas' of git.ardour.org:ardour/ardour into cairocanvas 2013-04-17 15:23:01 -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
Robin Gareus
8f2a2877b5 ArdourCanvas::Image allow to set custom data instead of class pre-allocated memory. 2013-04-17 20:26:09 +02: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
96eee9e7a1 change UIConfig to use accessor/setter methods like RCConfig so that ParameterChanged methods can actually be emitted; add variable (over a small range) background shading for all TimeAxisViewItems 2013-04-16 23:46:22 -04:00
Paul Davis
381d4debf4 make waveform gradient depth continuously variable. color probably needs adjusting as do color stops to get a pleasing effect at most settings 2013-04-16 21:23:50 -04:00
Paul Davis
c1df3295c1 virtual Fill:: and Outline:: methods so that Canvas::Items that cache image renderings of themselves can invalidate those caches when colors etc. change; add Item::{begin,end}_visual_change() so that we can notify the canvas more efficiently when *only* visual properties have changed and not the bounding box (probably needs to be used more widely) 2013-04-16 20:38:10 -04:00
Paul Davis
81eed21dde some rationalization of how global WaveView properties and per-WaveView properties interact 2013-04-16 18:02:12 -04:00
Paul Davis
a74743f551 somewhat restore ability to see rectified waveforms 2013-04-16 16:14:57 -04:00
Paul Davis
33e09447e9 restore log-scaled waveform functionality 2013-04-16 15:38:18 -04:00
Paul Davis
ef60401d92 (hopefully) fix double-buffering design of ArdourCanvas::Image 2013-04-16 14:20:04 -04:00
Paul Davis
ccc9b6adee change rendering technique for waveforms, add back optional gradient, add back amplitude scaling, add rgb/hsv conversion utilities to canvas 2013-04-16 14:04:59 -04:00
Paul Davis
a0044e5f71 add back various functionality to waveviews such as zero line, amplitude scaling 2013-04-16 10:07:52 -04:00
Paul Davis
be23e48e7f add some comments to Canvas::Image and ensure that the canvas redraws after a put_image() call is handled in the GUI thread 2013-04-15 22:34:36 -04:00
Paul Davis
37dd7e952b add headers to all canvas .cc and .h files 2013-04-15 22:10:18 -04:00
Paul Davis
64d3763652 remove all xml++.h inclusion by canvas implementations 2013-04-15 22:00:13 -04:00
Paul Davis
84fb0a8dce remove all XML related API from canvas. it may have been useful during development, but it is just a distraction - we will NEVER be saving or restoring canvas state via XML or any kind of serialized state 2013-04-15 21:57:08 -04:00
Paul Davis
fe34485907 add new canvas Image item, with somewhat optimized API for asynchronous, threaded rendering directly into an image buffer suitable for use by cairo as a source surface (currently untested) 2013-04-15 21:40:15 -04:00
Paul Davis
393ba98422 tweak time axis view item text positioning; allow ArdourCanvas::Text to have its width clamped, and use this as TAVI's get narrow so that text doesn't overflow 2013-04-15 14:45:22 -04:00
Paul Davis
7e19053b88 Fix dragging objects on the canvas and remove redundant canvas groups
Delivery of fake motion events to the editor needed the event coordinates to be
in canvas space, as they are with "real" events. Editor and other objects had
many redundant groups from timbyr's work on gnomecanvas to scroll by moving
groups. We don't need this anymore with cairo-canvas (though possibly a
stationay background group for the canvas might be useful again one day as in
the SAE logo. Its implementation would be fairly different though, since we
would have to explicitly move the group on every scroll, since nothing else
ever moves on scroll).

Also tweaks to text item placement, and switch TimeAxisViewItem from
name_pixbuf to name_text, since ArdourCanvas::Text is already "pixbuf optimized".
2013-04-15 13:50:05 -04:00
Paul Davis
af4539f857 a few changes to fix region dragging, all related to coordinate system handling, which is now much simpler with the new canvas; more debugging output when asked for 2013-04-15 10:38:12 -04:00
Paul Davis
4e84bc3a39 changes to get cairocanvas branch to build on OS X, with its stupid nil and Rect macros, plus some const_cast<> and unused variable fixes that should really be in master but will have to wait till we rebase master 2013-04-12 21:46:44 -04:00