File size: 1,356 Bytes
8c39918
 
 
 
 
 
 
 
 
 
 
 
 
 
813f591
8c39918
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <JuceHeader.h>
#include "SamplePlayer.h"

/**
 * Main entry point for JUCE audio host
 * This is used for testing the audio engine standalone
 */
class AudioHostApplication : public juce::JUCEApplication
{
public:
    AudioHostApplication() : application(nullptr) {}

    void initialise(const juce::String&) override
    {
        DBG("SillyLoops Audio Engine Starting...");
        
        application = std::make_unique<SamplePlayer>();
        
        if (!application->initialize())
        {
            DBG("Failed to initialize audio engine!");
            quit();
            return;
        }
        
        DBG("Audio engine initialized successfully!");
        DBG("Loading test samples...");
        
        // Load some test samples (paths would be configured for your system)
        // application->loadSample(0, "/path/to/kick.wav");
        // application->loadSample(1, "/path/to/snare.wav");
        
        DBG("Audio host ready. Press any key to exit...");
    }

    void shutdown() override
    {
        if (application)
        {
            application->stopAll();
            application->shutdown();
            application.reset();
        }
        
        DBG("Audio engine shutdown complete.");
    }

private:
    std::unique_ptr<SamplePlayer> application;
};

START_JUCE_APPLICATION(AudioHostApplication)