13
0
Commit Graph

875 Commits

Author SHA1 Message Date
cec5ce8f45
Update canvas/UI lib GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
46f0b75e12
Undo more incorrect sample/frame replacements 2019-04-08 04:10:04 +02:00
c83ba53399
Remove ancient, unmaintained xcode project files 2019-02-28 18:12:44 +01:00
Andreas Müller
d2aa57af3b Prevent excessive meter redraws for inactive meters at zero II
Same as be826f3635

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
2018-10-17 22:35:29 +02:00
8ed33f1bc7 remove use of hardcoded -fPIC compiler flag, and use compiler flag dict instead 2018-10-14 22:06:11 -04:00
cf652331ad Adapt our remaining MSVC projects for 'boost::atomic' (in case it later gets extended to the other libs)
Stage 3 of 3
2018-09-30 09:19:28 +01:00
79f01bc889 Initial changes needed for building Mixbus (with MSVC) as version 5
(Mixbus itself will probably need extra changes)
2018-09-10 07:14:59 +01:00
8664768efa make velocity bars thinner (from alex mitchell) 2018-07-08 07:12:12 -04:00
ab6525a24f Accommodate newly introduced source(s) in our MSVC project (cairocanvas) 2018-07-05 08:22:44 +01:00
bf2f4bd28a method for setting whether or not to show velocity bars 2018-07-03 15:39:08 -04:00
c190581552 fix rectangle computation, and re-use alex' color computation 2018-07-03 12:39:56 -04:00
21582828b7 add a guess at appropriate color management for note velocity display
I think that HSV::opposite() is probably too strong here. HSV::darker() might be better. Experimentation needed.
2018-07-03 11:43:42 -04:00
644a05f60b use new Canvas::Note object for (sustained) note display 2018-07-03 11:21:53 -04:00
ed24e01658 initial implementation of a more specialized canvas item for (sustained) notes 2018-07-03 11:21:25 -04:00
5102d8fae1 minor code optimization for Rectangle::render() 2018-07-03 09:22:32 -04:00
b9c9777b9a When building with MSVC, allow for the fact that Mixbus and Ardour can be using different versions of the SESSION_FILE format 2018-02-15 09:03:32 +00:00
6f019faaa0 Accommodate the change from libtimecode to libtemporal 2018-02-14 10:02:11 +00:00
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
36046cccc1 add basic data members and methods for adding an explicit size allocation for Canvas::Item 2017-09-18 11:40:52 -04:00
951404475c MSVC changes needed to implement the new 'waveview' library 2017-07-19 08:20:18 +01:00
9a0a2a29b5 Fix NSGLView invalidation 2017-07-18 21:34:03 +02:00
beb73edf55 Purify libcanvas, remove libardour dependency
A canvas is just a canvas. Move WaveView into its own library.
2017-07-17 21:06:04 +02:00
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
33d30fdf57 Accommodate newly introduced source(s) in our MSVC project (cairocanvas) 2017-06-29 10:10:26 +01:00
d3510b5606 fix OSX builds (llmath compat) 2017-06-28 03:03:05 +02:00
a1cd4f8dfe Fix friend declaration in WaveView code for non-c++11 builds 2017-06-26 17:04:18 +10:00
6e91ee071c Reimplementation of large parts of the WaveView class
The drawing itself should be unchanged but much of the rest of the
implementation has changed. The WaveViewThreads and WaveViewDrawingThread
classes were added and allow multiple drawing threads.

The Item::prepare_for_render interface is implemented by WaveView to enable
queuing draw requests for the drawing threads to process as soon as the state
change occurs during Editor::visual_changer, which often means the images will
be finished by the time they are needed in WaveView::render. This can
significantly reduce total render time and also flickering caused by images not
being ready for display.

If the drawing thread/s cannot finish the request by the time it is required in
WaveView::render then cancel it and draw the WaveViewImage in the GUI thread if
it is likely it can be completed in the current render pass/frame.  This change
also helps reduce the flickering caused by images not being ready with threaded
rendering, but with several drawing threads, drawing in the GUI thread may not
often occur (unless explicitly requested).

Allow unfinished images to be returned from the cache in
WaveView::prepare_for_render so that new draw requests aren't queued for
duplicate images. This reduces the amount of drawing for instance in
compositions where there are many instances of the same sample/waveform
displayed on the canvas as only a single image should be drawn.

Use a random width within a certain range for
WaveView::optimal_image_width_samples so that image drawing is less likely to
occur at the same time (which will cause a spike in render/draw time and
increase the chance of flickering waveforms).

Move implementations of the private WaveView classes into wave_view_private.h
and wave_view_private.cc source files.

Incorporate a fix for limiting the waveview image size to the cairo image size
limit.

Should hopefully Resolve: #6478
2017-06-26 08:40:47 +10:00
4ddf97f5a2 Add Canvas::get_microseconds_since_render_start() method
Initial use is for the WaveView class to determine whether on not to draw the
waveform in the GUI thread.
2017-06-26 08:40:47 +10:00
ab13e87ec2 Add Canvas::get_last_render_start_timestamp method 2017-06-26 08:40:47 +10:00
8538ba35fe Only call Gtk::Widget::queue_draw_area in canvas when item and visible area intersect
Refactor GtkCanvas::request_redraw to use Rect::intersection
2017-06-26 08:40:47 +10:00
c4e31fc322 Add an optional ArdourCanvas::Item::prepare_for_render interface
Called when an item has requested a redraw and intersects with visible
canvas area.

