Commit Graph
100 Commits
Author SHA1 Message Date
itsmattkc 532af463f0 sequencedialog: extended sequence dialog to include presets
Also includes the ability to make custom presets which negates the need for
setting default sequence parameters in preferences.
2020-06-08 03:12:54 +10:00
itsmattkc b9de8ea035 rendertask: include audio in progress signal 2020-06-06 18:24:28 +10:00
itsmattkc be784591fc timeline: optimized pointer tool ctrl+drop 2020-06-06 17:50:23 +10:00
itsmattkc aaee2ab9ed timeline: vastly improved snapping 2020-06-06 13:59:49 +10:00
itsmattkc 5055c136b6 renderer: clear graph update queue when disconnecting a viewer 2020-06-06 01:02:03 +10:00
itsmattkc 550d30ed8f viewer: rewrote playback code for stability
The viewer playback used to rely primarily on the vsync, which was
extremely smooth, but had issues when there was only audio or the viewer
was hidden. This was bodged by attaching to the audio in these scenarios,
but still not perfect.

Now we run a timer in tandem with vsync for the best of both worlds.
Playback is no longer wholly reliant on vsync, yet the viewer can remain
as smooth as possible using vsync.
2020-06-06 00:20:06 +10:00
itsmattkc bad039e7a9 playbackcache: don't invalidate if the cache has no length
Prevents zero-length invalidations.
2020-06-05 17:21:46 +10:00
itsmattkc 593316876f track: save and load track heights to and from project files 2020-06-05 16:12:00 +10:00
itsmattkc 4a8d557c59 various: removed unused debug lines 2020-06-05 16:11:49 +10:00
itsmattkc 242994c736 rendertask: initialize nb_frames
The code path doesn't ever use this value uninitialized, but GCC is unaware
and still presents a warning.
2020-06-05 15:53:07 +10:00
itsmattkc 33e3225c89 audioplaybackcache: use std::rand instead of QRandomGenerator
Improves support for versions of Qt < 5.10.
2020-06-05 15:47:00 +10:00
itsmattkc 7609754103 playbackcache: more intelligent job matching
Ensures audio ranges can be anticipated and accurately ignored if they're
old or acknowledged if they're current.
2020-06-05 15:23:16 +10:00
itsmattkc b143b39869 track: provide control over invalidation when setting length 2020-06-05 15:21:11 +10:00
itsmattkc de3288893d renderer: move waveform generation into worker and mutex the waveform
Addresses scheduling issues where a backend might be closed (or even
destroyed) before it processes a waveform signal from a worker. Requires
extra multithreading code.
2020-06-05 15:18:14 +10:00
itsmattkc ddf63b39e1 viewer: don't invalidated zero-length ranges
A zero-length range doesn't represent any amount of time and has no need
to actually invalidate anything.
2020-06-05 15:15:59 +10:00
itsmattkc a29de7cea0 audiovisualwaveform: allow only partial sum overwrite 2020-06-05 15:02:44 +10:00
itsmattkc 5ce508a1da timerange: fixed issue that broke removing timeranges from a timerangelist 2020-06-05 14:43:18 +10:00
itsmattkc 2fd897c380 viewer: keep track of viewer length
Useful for determining if the view should be updated from a length change.
2020-06-05 04:31:44 +10:00
itsmattkc 8051a42fcc timerange: added some helper functions for comparing timeranges and rationals 2020-06-05 04:30:59 +10:00
itsmattkc cb0d89c09e rational: print double rather than rational to debug
Doubles are mostly used here anyway.
2020-06-05 04:30:39 +10:00
itsmattkc 5eeef76b62 waveform: shift track waveform alongside cache 2020-06-04 23:32:50 +10:00
itsmattkc 0e87762afa waveforms: moved waveform to track rather than block
This is a much more robust and thread-safe system of storing the waveforms.
2020-06-04 18:03:21 +10:00
itsmattkc 9ff9817b95 cache: use render job times to synchronize cache
Ensure old inaccurate jobs are never prioritized over current jobs.
2020-06-04 16:48:23 +10:00
itsmattkc cc34f0e251 viewer: ensure view is updated if the cache is shifted
Also moves "ForceUpdate" to a queued connection so it occurs as soon as
the rest of the processing is done. This ensures the viewer isn't updated
too early.
2020-06-03 03:49:39 +10:00
itsmattkc 12be8f72f1 node: disconnect all parameters before destroying them
Fixes a common segfault where destroying a node may ripple a disconnect
signal up the graph and trigger something to try to access its
(now-destroyed) parameters.
2020-06-03 03:40:31 +10:00
itsmattkc fb5c06db50 audiooutputmanager: use deleteLater instead of delete
Ensures destructor is run in its own thread.
2020-06-03 03:39:02 +10:00
itsmattkc e30d278327 playbackcache: made thread-safe
Since this class is regularly accessed by multiple threads, it makes the
most sense to make all of its functions thread-safe.
2020-06-03 03:38:28 +10:00
itsmattkc 08eb12710c audiovisualwaveform: ignore OverwriteSums if input data is empty
Prevents potential index out of bounds error.
2020-06-03 03:37:46 +10:00
itsmattkc f2050a0342 timeline: optimized rippling workarea, rippling to in/out, and the ripple tool
Use cache shift functionality introduced in previous commit to optimize
timeline usage.
2020-06-02 04:24:12 +10:00
itsmattkc 11bfe61208 cache: began base implementation of "shifting" the cache
Should be a fairly important optimization to make.
2020-06-02 01:38:12 +10:00
itsmattkc 6acfe995fa timerange: use doubles instead of rationals when printing debug info
Doubles are infinitely more readable and have been the vast majority of
debug printing cases thus far.
2020-06-01 17:45:21 +10:00
itsmattkc 1301d4b9cf rational: use true min/max values for extended range
Will address issues caused by comparisons to our MIN/MAX constants when
a numerator/denominator is > INT32_MAX/MIN.
2020-06-01 17:44:42 +10:00
itsmattkc 644fb7cec8 block: fixed buggy cache invalidation behavior when resizing blocks 2020-06-01 17:39:08 +10:00
itsmattkc 001b7179c5 timeline: cleaned up pointer tool derivatives and fixed bug introduced by earlier behavior improvement 2020-06-01 17:38:24 +10:00
itsmattkc 1fce380cc6 timeline: automate waveform resizing
Now each UndoCommand won't have to handle it (unless it can introduce
specific optimizations).
2020-06-01 14:54:14 +10:00
itsmattkc a62960ecc0 track: block length changed signals until the cache can be invalidated
Optimization, prevents unnecessary processing.
2020-06-01 13:08:08 +10:00
itsmattkc 8eac4fd123 footageviewer: fix some behavior issues
- Caches timestamps of different footage so they're restored when each is
  reopened.
