Merge lp:~osomon/moovida/player_feedback into lp:moovida

Proposed by Olivier Tilloy
Status: Superseded
Proposed branch: lp:~osomon/moovida/player_feedback
Merge into: lp:moovida
Diff against target: 208 lines (+58/-29)
3 files modified
elisa-plugins/elisa/plugins/poblesec/player_audio.py (+3/-0)
elisa-plugins/elisa/plugins/poblesec/player_video.py (+29/-27)
elisa-plugins/elisa/plugins/poblesec/widgets/player/status_display.py (+26/-2)
To merge this branch: bzr merge lp:~osomon/moovida/player_feedback
Reviewer Review Type Date Requested Status
Moovida Developers Pending
Review via email: mp+15282@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Olivier Tilloy (osomon) wrote :

This bundle fixes various bugs in the player OSD:

1) The OSD wasn't really cleared when necessary, despite various attempts to fix that (see https://bugs.launchpad.net/moovida/+bug/432269 among others). The issue was less easy to observe but it was there (hint: a slow network connection helps to reproduce the issue).

2) The default thumbnail for music was that of videos (https://bugs.launchpad.net/moovida/+bug/463733).

3) The posters for TV episodes were never shown in the OSD, despite the fact that we had their URIs in the DB (https://bugs.launchpad.net/moovida/+bug/485933).

With all that the OSD is hopefully less buggy and a tad more useful.

Thanks for the review!

Unmerged revisions

1607. By Olivier Tilloy

Removed an outdated FIXME.

1606. By Olivier Tilloy

Get, cache and display in the OSD the episode's poster URI if needed.

1605. By Olivier Tilloy

Do not re-load default preview artwork, it's already there.

1604. By Olivier Tilloy

Fix the default preview artwork for the audio player.

1603. By Olivier Tilloy

Clear the OSD when the player is stopped.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'elisa-plugins/elisa/plugins/poblesec/player_audio.py'
--- elisa-plugins/elisa/plugins/poblesec/player_audio.py 2009-05-27 11:57:22 +0000
+++ elisa-plugins/elisa/plugins/poblesec/player_audio.py 2009-11-26 16:45:27 +0000
@@ -50,3 +50,6 @@
50 'will be used.',50 'will be used.',
51 }51 }
52 default_config = player_default_config()52 default_config = player_default_config()
53
54 default_preview = 'elisa.plugins.poblesec.player.thumbnail.default_album'
55
5356
=== modified file 'elisa-plugins/elisa/plugins/poblesec/player_video.py'
--- elisa-plugins/elisa/plugins/poblesec/player_video.py 2009-11-23 09:55:40 +0000
+++ elisa-plugins/elisa/plugins/poblesec/player_video.py 2009-11-26 16:45:27 +0000
@@ -14,7 +14,8 @@
14# See "LICENSE.Moovida" in the root directory of this distribution package14# See "LICENSE.Moovida" in the root directory of this distribution package
15# for details on that license.15# for details on that license.
1616
17from elisa.core.utils import locale_helper17from elisa.core.utils import locale_helper, caching
18
18from elisa.plugins.poblesec.widgets.player.status_display import VideoStatusDisplay,\19from elisa.plugins.poblesec.widgets.player.status_display import VideoStatusDisplay,\
19 BARS20 BARS
20from elisa.plugins.poblesec.widgets.player.control_ribbon import ControlRibbon21from elisa.plugins.poblesec.widgets.player.control_ribbon import ControlRibbon
@@ -425,6 +426,14 @@
425 """426 """
426 return self.animated.opacity > 0427 return self.animated.opacity > 0
427428
429 def clear(self):
430 """
431 Clear the status widget.
432 """
433 self.status.clear()
434 self.cover_overlay.cover.clear()
435
436
428class Player(gobject.GObject, Loggable):437class Player(gobject.GObject, Loggable):
429438
430 STOPPED = 0439 STOPPED = 0
@@ -1062,6 +1071,8 @@
1062 PlayerClass = Player1071 PlayerClass = Player
1063 PlayerOsdClass = PlayerOsd1072 PlayerOsdClass = PlayerOsd
10641073
1074 default_preview = 'elisa.plugins.poblesec.player.thumbnail.default_movie'
1075
1065 def __init__(self):1076 def __init__(self):
1066 super(PlayerController, self).__init__()1077 super(PlayerController, self).__init__()
10671078
@@ -1189,21 +1200,14 @@
1189 return True1200 return True
11901201
1191 def _on_current_model_changed(self, player, model):1202 def _on_current_model_changed(self, player, model):
1192 default_video_icon = 'elisa.plugins.poblesec.player.thumbnail.default_movie'
1193 default_music_album_icon = 'elisa.plugins.poblesec.player.thumbnail.default_album'
1194
1195 self.info("Played model changed to %r", model)1203 self.info("Played model changed to %r", model)
11961204
1197 # internal functions1205 # internal functions
1198 def dfr_error(failure, source):1206 def dfr_error(failure, source):
1199 self.warning("failure in %s : %s" % (source, failure))1207 self.warning("failure in %s : %s" % (source, failure))
12001208
1201 def got_artwork(file_path, default_resource=None):1209 def got_artwork(file_path):
1202 if not file_path:1210 if not file_path:
1203 # no artwork found
1204 if default_resource:
1205 self.frontend.load_from_theme(default_resource,
1206 self.player_osd.status.preview)
1207 return1211 return
12081212
1209 self.player_osd.status.preview.set_from_file(file_path)1213 self.player_osd.status.preview.set_from_file(file_path)
@@ -1216,21 +1220,11 @@
12161220
1217 osd_details = self.player_osd.status.status_display_details1221 osd_details = self.player_osd.status.status_display_details
12181222
1219 # clear the OSD1223 self.player_osd.clear()
1220 osd_details.title.label = ""
1221 osd_details.details.label = ""
1222 osd_details.details_2.label = ""
1223 self.background.clear()1224 self.background.clear()
1224 self.player_osd.cover_overlay.cover.clear()
12251225
1226 # FIXME: by default we display the video icon, this is fine in1226 # Load default preview
1227 # the case of video playable_models but not for audio1227 self.frontend.load_from_theme(self.default_preview,
1228 # playable_models. There's no way to make the difference
1229 # between and audio-only and video playable model, the correct
1230 # solution would be to fix all the plugins that directly give
1231 # PlayableModel instances to the player and instead, create
1232 # VideoModels or TrackModels.
1233 self.frontend.load_from_theme(default_video_icon,
1234 self.player_osd.status.preview)1228 self.player_osd.status.preview)
12351229
1236 # we want to update the layout for dynamic changes1230 # we want to update the layout for dynamic changes
@@ -1242,7 +1236,7 @@
1242 def got_artist(artist, album):1236 def got_artist(artist, album):
1243 osd_details.details_2.label = artist1237 osd_details.details_2.label = artist
1244 dfr = self.album_helper.get_image(album, None)1238 dfr = self.album_helper.get_image(album, None)
1245 dfr.addCallback(got_artwork, default_music_album_icon)1239 dfr.addCallback(got_artwork)
1246 dfr.addErrback(dfr_error, "in got_artwork")1240 dfr.addErrback(dfr_error, "in got_artwork")
1247 return dfr1241 return dfr
12481242
@@ -1267,22 +1261,29 @@
1267 elif isinstance(model, VideoModel):1261 elif isinstance(model, VideoModel):
1268 osd_details.title.label = model.title or ''1262 osd_details.title.label = model.title or ''
1269 dfr = model.get_poster()1263 dfr = model.get_poster()
1270 dfr.addCallback(got_artwork, default_video_icon)1264 dfr.addCallback(got_artwork)
1271 elif isinstance(model, Video):1265 elif isinstance(model, Video):
1272 # a model from database1266 # a model from database
1273 osd_details.title.label = model.name1267 osd_details.title.label = model.name
1274 got_artwork(model.thumbnail_uri, default_video_icon)1268 got_artwork(model.thumbnail_uri)
1275 elif isinstance(model, Movie):1269 elif isinstance(model, Movie):
1276 # a movie model from database1270 # a movie model from database
1277 osd_details.title.label = model.title1271 osd_details.title.label = model.title
1278 poster = getattr(model, 'thumbnail_path', None)1272 poster = getattr(model, 'thumbnail_path', None)
1279 if poster:1273 if poster:
1280 got_artwork(poster, default_video_icon)1274 got_artwork(poster)
1281 elif isinstance(model, TVEpisode):1275 elif isinstance(model, TVEpisode):
1282 # a TV Episode model from database1276 # a TV Episode model from database
1283 poster = getattr(model, 'thumbnail_path', None)1277 poster = getattr(model, 'thumbnail_path', None)
1284 if poster:1278 if poster:
1285 got_artwork(poster, default_video_icon)1279 got_artwork(poster)
1280 else:
1281 poster_uri = model.poster_uri
1282 if poster_uri:
1283 cache_path = caching.get_pictures_cache_path()
1284 dfr = caching.get_and_cache_to_file(MediaUri(poster_uri),
1285 cache_path)
1286 dfr.addCallback(got_artwork)
12861287
1287 def got_tvshow(tvshow, season):1288 def got_tvshow(tvshow, season):
1288 osd_details.details.label = tvshow.name1289 osd_details.details.label = tvshow.name
@@ -1395,6 +1396,7 @@
1395 (player_position / gst.SECOND)1396 (player_position / gst.SECOND)
1396 self.show_on_screen_display()1397 self.show_on_screen_display()
1397 elif status == player.STOPPED:1398 elif status == player.STOPPED:
1399 self.player_osd.clear()
1398 self.background.clear()1400 self.background.clear()
1399 self.exit()1401 self.exit()
1400 return True1402 return True
14011403
=== modified file 'elisa-plugins/elisa/plugins/poblesec/widgets/player/status_display.py'
--- elisa-plugins/elisa/plugins/poblesec/widgets/player/status_display.py 2009-07-27 12:16:25 +0000
+++ elisa-plugins/elisa/plugins/poblesec/widgets/player/status_display.py 2009-11-26 16:45:27 +0000
@@ -74,6 +74,14 @@
74 self.left.width = 0.5074 self.left.width = 0.50
75 self.right.width = 0.5075 self.right.width = 0.50
7676
77 def clear(self):
78 """
79 Clear the position and duration labels.
80 """
81 self.left.label = ''
82 self.right.label = ''
83
84
77BARS = enum.Enum("SEEKING_BAR", "VOLUME_BAR", "BUFFERING_BAR")85BARS = enum.Enum("SEEKING_BAR", "VOLUME_BAR", "BUFFERING_BAR")
7886
7987
@@ -259,7 +267,7 @@
259267
260 """268 """
261 right part of the status widget269 right part of the status widget
262 with the scroll bar, title, details and player status270 with the progress bar, title, details and player status
263 """271 """
264272
265 def create_widgets(self):273 def create_widgets(self):
@@ -300,6 +308,17 @@
300 self.pack_start(self.progress_bars)308 self.pack_start(self.progress_bars)
301 self.progress_bars.visible = True309 self.progress_bars.visible = True
302310
311 def clear(self):
312 """
313 Clear the progress bar, the title and details labels.
314 """
315 self.title.label = ''
316 self.details.label = ''
317 self.details_2.label = ''
318 self.progress_bars.seeking_bar.current_index = 0
319 self.progress_bars.seeking_bar_label.clear()
320 self.progress_bars.buffering_bar.stop_animation()
321
303322
304class StatusDisplay(HBox):323class StatusDisplay(HBox):
305 """324 """
@@ -492,8 +511,13 @@
492 511
493 pbc.volume_bar_label.label = "%s %s%%" % (_('Volume'), int(volume_level))512 pbc.volume_bar_label.label = "%s %s%%" % (_('Volume'), int(volume_level))
494513
514 def clear(self):
515 """
516 Clear the preview image and the status details.
517 """
518 self.preview.clear()
519 self.status_display_details.clear()
495520
496
497 @classmethod521 @classmethod
498 def _demo_widget(cls, *args, **kwargs):522 def _demo_widget(cls, *args, **kwargs):
499 widget = cls()523 widget = cls()

Subscribers

People subscribed via source and target branches