/[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 1541 by iliev, Tue Dec 4 18:09:26 2007 UTC revision 1835 by iliev, Mon Feb 16 17:56:50 2009 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, 2006 Christian Schoenebeck                        *   *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program 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 150  namespace LinuxSampler { Line 150  namespace LinuxSampler {
150               * Sampler instance.               * Sampler instance.
151               */               */
152              uint Index();              uint Index();
153    
154                /** Returns the sampler to which this channel belongs */
155                Sampler* GetSampler();
156                            
157              /**              /**
158               * Registers the specified listener to be notified               * Registers the specified listener to be notified
# Line 168  namespace LinuxSampler { Line 171  namespace LinuxSampler {
171              void RemoveAllEngineChangeListeners();              void RemoveAllEngineChangeListeners();
172    
173              /**              /**
174                 * Notifies listeners that the engine type of this sampler
175                 * channel is going to be changed soon.
176                 */
177                void fireEngineToBeChanged();
178    
179                /**
180               * Notifies listeners that the engine               * Notifies listeners that the engine
181               * type of this sampler channel is changed.               * type of this sampler channel is changed.
182               */               */
# Line 308  namespace LinuxSampler { Line 317  namespace LinuxSampler {
317              void RemoveSamplerChannel(uint uiSamplerChannel);              void RemoveSamplerChannel(uint uiSamplerChannel);
318    
319              /**              /**
320                 * Destroy and remove all sampler channels from this
321                 * Sampler instance.
322                 */
323                void RemoveAllSamplerChannels();
324    
325                /**
326               * Registers the specified listener to be notified               * Registers the specified listener to be notified
327               * when the number of sampler chanels is changed.               * when the number of sampler chanels is changed.
328               */               */
# Line 491  namespace LinuxSampler { Line 506  namespace LinuxSampler {
506    
507              /**              /**
508               * Destroy the given audio output device and takes care if there               * Destroy the given audio output device and takes care if there
509               * are still sampler angines connected to this device, etc.               * are still sampler engines connected to this device, etc.
510               *               *
511               * @throws Exception  if sampler channels are still               * @throws Exception  if sampler channels are still
512               *                    connected to the device               *                    connected to the device
# Line 499  namespace LinuxSampler { Line 514  namespace LinuxSampler {
514              void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (Exception);              void DestroyAudioOutputDevice(AudioOutputDevice* pDevice) throw (Exception);
515    
516              /**              /**
517                 * Destroy all audio output devices and takes care if there
518                 * are still sampler engines connected to devices, etc.
519                 *
520                 * @throws Exception  if sampler channels are still
521                 *                    connected to device
522                 */
523                void DestroyAllAudioOutputDevices() throw (Exception);
524    
525                /**
526               * Destroy the given MIDI input device and takes care if there               * Destroy the given MIDI input device and takes care if there
527               * are still sampler angines connected to this device, etc.               * are still sampler engines connected to this device, etc.
528               *               *
529               * @throws Exception  if sampler channels are still               * @throws Exception  if sampler channels are still
530               *                    connected to the device               *                    connected to the device
531               */               */
532              void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (Exception);              void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (Exception);
533    
534                /**
535                 * Destroy all MIDI input devices and take care if there
536                 * are still sampler engines connected to device, etc.
537                 *
538                 * @throws Exception  if sampler channels are still
539                 *                    connected to device
540                 */
541                void DestroyAllMidiInputDevices() throw (Exception);
542    
543               /**               /**
544               * Gets the current number of all active streams.               * Gets the current number of all active streams.
545               * @returns The current number of all active streams.               * @returns The current number of all active streams.
# Line 525  namespace LinuxSampler { Line 558  namespace LinuxSampler {
558               */               */
559              void Reset();              void Reset();
560    
561                /**
562                 * Advise the FPU to treat denormal floating point numbers as
563                 * zero, to avoid severe performance penalty when dealing with
564                 * such extreme floating point values.
565                 *
566                 * @returns @c true if FPU supports it, @c false otherwise
567                 */
568                static bool EnableDenormalsAreZeroMode();
569    
570                /**
571                 * Notifies listeners about the current number of voices,
572                 * streams and total voices, and the current fill state of
573                 * the disk stream buffers.
574                 */
575                void fireStatistics();
576    
577          protected:          protected:
578              /**              /**
579               * Notifies listeners that the number of sampler channels has been changed.               * Notifies listeners that the number of sampler channels has been changed.
# Line 533  namespace LinuxSampler { Line 582  namespace LinuxSampler {
582              void fireChannelCountChanged(int NewCount);              void fireChannelCountChanged(int NewCount);
583    
584              /**              /**
585                 * Notifies listeners that the specified sampler channel has just
586                 * been added.
587                 * @param pChannel The new sampler channel.
588                 */
589                void fireChannelAdded(SamplerChannel* pChannel);
590    
591                /**
592                 * Notifies listeners that the specified sampler channel is
593                 * going to be removed soon.
594                 * @param pChannel sampler channel to be removed.
595                 */
596                void fireChannelToBeRemoved(SamplerChannel* pChannel);
597    
598                /**
599               * Notifies listeners that the number of audio output devices has been changed.               * Notifies listeners that the number of audio output devices has been changed.
600               * @param NewCount The new number of audio output devices.               * @param NewCount The new number of audio output devices.
601               */               */
# Line 545  namespace LinuxSampler { Line 608  namespace LinuxSampler {
608              void fireMidiDeviceCountChanged(int NewCount);              void fireMidiDeviceCountChanged(int NewCount);
609    
610              /**              /**
611                 * Notifies listeners that the supplied MIDI input device is
612                 * going to be destroyed soon.
613                 * @param pDevice MIDI input device to be destroyed
614                 */
615                void fireMidiDeviceToBeDestroyed(MidiInputDevice* pDevice);
616    
617                /**
618                 * Notifies listeners that the supplied MIDI input device was
619                 * just created.
620                 * @param pDevice new MIDI input device
621                 */
622                void fireMidiDeviceCreated(MidiInputDevice* pDevice);
623    
624                /**
625               * Notifies listeners that the number of effect sends               * Notifies listeners that the number of effect sends
626               * on a particular sampler channel is changed.               * on a particular sampler channel is changed.
627               * @param ChannelId The numerical ID of the sampler channel.               * @param ChannelId The numerical ID of the sampler channel.
# Line 560  namespace LinuxSampler { Line 637  namespace LinuxSampler {
637              AudioOutputDeviceMap  mAudioOutputDevices; ///< contains all created audio output devices              AudioOutputDeviceMap  mAudioOutputDevices; ///< contains all created audio output devices
638              MidiInputDeviceMap    mMidiInputDevices;   ///< contains all created MIDI input devices              MidiInputDeviceMap    mMidiInputDevices;   ///< contains all created MIDI input devices
639    
640                // statistics cache
641                uint uiOldTotalVoiceCount;
642                uint uiOldTotalStreamCount;
643                std::map<uint, uint> mOldVoiceCounts;
644                std::map<uint, uint> mOldStreamCounts;
645    
646              friend class SamplerChannel;              friend class SamplerChannel;
647    
648          private:          private:
# Line 578  namespace LinuxSampler { Line 661  namespace LinuxSampler {
661                      void SetSampler(Sampler* pSampler) { this->pSampler = pSampler; }                      void SetSampler(Sampler* pSampler) { this->pSampler = pSampler; }
662    
663                      /**                      /**
664                         * Invoked when the engine type of the specified sampler
665                         * channel is going to be changed soon.
666                         * @param ChannelId The numerical ID of the sampler channel
667                         */
668                        virtual void EngineToBeChanged(int ChannelId);
669    
670                        /**
671                       * Invoked when the engine type of the                       * Invoked when the engine type of the
672                       * specified sampler channel is changed.                       * specified sampler channel is changed.
673                       * @param ChannelId The numerical ID of the sampler                       * @param ChannelId The numerical ID of the sampler

Legend:
Removed from v.1541  
changed lines
  Added in v.1835

  ViewVC Help
Powered by ViewVC