package com.bignerdranch.android.beatbox;

import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;

import java.io.IOException;

public class BeatBox {
    private static final String TAG = "BeatBox";
    private static final String SOUNDS_FOLDER = "sample_sounds";

    private AssetManager mAssetsManager;

    public BeatBox(Context context) {
        mAssetsManager = context.getAssets();
        loadSounds();
    }

    private void loadSounds() {
        String[] soundNames;
        try {
            soundNames = mAssetsManager.list(SOUNDS_FOLDER);
            Log.i(TAG, "Found " + soundNames.length + " sounds");
        }
        catch (IOException ioe) {
            Log.e(TAG, "Couldn't list assets", ioe);
        }
    }
}

@@ -162,16 +162,67 @@
 ception;
+%0Aimport java.util.ArrayList;%0Aimport java.util.List;
 %0A%0Apublic
@@ -393,16 +393,69 @@
 Manager;
+%0A    private List%3CSound%3E mSounds = new ArrayList%3C%3E();
 %0A%0A    pu
@@ -864,22 +864,311 @@
 e);%0A        
-%7D
+    return;%0A        %7D%0A%0A        for (String soundName : soundNames) %7B%0A            String assetPath = SOUNDS_FOLDER + %22/%22 + soundName;%0A            Sound sound = new Sound(assetPath);%0A            mSounds.add(sound);%0A        %7D%0A    %7D%0A%0A    public List%3CSound%3E getSounds() %7B%0A        return mSounds;
 %0A    %7D%0A%7D%0A

Modify BeatBox to build Sound objects