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

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

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

revision 1897 by persson, Sun May 10 09:31:51 2009 UTC revision 1934 by schoenebeck, Sun Jul 12 10:35:55 2009 UTC
# Line 153  namespace LinuxSampler { Line 153  namespace LinuxSampler {
153    
154              /** Returns the sampler to which this channel belongs */              /** Returns the sampler to which this channel belongs */
155              Sampler* GetSampler();              Sampler* GetSampler();
156                
157                ///////////////////////////////////////////////////////////////
158                // Event Listener methods
159    
160              /**              /**
161               * Registers the specified listener to be notified               * Registers the specified listener to be notified
162               * when the engine type of this sampler channel is changed.               * when the engine type of this sampler channel is changed.
# Line 323  namespace LinuxSampler { Line 326  namespace LinuxSampler {
326              void RemoveAllSamplerChannels();              void RemoveAllSamplerChannels();
327    
328              /**              /**
329                 * Returns the names of all available audio output drivers.
330                 */
331                std::vector<String> AvailableAudioOutputDrivers();
332    
333                /**
334                 * Returns the names of all available MIDI input drivers.
335                 */
336                std::vector<String> AvailableMidiInputDrivers();
337    
338                /**
339                 * Returns the names of all available sampler engine types.
340                 * @see SamplerChannel::SetEngineType()
341                 */
342                std::vector<String> AvailableEngineTypes();
343    
344                /**
345                 * Create an audio output device.
346                 *
347                 * @param AudioDriver - name of the audio driver
348                 * @param Parameters - eventually needed driver parameters to
349                 *                     create the device
350                 * @returns  pointer to created audio output device
351                 * @throws Exception  if device could not be created
352                 */
353                AudioOutputDevice* CreateAudioOutputDevice(String AudioDriver, std::map<String,String> Parameters) throw (Exception);
354    
355                /**
356                 * Create a midi input device.
357                 *
358                 * @param MidiDriver - name of the midi driver
359                 * @param Parameters - eventually needed driver parameters to
360                 *                     create the device
361                 * @returns  pointer to created midi input device
362                 * @throws Exception  if device could not be created
363                 */
364                MidiInputDevice* CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (Exception);
365    
366                /**
367                 * Returns the number of all created audio output devices.
368                 */
369                uint AudioOutputDevices();
370    
371                /**
372                 * Returns the number of all created MIDI input devices.
373                 */
374                uint MidiInputDevices();
375    
376                /**
377                 * Returns all created audio output devices.
378                 */
379                std::map<uint, AudioOutputDevice*> GetAudioOutputDevices();
380    
381                /**
382                 * Returns all created MIDI input devices.
383                 */
384                std::map<uint, MidiInputDevice*> GetMidiInputDevices();
385    
386                /**
387                 * Destroy the given audio output device and takes care if there
388                 * are still sampler engines connected to this device, etc.
389                 *
390                 * @throws Exception  if sampler channels are still
391                 *                    connected to the device
392                 */
393                void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (Exception);
394    
395                /**
396                 * Destroy all audio output devices and takes care if there
397                 * are still sampler engines connected to devices, etc.
398                 *
399                 * Note: non-autonomous devices, that is devices associated with
400                 * host plugin instances like VST, AU, DSSI, LV2 are not
401                 * destroyed by this method.
402                 *
403                 * @throws Exception  if sampler channels are still
404                 *                    connected to device
405                 */
406                void DestroyAllAudioOutputDevices() throw (Exception);
407    
408                /**
409                 * Destroy the given MIDI input device and takes care if there
410                 * are still sampler engines connected to this device, etc.
411                 *
412                 * @throws Exception  if sampler channels are still
413                 *                    connected to the device
414                 */
415                void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (Exception);
416    
417                /**
418                 * Destroy all MIDI input devices and take care if there
419                 * are still sampler engines connected to device, etc.
420                 *
421                 * Note: non-autonomous devices, that is devices associated with
422                 * host plugin instances like VST, AU, DSSI, LV2 are not
423                 * destroyed by this method.
424                 *
425                 * @throws Exception  if sampler channels are still
426                 *                    connected to device
427                 */
428                void DestroyAllMidiInputDevices() throw (Exception);
429    
430                 /**
431                 * Gets the current number of all active streams.
432                 * @returns The current number of all active streams.
433                 */
434                int GetDiskStreamCount();
435    
436                /**
437                 * Gets the current number of all active voices.
438                 * @returns The current number of all active voices.
439                 */
440                int GetVoiceCount();
441    
442                /**
443                 * Reset the whole sampler. Destroy all engines, sampler
444                 * channels, MIDI input devices and audio output devices.
445                 */
446                void Reset();
447    
448                ///////////////////////////////////////////////////////////////
449                // Event Listener methods
450    
451                /**
452               * Registers the specified listener to be notified               * Registers the specified listener to be notified
453               * when the number of sampler chanels is changed.               * when the number of sampler chanels is changed.
454               */               */
# Line 344  namespace LinuxSampler { Line 470  namespace LinuxSampler {
470               */               */
471              void RemoveAudioDeviceCountListener(AudioDeviceCountListener* l);              void RemoveAudioDeviceCountListener(AudioDeviceCountListener* l);
472    
               
473              /**              /**
474               * Registers the specified listener to be notified               * Registers the specified listener to be notified
475               * when the number of MIDI input devices is changed.               * when the number of MIDI input devices is changed.
# Line 430  namespace LinuxSampler { Line 555  namespace LinuxSampler {
555               * @param NewCount The new number of active voices.               * @param NewCount The new number of active voices.
556               */               */
557              void fireTotalVoiceCountChanged(int NewCount);              void fireTotalVoiceCountChanged(int NewCount);
               
             void AddTotalStreamCountListener(TotalStreamCountListener* l);  
             void RemoveTotalStreamCountListener(TotalStreamCountListener* l);  
             void fireTotalStreamCountChanged(int NewCount);  
558    
559              /**              /**
560               * Registers the specified listener to be notified when the number               * Registers the specified listener to be notified when the number
561               * of effect sends on a particular sampler channel is changed.               * of total streams is changed.
562               */               */
563              void AddFxSendCountListener(FxSendCountListener* l);              void AddTotalStreamCountListener(TotalStreamCountListener* l);
564    
565              /**              /**
566               * Removes the specified listener.               * Removes the specified listener.
567               */               */
568              void RemoveFxSendCountListener(FxSendCountListener* l);              void RemoveTotalStreamCountListener(TotalStreamCountListener* l);
   
             /**  
              * Returns the names of all available audio output drivers.  
              */  
             std::vector<String> AvailableAudioOutputDrivers();  
   
             /**  
              * Returns the names of all available MIDI input drivers.  
              */  
             std::vector<String> AvailableMidiInputDrivers();  
   
             /**  
              * Returns the names of all available sampler engine types.  
              * @see SamplerChannel::SetEngineType()  
              */  
             std::vector<String> AvailableEngineTypes();  
   
             /**  
              * Create an audio output device.  
              *  
              * @param AudioDriver - name of the audio driver  
              * @param Parameters - eventually needed driver parameters to  
              *                     create the device  
              * @returns  pointer to created audio output device  
              * @throws Exception  if device could not be created  
              */  
             AudioOutputDevice* CreateAudioOutputDevice(String AudioDriver, std::map<String,String> Parameters) throw (Exception);  
   
             /**  
              * Create a midi input device.  
              *  
              * @param MidiDriver - name of the midi driver  
              * @param Parameters - eventually needed driver parameters to  
              *                     create the device  
              * @returns  pointer to created midi input device  
              * @throws Exception  if device could not be created  
              */  
             MidiInputDevice* CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (Exception);  
   
             /**  
              * Returns the number of all created audio output devices.  
              */  
             uint AudioOutputDevices();  
   
             /**  
              * Returns the number of all created MIDI input devices.  
              */  
             uint MidiInputDevices();  
   
             /**  
              * Returns all created audio output devices.  
              */  
             std::map<uint, AudioOutputDevice*> GetAudioOutputDevices();  
   
             /**  
              * Returns all created MIDI input devices.  
              */  
             std::map<uint, MidiInputDevice*> GetMidiInputDevices();  
   
             /**  
              * Destroy the given audio output device and takes care if there  
              * are still sampler engines connected to this device, etc.  
              *  
              * @throws Exception  if sampler channels are still  
              *                    connected to the device  
              */  
             void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (Exception);  
