visualizer: scale spectrum along with window's width
This commit is contained in:
1
NEWS
1
NEWS
@@ -2,6 +2,7 @@ ncmpcpp-0.7 (????-??-??)
|
||||
|
||||
* Visualizer has now support for multiple colors (visualizer_color configuration variable takes the list of colors to be used).
|
||||
* Visualizer has now support for two more modes: sound wave filled and sound ellipse.
|
||||
* Visualizer's spectrum mode now scales better along with window's width.
|
||||
* It is now possible to abort the current action using Ctrl-C or Ctrl-G in prompt mode. As a result, empty value is no longer a special value that aborts most of the actions.
|
||||
* Directories and playlists in browser can now be sorted by modification time.
|
||||
* ~ is now expanded to home directory in mpd_host configuration variable.
|
||||
|
||||
@@ -418,7 +418,7 @@ void Visualizer::DrawFrequencySpectrum(int16_t *buf, ssize_t samples, size_t y_o
|
||||
for (int j = 0; j < bins_per_bar; ++j)
|
||||
bar_height += m_freq_magnitudes[x*bins_per_bar+j];
|
||||
// buff higher frequencies
|
||||
bar_height *= log2(2 + x);
|
||||
bar_height *= log2(2 + x) * 100.0/win_width;
|
||||
// moderately normalize the heights
|
||||
bar_height = pow(bar_height, 0.5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user