Implementation of the playback selection tool. This one is a bit messy.