Also add Canvas::prepare_for_render that will call Item::prepare_for_render for
items visible on the canvas.
2017-06-26 08:40:47 +10:00
dac25b8db9 Add PreRender signal to the canvas
Emitted by the canvas immediately before rendering.
2017-06-26 08:40:47 +10:00
9618b6dcbb Whitespace fixes in canvas.h 2017-06-26 08:40:47 +10:00
90f169881f Remove unused ArdourCanvas::HSV constructor
Using stringstream for this is not locale independant. If this constructor is
needed at a later stage it should be reimplemented.
2017-06-22 10:48:38 +10:00
1170bd9043 Remove LocaleGuards from SVAModifier and HSV classes
float <=> string conversion now done using PBD::to_string/string_to so
LocaleGuards are no longer needed.
2017-06-22 10:48:38 +10:00
0e4ddcf506 Fix out-of-bounds waveform image rendering.
With large sample-rates and high-zoom-level the minimal request-size
or at least 1/10sed can exceed the max image size supported by cairo.
e.g. @192kSPS;  100ms = 19200 samples.
 * 1 sample/pixel, * 2 (left/right) = 38400px > 2^15px.
2017-05-14 20:37:58 +02:00
926a064744 Use PBD::to_string from pbd/string_convert.h in WaveView debug code 2017-04-19 09:37:01 +10:00
7085d7305d Use locale independent string conversion functions in SVAModifier class 2017-04-19 09:36:55 +10:00
aff92a019d Stop tooltip timeout when a canvas-widget or item is hidden. 2017-04-17 01:45:25 +02:00
5e9492b996 consolidate NSGLView 2017-03-21 15:53:29 +01:00
85b5741081 Allow to selectively use NSGLView Canvas
Various GdkEvents are not yet handled correctly, eg. unpacking a widget
from its container does not unmap it, nor are remaining widgets in the
contained re-positioned (size allocation does not change, nor does the
mapping). This affects eg. Mixbus Strips
2017-03-21 05:37:44 +01:00
d06de26a4f Towards a consistent render() API.
This fixes an -Woverloaded-virtual ambiguity introduced in b5e613d45

  void render (cairo_t*, cairo_rectagle*)
  void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*)

