mirror of
https://codeberg.org/armin/justasample.git
synced 2026-09-01 12:20:48 +02:00
init
This commit is contained in:
commit
d21bc831e1
178 changed files with 24136 additions and 0 deletions
31
Source/Sampler/CustomSynthesizer.h
Normal file
31
Source/Sampler/CustomSynthesizer.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
CustomSynthesizer.h
|
||||
Created: 9 Jun 2024 10:37:38am
|
||||
Author: binya
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <JuceHeader.h>
|
||||
|
||||
/** JUCE's voice and sound paradigm is not so helpful for us, so we use a blank sound class and pass in our parameters directly to the voices. */
|
||||
class BlankSynthesizerSound final : public juce::SynthesiserSound
|
||||
{
|
||||
public:
|
||||
bool appliesToNote(int) override { return true; }
|
||||
bool appliesToChannel(int) override { return true; }
|
||||
};
|
||||
|
||||
/** We add some custom methods because our Synthesizer does not own its voices */
|
||||
class CustomSynthesizer final : public juce::Synthesiser
|
||||
{
|
||||
public:
|
||||
juce::SynthesiserVoice* removeVoiceWithoutDeleting(const int index)
|
||||
{
|
||||
const juce::ScopedLock sl(lock);
|
||||
return voices.removeAndReturn(index);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue