Skip to content

Implement a cached-ring-buffer for the visualizer#629

Open
Stephen-Seo wants to merge 2 commits intoncmpcpp:masterfrom
Stephen-Seo:visualizer_buffer
Open

Implement a cached-ring-buffer for the visualizer#629
Stephen-Seo wants to merge 2 commits intoncmpcpp:masterfrom
Stephen-Seo:visualizer_buffer

Conversation

@Stephen-Seo
Copy link

A new configuration option is added: visualizer_buffer_size. It defaults to "1" and is used to "delay" the visualizer should it render too quickly. I've found that using a value of "20" works for my use case without a large impact on memory.

The implementation is a ring-buffer so there should be no extraneous heap allocations during usage (except possibly when visualizer modes are changed). The behavior with a default setting of "1" should be identical to the previous behavior.

Please do let me know if there are any issues with this pull request.

Also, thank you to the previous contributors to this software as I've used ncmpcpp for a long time.

A ring-buffer is added to cache visualizer data before it is drawn to
the terminal. By default, the size of this buffer is "1", which is the
same as the previous behavior. Larger sizes "delay" the visualizer
output as only the earliest-cached data is shown. Negative or "0" values
default to "1".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments