Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: UI Controls to change playback rate and gain (Read 4529 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

UI Controls to change playback rate and gain

What i need is two UI controls. I use Default User Interface.

One control would be a scrollbar (like volume control or seekbar) that sets speed of playback.
Second would be scrollbar that sets gain.

I know i can do both with with already existing dsp effects. The problem is i have to open preferences, add that dsp and open it configuration, then click ok, then again ok. Sometimes in one day i change playback rate about 50 times - just imagine how many stupid clicks that is.
So that's why i need that UI controls. First thing i though, would be to control existing dsp effect with those controls. But later i though that its better to not include anything on dsp effect list and have the controls do that separately.

But is it possible? And how to? I can write code to change rate and gain on my own, its simple, but, can I get audio chunk in that component and make my adjustments to audio? You better don't say that i can only adjust audio chunk in dsp effect.

UI Controls to change playback rate and gain

Reply #1
I also would want a third UI control: combobox to select "midi settings profile".
So i would have few profiles and was able to select them. When i'd select it, it would apply some settings to "MIDI Synthesizer host" (as you can in preferences manually). Is that possible? if yes, how?

UI Controls to change playback rate and gain

Reply #2
Your questions fall into two categories: questions about the foobar2000 SDK and feature requests for existing (third-party) components.

A component which can intercept and transform audio data is known as a DSP effect in the foobar2000 software architecture. It is possible to programmatically add a DSP effect to the DSP chain if you know have valid configuration data for the desired effect. This is trivial if it is your own DSP effect. It is not possible to inject a hidden DSP effect into the processing chain, i.e. one where the user cannot control where and if is is inserted.

Third-party components like foo_midi rarely provide programmatic access to their configuration. If you need additional features you should send a feature request to its author in the appropriate forum thread.

UI Controls to change playback rate and gain

Reply #3
@foosion
If its only possible by adding and controlling dsp then ok, how to do that? In what API file there are functions to control dsp (like add effect, configure it), what function to add dsp effect?
Should I add windows controls (scrollbar) or should i draw and handle it on my own? how are seekbar and volume scrollbar in foobar made? Window controls or custom controls drawn from scratch?

UI Controls to change playback rate and gain

Reply #4
I suggest looking at the source at foo_dsp_eq for pointers.

UI Controls to change playback rate and gain

Reply #5
What function can i use to open preferences dialog? id like to have simple button on interface to open preferences, and not click on menu two times to open them.


UI Controls to change playback rate and gain

Reply #7
Use ui_control::show_preferences() with a GUID from preferences_page or your own. Alternatively, call standard_commands::main_preferences() if you don't care about opening a specific page.

Thanks, that's great. Gonna make buttons to display Dsp settings and Midi settings. Still gonna make controls to change rate & gain though.