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 * |
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 |
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 |
*/ |
*/ |
424 |
* @param NewCount The new number of active voices. |
* @param NewCount The new number of active voices. |
425 |
*/ |
*/ |
426 |
void fireTotalVoiceCountChanged(int NewCount); |
void fireTotalVoiceCountChanged(int NewCount); |
427 |
|
|
428 |
|
void AddTotalStreamCountListener(TotalStreamCountListener* l); |
429 |
|
void RemoveTotalStreamCountListener(TotalStreamCountListener* l); |
430 |
|
void fireTotalStreamCountChanged(int NewCount); |
431 |
|
|
432 |
/** |
/** |
433 |
* Registers the specified listener to be notified when the number |
* Registers the specified listener to be notified when the number |
516 |
*/ |
*/ |
517 |
void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (Exception); |
void DestroyMidiInputDevice(MidiInputDevice* pDevice) throw (Exception); |
518 |
|
|
519 |
|
/** |
520 |
|
* Gets the current number of all active streams. |
521 |
|
* @returns The current number of all active streams. |
522 |
|
*/ |
523 |
|
int GetDiskStreamCount(); |
524 |
|
|
525 |
/** |
/** |
526 |
* Gets the current number of all active voices. |
* Gets the current number of all active voices. |
527 |
* @returns The current number of all active voices. |
* @returns The current number of all active voices. |
534 |
*/ |
*/ |
535 |
void Reset(); |
void Reset(); |
536 |
|
|
537 |
|
/** |
538 |
|
* Advise the FPU to treat denormal floating point numbers as |
539 |
|
* zero, to avoid severe performance penalty when dealing with |
540 |
|
* such extreme floating point values. |
541 |
|
* |
542 |
|
* @returns @c true if FPU supports it, @c false otherwise |
543 |
|
*/ |
544 |
|
static bool EnableDenormalsAreZeroMode(); |
545 |
|
|
546 |
|
/** |
547 |
|
* Notifies listeners about the current number of voices, |
548 |
|
* streams and total voices, and the current fill state of |
549 |
|
* the disk stream buffers. |
550 |
|
*/ |
551 |
|
void fireStatistics(); |
552 |
|
|
553 |
protected: |
protected: |
554 |
/** |
/** |
555 |
* Notifies listeners that the number of sampler channels has been changed. |
* Notifies listeners that the number of sampler channels has been changed. |
558 |
void fireChannelCountChanged(int NewCount); |
void fireChannelCountChanged(int NewCount); |
559 |
|
|
560 |
/** |
/** |
561 |
|
* Notifies listeners that the specified sampler channel has just |
562 |
|
* been added. |
563 |
|
* @param pChannel The new sampler channel. |
564 |
|
*/ |
565 |
|
void fireChannelAdded(SamplerChannel* pChannel); |
566 |
|
|
567 |
|
/** |
568 |
|
* Notifies listeners that the specified sampler channel is |
569 |
|
* going to be removed soon. |
570 |
|
* @param pChannel sampler channel to be removed. |
571 |
|
*/ |
572 |
|
void fireChannelToBeRemoved(SamplerChannel* pChannel); |
573 |
|
|
574 |
|
/** |
575 |
* Notifies listeners that the number of audio output devices has been changed. |
* Notifies listeners that the number of audio output devices has been changed. |
576 |
* @param NewCount The new number of audio output devices. |
* @param NewCount The new number of audio output devices. |
577 |
*/ |
*/ |
584 |
void fireMidiDeviceCountChanged(int NewCount); |
void fireMidiDeviceCountChanged(int NewCount); |
585 |
|
|
586 |
/** |
/** |
587 |
|
* Notifies listeners that the supplied MIDI input device is |
588 |
|
* going to be destroyed soon. |
589 |
|
* @param pDevice MIDI input device to be destroyed |
590 |
|
*/ |
591 |
|
void fireMidiDeviceToBeDestroyed(MidiInputDevice* pDevice); |
592 |
|
|
593 |
|
/** |
594 |
|
* Notifies listeners that the supplied MIDI input device was |
595 |
|
* just created. |
596 |
|
* @param pDevice new MIDI input device |
597 |
|
*/ |
598 |
|
void fireMidiDeviceCreated(MidiInputDevice* pDevice); |
599 |
|
|
600 |
|
/** |
601 |
* Notifies listeners that the number of effect sends |
* Notifies listeners that the number of effect sends |
602 |
* on a particular sampler channel is changed. |
* on a particular sampler channel is changed. |
603 |
* @param ChannelId The numerical ID of the sampler channel. |
* @param ChannelId The numerical ID of the sampler channel. |
613 |
AudioOutputDeviceMap mAudioOutputDevices; ///< contains all created audio output devices |
AudioOutputDeviceMap mAudioOutputDevices; ///< contains all created audio output devices |
614 |
MidiInputDeviceMap mMidiInputDevices; ///< contains all created MIDI input devices |
MidiInputDeviceMap mMidiInputDevices; ///< contains all created MIDI input devices |
615 |
|
|
616 |
|
// statistics cache |
617 |
|
uint uiOldTotalVoiceCount; |
618 |
|
uint uiOldTotalStreamCount; |
619 |
|
std::map<uint, uint> mOldVoiceCounts; |
620 |
|
std::map<uint, uint> mOldStreamCounts; |
621 |
|
|
622 |
friend class SamplerChannel; |
friend class SamplerChannel; |
623 |
|
|
624 |
private: |
private: |
628 |
ListenerList<VoiceCountListener*> llVoiceCountListeners; |
ListenerList<VoiceCountListener*> llVoiceCountListeners; |
629 |
ListenerList<StreamCountListener*> llStreamCountListeners; |
ListenerList<StreamCountListener*> llStreamCountListeners; |
630 |
ListenerList<BufferFillListener*> llBufferFillListeners; |
ListenerList<BufferFillListener*> llBufferFillListeners; |
631 |
|
ListenerList<TotalStreamCountListener*> llTotalStreamCountListeners; |
632 |
ListenerList<TotalVoiceCountListener*> llTotalVoiceCountListeners; |
ListenerList<TotalVoiceCountListener*> llTotalVoiceCountListeners; |
633 |
ListenerList<FxSendCountListener*> llFxSendCountListeners; |
ListenerList<FxSendCountListener*> llFxSendCountListeners; |
634 |
|
|
637 |
void SetSampler(Sampler* pSampler) { this->pSampler = pSampler; } |
void SetSampler(Sampler* pSampler) { this->pSampler = pSampler; } |
638 |
|
|
639 |
/** |
/** |
640 |
|
* Invoked when the engine type of the specified sampler |
641 |
|
* channel is going to be changed soon. |
642 |
|
* @param ChannelId The numerical ID of the sampler channel |
643 |
|
*/ |
644 |
|
virtual void EngineToBeChanged(int ChannelId); |
645 |
|
|
646 |
|
/** |
647 |
* Invoked when the engine type of the |
* Invoked when the engine type of the |
648 |
* specified sampler channel is changed. |
* specified sampler channel is changed. |
649 |
* @param ChannelId The numerical ID of the sampler |
* @param ChannelId The numerical ID of the sampler |