569    
570              /**              /**
571               * Destroy all audio output devices and takes care if there               * Notifies listeners that the total number of total streams changed.
572               * are still sampler engines connected to devices, etc.               * @param NewCount The new number of total streams.
              *  
              * @throws Exception  if sampler channels are still  
              *                    connected to device  
573               */               */
574              void DestroyAllAudioOutputDevices() throw (Exception);              void fireTotalStreamCountChanged(int NewCount);
575    
576              /**              /**
577               * Destroy the given MIDI input device and takes care if there               * Registers the specified listener to be notified when the number
578               * are still sampler engines connected to this device, etc.               * of effect sends on a particular sampler channel is changed.
              *  
              * @throws Exception  if sampler channels are still  
              *                    connected to the device  
579               */               */
580              void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (Exception);              void AddFxSendCountListener(FxSendCountListener* l);
581    
582              /**              /**
583               * Destroy all MIDI input devices and take care if there               * Removes the specified listener.
              * are still sampler engines connected to device, etc.  
              *  
              * @throws Exception  if sampler channels are still  
              *                    connected to device  
              */  
             void DestroyAllMidiInputDevices() throw (Exception);  
   
              /**  
              * Gets the current number of all active streams.  
              * @returns The current number of all active streams.  
584               */               */
585              int GetDiskStreamCount();              void RemoveFxSendCountListener(FxSendCountListener* l);
586    
587              /**              /**
588               * Gets the current number of all active voices.               * Notifies listeners about the current number of voices,
589               * @returns The current number of all active voices.               * streams and total voices, and the current fill state of
590                 * the disk stream buffers.
591               */               */
592              int GetVoiceCount();              void fireStatistics();
593    
594              /**              ///////////////////////////////////////////////////////////////
595               * Reset the whole sampler. Destroy all engines, sampler              // system specific methods
              * channels, MIDI input devices and audio output devices.  
              */  
             void Reset();  
596    
597              /**              /**
598               * Advise the FPU to treat denormal floating point numbers as               * Advise the FPU to treat denormal floating point numbers as
# Line 567  namespace LinuxSampler { Line 603  namespace LinuxSampler {
603               */               */
604              static bool EnableDenormalsAreZeroMode();              static bool EnableDenormalsAreZeroMode();
605    
             /**  
              * Notifies listeners about the current number of voices,  
              * streams and total voices, and the current fill state of  
              * the disk stream buffers.  
              */  
             void fireStatistics();  
   
606  #if defined(WIN32)  #if defined(WIN32)
607              /**              /**
608               * Gets the directory where the liblinuxsampler dll is               * Gets the directory where the liblinuxsampler dll is located.
609               * located.               * Note: this method is currently only available for Windows.
610               * @returns installation directory               * @returns installation directory
611               */               */
612              static String GetInstallDir();              static String GetInstallDir();
# Line 637  namespace LinuxSampler { Line 666  namespace LinuxSampler {
666               */               */
667              void fireFxSendCountChanged(int ChannelId, int NewCount);              void fireFxSendCountChanged(int ChannelId, int NewCount);
668    
             typedef std::map<uint, AudioOutputDevice*> AudioOutputDeviceMap;  
             typedef std::map<uint, MidiInputDevice*> MidiInputDeviceMap;  
669              typedef std::map<uint, SamplerChannel*> SamplerChannelMap;              typedef std::map<uint, SamplerChannel*> SamplerChannelMap;
670    
671              SamplerChannelMap     mSamplerChannels;    ///< contains all created sampler channels              SamplerChannelMap mSamplerChannels; ///< contains all created sampler channels
             AudioOutputDeviceMap  mAudioOutputDevices; ///< contains all created audio output devices  
             MidiInputDeviceMap    mMidiInputDevices;   ///< contains all created MIDI input devices  
672    
673              // statistics cache              // statistics cache
674              uint uiOldTotalVoiceCount;              uint uiOldTotalVoiceCount;

Legend:
Removed from v.1897  
changed lines
  Added in v.1934

  ViewVC Help
Powered by ViewVC