Version: 1.1.1 (using KDE KDE 3.1.1) Installed from: Mandrake RPMs Compiler: gcc version 3.2.2 (Mandrake Linux 9.2 3.2.2-5mdk) OS: Linux arts_init() will open a connection to the artsd daemon, and let you use it. It suceeds (returns 0) if artsd is running. You can use this to pick whether to output to arts or OSS in your application. If you have to use arts_init() to do it, the only criteria you can use to make your choice is whether artsd is *running* or not. It would be nice to make the choice based on whether artsd actually has the DSP device open or not, so you can choose to only use arts if it has the device open, and OSS otherwise. What would be needed for that would be another call that would work like arts_init(), except it would only return 0 if artsd was running *and* had the DSP device open.
Another possibility is a function that you could run after arts_init(), maybe called arts_suspended() which would return 1 if it is suspended (not holding the device open), or 0 otherwise. I was just looking through the arts code, and it looks like that could be pretty easy to implement.
Ok, I've taken my advice, and implemented a patch. I'll attach it.
Created attachment 1920 [details] fixes this bug by adding arts_suspended() to the C API
The patch looks good, applies clean. My one concern is that we shouldn't say that backend is no-good simply because this new method doesn't exist. Therefore I made a slight change which should allow it to work with older revisions of the backend and newer revisions of the frontend. Maybe this is unnecessary, but it seems reasonable to me. What do you think? I"ll commit to 1.1-branch shortly and cc this report#
Subject: ARTS_1_1_BRANCH: arts CVS commit by staikos: commit the patch attached to #59184 - allows the app to query if the server is suspended. Has a slight modification to work with older backends. Looks ok? CCMAIL: 59184@bugs.kde.org M +16 -1 artsc/artsc.c 1.10.4.1 M +8 -0 artsc/artsc.h 1.9.8.1 M +22 -0 artsc/artscbackend.cc 1.21.2.1 M +8 -4 mcop/mcoputils.cc 1.19.4.3 M +4 -1 mcop/startupmanager.cc 1.11.4.2 M +5 -0 soundserver/soundserver.idl 1.25.2.1 M +4 -0 soundserver/soundserver_impl.cc 1.7.4.3 M +1 -0 soundserver/soundserver_impl.h 1.4.4.2
My testing indicates that this patch is sufficient.
I think that's perfectly reasonable, I was concerned about breaking compatibility and I'm glad you were able to address that. Thank you again.