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

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

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

revision 989 by schoenebeck, Tue Dec 19 19:34:08 2006 UTC revision 1649 by nagata, Fri Jan 25 15:06:02 2008 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2005, 2006 Christian Schoenebeck                        *   *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *
4   *                                                                         *   *                                                                         *
5   *   This library is free software; you can redistribute it and/or modify  *   *   This library is free software; you can redistribute it and/or modify  *
6   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 20  Line 20 
20    
21  #include "InstrumentManagerThread.h"  #include "InstrumentManagerThread.h"
22    
23    #include "../common/global_private.h"
24    
25  namespace LinuxSampler {  namespace LinuxSampler {
26    
27      InstrumentManagerThread::InstrumentManagerThread() : Thread(true, false, 0, -4) {      InstrumentManagerThread::InstrumentManagerThread() : Thread(true, false, 0, -4) {
# Line 40  namespace LinuxSampler { Line 42  namespace LinuxSampler {
42       * @param pEngineChannel - engine channel on which the instrument should be loaded       * @param pEngineChannel - engine channel on which the instrument should be loaded
43       */       */
44      void InstrumentManagerThread::StartNewLoad(String Filename, uint uiInstrumentIndex, EngineChannel* pEngineChannel) {      void InstrumentManagerThread::StartNewLoad(String Filename, uint uiInstrumentIndex, EngineChannel* pEngineChannel) {
45          dmsg(1,("Scheduling '%s' (Index=%d) to be loaded in background (if not loaded yet).",Filename.c_str(),uiInstrumentIndex));          dmsg(1,("Scheduling '%s' (Index=%d) to be loaded in background (if not loaded yet).\n",Filename.c_str(),uiInstrumentIndex));
46          // already tell the engine which instrument to load          // already tell the engine which instrument to load
47          pEngineChannel->PrepareLoadInstrument(Filename.c_str(), uiInstrumentIndex);          pEngineChannel->PrepareLoadInstrument(Filename.c_str(), uiInstrumentIndex);
48    
# Line 86  namespace LinuxSampler { Line 88  namespace LinuxSampler {
88      // Entry point for the task thread.      // Entry point for the task thread.
89      int InstrumentManagerThread::Main() {      int InstrumentManagerThread::Main() {
90          while (true) {          while (true) {
91    
92                            #if CONFIG_PTHREAD_TESTCANCEL
93                            TestCancel();
94                            #endif
95    
96              while (!queue.empty()) {              while (!queue.empty()) {
97                  command_t cmd;                  command_t cmd;
98    
# Line 105  namespace LinuxSampler { Line 112  namespace LinuxSampler {
112                          default:                          default:
113                              std::cerr << "InstrumentManagerThread: unknown command - BUG!\n" << std::flush;                              std::cerr << "InstrumentManagerThread: unknown command - BUG!\n" << std::flush;
114                      }                      }
115                  }                  } catch (Exception e) {
                 catch (Exception e) {  
116                      e.PrintMessage();                      e.PrintMessage();
117                    } catch (...) {
118                        std::cerr << "InstrumentManagerThread: some exception occured, could not finish task\n" << std::flush;
119                  }                  }
120    
121                  // remove processed command from queue                  // remove processed command from queue

Legend:
Removed from v.989  
changed lines
  Added in v.1649

  ViewVC Help
Powered by ViewVC