--- linuxsampler/trunk/src/linuxsampler.cpp 2005/12/22 19:29:52 816 +++ linuxsampler/trunk/src/linuxsampler.cpp 2007/04/16 15:51:18 1161 @@ -2,8 +2,8 @@ * * * LinuxSampler - modular, streaming capable sampler * * * - * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * - * Copyright (C) 2005 Christian Schoenebeck * + * Copyright (C) 2003-2004 by Benno Senoner and Christian Schoenebeck * + * Copyright (C) 2005-2007 Christian Schoenebeck * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -57,8 +57,6 @@ main_pid = getpid(); main_thread = pthread_self(); - - // setting signal handler for catching SIGINT (thus e.g. ) signal(SIGINT, signal_handler); @@ -82,8 +80,8 @@ parse_options(argc, argv); dmsg(1,("LinuxSampler %s\n", VERSION)); - dmsg(1,("Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck\n")); - dmsg(1,("Copyright (C) 2005 Christian Schoenebeck\n")); + dmsg(1,("Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck\n")); + dmsg(1,("Copyright (C) 2005-2007 Christian Schoenebeck\n")); if (tune) { // detect and print system / CPU specific features @@ -98,6 +96,7 @@ pSampler = new Sampler; dmsg(1,("OK\n")); + dmsg(1,("Registered sampler engines: %s\n", EngineFactory::AvailableEngineTypesAsString().c_str())); dmsg(1,("Registered MIDI input drivers: %s\n", MidiInputDeviceFactory::AvailableDriversAsString().c_str())); dmsg(1,("Registered audio output drivers: %s\n", AudioOutputDeviceFactory::AvailableDriversAsString().c_str())); @@ -113,9 +112,9 @@ if (profile) { dmsg(1,("Calibrating profiler...")); - gig::Profiler::Calibrate(); - gig::Profiler::Reset(); - gig::Profiler::enable(); + LinuxSampler::gig::Profiler::Calibrate(); + LinuxSampler::gig::Profiler::Reset(); + LinuxSampler::gig::Profiler::enable(); dmsg(1,("OK\n")); } @@ -129,7 +128,7 @@ while (true) { if (bPrintStatistics) { - std::set engines = EngineFactory::EngineInstances(); + const std::set& engines = EngineFactory::EngineInstances(); std::set::iterator itEngine = engines.begin(); for (int i = 0; itEngine != engines.end(); itEngine++, i++) { Engine* pEngine = *itEngine; @@ -145,7 +144,7 @@ if (profile) { unsigned int samplingFreq = 48000; //FIXME: hardcoded for now - unsigned int bv = gig::Profiler::GetBogoVoices(samplingFreq); + unsigned int bv = LinuxSampler::gig::Profiler::GetBogoVoices(samplingFreq); if (bv != 0) { printf(" BogoVoices: %i \r", bv); @@ -164,10 +163,10 @@ if (!pEngineChannel) continue; Engine* pEngine = pEngineChannel->GetEngine(); if (!pEngine) continue; - LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_voice_count, iter->first, pEngine->VoiceCount())); - LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_stream_count, iter->first, pEngine->DiskStreamCount())); - LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_buffer_fill, iter->first, pEngine->DiskStreamBufferFillPercentage())); - LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_voice_count, pSampler->GetVoiceCount())); + pSampler->fireVoiceCountChanged(iter->first, pEngine->VoiceCount()); + pSampler->fireStreamCountChanged(iter->first, pEngine->DiskStreamCount()); + pSampler->fireBufferFillChanged(iter->first, pEngine->DiskStreamBufferFillPercentage()); + pSampler->fireTotalVoiceCountChanged(pSampler->GetVoiceCount()); } LSCPServer::UnlockRTNotify(); } @@ -186,6 +185,9 @@ delete pLSCPServer; } if (pSampler) delete pSampler; +#if HAVE_SQLITE3 + InstrumentsDb::Destroy(); +#endif printf("LinuxSampler stopped due to SIGINT.\n"); exit(EXIT_SUCCESS); }