Implement a cached-ring-buffer for the visualizer#629
Open
Stephen-Seo wants to merge 2 commits intoncmpcpp:masterfrom
Open
Implement a cached-ring-buffer for the visualizer#629Stephen-Seo wants to merge 2 commits intoncmpcpp:masterfrom
Stephen-Seo wants to merge 2 commits intoncmpcpp:masterfrom
Conversation
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".
c725993 to
57e4ad9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.