13
0
Commit Graph

790 Commits

Author SHA1 Message Date
be481ec266 Canvas: fix fill/outline area for a cBox 2021-08-13 12:51:26 -06:00
0823a6328b Canvas: third constraint test 2021-08-13 12:51:26 -06:00
a349d7e49b remove debug output 2021-08-13 12:51:26 -06:00
94b44ceb52 Canvas: add second constraint tester 2021-08-13 12:51:26 -06:00
0d5725a63b Canvas; fix rectangle rendering geometry 2021-08-13 12:51:26 -06:00
04d00da461 Canvas: fix text rendering geometry 2021-08-13 12:51:26 -06:00
7153544b52 Canvas: many changes to cBox implementation 2021-08-13 12:51:26 -06:00
d37202585f Canvas: root group should not fill or outline itself 2021-08-13 12:51:26 -06:00
2e993c6f86 Canvas: tweak test script runner 2021-08-13 12:51:26 -06:00
61742ededf Canvas: change behavior of Item::preferred_size() for items without an intrinsic size 2021-08-13 12:51:26 -06:00
ea96798ee9 Canvas: tweak debug output for canvas rendering 2021-08-13 12:51:26 -06:00
0434f00a47 remove debug output 2021-08-13 12:51:26 -06:00
711c1520b5 Revert "towards a very different constraint layout tester"
This reverts commit 7f65ffe57685304f59bb336c9701c3a9d5cdc1a7.
2021-08-13 12:51:26 -06:00
11931f5ffb towards a very different constraint layout tester 2021-08-13 12:51:26 -06:00
f0a0104087 Canvas: add shell scrip to run cnnstraint_test 2021-08-13 12:51:26 -06:00
504d8fdab3 Canvas: size request using preferred_size() callstack 2021-08-13 12:51:26 -06:00
5650d4f5bb Canvas: container supports option to do fill & outline 2021-08-13 12:51:26 -06:00
55deb1261a Canvas: use whomami() not earlier debug_name() API 2021-08-13 12:51:26 -06:00
811a893583 Canvas: some tidying in layout test app 2021-08-13 12:51:26 -06:00
240cb7b98f Canvas: make Rectangle work with layouts 2021-08-13 12:51:26 -06:00
e0c58a2736 Canvas: add aliases to Canvas::Rect for comprehension 2021-08-13 12:51:26 -06:00
2423994029 Canvas: add aliases to Canvas::Rect for comprehension 2021-08-13 12:51:26 -06:00
f47deb717c Canvas: add layout-related methods and members to Item 2021-08-13 12:51:25 -06:00
6d89d3afef Canvas: add Item::whoami() for debugging output 2021-08-13 12:51:25 -06:00
f17160ee0e Canvas: modify Arc to work with layout 2021-08-13 12:51:25 -06:00
ad39faeb3e Canvas: alter RootGroup to work with layout 2021-08-13 12:51:25 -06:00
baea368223 Canvas: initiate size allocation process from GTK-level size allocate event 2021-08-13 12:51:25 -06:00
84afcb62c4 Canvas: child_changed() API fix for Box 2021-08-13 12:51:25 -06:00
fc9840f2a9 Canvas: change API of Item::child_changed() to include bool indicate bounding_box change 2021-08-13 12:51:25 -06:00
d6fa458f3b Canvas: Text item should take position into account when rendering 2021-08-13 12:51:25 -06:00
1baa8d68c7 Canvas: reindent Kiwi code, and provide operator<<(ostream&) for several objects 2021-08-13 12:51:25 -06:00
ba3515e619 NOOP: remove whitespace 2021-08-13 12:51:25 -06:00
b1a6982064 Canvas::Arc obey fill/outline conditionals 2021-08-13 12:51:25 -06:00
a3039d3895 add/update constraint packing containers, test code 2021-08-13 12:51:25 -06:00
606866ea00 add small dev/test utility for working on constraint packer 2021-08-13 12:51:25 -06:00
1c3e743d2a Canvas: continued work on constraint packer 2021-08-13 12:51:25 -06:00
01137cbbf3 Canvas: change container-related methods in Item to be virtual 2021-08-13 12:51:25 -06:00
b90332b439 Canvas: change LineSet::add() to ::add_line()
Preparation for virtualization of Item::add()
2021-08-13 12:51:25 -06:00
539e1a1f1b stub constraint-based packer for canvas 2021-08-13 12:51:25 -06:00
5957e14259
Remove unused #include<> (2/2)
PBD::stacktrace() is not used nor needed by default.
It should be used sparingly.
2021-05-05 17:57:16 +02:00
d04713c0ab
Add missing class to canvas forward declarations 2021-02-14 00:54:17 +01:00
20029ec7e6 canvas/ruler: provide option for a second font to be used for "major" marks 2021-01-03 16:50:18 -07:00
8a14a7a00b
Fix tracking-text offset
If position along a given axis is not tracked, then the
offset was applied repeatedly to the current position.
This caused the coordinate to run away.
2020-12-30 03:26:00 +01:00
d741f01ad0
NO-OP: whitespace 2020-12-30 03:25:57 +01:00
ce8846d13f
Fix polygon redrawing -- #8148
Polygons used PolyLine::render() to render the path.
However since 7bb8ca1e76, the PolyLine path is constrained
(for automation lanes), and closed shaped polygons were not
always completely redrawn.
2020-07-09 02:10:28 +02:00
247bd4d3d9
NO-OP: whitespace 2020-04-10 18:32:18 +02:00
ede0fd3ddf
Remove hardcoded 2^15 cairo-boundary, prefer window-area 2020-04-10 18:28:26 +02:00
2177462b73
NO-OP: consistent function and variable naming 2020-04-10 18:06:42 +02:00
bc4de874dc
NO-OP: whitespace 2020-04-10 18:06:42 +02:00
9bbedcb781
Remove unused function
Cairo::curve_to renders cubic Bézier splines, those are not
generally useful in a DAW context.

