Commit Graph

91 Commits

Author SHA1 Message Date
Amish Naidu 107e945872 Convert uses of QtAlgorithms to std:: algorithms 2018-10-09 19:17:54 +01:00
Mark Furneaux fba9e8dd69 Fix psychedelic mode on analysers (#5688)
* Fix psychedelic mode

* Remove unnecessary checks

When the code isn't broken, these are just a waste
2017-03-31 11:48:28 +01:00
Santiago Gil 0b34586e52 Fix some warnings shown on start-up (#5679)
* Fix 'RGB parameters out of range' with psychedelic colors

* Fix 'edit-find' icon name

* BlockAnalyzer::drawBackground(): do not attempt to paint on a null background

* Use qBound()
2017-03-27 12:57:24 +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
santigl 6a19afde15 Refactor FHT class: use QVector and const values, remove unnecesary memory handling. 2017-03-13 18:56:37 +00:00
narunlifescience e586829452 use emplace_back 2015-11-24 03:44:33 -06:00
narunlifescience 154da7b5c0 Fix boom analyzer, terbine & bar analyzer behaviour when paused
remove hidden file added
2015-11-23 12:54:08 -06:00
narunlifescience b77cb613e2 combine nyancatanalyzer & rainbowdashanalyzer(eliminate duplicated code)
update

minor modifications

format

add seperate classes for nyancat & dash

format

minor correction

restore previous name Nyanalyzer cat
2015-11-23 11:39:42 -06:00
Ivan Leontiev 651289ea26 Add condition against nullptr dereferencing to AnalyzerContainer::TogglePsychedelicColors() 2015-08-18 23:21:34 +00:00
Mark Furneaux f68d983ddc Sonogram should stop scrolling when paused
Fixes #755
2015-07-11 23:12:44 -04:00
Mark Furneaux 8e2795c6a2 More readable toggle 2015-07-02 08:10:08 -04: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
Mark Furneaux 36d885b73d Bound the Block Analyzer's column count
As it stands, the block analyzer just chops off columns to the right if the window is too small and always internally runs off 256 columns. Since the analyzer is bounded to 256 colums, this qMax bound is totally pointless.
It also makes the demo asymmetrical which trips up my OCD whenever Clementine is idling...
2015-06-20 00:09:38 -04:00
Krzysztof Sobiecki 1cbe135a8d Fix some errors in src/analyzers introduced while fixing cpplint.py errors 2014-11-29 21:05:59 +01: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
Alibek Omarov a8c2537056 RainbowDash analyzer now more pretty 2014-06-18 23:37:43 +06:00
Alibek Omarov 60ae9e9408 Now Bar Analyzer respects color scheme 2014-06-18 21:55:29 +06:00
David Sansome c217450d0c Fix some bad sizeof -> arraysize changes from revision 41e9c15248. 2014-05-23 21:31:50 +10:00
Mark Furneaux c404552682 Fix random artifacting on nyanalyzer on startup
memset works on bytes, not the source datatype width
2014-05-23 07:20:13 -04:00
Mark Furneaux f2a1defa2a Make sizeof more generic 2014-05-22 10:58:08 -04:00
Mark Furneaux 663b7430d8 Add new analyzer "Rainbow Dash"
As requested in SuperUltraCriticalShowstopper request #2685
I have built an analyzer based on Rainbow Dash
...oh god, what have I done...

This will either make some people happy, or is absolute garbage.
2014-05-22 10:33:21 -04: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 00a1fe1e32 Refactoring 2014-05-03 09:14:15 -04:00
Mark Furneaux 53f21584e4 Fix inconsistent buffer sizes sent to analyzer
The analyzers are sent new buffers of audio data to process each time
they pass through the gst pipeline. Different file formats and bit depths/
sample rates can change the size of these buffers, in some cases making them
large and therefore infrequent. This causes choppiness in the analyzer
as it is not getting new data with every frame. This patch chunks the buffers
coming off the pipeline to correspond with the framerate of the analyzer.
2014-04-29 21:38:21 -04:00
John Maguire 41e9c15248 Add arraysize macro from Chromium 2014-04-29 14:11:52 +02:00
Mark Furneaux 16f12a3da8 Formatting 2014-04-27 02:49:26 -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
John Maguire 71893e4847 Use nullptr instead of NULL everywhere. 2014-02-06 17:29:59 +01:00
Vasily Fomin b1c488ffea Make wheel events on the analyzer change the volume. Fixes issue 3761 2013-07-27 16:13:07 +10:00
John Maguire 79318cc4e1 Build fixes for mingw-w64 2012-11-13 14:43:13 +01:00
David Sansome 41d8c61e0d Let nyanalyzer cat nap inbetween songs 2012-10-16 21:20:56 +11:00
John Maguire 5280038f9a Remove unused debug #define. 2012-06-18 13:56:56 +02:00
Arnaud Bienner bb5eaabadb Make analyzers' framerate constant values private members of AnalyzerContainer.
Looks cleaner like this
2012-03-22 20:03:17 +01:00
David Sansome 94a3c7f816 Draw over the last segment of nyancat's polyline as well as drawing the current segment to slightly smooth the gaps between segments. 2011-12-01 17:38:14 +00:00
David Sansome 0d2dd452e2 Double buffer nyanalayzer cat drawing - trying to draw a pixmap into itself produces weird artifacts in Qt 4.8 2011-12-01 17:29:27 +00:00
Arnaud Bienner 8d0920073b Revert "Prevent block analyzer to be initialized in very high framerate mode. This is strangely slowing it"
This reverts commit 6098e298fd.
2011-11-01 02:04:42 +01:00
David Sansome 409d3b0184 Rename the nyancat analyzer to "Nyanalyzer cat" 2011-07-20 20:33:11 +01:00
David Sansome 7d6aa42ba3 Shift the rainbow back into the right place again 2011-06-23 22:49:33 +00:00
David Sansome b2418fd3ee Oops, remove some debug output 2011-06-23 22:49:23 +00:00
David Sansome 05e6ee8440 Cache the last rainbow frame so it can be used again in the next frame. Makes the painting much kinder on the CPU, but has the side effect of requiring the line segments to have integer spacings. 2011-06-23 20:36:38 +00:00
David Sansome decc769ebb Precalculate the band scale constants and apply them once when adding new values, instead of every time the polyline is drawn 2011-06-23 20:36:30 +00: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
David Sansome a81c5fdf90 Center the rainbow a bit better 2011-06-23 20:36:05 +00:00
Tyler Rhodes 5792c114e8 Update nyan rainbow scaling and painting.
This is the last time, promise :)
2011-06-23 15:14:39 +00:00
Tyler Rhodes 663e5916dd Make nyan rainbow movements centered. (can move up and down, as opposed to just down). 2011-06-23 13:55:53 +00:00