Commit graph

64 commits

Author SHA1 Message Date
Robin Gareus
5ffc3aa28b
Use PBD namespace for free CPU functions
Ideally never put methods in the global namespace
to prevent potential conflicts.
2025-08-15 22:10:31 +02:00
Paul Davis
0b0dde46e0 waveview is the only type of canvas item that needs prepare for render
Also, virtual keyword in derived classes is redundant
2025-07-29 18:16:35 -06:00
Robin Gareus
99c1f50a72
Really remove gtk+ option (see also 1e28ee9cc9)
After patching gtk/ytk to add touch support and macOS rendering,
upstream gtk+2 is no longer an option
2025-07-06 15:20:20 +02:00
Robin Gareus
233fc890de
Update gdkmm -> ydkmm header location (omnibus commit) 2025-02-01 15:01:52 +01:00
Robin Gareus
911399f8b3
Use same rounding for wave-view rectangle as TAV
Previously the waveform could exceed the AudioRegionView's
Rectangle on either side due to rounding.

```
round ((start - end) / spp) != round (start/spp) - round (end/spp)
```
2024-11-28 15:00:36 +01:00
Robin Gareus
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Alejandro Domínguez
1ffb70f670
Replace boost::scoped_ptr with std::unique_ptr (1/2) 2024-10-19 01:04:14 +02:00
Robin Gareus
30dc9ccc86
Replace boost::scoped_array<T> 2024-10-19 01:04:02 +02:00
Robin Gareus
2d7cce44f1
Replace PBD::Signals (1/2) 2024-10-18 20:41:08 +02:00
Paul Davis
75f56cd3e1 the great onceification (libs)
Replace use of #ifndef header guards with #pragma once

Modern C++, baby!
2024-10-17 07:44:31 -06:00
Robin Gareus
88a24ae8e5
Let PBD::Thread set thread-name 2024-09-28 03:16:07 +02:00
Robin Gareus
d8e4e7b259
Fix calculating intersection of waveform rectangle
see also 68eb63e0c8
2024-09-27 02:54:35 +02:00
Robin Gareus
9d0415ba04
Waveview: fix visual jitter when trimming or splitting regions
The left edge of a region on the the editor is rounded to be
on a pixel. When zoomed out, the position corresponding to that
pixel is not usually identical to the region's position().

We need to correct for this as best as possible, while keeping
peaks aligned to pixels.
2024-09-26 02:21:24 +02:00
Robin Gareus
68eb63e0c8
Waveview: fix rounding, span entire region rectangle
Previously samples at the end could end up being cropped,
when the Waveview is rendered using an offset.
2024-09-26 02:21:24 +02:00
Robin Gareus
ad51c7c2ba
Localize stripped down gtk2
This is intended mainly for GNU/Linux distros who will remove
GTK2 support in the near future.
2024-01-06 21:52:48 +01:00
Mads Kiilerich
6b61b03434 wscript: drop traces of shutdown() handling
autowaf has no real shutdown functionality anyway. The automatic
shutdown function that could have been called wouldn't work anyway, as
it takes an argument.

The only reason it doesn't fail is that the top level wscript has no
shutdown handling and doesn't recurse to other scripts, so it is all
dead code.
2023-10-15 10:47:16 -06:00
Mads Kiilerich
88cecdfaef wscript: drop repeated autowaf.set_options - it is enough to set at top level 2023-10-15 10:47:16 -06:00
Mads Kiilerich
d220f477ed wscript: drop unused "mandatory variables" 'top' and 'out' in libs
Variables by these names are only used from the local wscript and when
running "waf configure", which already for other reasons only can run at
the top-level.

These variables are thus not mandatory and not used.
2023-09-17 07:34:55 -06:00
Mads Kiilerich
a0916ef368 wscript: drop unused APPNAME assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in
  the top-level project file

- and waf code inspection confirms that waf itself only will use the top
level APPNAME.

Also, the 'waf dist' comment doesn't seem relevant - especially after
this change - and is removed too.

(Note: libs/evoral/wscript and libs/temporal/wscript still use APPNAME
for other purposes.)
2023-09-17 07:34:55 -06:00
Mads Kiilerich
3b4cf9191c wscript: drop unused VERSION assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in the
  top-level project file

- and waf code inspection confirms that waf itself only will use the top
  level VERSION.

Some wscripts will use
  bld.env['VERSION']
but that will also just use the value set in the top wscript.
2023-09-17 07:34:55 -06:00
Mads Kiilerich
7737c17d52 wscript: drop unused imports, scripted
Done with ad hoc scripting hacks processing unused imports found by pyflakes:

