mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed some errors in the examples
This commit is contained in:
parent
69d5f16be0
commit
7035a40879
7 changed files with 13 additions and 25 deletions
|
|
@ -195,10 +195,8 @@ public:
|
|||
roomSizeSlider.setRange (0.0, 1.0);
|
||||
addAndMakeVisible (roomSizeSlider);
|
||||
|
||||
if (auto* assetStream = createAssetInputStream ("proaudio.path"))
|
||||
if (auto fileStream = createAssetInputStream ("proaudio.path"))
|
||||
{
|
||||
std::unique_ptr<InputStream> fileStream (assetStream);
|
||||
|
||||
Path proAudioPath;
|
||||
proAudioPath.loadPathFromStream (*fileStream);
|
||||
proAudioIcon.setPath (proAudioPath);
|
||||
|
|
@ -411,13 +409,13 @@ private:
|
|||
//==============================================================================
|
||||
void loadNewSampleBinary (const void* data, int dataSize, const char* format)
|
||||
{
|
||||
auto* soundBuffer = new MemoryInputStream (data, static_cast<std::size_t> (dataSize), false);
|
||||
loadNewSample (soundBuffer, format);
|
||||
auto soundBuffer = std::make_unique<MemoryInputStream> (data, static_cast<std::size_t> (dataSize), false);
|
||||
loadNewSample (std::move (soundBuffer), format);
|
||||
}
|
||||
|
||||
void loadNewSample (InputStream* soundBuffer, const char* format)
|
||||
void loadNewSample (std::unique_ptr<InputStream> soundBuffer, const char* format)
|
||||
{
|
||||
std::unique_ptr<AudioFormatReader> formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer, true));
|
||||
std::unique_ptr<AudioFormatReader> formatReader (formatManager.findFormatForFileExtension (format)->createReaderFor (soundBuffer.release(), true));
|
||||
|
||||
BigInteger midiNotes;
|
||||
midiNotes.setRange (0, 126, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue