Making DUI visualizer plugin: best way to fetch sample data + repaint?, Was: DUI visualizer compontent (TOS #6: undescriptive) |
This forum is for developer discussions only. If you have a problem / bug report / idea / feature request that isn't related to foobar2000 SDK, post it in an appropiate forum instead - tech support questions go to support forum, everything else goes to general forum.
All non-developer posts on this forum will be removed. Continued abuse of this forum will result in admin actions (warnings, account suspension).
![]() ![]() |
Making DUI visualizer plugin: best way to fetch sample data + repaint?, Was: DUI visualizer compontent (TOS #6: undescriptive) |
Aug 26 2011, 16:20
Post
#1
|
|
|
Group: Members Posts: 291 Joined: 27-January 04 From: Germany Member No.: 11530 |
I'm trying to develop a visualizer (a simple peak and RMS meter) component for the default UI. I used foo_sample as a starting point and removed all unnecessary source files from the project, so I kept main.cpp, PCH.cpp (dummy) and ui_element.cpp. Now I wonder what's the best approach to fetch the sample data at a regular interval and repaint the UI element's contents.
I found out that I can use Invalidate() to force a repaint and that on_playback_time() is called every second. For a visualizer that would be too slow, so I used SetTimer() and KillTimer() in combination with OnTimer() to get a smaller interval. But I'm sure there are better ways. To retrieve the sample data I used visualisation_stream_v3 with get_absolute_time() and get_chunk_absolute() but I noticed that the video was ahead of the audio, just like I noticed with VST plug-ins before. This post has been edited by Hancoque: Aug 26 2011, 16:27 |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th May 2013 - 20:28 |