for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Logs.* but unused' | cut -d: -f1 | while read f; do sed -i 's/^import waflib.Logs as Logs,/import/g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i 's/import waflib.Options as Options, /import /g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i 's/^from waflib import Options,/from waflib import/g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep ' imported but unused$' | sed "s/^\([^:]*\):[0-9]*:[0-9]* '\(.*\)'.*/\1 \2/g" | while read f lib; do sed -i "/^import $lib$/d" $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i '/from waflib import Options$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.TaskGen.* but unused' | cut -d: -f1 | while read f; do sed -i '/from waflib import TaskGen$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Task.Task.* but unused' | cut -d: -f1 | while read f; do sed -i '/^from waflib.Task import Task$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Tools.winres.* but unused' | cut -d: -f1 | while read f; do sed -i '/^from waflib.Tools import winres$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Utils.* but unused' | cut -d: -f1 | while read f; do sed -i '/^import waflib.Utils as Utils$/d' $f; done
2023-09-17 07:34:55 -06:00
Paul Davis
4ba4cd69ff switch from glib atomic to std::atomic (libs edition) 2023-03-24 14:19:15 -06:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis
39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
Robin Gareus
d12dd4015d
Revert canvas debugging
This reverts commit 8359311849.
This reverts commit f377822891.
This reverts commit 859d6ebe4a.
This reverts commit 4cd7de7a6f.
2023-02-04 18:23:18 +01:00
Paul Davis
4cd7de7a6f debugging: allow selection no-draw for canvas fill, outline, text, lineset and waveview 2023-01-20 18:13:12 -07:00
Robin Gareus
5b52aa956f
Prepare for region polarity inversion (using negative gain) 2022-12-17 13:14:54 +01:00
Robin Gareus
d44b4b4674
Remove cruft (unused CANVAS_COMPATIBILITY - 2/3) 2022-11-19 21:49:15 +01:00
Mads Kiilerich
004b32b91e
Update tracker/reference URLs to prefer HTTPs 2022-10-24 04:59:20 +02:00
Paul Davis
0d9656ef82 use new macros to cleanup #ifndef NDEBUG as much as possible (libs edition) 2022-06-22 13:31:08 -06:00
Paul Davis
4599b07217 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
Paul Davis
bbb0b78a50 fetch thread local tempo map in potential peak-building threads 2022-06-20 14:25:40 -06:00
Paul Davis
c9b8a91edb apply new Item method name to various other usage sites 2022-04-26 22:04:08 -06:00
Robin Gareus
24bbf403b9
Replace Glib::Threads with PBD::Thread (1/2) 2022-03-01 01:33:49 +01:00
Mads Kiilerich
8bb91099c5 wscript: drop configure statements already present in the top level wscript
Avoid repeated pointless configure messages like:
Checking for 'g++' (C++ compiler!)                   : /usr/lib64/ccache/g++
Checking for 'gcc' (C compiler)                      : /usr/lib64/ccache/gcc
2022-01-22 22:19:03 +01:00
Robin Gareus
d9b9f4f588
Waveform: work around empty peakfile edge-case
(gdb) p peak.max
$5 = -1
(gdb) p peak.min
$6 = 1
2021-11-14 23:11:19 +01:00
Robin Gareus
8e89325bee
Waveform: scope-like smooth waveform
* Draw antialised waveform if waveform is monotonic
* Fix center-line position (span at most height - 1),
* Remove invalid "side-lines" that were previously
  drawn around spikes.
* Do not linearly center min/max when drawing log-scale
* Fix offset of lower outline and clip indicators
2021-11-14 22:28:55 +01:00
Robin Gareus
70a07eec48
Waveview: properly draw 1px outline 2021-11-14 22:28:55 +01:00
Paul Davis
c9035efb25 timeline types for libs/waveview 2021-08-13 12:51:29 -06:00
Robin Gareus
a6fc82537e
Fix assert in Waveview cache size
previous condition made no sense. effectively assert(bytes > 0).
2021-05-23 21:41:45 +02:00
Paul Davis
19c9622a30 NOOP: comment fix, there is no deadlock! 2021-05-11 08:35:14 -06:00
Paul Davis
99022a6157 waveview: add some extensive notes about threading design 2021-05-11 07:57:31 -06:00
Paul Davis
1a9df476c2 waveview: now that _quit is protected by a mutex, it doesn't need to be atomic
No reason to have two memory fences when we only need one
2021-05-11 07:57:31 -06:00
Paul Davis
166ac63924 waveview: redesign thread exit strategy
The previous design had a race condition. When WaveViewThreads::stop_threads() was called, it would
first acquire the mutex, then set _quit, then call condition.broadcast(). But worker threads would
check _quit without holding the mutex. It was therefore for a thread to be delayed in its
own lock acquisition by the ::stop_threads() caller, then end up back in cond.wait() AFTER
the cond.broadcast() was done. Such a thread would sleep forever and never wake up.

This new design removes WaveViewDrawRequestQueue, which was a clean encapsulation of the
queueing aspects of WaveViewThreads, but unfortunately made correct mutex acquisition
and condition signalling/waiting needlessly complex. THe mutex, condition variable
and actual queue were moved into WaveViewThreads, and all worker threads execute a method
of the class which gives the appropriate code easy access to the mutex and condition var,
which must always be used together.
2021-05-10 21:41:26 -06:00
Robin Gareus
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
Robin Gareus
cc7b8b1bc5
gcc-11 compat, volatile atomic variables (1/2)
"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)

Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.

This also fixes a few cases where atomic variables were
accessed directly.

see also libs/pbd/pbd/g_atomic_compat.h
2021-03-22 15:30:07 +01:00
Robin Gareus
239c340527
Do not show blank waveforms in case height is < 1px
Instead draw some lines to indicate that "something" is there.
2020-12-22 13:27:46 +01:00
Robin Gareus
4b0f72e205
Do not bother to render waveforms < 2px high
Those are blank to begin with, nothing is drawn, yet they'd still be
cached.

This may happen during an initial exposure (see 1a49d7d42b),
or when deleting regions.
2020-12-22 05:54:55 +01:00
Robin Gareus
b8e336b973
Add API to clear waveform cache 2020-12-21 21:12:53 +01:00
Robin Gareus
c365c6cdb2
Set thread-names (libs) 2020-03-29 14:56:22 +02:00