--- linuxsampler/trunk/src/Sampler.h 2007/03/25 18:59:14 1130 +++ linuxsampler/trunk/src/Sampler.h 2008/04/20 08:53:39 1723 @@ -3,7 +3,7 @@ * LinuxSampler - modular, streaming capable sampler * * * * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * - * Copyright (C) 2005, 2006 Christian Schoenebeck * + * Copyright (C) 2005 - 2008 Christian Schoenebeck * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -168,6 +168,12 @@ void RemoveAllEngineChangeListeners(); /** + * Notifies listeners that the engine type of this sampler + * channel is going to be changed soon. + */ + void fireEngineToBeChanged(); + + /** * Notifies listeners that the engine * type of this sampler channel is changed. */ @@ -415,6 +421,10 @@ * @param NewCount The new number of active voices. */ void fireTotalVoiceCountChanged(int NewCount); + + void AddTotalStreamCountListener(TotalStreamCountListener* l); + void RemoveTotalStreamCountListener(TotalStreamCountListener* l); + void fireTotalStreamCountChanged(int NewCount); /** * Registers the specified listener to be notified when the number @@ -503,6 +513,12 @@ */ void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (Exception); + /** + * Gets the current number of all active streams. + * @returns The current number of all active streams. + */ + int GetDiskStreamCount(); + /** * Gets the current number of all active voices. * @returns The current number of all active voices. @@ -515,6 +531,15 @@ */ void Reset(); + /** + * Advise the FPU to treat denormal floating point numbers as + * zero, to avoid severe performance penalty when dealing with + * such extreme floating point values. + * + * @returns @c true if FPU supports it, @c false otherwise + */ + static bool EnableDenormalsAreZeroMode(); + protected: /** * Notifies listeners that the number of sampler channels has been changed. @@ -523,6 +548,20 @@ void fireChannelCountChanged(int NewCount); /** + * Notifies listeners that the specified sampler channel has just + * been added. + * @param pChannel The new sampler channel. + */ + void fireChannelAdded(SamplerChannel* pChannel); + + /** + * Notifies listeners that the specified sampler channel is + * going to be removed soon. + * @param pChannel sampler channel to be removed. + */ + void fireChannelToBeRemoved(SamplerChannel* pChannel); + + /** * Notifies listeners that the number of audio output devices has been changed. * @param NewCount The new number of audio output devices. */ @@ -535,6 +574,20 @@ void fireMidiDeviceCountChanged(int NewCount); /** + * Notifies listeners that the supplied MIDI input device is + * going to be destroyed soon. + * @param pDevice MIDI input device to be destroyed + */ + void fireMidiDeviceToBeDestroyed(MidiInputDevice* pDevice); + + /** + * Notifies listeners that the supplied MIDI input device was + * just created. + * @param pDevice new MIDI input device + */ + void fireMidiDeviceCreated(MidiInputDevice* pDevice); + + /** * Notifies listeners that the number of effect sends * on a particular sampler channel is changed. * @param ChannelId The numerical ID of the sampler channel. @@ -559,6 +612,7 @@ ListenerList llVoiceCountListeners; ListenerList llStreamCountListeners; ListenerList llBufferFillListeners; + ListenerList llTotalStreamCountListeners; ListenerList llTotalVoiceCountListeners; ListenerList llFxSendCountListeners; @@ -567,6 +621,13 @@ void SetSampler(Sampler* pSampler) { this->pSampler = pSampler; } /** + * Invoked when the engine type of the specified sampler + * channel is going to be changed soon. + * @param ChannelId The numerical ID of the sampler channel + */ + virtual void EngineToBeChanged(int ChannelId); + + /** * Invoked when the engine type of the * specified sampler channel is changed. * @param ChannelId The numerical ID of the sampler