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

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

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

revision 2374 by schoenebeck, Wed Sep 15 10:04:07 2010 UTC revision 2375 by schoenebeck, Thu Oct 4 17:45:22 2012 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2010 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2012 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This library is free software; you can redistribute it and/or modify  *   *   This library is free software; you can redistribute it and/or modify  *
9   *   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 680  namespace LinuxSampler { Line 680  namespace LinuxSampler {
680          return count;          return count;
681      }      }
682    
683        int Sampler::GetGlobalMaxVoices() {
684            return GLOBAL_MAX_VOICES; // see common/global_private.cpp
685        }
686    
687        int Sampler::GetGlobalMaxStreams() {
688            return GLOBAL_MAX_STREAMS; // see common/global_private.cpp
689        }
690    
691        void Sampler::SetGlobalMaxVoices(int n) throw (Exception) {
692            if (n < 1) throw Exception("Maximum voices may not be less than 1");
693            GLOBAL_MAX_VOICES = n; // see common/global_private.cpp
694            const std::set<Engine*>& engines = EngineFactory::EngineInstances();
695            if (engines.size() > 0) {
696                std::set<Engine*>::iterator iter = engines.begin();
697                std::set<Engine*>::iterator end  = engines.end();
698                for (; iter != end; ++iter) {
699                    (*iter)->SetMaxVoices(n);
700                }
701            }
702        }
703    
704        void Sampler::SetGlobalMaxStreams(int n) throw (Exception) {
705            if (n < 0) throw Exception("Maximum disk streams may not be negative");
706            GLOBAL_MAX_STREAMS = n; // see common/global_private.cpp
707            const std::set<Engine*>& engines = EngineFactory::EngineInstances();
708            if (engines.size() > 0) {
709                std::set<Engine*>::iterator iter = engines.begin();
710                std::set<Engine*>::iterator end  = engines.end();
711                for (; iter != end; ++iter) {
712                    (*iter)->SetMaxDiskStreams(n);
713                }
714            }
715        }
716    
717      void Sampler::Reset() {      void Sampler::Reset() {
718          // delete sampler channels          // delete sampler channels
719          try {          try {

Legend:
Removed from v.2374  
changed lines
  Added in v.2375

  ViewVC Help
Powered by ViewVC