ArdourCanvas prefers cairomm and CairoWidget itself uses Cairo::Context,
this improves overall API consistency.
2017-03-20 17:12:08 +01:00
60a0b8f645 Forward un/map events to NSGLView 2017-03-20 17:12:08 +01:00
b5e613d453 Move NSGlView into libgtkmm2ext
This allows to re-use the concept with CairoWidget
2017-03-20 04:35:05 +01:00
b726255007 Fix OSX canvas when used without openGL NSView 2017-03-20 03:37:37 +01:00
5fe355af92 Use NSGLView with patched gdk
Special case Ardour's Canvas NSView to forward gdk-events
which are otherwise special-cased to read AU-views..
2017-03-20 02:15:15 +01:00
c371fc5115 Prepare NSView/OpenGL Canvas (to speed up rendering on [mac]OS[X]
This avoids Coregraphics (cairo_quartz_surface..) competely.
The openGL texture bypasses CG's slow argb_image and CGSColorMask
methods.
2017-03-19 22:49:17 +01:00
7ab1becd43 Snow White and the Pharaoh (mac rendering)
Once upon a time there was a beautiful Apple tree in palace of
GtkAnkhAmun in Cairo...
2017-03-17 16:54:16 +01:00
86ac64d528 NO-OP: whitespace 2017-03-17 16:03:59 +01:00
34d6de83a0 Disable Retina/Appple pango text-width workaround
Fix right-alignment (tempo-markers) and oversized bounding-boxes.
_width_correction should be removed after testing on various systems.
2017-03-11 05:13:17 +01:00
f5d6c908ac canvas::grid - more tweaks and improvements 2017-02-01 21:58:20 +01:00
fa2c4c525b canvas::grid : compute all row/col extents 2017-02-01 21:58:20 +01:00
94443bab7e basics of row/col span for Canvas::Grid 2017-02-01 21:58:20 +01:00
2c9b0796a3 change Grid API to avoid unnecessary Duple and open door for row/col span 2017-02-01 21:58:20 +01:00
91908dde7e clear up some CSS padding/margin confusion, and add row/col spacing 2017-02-01 21:58:20 +01:00
14cb9ec795 canvas::grid starts being able to do its job a little 2017-02-01 21:58:20 +01:00
e616324683 add basic data members and methods for adding an explicit size allocation for Canvas::Item 2017-02-01 21:58:20 +01:00
52718b3411 some initial bits of work on canvas allocation 2017-02-01 21:58:20 +01:00
484c3316d6 yet another case of misplaced parentheses during the removal of boost::optional from Canvas 2017-01-25 16:56:31 +01:00
49422aa89a another case of misplaced parentheses during the removal of boost::optional from Canvas 2017-01-25 16:54:29 +01:00
cce1c58198 This wasn't supposed to be pushed to master.
Revert "add basic data members and methods for adding an explicit size allocation for Canvas::Item"

This reverts commit d1c1d8df61.
2017-01-24 23:17:38 +01:00
d1c1d8df61 add basic data members and methods for adding an explicit size allocation for Canvas::Item 2017-01-24 22:45:22 +01:00
4fa4b9a135 remove use of boost::optional to define "undefined" Canvas::Rect, and use Rect::empty instead.
This commit includes Rect::operator bool() which might be a candidate for removal in a future commit, in an attempt
to make the meaning clearer
2017-01-19 20:54:54 +01:00
b4cf8cfc49 fix up Canvas::Grid child layout 2017-01-19 00:24:54 +01:00
73acd5b413 correct translation matrix for Canvas::Widget 2017-01-19 00:24:54 +01:00
c91c028c37 do not add items twice to their canvas parent! 2017-01-19 00:24:54 +01:00
88b3aa926a Accommodate newly introduced source(s) in our MSVC project (cairocanvas) 2017-01-16 15:21:47 +00:00
09a8ec534f canvas::grid: get padding and margin to work; remove some debug output 2017-01-15 21:40:42 +00:00
7c17327f56 get grid layout working 2017-01-15 12:13:03 +00:00
04e346a3d8 tweak Grid repositioning code to be a little more O(N) 2017-01-15 12:13:03 +00:00
99b86f0f05 basic (and probably wrong) Canvas::Grid child placement 2017-01-15 12:13:03 +00:00
0d1a083a5d include Canvas::Grid in build script 2017-01-15 12:13:03 +00:00
9ed87f6693 initial skeleton for a Grid canvas item 2017-01-15 12:13:03 +00:00
nick_m
3129370bc5 add ArdourCanvas::Flag::width() 2016-12-29 04:16:09 +11:00
004431426d Towards packing CairoWidgets on ArdourCanvas. 2016-12-19 13:36:42 +01:00
218d376154 vertically center text in time rulers 2016-12-19 13:27:22 +01:00
6bbb2c72f0 NO-OP: whitespace 2016-12-19 13:27:22 +01:00
nick_m
d118a60090 fix unused Outside filled framed curve for constant points outside the draw area. 2016-12-16 02:54:10 +11:00
nick_m
49c6d13386 revert c3ab67dd now that this misbehaviour is understood. 2016-12-16 02:52:39 +11:00
nick_m
d3ad6dc001 fix issue with disappearing tempo curve at constant tempi. 2016-12-16 02:50:07 +11:00
nick_m
9afe719827 amend incomplete change in previous commit. 2016-12-16 02:01:50 +11:00
nick_m
a99331a4e9 more work on patch change redisplay.
- fixes just-introduced undo crash.
2016-12-16 01:58:58 +11:00
nick_m
c3ab67ddb6 go back to always interpolating framed curve points. 2016-12-11 23:54:03 +11:00
f1f47664ff fix compilation with newer version of *mm and gcc-6.2 (RefPtr<> cast) 2016-11-30 16:00:05 +01:00
24c799cde3 prefer bool operator 2016-11-30 12:15:35 +01:00
5ed764178a Fix crash with empty patch-names.
An empty text will not produce a bounding box.
2016-10-29 19:57:43 +02:00
nick_m
92920307ae Tempo curve cleanup, now also works on optimized builds. 2016-10-17 01:28:33 +11:00
1552547f65 stop using gkd_pango_context_get() in ArdourCanvas::Canvas and require concrete instances to supply a Pango::Context; do this for GtkCanvas and Push2Canvas 2016-10-13 17:18:54 -04:00
1fe19ead70 Accommodate newly introduced source(s) in our MSVC project (cairocanvas) 2016-09-30 08:20:14 +01:00
c8ae41d598 fix errors reported by pixman for meter redraws (and add more comments to help the coordinate challenged 2016-09-28 13:37:19 -05:00
81f2ed452b provide ArdourCanvas::Text::{width,height}() 2016-09-27 14:59:32 -05:00
df5bb70616 optimize canvas meter redrawing (as in the non-canvas version) 2016-09-27 14:59:32 -05:00
1c94f6490e bug fixes for vertically-drawn Canvas::Meter 2016-09-27 14:59:32 -05:00
fccd0da9c6 bug fixes for Canvas::Box 2016-09-27 14:59:32 -05:00
29b8072555 add canvas-based Meter object 2016-09-27 14:59:32 -05:00
85c1523611 add new Box container for Canvas.
API subject to change and improvement
2016-09-27 14:59:32 -05:00
ba82e673fd add variant of Rect::expand() that allows different amounts in each direction 2016-09-27 14:59:32 -05:00
5d43d2e43f don't do as much work if a Rectangle has no outline width or outline what values 2016-09-27 14:59:32 -05:00
f66f7ba136 make inclusion/exclusion of hidden children optional in Item::add_child_bounding_boxes 2016-09-27 14:59:32 -05:00
5672419fff add Item::add_front() 2016-09-27 14:59:32 -05:00
095bdb7d40 make Item::child_changed() virtual 2016-09-27 14:59:32 -05:00
0613f8e3bd put change_alpha() into ArdourCanvas namespace as intended 2016-09-27 14:59:31 -05:00
216ce7bcb8 a slew of unconnected mostly minor tweaks to get Push2 support back to where it was...
... prior to using the canvas for the video screen
2016-09-27 14:59:31 -05:00
d4a64299c5 Add missing header include guards in canvas library 2016-09-13 14:32:22 +10:00
0ff233d234 Update our MSVC project files to generate the most recent Ardour session file format (ver 5) rather than the older v3 format 2016-08-30 07:15:00 +01:00
eec294a97e the endless quest to plug memory leaks -- episode 378 2016-07-25 17:16:32 +02:00
062712c691 Remove 'i18n.h' from some VC projects where it's no longer needed 2016-07-18 09:41:46 +01:00
cf52d6e4b4 enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
205fbb99ad canvas HSV color serialization needs LocaleGuard 2016-07-14 11:46:02 -04:00
a66ad18402 initialize some uninitialized variables 2016-07-13 04:31:34 +02:00
17b162c5da add fill-area feature to poly-line 2016-07-05 00:39:39 +02:00
nick_m
360f87b217 Fix FramedCurve Outside fill for curve. 2016-06-04 07:03:18 +10:00
nick_m
1eb8216408 More FramedCurve render work
- draw last point correctly if applicable

	- comment intent.
2016-06-04 06:40:59 +10:00
nick_m
62be6b2ed8 Fix framed curve thinko.
- in FramedCurve, the first _point is used for the bounding box.
	  Don't confuse this with actual data.
2016-06-04 06:00:41 +10:00
nick_m
575bb7792f Small cleanup in FramedCurve. 2016-06-03 02:02:50 +10:00
nick_m
8f88f42ba9 Fix assorted drawing bugs in framed curve.
- treat drawing area of boxes and curves similarly.

	- handle a redraw request between
	  the last sample and the last point.
2016-06-03 00:00:31 +10:00
81a2fe39e8 port 7e716d27 to XFadeCurve 2016-06-01 17:48:33 +02:00
nick_m
7e716d27a8 Fix conditional on uninitialised idx (via n_samples) in framed curve.
- possibly fixes drawing artefacts in the tempo curve.
2016-06-02 01:11:23 +10:00
nick_m
0d7f73cb27 Hopefully finally fix tempo curve flickering. 2016-05-29 05:12:07 +10:00
4c4bb98052 Accommodate newly introduced source(s) in our MSVC project (cairocanvas) 2016-05-28 10:43:50 +01:00
nick_m
2d31fa7bb1 Tempo ramps - finally fix flicker in framed curve. 2016-05-27 23:38:17 +10:00
nick_m
2a8104f2f8 Yr,[p ramps - fix flickering tempo curves when zoomed in. 2016-05-27 23:38:17 +10:00
nick_m
0c7ecc6cbb Tempo ramps - add Canvas::FramedCurve and use it in the tempo marker bar. 2016-05-27 23:38:16 +10:00
nick_m
6209b3f445 Tempo ramps - revert earlier change to Canvas::Curve 2016-05-27 23:38:16 +10:00
nick_m
86b0268e8b Tempo ramps - add visualtempo curve, dragging bbt or music rulers with constraint modifier dilates previous tempo. 2016-05-27 23:38:16 +10:00
nick_m
4f7a4cd233 Crapola - this is an experimental performance hack that must be reverted. 2016-05-27 23:38:14 +10:00
nick_m
7fc3b0c34c Initial stab at tempo ramps.
Replaces the list of points in TempoMap with TempoSection functions, which
compute tempo-at or tick-at time relative to tempo section start.
TempoMap consults them additively to determine things like bbt_time(),
frame_time() get_grid() etc.
This has a marked effect on scrolling speed along with the code simplification
in the places it has been attempted.

Several things are broken here.
Currently every ramp except the last one is an exponential ramp. this may
be simple to fix :).
Mouse-over midi grid doesn't match mouse click grid. should also be simple.

Many things seem to work, but their accuracy should be in question until
each area has been addressed.
2016-05-27 23:38:09 +10:00
742e113a7b backport canvas color functions from Mixbus 2016-05-17 18:17:51 +02:00
6d343ba3c6 fix LocaleGuard contstructor (3dc77280) 2016-05-07 12:19:41 +02:00
3dc7728038 we always only use the "C" locale when saving. 2016-05-05 21:49:56 +02:00
da26a55b31 canvas tooltips, too 2016-04-27 01:24:37 +02:00
40aa4cfe06 Modify our MSVC projects to build liblua as a DLL rather than a static lib 2016-04-04 16:40:20 +01:00
208dec7231 remove debug output 2016-03-01 18:37:19 +01:00
79d9973fa0 fix waveform flickering during recording 2016-03-01 18:06:29 +01:00
a27fed772b NO OP, whitespace 2016-03-01 14:43:44 +01:00
4384aff43f protect current_request with request_queue_lock 2016-03-01 14:43:28 +01:00
36d30f8c89 use glib mutex API 2016-03-01 12:53:54 +01:00
ba78359129 prepare for update to waf 1.8
uselib is no longer implicit (inherited by .use). This is still incomplete,
some uselibs for non-linux variants may be missing.

bld.is_defined("HAVE_XXX") also no longer works and will have to be
changed (I think to bld.env["HAVE_XXX"]) in countless places.
2016-02-28 21:16:44 +01:00
49148b627c force waveform images to be least 1px wide 2016-02-28 18:07:46 +01:00
4cd77f0544 try to narrow down #6478 2016-02-27 23:16:05 +01:00
d3634c5779 Accommodate 'lua' search paths in various projects where they're needed
(i.e. so that MSVC can find header files from lua).
2016-02-27 16:29:55 +00:00
Adrian Knoth
6fa88273aa Spelling correction patch from Debian
Patch taken (and forward-ported to HEAD) from
<https://anonscm.debian.org/cgit/pkg-multimedia/ardour.git/plain/debian/patches/0100-fix-typos.patch>
2016-02-22 15:13:01 -05:00
2d18283379 make threaded waveview rendering a configure time option (enabled by default) 2016-02-21 12:34:10 -05:00
b0518fa2be Revert "disable threaded waveform rendering for 4.7"
This reverts commit b0032adb44.
2016-02-19 21:13:29 +01:00
b0032adb44 disable threaded waveform rendering for 4.7 2016-02-18 18:56:05 -05:00
d61cf81997 The return of threaded waveform rendering and related crashes. 2016-01-16 14:18:59 +01:00
2992506652 disable threaded waveview rendering.
This will be re-enabled once 4.5 has been released
2015-12-16 10:28:17 -05:00
5f4f89fb39 Move PBD symbol demangle functions into pbd/demangle.h/cc
Add pbd/demangle.cc source file and move functions from pbd/stacktrace.cc into
it
2015-12-01 14:22:38 +10:00
73d1de3b75 NOOP, remove trailing whitespace, replace tabs in python scripts 2015-11-29 17:54:31 +01:00
160b24b137 fix crash when cleaning up canvas items
Backport from Mixbus. In Ardour this does not currently matter
since there is no top-level canvas destroyed top-down.

...
Editor::session_going_away
MixerStrip::~MixerStrip
MixbusStripCanvas::~MixbusStripCanvas
ArdourCanvas::GtkCanvas::~GtkCanvas
ArdourCanvas::Canvas::~Canvas
ArdourCanvas::Root::~Root
ArdourCanvas::Container::~Container
ArdourCanvas::Item::~Item
ArdourCanvas::Item::clear_items
GtkCanvas::item_going_away()
queue_draw_item_area()

..expose can take place async to garbage collection: crash in one of the
items.
2015-11-02 05:15:55 +01:00
5bdc869e49 remove invalid assertion - #6634
There is a highly unlikely case where the render thread can have zero
requests in the queue, but it is not supposed to be terminated.

 1) WaveView::queue_get_image(); 
wake up thread, *but* the thread does not start yet
 2) WaveView::cancel_my_render_request(); 
and now the thread starts.

1,2 are initiated by user actions from the GUI thread and are normally
orders of magnitude slower than scheduler-thread wakeup.
2015-10-22 12:20:42 +02:00
1c0265e27c Include button number in canvas button press/release debug info 2015-10-06 13:29:57 +10:00
22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
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
8a4bf386a4 amend previous commit. 2015-09-14 21:25:57 +02:00
9a533c925b fix short x-fade rendering 2015-09-14 21:18:56 +02:00
ec06f2c49f spelling error fixes (notably "overriden" => "overidden") from IOhannes m zmölnig 2015-09-11 09:23:43 -04:00
57321bef35 consistent pango-text layout size - fixes #6490
Use gdk_pango_layout() for all text-size calculations.
In Canvas::Text always use the same context (local image surface)
for layouting (prior to this, local and window-context mix resulted in 
different sizes).
2015-09-06 16:39:08 +02:00
2f69ee8ec8 a couple of debug output statements to help diagnose a crash, part 2 2015-09-02 12:58:07 -04:00
e91a0f7e11 a couple of debug output statements to help diagnose a crash 2015-09-02 12:24:37 -04:00
93aa8d3734 waveform, mutex for _current_image
may be used in render-thread while invalidate_image_cache() is called.
possible fix for #6478
2015-09-02 14:28:26 +02:00
c6d6f038b4 handle waveform drawing thread shutdown 2015-09-02 01:46:31 +02:00
e69368cc8f clear out some SessionHandleRef's on close. 2015-08-20 22:27:35 +02:00
63e3f326e9 clear waveform cache when shape changes - fixes #6525 2015-08-20 03:01:51 +02:00
ca0c9b3636 Replace "%z" modifier with glib macro for portability. 2015-07-30 17:00:03 +02:00
bbece8f8d9 try using threaded waveviews in tracks also 2015-06-29 14:18:15 -04:00
a38e67d55b never use threaded waveview rendering for Tracks 2015-06-29 14:18:15 -04:00
329753241f clip level is adjusted only by region amplitude (which is audible), not by _amplitude_above_axis 2015-06-29 14:18:15 -04:00
bace0e85dc attempt to correctly respond to changes in _amplitude_above_axis in ArdourCanvas::WaveView 2015-06-29 14:18:15 -04:00
7fae6bcd87 copy all XCode project files from Tracks.
Rationale: the Waves team maintains the XCode project files, the Ardour crew doesn't. Thus, the Waves'
version is more canonical
2015-06-29 14:18:10 -04:00
14ffde884f conditionalize background fades depending on whether this is a tracks or other build 2015-06-29 14:18:10 -04:00
26b0201c69 tweak for static library build 2015-06-29 14:18:10 -04:00
5aa834e1d8 fix windows debug builds:
undefined reference to `std::basic_ostream >& boost::operator<< , ArdourCanvas::Rect>(std::basic_ostream >&, boost::optional const&)'
2015-06-25 14:33:45 +02:00
fe672c827c show zero line when a DC offset moves waveform so that it doesn't intersect with the zero line (from Nimal Ratnayake <nimalr@pdn.ac.lk>) 2015-06-24 14:12:13 -04:00
2b81d4d0fe do not draw waveform outline at x-positions where the waveform "spread" would not leave at least 1 pixel between the two outline pixels.
Plus a better comment.
2015-06-23 17:12:52 -04:00
e9224a58d1 several changes, major and minor, to improve threaded waveview rendering 2015-06-23 14:26:26 -04:00
dece3c20ca create sortable, linear list for cache clearing on demand, rather than trying to maintain it in parallel with the cache map 2015-06-23 08:42:55 -04:00
424f6539b4 change location for initialization of static WaveView image cache, and provide a visible method to set the cache flush threshold 2015-06-23 08:17:48 -04:00
239052759f stop endless loop in WaveViewCache::cache_flush()
Still need to figure out how this could ever happen. It requires an image (shared pointer) to
be in the linear cache image list but not in the map
2015-06-22 22:00:45 -04:00
10203b5517 two more corrections to waveform zooming changes 2015-06-19 08:32:05 -04:00
3cf8cb3c3e fix call to consolidate image cache to use the information held in the request 2015-06-19 08:29:05 -04:00
8491a015e3 stop pixel jitter when changing waveview height.
To avoid pixel jitter, the top and bottom of each line in the waveview must be computed together in a single computation,
rather than independently.

Also, remove various height corrections and cairo translations that are not necessary or relevant anymore. A subsequent
commit for the GUI will pick up on this work to get the appearance completely correct
2015-06-19 08:14:02 -04:00
1043357cc9 attempt to correctly respond to changes in _amplitude_above_axis in ArdourCanvas::WaveView 2015-06-19 08:10:45 -04:00
2ec9151170 fix compiler const-cast warning 2015-06-19 08:10:35 -04:00
a1932c7feb Correctly re-start an iteration (if we delete one of the items being iterated) 2015-06-19 12:55:38 +01:00
d65f03d074 fixes for canvas text display on Retina (from Valeriy) 2015-06-16 07:52:00 -04:00
b86a8edcff NOOP, reindent code. 2015-06-13 22:05:29 +02:00
c8e16998bf fix crash on OSX displaying MIDI sysex, or similar text. 2015-06-13 22:04:31 +02:00
cc543280d9 We were 2 more debug "bits" away from overflow, so recast PBD::DEBUG mechanism away from a 64bit integer and toward std::bitset.
Clean up a few minor related PBD::DEBUG issues along the way
2015-06-12 18:14:09 -04:00
10643779b6 more refactoring of WaveView threaded code to try to get to heart of crash bug 2015-06-11 17:04:08 -04:00
077e625734 don't queue a callback with the idle event for waveview image generation if one is already queued.
Also, hold relevant lock when waking image rendering thread.
2015-06-11 13:35:01 -04:00
753d1ac392 possible fix for crashes related to vanishing waveviews (and if it doesn't fix anything, it is still more correct than it was) 2015-06-10 22:26:58 -04:00
ac2b0a327c fix basic error with computation of partial image width; add use of DEBUG_TRACE (DEBUG::WaveView,...) 2015-06-10 18:48:12 -04:00
1c6c9e95ba add PBD::DEBUG::WaveView 2015-06-10 18:48:12 -04:00
801af5df9e Add the new (UINTSDEFINED) preprocessor directive to all out MSVC projects (just to be on the safe side) 2015-06-09 13:18:42 +01:00
bc945bb3d3 use existing partial existing waveview images (if they exist) while waiting for the full ones 2015-06-04 17:46:53 -04:00
25797d8618 don't use the return value from AudioRegion::read_peaks() because it is either zero or n_peaks 2015-06-02 12:17:50 -04:00
9706125526 Amend WaveView::send_request() such that it'll compile with MSVC
Hopefully, this was the original intention (I've simply amended a function call to match similar usages elsewhere in the code).
2015-06-02 11:17:31 +01:00
95c991ba35 reinstate absent image.
Then go back to bed and be ill some more.
2015-06-01 21:08:56 -04:00
0288454387 remove debug output and get logic correct to cause first render to always use the render thread 2015-06-01 14:55:17 -04:00
d17e35772d drop in threaded waveview changes via the two affected files.
Rebasing the feature branch against master was too messy, and only these two files were
changed. The development history of this branch could easily have been --squash'ed anyway,
so not much of a loss
2015-06-01 14:45:41 -04:00
d7a9c11315 fix x-fade display access beyond array boundaries 2015-05-19 19:28:22 +02:00
198c4d1d88 gfx-card & performance testing 2015-05-02 04:54:59 +02:00
89f5e22896 fix double precision abs value computation 2015-04-29 19:56:35 +02:00
84aab564b4 enable fade-out display by default in A4.
..because fade outs are implicit in A4.
Eventually the GUI needs to set_show_background_fade() as needed.
2015-04-29 19:55:53 +02:00
c36504f2ec NOOP: fix indentation 2015-04-29 09:05:15 -04:00
GZharun
1a84fa3c42 [Summary] Should have been committed with previous: made background fade optional and not shown by default 2015-04-29 08:59:24 -04:00
80ae2bbe23 fix issue with manual merge conflict 2015-04-29 08:23:13 -04:00
2828dcaaf9 make computation of OS X pango text width correction less intrusive/more efficient.
Compute the correction only once after each font specification setting.

Conflicts:
	libs/canvas/canvas/text.h
2015-04-29 08:20:31 -04:00
a83050a255 manually apply grygorii's API to manage a correction for pango errors in text size computation on OS X 2015-04-29 08:19:22 -04:00
5ab699f898 manually apply grygorii's waveform amplitude implementation 2015-04-29 07:54:21 -04:00
GZharun
96371c8327 [Summary] Fixed issue when width request from Cavas text returned old width value
[Reviewed by] Paul Davis

Conflicts:
	libs/canvas/canvas/text.h
2015-04-29 07:27:34 -04:00
84cb8913b0 change placement of ruler divider so that the lower line is at the specified height, rather than the upper 2015-04-29 07:26:29 -04:00
697d8a2732 do the right thing when TrackingText::offset is changed 2015-04-29 07:26:18 -04:00
d9cb8a807e Fix method hiding in Canvas::Text 2015-04-29 07:25:58 -04:00
2673ef4af4 change ruler rendering to change tick heights and move text down 2015-04-29 07:23:36 -04:00
065c6d813e add missing API 2015-04-29 07:22:48 -04:00
4cf402bdcf add API to Ruler to optionally draw a divider (2 single pixel horizontal lines) at some position within the vertical extent of the ruler 2015-04-29 07:22:36 -04:00
38728f0835 correct implementation for Rectangle::vertical_fraction() 2015-04-29 07:22:21 -04:00
59ce8663f9 add Rectangle::vertical_fraction() as a convenience method
Conflicts:
	libs/canvas/rectangle.cc
2015-04-29 07:22:05 -04:00
nick_m
dff83c77cf Amend ac1f7e0b 2015-04-17 05:36:13 +10:00
nick_m
ac1f7e0b9f Indicate all clips on rectified view. 2015-04-17 05:26:57 +10:00
nick_m
7f41de7427 Improve waveview height and scaling.
The top line of the selection rect is arguably 1 px too low, but
waveviews seem centered on the area properly.
2015-04-17 05:03:51 +10:00
b3fb73812c Position (and size) canvas tooltips such that they better resemble Gtk tooltips
Mixbus in particular uses both types of tooltip so we might as well make them look the same.

N.B. The appearance is fine now on Windows but needs to be tested on the other platforms (i.e. some tweaking might be necessary).
2015-04-09 15:46:12 +01:00
2234fd4b8a Delete a canvas tooltip after we've finished with it
All canvas objects share just one tooltip object which is based around Gtk::Label. The Label expands if the current tooltip text is wider than the previous text. However, it doesn't shrink again if the next tooltip has shorter text. Eventually, this results in some very strange looking tooltips (especially in Mixbus where they're used quite extensively).

Deleting the object after use will force a new object to get generated next time (at the correct size). There's still only ever one object per canvas but it's no longer persistent.
2015-04-09 15:42:00 +01:00
47110c983c fix OSX/PPC 10.4 long maths 2015-03-31 16:05:15 +02:00
2e27b55179 For the canvas library, #include 'gtkmm2ext/gui_thread.h' rather than 'gtk2_ardour/gui_thread.h'
Technically it doesn't make much difference but from what I can tell, the only files which #include 'gtk2_ardour/gui_thread.h' are the source files from gtk2_ardour itself. The support libraries always #include 'gtkmm2ext/gui_thread.h' directly (which seems sensible). So for consistency's sake, let's keep it the same for libcanvas.
2015-03-29 09:53:02 +01:00
nick_m
8962bfba61 Better fix for 6183.
Invalidate all source entries from the image cache when we get our
region's DropReferences signal, while ignoring any subsequent regions with
no source.
2015-03-29 02:13:40 +11:00
nick_m
eff25b06f5 Fix 0006183 (waveview crash).
Should fix crash when audiosource disappears.
Reworked from submitted patch from tlat.
2015-03-24 23:35:43 +11:00
nick_m
bc20da35f7 Revert mistaken change in e7b0e67bc8 2015-03-22 05:35:13 +11:00
nick_m
69a6c4d747 Provide an image if there are no peaks. 2015-03-22 00:31:32 +11:00
0f2ead3d6b fix redraw of automation ControlPoints 2015-03-20 23:31:21 +01:00
86c6541323 Move PC flags to avoid obscuring region name.
Fixes bug #6179.  Top vs. bottom seems pretty arbitrary to me, and this solves
the obscuring issue (which is quite common since there are often PC events at
the start of MIDI files), so bottom it is.
2015-03-14 00:21:29 -04:00
nick_m
e7b0e67bc8 Manual merge of the drawing component of waveview branch.
In summary:

    * no antialiasing of waveviews
    * no diagonal lines
    * simplify clip detection
    * don't use LINE_CAP_ROUND for outline
    * use the wave colour when drawing outline only
2015-03-10 23:35:53 +11:00
nick_m
5d5f83c56b The commit 3da9c3b740
wasn't the no-op it claimed to be.
2015-02-20 23:30:48 +11:00
bd6ef95989 add accessor methods for single_exposure 2015-02-12 11:35:35 -06:00
b8ec035b24 _single_exposure is now a member variable for each GtkCanvas.
Gtk coalesces multiple exposes into a single combined rect.
If _single_exposure is disabled, we break apart the individual expose rects for the canvas rendering.
2015-02-12 11:35:35 -06:00
0f0aebf26b remove naive attempt to avoid drawing first vertical pixel line of Canvas::WaveView
And add commented out attempt at more subtle attempt to get it right
2015-02-11 21:59:38 -05:00
a992a2e6e0 simplify Canvas::Rectangle rendering to avoid unnecessary nonsense, and remove TimeRectangle 2015-02-11 21:59:38 -05:00
2a5921ecf1 Canvas::Rect::contains() should treat its right/left coordinates as exclusive 2015-02-11 21:59:38 -05:00
34779ee81e add a sort-of hack to allow us to avoid drawing the first pixel of a waveview when necessary 2015-02-10 19:48:47 -05:00
c679d616f6 correct drawing of rectangle borders.
They need to use fractional coordinates, and the border position needed
generalizing for other border widths. See verbose comment for details
2015-02-09 16:41:28 -05:00
736038556f canvas items must be able to use fractional positions when rendering.
This is required to be able to draw precise single pixel lines, as described
in the Cairo FAQ
2015-02-09 16:40:10 -05:00
b4a0136155 tweak to help with uncoalesced renders 2015-02-03 17:35:37 -06:00
9fab39358a render canvas using the GDK region rather than the GDK area.
The region is the un-coalesced set of rectangles that were requested for redraw. The area
is the coalesced single rectangle. In the worst cases, the coalesced rectangle could span
the entire window even though just two pixels in opposite corners were to be redrawn.

There is a problem with the verbose cursor as it is dragged across MIDI tracks. TO BE
FIXED.
2015-02-03 15:38:14 -05:00
ccd881d518 ScrollGroup::covers_{window,canvas}() need to account for possible non-zero position of the group.
They also do NOT need to consider scroll offset
2015-01-24 18:48:28 -05:00
e84e1f7403 ScrollGroups are kept in their own list, so ::window_to_canvas() does not need to inspect root group children to find them
Conflicts:
	libs/canvas/canvas.cc
2015-01-24 18:48:15 -05:00
f282884094 apply Theme > “Show waveform clipping”
fixes http://tracker.ardour.org/view.php?id=5589#c15515
2015-01-21 19:35:04 +01:00
d2fa2450aa use C locale, because POSIX locale is not supported on windows, and operation is undefined. C works on all platforms 2015-01-19 07:29:25 -06:00
a58730e8f9 Revert "Kludgey fix for invisible playhead when scrolled."
This reverts commit 8f823388d9.
2015-01-16 22:06:10 -05:00
fc70b5a9f9 Compute arrow bbox manually to appease crazy canvas. 2015-01-16 22:04:26 -05:00
8f823388d9 Kludgey fix for invisible playhead when scrolled.
The problem this is avoiding makes absolutely no sense.  Either I'm dumb, or
something is more deeply wrong with scroll group bounding boxes, or both, but I
don't care anymore.  This works.  Viva release mode.
2015-01-16 21:04:38 -05:00
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
d194ec9135 Update arrow bbox when geometry changes. 2015-01-16 19:13:56 -05:00
e48ff6b6a0 Fix clipping for scroll groups an offset bbox. 2015-01-16 19:13:56 -05:00
55278fb3b0 Fix mouse event position offset bug.
Search scroll groups for event delivery from top to bottom rather than bottom
to top.  Overlapping scroll groups still aren't properly supported by the
canvas, but currently all we care about is that the top one gets the event, so
the hscroll group (tempo lines) can be below the hvscroll group (tracks), but
the latter gets events.
2015-01-12 01:05:01 -05:00
0367aa5825 remove cruft (old unused pre-git version files) 2015-01-09 06:11:57 +01:00
ec17b5388f Fix bounding box of rectangles with wide outlines. 2015-01-08 18:36:10 -05:00
7985624037 Close polygon borders (fix partially drawn hits). 2015-01-08 11:09:38 -05:00
2558e52e22 Fix alleged use of uninitialized variable.
Looks like a guaranteed else branch to me, but who am I to argue with gcc?
2014-12-31 17:32:21 -05:00
86242348ec Fix crash when getting width of item with no bbox. 2014-12-24 16:02:56 -05:00
a494211e73 add ArdourCanvas::change_alpha()
Time to move away from rgba macros
2014-12-19 09:53:26 -05:00
74be550698 change Item::visible() to Item::self_visible(); add Item::visible() which returns accurate visibility
Child items will be hidden when their ancestors are hidden. The old ::visible() implementation didn't reflect this. In addition,
when changes are made to hidden items (new definition of visible/not visible), don't bother to request redraws, since this will
be done when the item becomes visible again.
2014-12-18 10:30:38 -05:00
9831006c8e add getters for SVAModifier 2014-12-15 12:06:53 -05:00
995bcd3aa0 fix typo 2014-12-15 09:29:04 -05:00
aa57e9e032 more fixes to SVAModifier constructor(s) 2014-12-15 09:03:52 -05:00
3fa4063d9b fix up SVAModifier constructors 2014-12-14 23:41:31 -05:00
427b93055f add SVAModifier to ArdourCanvas color code 2014-12-14 23:34:36 -05:00
624a86c39d lots more color work, closer and closer to being ready for ... being taken apart again 2014-12-08 22:02:38 -05:00
9ac7ddb31d remove all explicit button text colors; use contrasting_text_color() instead.
Also, use a slightly off-white rather than pure white, which should really be configurable
2014-12-07 13:55:40 -05:00
60f4f5b9d8 Fix inappropriately massive flag font. 2014-12-06 16:07:32 -05:00
9266e7524a experimental drawing optimization.
Q: is bounding_box(); etc more complex than queuing draw?

either way, canvas should eventually switch to
use an optimized OptimizingLookupTable.
2014-12-05 22:40:26 +01:00
207fd04587 include alpha-delta computation in HSV::delta() 2014-12-05 09:01:55 -05:00
db3d42d551 first pass at optimization for low-level canvas code 2014-12-02 05:32:34 -05:00
f190e630ab Show discrete/toggled automation as stepped line. 2014-11-28 21:15:28 -05:00
ea35595370 Add some newly introduced source files to our MSVC project (cairocanvas) 2014-11-28 14:42:17 +00:00
3d4b1d324e Fix calculation using uninitialized value.
Implicit "this" is the devil.
2014-11-27 04:15:30 -05:00
6edd81e4f6 get correct ::distance() and ::delta() implementations for cases involving achromatics 2014-11-26 18:22:22 +02:00
318a9edab9 massive reworking of color selection implementation 2014-11-26 18:22:22 +02:00
ea5876b836 Remove dead code. 2014-11-25 02:11:44 -05:00
bd577a0663 Avoid possible use of uninitialized values.
This could only happen with a broken widget, but it shuts up clang and doesn't
hurt.
2014-11-18 02:55:03 -05:00
333c776e0e Fix MIDI region keyboard editing (add key handling to canvas). 2014-11-15 02:04:28 -05:00
9a9a8f78ef fix define 2014-11-13 19:05:58 +01:00
12b715e6fa tweak canvas on_expose_event() handler to avoid unnecessary save/paint/restore 2014-11-10 20:34:20 -05:00
fdcb792358 further work on new color manipulation code 2014-11-10 20:33:54 -05:00
1317b57221 add required header for compilation 2014-11-10 11:46:17 -05:00
ef56948d4a add background color property to Canvas::Canvas ; rearrange expose handling and include background fill
Conflicts:
	libs/canvas/canvas.cc
	libs/canvas/canvas/canvas.h
2014-11-10 10:43:25 -05:00
373caeede8 Add some newly introduced source files to our MSVC project (cairocanvas) 2014-11-08 10:48:26 +00:00
4260d0ca0e use new canvas colors header as necessary 2014-11-07 14:24:27 -05:00
69fd25f6f4 move canvas colors code into its own file(s) 2014-11-07 14:24:13 -05:00
a441de1a18 when drawing only part of a Canvas::Rectangle outline, we only need to do the cairo-pixel alignment math for the axis perpendicular to the edge 2014-11-07 12:58:56 -05:00
0fedfab593 tentative fix for canvas background/image surface 2014-11-07 16:50:21 +01:00
7670e463cc add API to extract color from ArdourCanvas::Text and tidy up member declarations
Conflicts:
	libs/canvas/canvas/text.h
2014-11-06 20:38:02 -05:00
787f9748b6 changing the clamp_width of an ArdourCanvas::Text needs to potentially provoke an entire redraw
This fixes missing range marker text in sessions where the initial zoom value causes an initial clamp_width of zero
2014-11-06 20:38:02 -05:00
c9c4a5c29d raising/lowering canvas items should trigger a redraw 2014-11-06 10:58:37 -05:00
ecd618c343 correct the rendering of Rectangle outlines, and the computation of their bounding box 2014-11-05 19:45:23 -05:00
857719f2e1 add Rect::shrink(Distance) even though it arguably should be handled by Rect::expand() 2014-11-05 19:45:23 -05:00
f3d349bc9a add some more outline enums to ArdourCanvas::Rectangle 2014-11-05 19:45:23 -05:00
589e59d7a1 allow derived classes to access Item::{scroll,position}_offset(), mostly for debugging purposes 2014-11-05 19:45:23 -05:00
b02ea3d435 alter implementation of ArdourCanvas::contrasting_text_color() to use gamma-adjusted luminance values rather than simple contrast 2014-11-05 11:13:28 -05:00