? doc/TODO.X ? soundserver/TEXT Index: knotify/knotify.cpp =================================================================== RCS file: /home/kde/kdelibs/arts/knotify/knotify.cpp,v retrieving revision 1.51 diff -u -r1.51 knotify.cpp --- knotify/knotify.cpp 2001/04/28 00:50:29 1.51 +++ knotify/knotify.cpp 2001/08/05 19:59:08 @@ -63,7 +63,7 @@ QString externalPlayer; KProcess *externalPlayerProc; - Arts::SimpleSoundServer soundServer; + Arts::SoundServerV2 soundServer; Arts::PlayObjectFactory playObjectFactory; QValueList playObjects; @@ -110,7 +110,7 @@ : QObject(), DCOPObject("Notify") { d = new KNotifyPrivate; - d->soundServer = Arts::SimpleSoundServer::null(); + d->soundServer = Arts::SoundServerV2::null(); d->globalEvents = new KConfig("knotify/eventsrc", true, false, "data"); d->globalConfig = new KConfig("knotify.eventsrc", true, false); d->externalPlayerProc = 0; @@ -267,6 +267,9 @@ while( d->playObjects.count()>5 ) d->playObjects.remove( d->playObjects.begin() ); + if (d->soundServer.audioDevice() == "null") + return false; + Arts::PlayObject player = d->playObjectFactory.createPlayObject( QFile::encodeName(soundFile).data() ); if (player.isNull()) @@ -397,13 +400,13 @@ * startup sequence, even if artsd is started some time after the first * process requests knotify to do some notifications */ - Arts::SimpleSoundServer result; - d->soundServer = Arts::Reference("global:Arts_SimpleSoundServer"); + Arts::SoundServerV2 result; + d->soundServer = Arts::Reference("global:Arts_SoundServerV2"); if ( firstTime && d->soundServer.isNull() ) for( int tries=0; tries<7; tries++ ) { sleep( 1 ); - d->soundServer = Arts::Reference("global:Arts_SimpleSoundServer"); + d->soundServer = Arts::Reference("global:Arts_SoundServerV2"); if( !d->soundServer.isNull() ) break; } Index: soundserver/artsd.cc =================================================================== RCS file: /home/kde/kdelibs/arts/soundserver/artsd.cc,v retrieving revision 1.36 diff -u -r1.36 artsd.cc --- soundserver/artsd.cc 2001/03/26 16:01:30 1.36 +++ soundserver/artsd.cc 2001/08/05 19:59:10 @@ -71,6 +71,7 @@ fprintf(stderr,"-F number of fragments\n"); fprintf(stderr,"-S fragment size in bytes\n"); fprintf(stderr,"-s auto-suspend time in seconds\n"); + fprintf(stderr,"-f force starting artsd (if no soundcard is there, uses the null output device)\n"); fprintf(stderr,"\n"); fprintf(stderr,"misc options:\n"); fprintf(stderr,"-h display this help and exit\n"); @@ -106,6 +107,7 @@ static int cfgDebugLevel = 2; static const char *cfgDebugApp = 0; static bool cfgFullDuplex = 0; +static bool cfgForceStart = 0; static const char *cfgDeviceName = 0; static const char *cfgAudioIO = 0; static int cfgAutoSuspend = 0; @@ -116,7 +118,7 @@ static void handleArgs(int argc, char **argv) { int optch; - while((optch = getopt(argc,argv,"r:p:nuF:S:hD:dl:a:Ab:s:m:vNw:")) > 0) + while((optch = getopt(argc,argv,"r:p:nuF:S:hD:dl:a:Ab:s:m:vNw:f")) > 0) { switch(optch) { @@ -154,6 +156,8 @@ break; case 'w': cfgBuffers = atoi(optarg); break; + case 'f': cfgForceStart = true; + break; case 'h': default: exitUsage(argc?argv[0]:"artsd"); @@ -250,6 +254,19 @@ if(cfgFullDuplex) AudioSubSystem::the()->fullDuplex(cfgFullDuplex); if(cfgDeviceName) AudioSubSystem::the()->deviceName(cfgDeviceName); if(cfgBits) AudioSubSystem::the()->format(cfgBits); + + if(cfgForceStart && !AudioSubSystem::the()->check()) + { + /* hack to get this message to the user in any case */ + Debug::init("[artsd]", static_cast(1)); + arts_info( + "Error while initializing the sound driver:\n" + "%s\n\n" + "The sound server will continue, using the null output device.", + AudioSubSystem::the()->error()); + Debug::init("[artsd]", static_cast(cfgDebugLevel)); + AudioSubSystem::the()->audioIO("null"); + } if(!AudioSubSystem::the()->check()) {