- Set default sequence values if true parameters aren't available.
2020-06-01 04:49:13 +10:00
itsmattkc 2e85197f6e viewer: round divider rather than ceil it
Improves default divider.
2020-06-01 04:46:43 +10:00
itsmattkc dc57e8cffe timelineworkarea: initialize enabled value to false
I'm honestly surprised we made it this far without this being a problem.
2020-06-01 04:46:10 +10:00
itsmattkc 017271b909 cachetask: write silence if no samples are returned
Fixes segfault trying to access a null sample buffer.
2020-06-01 04:45:45 +10:00
itsmattkc 0424768f02 renderer: use deleteLater on nodes instead of delete
Fixes warning about node signals unable to fire in another thread.
2020-06-01 04:43:35 +10:00
itsmattkc c2e47a296c timeline: heavily optimized and improved nearly all timeline optimizations
Features a lot of timeline-related cache optimizations as well as general
optimizations and improvements in timeline behavior. Should improve
usability significantly.
2020-06-01 04:42:59 +10:00
itsmattkc 93f8b4f79c timeline: removed debug line 2020-05-31 01:21:49 +10:00
itsmattkc acee6c5958 timeline: reworked ripple/edit to behavior and documented some track behavior 2020-05-31 01:21:08 +10:00
itsmattkc 187c6c6108 timeline: fixed ripple to in/out bugs
Fixed issues that caused undesirable behavior with this function.
2020-05-30 23:13:38 +10:00
itsmattkc b9ba66632c timebasedwidge: fixed typo in comment 2020-05-30 23:05:51 +10:00
itsmattkc 4bf12b67a8 timeline: heavily optimized audio waveform
Only displays waveforms (and sections of waveforms) that are actually
visible in the viewport.
2020-05-30 17:47:20 +10:00
itsmattkc 4eb539b011 timebasedwidget: fixed regression that stuck "toggleshowall" in one state forever 2020-05-30 17:46:42 +10:00
itsmattkc bc5068afa1 audiocache: ensure cached ranges are actually marked as validated
For some reason, the audio cache never validated itself leading to an
endless loop of trying to re-render it. This is fixed now.
2020-05-30 15:20:14 +10:00
itsmattkc c1ed84b90e viewer: receive audio invalidation signal
Invalidates and runs cache task correctly even if there are no video
nodes connected.
2020-05-30 02:50:30 +10:00
itsmattkc 8299acf547 timebasedwidget: restore scroll when using "toggle show all"
"Toggle Show All" would restore only the scale. Now it sets/restores the
scroll as well.
2020-05-30 02:49:25 +10:00
itsmattkc 957e877b95 elapsed/remaining timer: increase default spacing between times 2020-05-30 02:05:11 +10:00
itsmattkc 4b8ac6a414 rendertask: ensure frames get sorted in chronological order
Previous commit broke the sorting system. This commit restores it.
2020-05-30 02:03:13 +10:00
itsmattkc 1d4bfba088 exportdialog: fixed default filename bug
Fixes bug where the last character of the default export filename (sourced
from the sequence name) would get cut off unnecessarily.
2020-05-30 02:02:39 +10:00
itsmattkc 6d16ac9f50 rendertask: optimized hash matching and grouping
Significantly improves speed of matching already cached frames.
2020-05-29 16:37:58 +10:00
itsmattkc 6638edb761 rendertask: ensure backend nodes are copied the main thread
May not be a permanent solution, but should prevents race conditions for
the time being.
2020-05-29 15:25:18 +10:00
itsmattkc 0874c361ba Merge branch 'cacheondemand' of https://github.com/olive-editor/olive.git into cacheondemand 2020-05-27 04:29:20 +10:00
itsmattkc 55cfae784b viewer: set automatic divider on connection
Probably not a permanent solution, but will aid performance for the
time-being.
2020-05-27 04:28:57 +10:00
itsmattkc e065885d78 timelineview: added backwards compatibility for qt < 5.12 2020-05-27 04:26:37 +10:00
itsmattkc a0dec75f2b renderer: ensure offscreen surface is created in main thread
Fixes render crash on some platforms.
2020-05-27 04:05:01 +10:00
itsmattkc 14ac1ada6e various: adding files missing in last commit
Oddly some files didn't commit previously. This commit adds those.
2020-05-27 03:24:37 +10:00
itsmattkc 3e3cacbc85 various: update Qt code deprecated in 5.15
- Replaces QLinkedList with std::list as recommended by Qt docs.
- Replaces QWheelEvent::delta() with QWheelEvent::angleDelta(). This
  should also benefit trackpad behavior.
