PortAudio / portaudio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.
Other
1.48k stars 305 forks source link

PaJack_SetClientName only available if portaudio has been compiled with JACK #972

Open umlaeute opened 2 hours ago

umlaeute commented 2 hours ago

PortAudio is great for writing applications that are written in an "audio-backend agnostic" way.

unfortunately, some of the features are only available if a certain backend has been compiled in.

E.g. i would like to set the client name of my application to something useful (if the backend supports client names).

This can be done with PaJack_SetClientName - but obviously this only works if portaudio has been compiled with JACK support. I guess, right now the only backend that supports setting the client name is JACK - but from an application dev POV i would like to not care about such an implementation detail. also, I'm (personally) using pre-built portaudio binaries (e.g. libportaudio2 on my Debian workstation), and there is no guarantee that such a pre-build binary actually is compiled with JACK support.

I would therefore like to propose to wrap backend-specific calls into generic backend-agnostic functions, that are always available. e.g. Pa_SetClientName(const char*) (which internally might call PaJack_SetClientName() or whatever) to set the client-name for all backends (that support client names)

umlaeute commented 2 hours ago

and before somebody suggests this: I'd rather not resort to doing a dynamic lookup of the PaJack_SetClientName symbol - it's just too brittle for cross-platform code.