/** * @author Wouter van Wijk * * all kinds functions and vars */ var baseurl = '/mopidy'; var host = window.location.hostname; var port = window.location.port; var wsurl = host + ':' + port + baseurl var intv; var socket; //var mopidy; //values for controls var play = false; var random; var repeat; var currentVolume = -1; var muteVolume = -1; var posTimer; var seekTimer; var initgui = true; var currentpos = 0; var artistshtml = ''; var artiststext = ''; var songname = ''; //array of cached playlists (not only user-playlists, also search, artist, album-playlists) var playlists = new Object; var currentplaylist; var customPlaylists = new Array(); var customTracklists = new Array(); //constants PROGRAM_NAME = 'Mopidy'; ARTIST_TABLE = '#artiststable'; ALBUM_TABLE = '#albumstable'; PLAYLIST_TABLE = '#playlisttable'; CURRENT_PLAYLIST_TABLE = '#currenttable'; SEARCH_ALL_TABLE = '#allresulttable'; SEARCH_ALBUM_TABLE = '#albumresulttable'; SEARCH_ARTIST_TABLE = '#artistresulttable'; SEARCH_TRACK_TABLE = '#trackresulttable'; //A hack to find the name of the first artist of a playlist. this is not yet returned by mopidy //does not work wel with multiple artists of course function getArtist(pl) { for (var i = 0; i < pl.length; i++) { for (var j = 0; j < pl[i]["artists"].length; j++) { if (pl[i]["artists"][j]["name"] != '') { return pl[i]["artists"][j]["name"]; } } }; } //A hack to find the first album of a playlist. this is not yet returned by mopidy function getAlbum(pl) { for (var i = 0; i < pl.length; i++) { if (pl[i]["album"]["name"] != '') { return pl[i]["album"]["name"]; } }; } //process updated playlist to gui function playlisttotable(pl, table, uri) { /*