// Handlers
//
console.log("Loading listen.js...");

function handleListen(res) {
    showListen();
}

function handleDeepPlayMix(res) {
    var id = Try.these(
	function() { return res['args'].id; },
	function() { return res['args'].mix_id; },
	function() { return 0; }
    );

    console.log("~~~~~~~ Got to handleDeepPlayMix() id: [%s]",id);

    getInfo(id);
    sendPlay(id);
}

function handleDeepPlayPlaylist(res) {
    var id = Try.these(
	function() { return res['args'].id; },
	function() { return res['args'].mix_id; },
	function() { return 0; }
    );

    console.log("~~~~~~~ Got to handleDeepPlayPlaylist() id: [%s]",id);

    getInfo(id);
    sendPlay(id);
}
