Limit the number of queued elements (2 would probably be good, maybe 3). ------------------------------------------------------------------------------------------------------ InputChain InputController Input - reads data from file, puts it in buffer ConverterController? Converter - reads data from buffer, puts it in next buffer EffectsController? Effects - reads data from buffer, puts it in next buffer outputBuffer - the final buffer, to be read by output Filename/URL OutputController output -Reads data from the outputbuffer and outputs SoundController InputChain OutputController ChainQueue On Input EOF, it will signal SoundController. SoundController will create a new InputChain for the next file. The NEW InputChain will get placed in the ChainQueue. When all data has been played from the current InputChain, it is released. Then, pop the first item from the Queue, and make it the new InputChain. Signal the delegate that a song change has taken place. How to get the next file from the delegate? /*Perhaps have it keep a copy of the playlist? No. Playlist changes would be a problem. Could have delegate call method like signalPlaylistChanged. Code to make modifications would be a pain. */ Need an offset for how many songs (chains) have been queued, probably. Delegate can get the offset, and tell it nextFile from that. Delegate will keep track of changes to the playlist. If the playlist is modified so it affected within the currently playing index to index + offset, then signal the soundcontroller, telling it had a playlist change. Would have to clear the ChainQueue and start again. /*Might want soundcontroller to keep track of changes, and have a signalPlaylistChanged, however. This means the soundcontroller wouldnt be independent of the playlist, however, which is a Nice ThingĀ®. */ So, soundcontroller will signal delegate when a file is first opened, to fill the nextfile. Also, when input hits EOF for the current file, nextFile becomes current, and it will signal the delegate for nextFile.