2020-05-27 02:54:05 +10:00
itsmattkc da04777a25 crashhandler: exclude GITHASH if git wasn't found
Allows compilation in environments where Git may be missing.
2020-05-27 02:51:10 +10:00
itsmattkc 0c7b3e1761 cache: streamlined audio into cache task
Since we always cache audio, it makes sense to lump it into the same auto-cache
task we use for everything else.
2020-05-27 00:09:09 +10:00
itsmattkc c907114b17 renderer: optimizing and fixing code paths
Re-introducing some old concepts for the new structure.
2020-05-26 22:40:54 +10:00
itsmattkc 8b872e7c29 track: smarter block detection code
Improves on the code before it in reliability (perhaps at the expense of some
cycles).
2020-05-25 22:12:25 +10:00
itsmattkc 9c59691295 timeline: blocked more unnecessary graph invalidations 2020-05-25 22:11:47 +10:00
itsmattkc 564cb29cc7 audiomonitor: fixed playback speed
Audio monitor used to ignore playback speed leading to inaccurate display if the
playback was not 1x forwards.
2020-05-25 14:12:41 +10:00
itsmattkc 85a7cae3ee cache: improved cache behavior when updating values or render parameters 2020-05-25 03:04:03 +10:00
itsmattkc 4c62dd3708 rendertask: automatically re-match existing hashes
Major optimization for frames that have already been cached.
2020-05-24 18:13:18 +10:00
itsmattkc bc2dd87719 cache: added convenience function to determine if any ranges are invalid 2020-05-24 18:12:43 +10:00
itsmattkc 5ae0a9f74f footageviewer: set viewer node's media name to footage name
Minor UI improvement. The viewer's media name is shown in the cache task
header.
2020-05-24 18:12:08 +10:00
itsmattkc bf9aa139b1 nodes: improved detection of length changes signalled from the viewer node 2020-05-24 18:11:26 +10:00
itsmattkc efdf56acf8 cache: improved code pathways for cache
Viewers are now more aware of each other and can pause each others' cache tasks
when one of them plays, as well as wait for other viewers' cache tasks to
finish before starting their own.
2020-05-24 18:10:38 +10:00
itsmattkc 4f21a930dd tasks: added elapsed/remaining time displays for all tasks 2020-05-24 18:10:08 +10:00
itsmattkc 4c4bcb0989 moved simple ms to hh:mm:ss function to timecodefunctions 2020-05-24 17:40:30 +10:00
itsmattkc 89ae6e026f cache: reimplemented auto-caching
Implemented a smarter auto-cache that's context sensitive. Caching will
automatically pause when playback begins or values are being changed and resume
when inactive.
2020-05-24 15:20:35 +10:00
itsmattkc a26a3cbf21 renderworker: improved update queue handling and reduced memory usage 2020-05-23 02:34:28 +10:00
itsmattkc 5b28070ed8 viewer: reimplemented playback queue warning
Not really sure why this was removed, must have been lost in the rewrite work.
2020-05-23 02:33:25 +10:00
itsmattkc 930248ce07 viewer: don't listen for added tracks to invalidate the cache
Fixes segfault when adding new tracks.
2020-05-23 02:32:01 +10:00
itsmattkc f8bd3c1905 nodeinputarray: use deletelater rather than delete
Slightly safer code.
2020-05-23 02:31:40 +10:00
itsmattkc 2f5d97f30f Merge branch 'cacheondemand' of https://github.com/olive-editor/olive into cacheondemand 2020-05-21 21:46:25 +10:00
itsmattkc 25370d0112 viewer: only start drags when using the primary mouse button 2020-05-21 21:45:46 +10:00
itsmattkc 5212a6032a renderbackend: initialize queuer value
Leaving uninitialized could potentially cause issues.
2020-05-21 21:45:12 +10:00
itsmattkc 6507cfbfc9 ffmpegencoder: ensure codec ID is initialized 2020-05-21 18:28:34 +10:00
itsmattkc 34fade9d81 cache: attempt to automatically re-match hashes on invalidate
This code is slow and unoptimized. Will require some more work.
2020-05-21 16:49:02 +10:00
itsmattkc cb72736f52 viewer: keep track of request order and ignore old requests
Prevents visual confusion with frames that were requested before the most recent
but arrived after.
2020-05-21 03:09:39 +10:00
itsmattkc 0cf6c9a1f6 export: use codec IDs rather than strings
Vastly improves portability between library versions.
2020-05-21 03:04:38 +10:00
itsmattkc d5766489e4 export: fixed audio exporting with new renderer system 2020-05-21 02:18:52 +10:00
itsmattkc a2d68f6d9f timerange: added functions to + and - rationals from timeranges 2020-05-21 02:17:47 +10:00
itsmattkc b6a42b812e rational: refactored and cleaned up code
Old code (imported from elsewhere) has been cleaned up significantly, made more
understandable/maintainable, and conformed to the rest of the code style.
2020-05-21 02:16:13 +10:00
itsmattkc 0dc548a97e viewer: fixed bugs in playback queue
Fixed issue that caused playback queue to desync and fallback to much slower
live playback.
2020-05-20 12:52:47 +10:00
itsmattkc 470bb44d0a renderbackend: removed unusued dialog
This dialog caused a bunch of warnings and was unused in the new renderer
system. It may be used again later, so it's just been commented out, but there's
currently no plan to.
2020-05-20 12:50:59 +10:00
itsmattkc 87e7564222 cache: heavily reworked exporting for new system
Also cleans up cache in general and moves it to the Task infrastructure.
2020-05-19 23:35:17 +10:00
itsmattkc cd847a89ce decoder: removed old unused code
Minor cleanup.
2020-05-19 03:34:49 +10:00
itsmattkc cb383d760b tasks now emit floats rather than integers
Simplifies code for tasks.
2020-05-19 02:44:38 +10:00
itsmattkc b9cd83eff1 task: massively simplified task system
Made various changes and fixes to the task system:

- Tasks are built around QtConcurrent rather than QThread. Reduces
  code complexity significantly.
- Task error reporting is now streamlined in both TaskManager and
  TaskDialog.
- Moved ProjectImport/Save/LoadManager to the app/task folder
2020-05-19 02:44:32 +10:00
itsmattkc c4b0a53174 cache: render audio in chunks so they can be multithreaded 2020-05-18 22:52:31 +10:00
itsmattkc 558773538d cache: fixed audio with new system 2020-05-18 17:16:28 +10:00
itsmattkc 127ebbe359 Merge branch 'master' into cacheondemandtake1 2020-05-18 13:46:35 +10:00