Commit Graph

17 Commits

Author SHA1 Message Date
Andrew Reading f59c9f4b2b Rewrite the Block Analyzer to improve performance.
The block analyzer was doing lots of repeated, out-of-order blits to the
widget's canvas. To improve performance and reduce CPU usage, this has
been rewritten to generate the canvas contents using only a single buffer.
Cache thrashing has been greatly reduced by writing to memory only
sequentially and in one single write pass. Further, the raw format is
now guaranteed to be in a format efficient for Qt.

The results are visually identical to what they were previously, but
result in a CPU usage reduction between 2 and 6 percent depending on refresh
rate and Psychadelic Mode value. In particular, there used to be a ~3 percent
overhead for Psychadelic Mode, and this has been eliminated.

The specific details of the block analyzer and explanations for how it works
(and used to work) have been documented via fairly extensive comments
in blockanalyzer.cpp.
2022-09-01 19:36:03 +01:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
santigl 6c9bc43bbb Refactor analyzers for new FHT modifications. Use QVectors where possible. Make readability changes in the code. 2017-03-13 18:56:37 +00:00
Mark Furneaux c102bf7fe6 Add "Psychedelic Colour" mode to all analyzers
(Well, except Nyanalyzer and Rainbow dash because they are already colourful enough.)

I have added functionality for any 2D analyzer to change any part of its colour palatte with the frequency content of the music, in the same way that Moodbars do.
I find this gives the analyzer a sort of "third dimention".
This is built into Analyzer::Base, so all analyzers can use it and override it as they please. I have thus added support for Block, Boom, Turbine, Sonogram, and Bar, however Boom and Block seem to look the best in my opinion.
This is of course all optional and is toggled by a checkbox in the context menu for the analyzer, disabled by default.
I have not been able to measure any increase in CPU activity with this enabled, even at 60fps.
2015-07-01 11:48:03 -04:00
Krzysztof Sobiecki dc669eb603 Fix cpplint.py errors, fix copyright notices in src/analyzers, move src/core/fht* to src/analyzers 2014-11-29 20:07:01 +01:00
John Maguire 42a2739daf Merge pull request #4343 from TheUbuntuGuy/master
Fix block analyzer framerate
2014-05-14 14:14:33 +02:00
Mark Furneaux 542dbe8d12 Make framerate notification less nasty
Now uses a virtual function in Analyser::Base to notify any
analyser which whishes to listen
2014-05-13 16:43:46 -04:00
John Maguire c2890de65f Remove "using" statement in header 2014-05-13 14:46:50 +02:00
Mark Furneaux 6a882370a6 Fix block analyzer framerate
Block analyzer uses an internal variable m_step to determine how
long to hold a bar up. This is dependant on framerate, however it is
only set on creation or resize of the analyzer. This patch changes
this value whenever the framerate is changed, preventing the analyzer
from appearing wildly fast or extremely slow until a restart.
2014-05-12 18:15:00 -04:00
Mark Furneaux 7d3d0f04cf Fix analyzer framerate when mouseover play scrubber
This patch prevents the framerate of all analyzers from
increasing beyond the framerate set in the interface at all times.
It however will allow the analyser to redraw as often as required
to prevent artifacting when the play scrubber is drawn in front.
2014-04-27 01:54:42 -04:00
Krzysztof A. Sobiecki 0ecf1e76a6 Reformat done with clang-3.5 svn200967 2014-02-07 17:08:31 +01:00
John Maguire bebd781fdf Reformat all non-3rd-party C/C++/Objective-C++.
Command line:
find src ext -regex '.*\.\(h\|cpp\|mm\)' -exec clang-format -i
 -style='{BasedOnStyle: Google, DerivePointerBinding: false}' {} \;
2014-02-07 16:34:20 +01:00
David Sansome aa20b6b3e2 Don't shift the rainbow data along when the widget is being repainted as a result of an expose event 2011-06-23 20:36:14 +00:00
John Maguire c801ce1a2d Rollback analyzer changes. 2010-08-28 18:48:16 +00:00
John Maguire 459a134201 Remove FHT and use gstreamer's FFT for all analyzers. 2010-08-18 18:21:30 +00:00
David Sansome e1c44cdc77 Add options for choosing or disabling the analyzer.
Fixes issue #75.
2010-03-20 22:45:54 +00:00
David Sansome 5b0496bf8f Move everything to trunk 2009-12-24 19:16:07 +00:00