mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
PIPs: Fixed some errors in the plugin examples
This commit is contained in:
parent
1be7db03cd
commit
3977403b1b
4 changed files with 73 additions and 61 deletions
|
|
@ -193,15 +193,18 @@ public:
|
|||
roomSizeSlider.setRange (0.0, 1.0);
|
||||
addAndMakeVisible (roomSizeSlider);
|
||||
|
||||
auto* fileStream = getAssetsDirectory().getChildFile ("proaudio.path").createInputStream();
|
||||
if (auto* assetStream = createAssetInputStream ("proaudio.path"))
|
||||
{
|
||||
ScopedPointer<InputStream> fileStream (assetStream);
|
||||
|
||||
Path proAudioPath;
|
||||
proAudioPath.loadPathFromStream (*fileStream);
|
||||
proAudioIcon.setPath (proAudioPath);
|
||||
addAndMakeVisible (proAudioIcon);
|
||||
Path proAudioPath;
|
||||
proAudioPath.loadPathFromStream (*fileStream);
|
||||
proAudioIcon.setPath (proAudioPath);
|
||||
addAndMakeVisible (proAudioIcon);
|
||||
|
||||
auto proAudioIconColour = findColour (TextButton::buttonOnColourId);
|
||||
proAudioIcon.setFill (FillType (proAudioIconColour));
|
||||
auto proAudioIconColour = findColour (TextButton::buttonOnColourId);
|
||||
proAudioIcon.setFill (FillType (proAudioIconColour));
|
||||
}
|
||||
|
||||
setSize (600, 400);
|
||||
startTimer (100);
|
||||
|
|
@ -314,7 +317,7 @@ public:
|
|||
for (auto i = 0; i < maxNumVoices; ++i)
|
||||
synth.addVoice (new SamplerVoice());
|
||||
|
||||
loadNewSampleFile (getAssetsDirectory().getChildFile ("singing.ogg"), "ogg");
|
||||
loadNewSample (createAssetInputStream ("singing.ogg"), "ogg");
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -410,12 +413,6 @@ private:
|
|||
loadNewSample (soundBuffer, format);
|
||||
}
|
||||
|
||||
void loadNewSampleFile (const File& sampleFile, const char* format)
|
||||
{
|
||||
auto* soundBuffer = sampleFile.createInputStream();
|
||||
loadNewSample (soundBuffer, format);
|
||||
}
|
||||
|
||||
void loadNewSample (InputStream* soundBuffer, const char* format)
|
||||
{
|
||||
ScopedPointer<AudioFormatReader> formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue