/[svn]/linuxsampler/trunk/src/linuxsampler.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/linuxsampler.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 420 by schoenebeck, Thu Mar 3 03:25:17 2005 UTC revision 579 by schoenebeck, Tue May 24 19:20:20 2005 UTC
# Line 76  int main(int argc, char **argv) { Line 76  int main(int argc, char **argv) {
76      dmsg(1,("Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck\n"));      dmsg(1,("Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck\n"));
77      dmsg(1,("Copyright (C) 2005 Christian Schoenebeck\n"));      dmsg(1,("Copyright (C) 2005 Christian Schoenebeck\n"));
78    
79      if (tune)      if (tune) {
80      {          // detect and print system / CPU specific features
81              // detect and print system / CPU specific features          Features::detect();
82              String sFeatures;          dmsg(1,("Detected features: %s\n", Features::featuresAsString().c_str()));
83              Features::detect();          // prevent slow denormal FPU modes
84  #if ARCH_X86          Features::enableDenormalsAreZeroMode();
             if (Features::supportsMMX()) sFeatures += " MMX";  
             if (Features::supportsSSE()) sFeatures += " SSE";  
 #endif // ARCH_X86  
             if (!sFeatures.size()) sFeatures = " None";  
             dmsg(1,("Detected features:%s\n",sFeatures.c_str()));  
85      }      }
86    
87      // create LinuxSampler instance      // create LinuxSampler instance
# Line 106  int main(int argc, char **argv) { Line 101  int main(int argc, char **argv) {
101    
102      if (profile)      if (profile)
103      {      {
104              dmsg(1,("Calibrating profiler..."));          dmsg(1,("Calibrating profiler..."));
105              gig::Profiler::Calibrate();          gig::Profiler::Calibrate();
106              gig::Profiler::Reset();          gig::Profiler::Reset();
107              dmsg(1,("OK\n"));          dmsg(1,("OK\n"));
108      }      }
109    
110      printf("LinuxSampler initialization completed.\n");      printf("LinuxSampler initialization completed. :-)\n\n");
111    
112      std::list<LSCPEvent::event_t> rtEvents;      std::list<LSCPEvent::event_t> rtEvents;
113      rtEvents.push_back(LSCPEvent::event_voice_count);      rtEvents.push_back(LSCPEvent::event_voice_count);
# Line 132  int main(int argc, char **argv) { Line 127  int main(int argc, char **argv) {
127                  fflush(stdout);                  fflush(stdout);
128              }              }
129          }          }
130            
131        sleep(1);        sleep(1);
132        if (profile)        if (profile)
133        {        {
134                unsigned int samplingFreq = 48000; //FIXME: hardcoded for now            unsigned int samplingFreq = 48000; //FIXME: hardcoded for now
135                unsigned int bv = gig::Profiler::GetBogoVoices(samplingFreq);            unsigned int bv = gig::Profiler::GetBogoVoices(samplingFreq);
136                if (bv != 0)            if (bv != 0)
137                {            {
138                        printf("       BogoVoices: %i         \r", bv);                printf("       BogoVoices: %i         \r", bv);
139                        fflush(stdout);                fflush(stdout);
140                }            }
141        }        }
142          
143        if (LSCPServer::EventSubscribers(rtEvents))        if (LSCPServer::EventSubscribers(rtEvents))
144        {        {
145                LSCPServer::LockRTNotify();            LSCPServer::LockRTNotify();
146                std::map<uint,SamplerChannel*> channels = pSampler->GetSamplerChannels();            std::map<uint,SamplerChannel*> channels = pSampler->GetSamplerChannels();
147                std::map<uint,SamplerChannel*>::iterator iter = channels.begin();            std::map<uint,SamplerChannel*>::iterator iter = channels.begin();
148                for (; iter != channels.end(); iter++) {            for (; iter != channels.end(); iter++) {
149                        SamplerChannel* pSamplerChannel = iter->second;                SamplerChannel* pSamplerChannel = iter->second;
150                        EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();                EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel();
151                        if (!pEngineChannel) continue;                if (!pEngineChannel) continue;
152                        Engine* pEngine = pEngineChannel->GetEngine();                Engine* pEngine = pEngineChannel->GetEngine();
153                        if (!pEngine) continue;                if (!pEngine) continue;
154                        LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_voice_count, iter->first, pEngine->VoiceCount()));                LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_voice_count, iter->first, pEngine->VoiceCount()));
155                        LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_stream_count, iter->first, pEngine->DiskStreamCount()));                LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_stream_count, iter->first, pEngine->DiskStreamCount()));
156                        LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_buffer_fill, iter->first, pEngine->DiskStreamBufferFillPercentage()));                LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_buffer_fill, iter->first, pEngine->DiskStreamBufferFillPercentage()));
157                }            }
158                LSCPServer::UnlockRTNotify();            LSCPServer::UnlockRTNotify();
159        }        }
160    
161      }      }
# Line 253  void parse_options(int argc, char **argv Line 248  void parse_options(int argc, char **argv
248                      exit(EXIT_SUCCESS);                      exit(EXIT_SUCCESS);
249                      break;                      break;
250                  case 2: // --profile                  case 2: // --profile
251                      profile = true;                      profile = true;
252                      break;                      break;
253                  case 3: // --no-tune                  case 3: // --no-tune
254                      tune = false;                      tune = false;
255                      break;                      break;
256                  case 4: // --statistics                  case 4: // --statistics
257                      bPrintStatistics = true;                      bPrintStatistics = true;

Legend:
Removed from v.420  
changed lines
  Added in v.579

  ViewVC Help
Powered by ViewVC