Source

AudioEngine / src / AudioEngine / player / Looper.h

Full commit
//
//  Looper.h
//  audioOutputExample
//
//  Created by Marek Bereza on 02/08/2011.
//

#pragma once

#include "Player.h"

class Looper: public Player {
public: 
    void loadFromXml(ofxXmlSettings &xml, string tagName, int which) {
        xml.pushTag(tagName, which);
        
        loadLoops(xml);
        xml.popTag();
    }
    
    
    
    

    void loadLoops(ofxXmlSettings &xml) {
        int numLoops = xml.getNumTags("loop");
        
        // load each sound in the xml
        for(int i = 0; i < numLoops; i++) {
            
            // test to see if we're loading files or folders
            string filePath = ofToDataPath(xml.getAttribute("loop", "file", "", i));
            loops.push_back(audio::loadSample(filePath));
        }
    }
    
    
private:
    vector<audio::SampleRef> loops;
    
    // which speakers to play the sound out of
    int output1;
    int output2;

};