Canvas::Curve implements centripetal catmull-rom spline drawing
which can be used for fades and automation interpolation.
2020-04-10 18:06:42 +02:00
7bb8ca1e76
Interpolate poly-line with view-point #6481 2020-04-10 18:06:41 +02:00
6cc1e5e75d
NO-OP: whitespace 2020-04-10 18:06:39 +02:00
f744b5fc12 change velocity bar inside notes to extend to edges of note
Having the velocity bar inset from note causes distracting space at beginning of note
when viewing a MIDI note that is zoomed out
2020-03-26 10:12:54 -06:00
4151ec1907 remove accumulated debug output 2020-03-25 15:12:30 -06:00
dbcf7dd666 more playhead-drag/click locate debugging 2020-03-25 13:50:23 -06:00
André Nusser
0a1ed004f2
Remove unused forward declaration. 2020-02-24 23:01:15 +01:00
06b2eb1c27
Explicitly use OSX
Previously this was inherited via PBD.

On MacOS/X,  this adds
  "-undefined dynamic_lookup -flat_namespace"
and various "-framework .." options to linkflags

Without this flag, .dylibs fail to link usually because
of missing `-lintl` (Undefined symbols: "_libintl_dgettext")

On other systems this is a NO-OP:
CFLAGS_OSX, CXXFLAGS_OSX and LINKFLAGS_OSX
are only set on the darwin platform.
2020-01-25 04:07:41 +01:00
bca825e515
NO-OP: whitespace 2020-01-14 00:52:24 +01:00
John Emmas
45dd6a8ed3 Add a missing semicolon 2020-01-05 10:29:35 +00:00
0b266a54f0
Return of image-surface backed canvas (windows graphics performance)
This partially reverts 2edbda2526.

Using cairo-groups increases performance on MacOS, and retains
retina-resolution.
However it adds a performance regression for MS Windows graphics
rendering. cairo-groups use a "similar" surface, not an image surface.
Empirically this adds significant overhead compared to rendering
using the CPU and using bitblt.
2020-01-04 00:30:07 +01:00
2edbda2526
Replace explicit image-surface with cairo pattern/group
For MacOS/X this is equivalent, rendering happens using a
CGBitmapContext + image-surface. Windows and Linux needs profiling
for respective equivalent surfaces.
2019-12-27 19:35:02 +01:00
c3ab63a2ea
Allow for per-widget image-surface backing
This is an intermediate commit, before replacing image surfaces with
cairo pattern groups.

The eventual goal is to reduce flickering and/or use
CPU + bitblt for specific widgets instead of cairo
graphics-cards accel.

This also removes excessive calls to getenv() for every rendering
operation.
2019-12-27 19:34:56 +01:00
ecc2597870
Fix remaining doxygen warnings (!) 2019-09-30 21:03:29 +02:00
bfec73b8c3
NO-OP: whitespace, indent 2019-09-30 21:03:20 +02:00
5ec5bc4523 goodbye USE_TRACKS_CODE_FEATURES and is_tracks_build 2019-09-25 12:16:13 -06:00
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