Bug 59184 - wanted: something like arts_init() that only suceeds if arts has DSP device open
Summary: wanted: something like arts_init() that only suceeds if arts has DSP device open
Status: RESOLVED FIXED
Alias: None
Product: arts
Classification: Miscellaneous
Component: general (show other bugs)
Version: 1.1.1
Platform: Mandrake RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: George Staikos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-31 19:29 UTC by David Walser
Modified: 2003-07-02 20:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
fixes this bug by adding arts_suspended() to the C API (4.77 KB, patch)
2003-07-02 19:23 UTC, David Walser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Walser 2003-05-31 19:29:43 UTC
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.
Comment 1 David Walser 2003-07-02 18:33:24 UTC
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. 
Comment 2 David Walser 2003-07-02 19:14:55 UTC
Ok, I've taken my advice, and implemented a patch.  I'll attach it. 
Comment 3 David Walser 2003-07-02 19:23:46 UTC
Created attachment 1920 [details]
fixes this bug by adding arts_suspended() to the C API
Comment 4 George Staikos 2003-07-02 20:06:48 UTC
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# 
Comment 5 George Staikos 2003-07-02 20:07:53 UTC
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



Comment 6 George Staikos 2003-07-02 20:23:03 UTC
My testing indicates that this patch is sufficient. 
Comment 7 David Walser 2003-07-02 20:24:23 UTC
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.