Skip to content

Commit

Permalink
merging: 33762, 33759, 33749, 33748 from trunk
Browse files Browse the repository at this point in the history
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@33764 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
malard committed Sep 13, 2010
1 parent 75c5440 commit 43330a9
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 44 deletions.
3 changes: 2 additions & 1 deletion addons/webinterface.default/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ div.imgWrapper div.inner {
color: #777;
}

#trackWrap {
#audioTrackWrap,
#videoTrackWrap {
width: 365px;
white-space: nowrap;
overflow: hidden;
Expand Down
4 changes: 2 additions & 2 deletions addons/webinterface.default/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<div id="nowPlayingContent">
<div id="audioDescription">
<div id="audioCoverArt"></div>
<div id="trackWrap">
<div id="audioTrackWrap">
<div id="audioArtistTitle"></div>
<div id="audioAlbumTitle"></div>
</div>
Expand All @@ -46,7 +46,7 @@
</div>
<div id="videoDescription">
<div id="videoCoverArt"></div>
<div id="trackWrap">
<div id="videoTrackWrap">
<div id="videoShowTitle"></div>
</div>
<div id="videoTitle"></div>
Expand Down
93 changes: 53 additions & 40 deletions addons/webinterface.default/js/NowPlayingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ NowPlayingManager.prototype = {
updateState: function() {
jQuery.post(JSON_RPC + '?UpdateState', '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}', jQuery.proxy(function(data) {
if (data && data.result) {
if (data.result.audio) {
if (data.result.audio && this.activePlayer != 'Audio') {
this.activePlayer = 'Audio';
this.stopVideoPlaylistUpdate();
this.displayAudioNowPlaying();
} else if (data.result.video) {
this.stopRefreshTime();
} else if (data.result.video && this.activePlayer != 'Video') {
this.activePlayer = 'Video';
this.stopAudioPlaylistUpdate();
this.displayVideoNowPlaying();
} else {
this.stopRefreshTime();
} else if (!data.result.audio && !data.result.video) {
this.stopRefreshTime();
}
}
Expand Down Expand Up @@ -193,6 +195,7 @@ NowPlayingManager.prototype = {
} else {
$('#nextText').hide();
$('#nowPlayingPlaylist').hide();
$('#nextTrack').hide();
}
if (!this.comparePlaylistItems(activeItem, this.activePlaylistItem)) {
this.activePlaylistItem = activeItem;
Expand Down Expand Up @@ -244,14 +247,15 @@ NowPlayingManager.prototype = {
this.trackBaseTime = data.result.time;
this.playing = data.result.playing;
this.paused = data.result.paused;
if (!this.autoRefreshData) {
if (data.result.playing) {
this.autoRefreshData = true;
}
if (this.activePlayer == 'Audio') {
this.refreshAudioData();
} else if (this.activePlayer == 'Video') {
this.refreshVideoData();
if (!this.autoRefreshAudioData && !this.autoRefreshVideoData) {
if (data.result.playing) {
if (this.activePlayer == 'Audio') {
this.autoRefreshAudioData = true;
this.refreshAudioData();
} else if (this.activePlayer == 'Video') {
this.autoRefreshVideoData = true;
this.refreshVideoData();
}
}
}
}
Expand All @@ -266,7 +270,7 @@ NowPlayingManager.prototype = {
this.refreshAudioData();
},
refreshAudioData: function() {
if (this.autoRefreshData && !this.audioRefreshTimer) {
if (this.autoRefreshAudioData && !this.audioRefreshTimer) {
this.audioRefreshTimer = 1;
setTimeout(jQuery.proxy(this.refreshAudioDataLoop, this), 1000);
}
Expand All @@ -279,19 +283,23 @@ NowPlayingManager.prototype = {
this.showPauseButton();
}
if (this.activePlaylistItem) {
var imgPath = DEFAULT_ALBUM_COVER;
if (this.activePlaylistItem.thumbnail) {
imgPath = (this.activePlaylistItem.thumbnail.startsWith('special://') ? '/vfs/' : 'images/') + this.activePlaylistItem.thumbnail;
}
$('#audioCoverArt').html('<img src="' + imgPath + '" alt="' + this.activePlaylistItem.album + ' cover art">');
$('#audioTrackTitle').html('<span title="' + this.activePlaylistItem.title + '">' + this.activePlaylistItem.title + '</span>');
if (this.activePlaylistItem.album) {
$('#audioAlbumTitle').html('<span title="' + this.activePlaylistItem.album + '">' + this.activePlaylistItem.album + '</span>')
.show();
} else {
$('#audioAlbumTitle').hide();
if (this.activePlaylistItem != this.lastPlaylistItem) {
this.lastPlaylistItem = this.activePlaylistItem;
var imgPath = DEFAULT_ALBUM_COVER;
if (this.activePlaylistItem.thumbnail) {
imgPath = (this.activePlaylistItem.thumbnail.startsWith('special://') ? '/vfs/' : 'images/') + this.activePlaylistItem.thumbnail;
}
$('#audioCoverArt').html('<img src="' + imgPath + '" alt="' + this.activePlaylistItem.album + ' cover art">');
$('#audioTrackTitle').html('<span title="' + this.activePlaylistItem.title + '">' + this.activePlaylistItem.title + '</span>');
if (this.activePlaylistItem.album) {
$('#audioAlbumTitle').html('<span title="' + this.activePlaylistItem.album + '">' + this.activePlaylistItem.album + '</span>')
.show();
} else {
$('#audioAlbumTitle').hide();
}
$('#audioArtistTitle').html(this.activePlaylistItem.artist);
$('#progressBar').attr('style', '');
}
$('#audioArtistTitle').html(this.activePlaylistItem.artist);
$('#audioDuration').html(durationToString(this.trackBaseTime) + ' / ' + durationToString(this.activePlaylistItem.duration));
var buttonWidth = $('#progressBar .progressIndicator').width();
var progressBarWidth = (this.trackBaseTime / this.activePlaylistItem.duration) * 100;
Expand All @@ -310,7 +318,7 @@ NowPlayingManager.prototype = {
this.refreshVideoData();
},
refreshVideoData: function() {
if (this.autoRefreshData && !this.videoRefreshTimer) {
if (this.autoRefreshVideoData && !this.videoRefreshTimer) {
this.videoRefreshTimer = 1;
setTimeout(jQuery.proxy(this.refreshVideoDataLoop, this), 1000);
}
Expand All @@ -323,21 +331,24 @@ NowPlayingManager.prototype = {
this.showPauseButton();
}
if (this.activePlaylistItem) {
var imgPath = DEFAULT_VIDEO_COVER;
if (this.activePlaylistItem.thumbnail) {
imgPath = (this.activePlaylistItem.thumbnail.startsWith('special://') ? '/vfs/' : 'images/') + this.activePlaylistItem.thumbnail;
}
$('#videoCoverArt').html('<img src="' + imgPath + '" alt="' + this.activePlaylistItem.title + ' cover art">');
var imgWidth = $('#videoCoverArt img').width();
$('#progressBar').width(365 - (imgWidth - 100));
$('#trackWrap').width(365 - (imgWidth - 100));
$('#videoTitle').width(365 - (imgWidth - 100));
$('#videoShowTitle').html(this.activePlaylistItem.showtitle||'&nbsp;');
var extra = '';
if (this.activePlaylistItem.season && this.activePlaylistItem.episode) {
extra = this.activePlaylistItem.season + 'x' + this.activePlaylistItem.episode + ' ';
if (this.activePlaylistItem != this.lastPlaylistItem) {
this.lastPlaylistItem = this.activePlaylistItem;
var imgPath = DEFAULT_VIDEO_COVER;
if (this.activePlaylistItem.thumbnail) {
imgPath = (this.activePlaylistItem.thumbnail.startsWith('special://') ? '/vfs/' : 'images/') + this.activePlaylistItem.thumbnail;
}
$('#videoCoverArt').html('<img src="' + imgPath + '" alt="' + this.activePlaylistItem.title + ' cover art">');
var imgWidth = $('#videoCoverArt img').width();
$('#progressBar').width(365 - (imgWidth - 100));
$('#videoTrackWrap').width(365 - (imgWidth - 100));
$('#videoTitle').width(365 - (imgWidth - 100));
$('#videoShowTitle').html(this.activePlaylistItem.showtitle||'&nbsp;');
var extra = '';
if (this.activePlaylistItem.season && this.activePlaylistItem.episode) {
extra = this.activePlaylistItem.season + 'x' + this.activePlaylistItem.episode + ' ';
}
$('#videoTitle').html(extra + this.activePlaylistItem.title);
}
$('#videoTitle').html(extra + this.activePlaylistItem.title);
$('#videoDuration').html(durationToString(this.trackBaseTime) + ' / ' + durationToString(this.activePlaylistItem.duration));
var buttonWidth = $('#progressBar .progressIndicator').width();
var progressBarWidth = (this.trackBaseTime / this.activePlaylistItem.duration) * 100;
Expand All @@ -352,7 +363,8 @@ NowPlayingManager.prototype = {
}
},
stopRefreshTime: function() {
this.autoRefreshData = false;
this.autoRefreshAudioData = false;
this.autoRefreshVideoData = false;
},
comparePlaylistItems: function(item1, item2) {
if (!item1 || !item2) {
Expand Down Expand Up @@ -422,6 +434,7 @@ NowPlayingManager.prototype = {
} else {
$('#nextText').hide();
$('#nowPlayingPlaylist').hide();
$('#nextTrack').hide();
}
if (!this.comparePlaylistItems(activeItem, this.activePlaylistItem)) {
this.activePlaylistItem = activeItem;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/APEv2Tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bool CAPEv2Tag::ReadTag(const char* filename)
{
// cd number is usually "CD 1/3"
char *num = apefrm_getstr(tag, (char*)"Media");
while (!isdigit(*num) && num != '\0') num++;
while (!isdigit(*num) && *num != '\0') num++;
if (isdigit(*num))
m_nDiscNum = atoi(num);
}
Expand Down

0 comments on commit 43330a9

Please sign in to comment.