Merge lp:~shockone89/audience/rewinding into lp:~audience-members/audience/trunk

Proposed by Volodymyr Shatsky
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~shockone89/audience/rewinding
Merge into: lp:~audience-members/audience/trunk
Diff against target: 79 lines (+34/-7)
3 files modified
src/Audience.vala (+15/-5)
src/Consts.vala (+2/-1)
src/Widgets/VideoPlayer.vala (+17/-1)
To merge this branch: bzr merge lp:~shockone89/audience/rewinding
Reviewer Review Type Date Requested Status
Cody Garver Disapprove
Robert Roth (community) Needs Fixing
Review via email: mp+218217@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Roth (evfool) wrote :

The changes look fine, some comments though
* with these changes, the jump intervals are hardcoded to 5 seconds and 60 seconds, instead of 5% of the total length. Is this something we want? In a 3-hour movie, 60 seconds jumps are rather short. Maybe short jump could work with jump 5-10 seconds, long jump could jump 5-10% of the total length.

review: Needs Fixing
Revision history for this message
Robert Roth (evfool) wrote :

Additionally, see my inline comments on the diff for what could be fixed.

review: Needs Fixing
Revision history for this message
Cody Garver (codygarver) wrote :

I just did a clean merge of the branch this code came from

review: Disapprove

Unmerged revisions

337. By Volodymyr Shatsky

Short and long rewinding.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Audience.vala'
--- src/Audience.vala 2013-11-24 08:10:51 +0000
+++ src/Audience.vala 2014-05-04 14:17:09 +0000
@@ -243,13 +243,18 @@
243 mainwindow.destroy ();243 mainwindow.destroy ();
244 break;244 break;
245 case Gdk.Key.Left:245 case Gdk.Key.Left:
246 if ((video_player.progress - 0.05) < 0)246 if (modifier_is_pressed (e, Gdk.ModifierType.SHIFT_MASK)) {
247 video_player.progress = 0.0;247 video_player.rewind_seconds (-REWIND_LONG);
248 else248 } else {
249 video_player.progress -= 0.05;249 video_player.rewind_seconds (-REWIND_SHORT);
250 }
250 break;251 break;
251 case Gdk.Key.Right:252 case Gdk.Key.Right:
252 video_player.progress += 0.05;253 if (modifier_is_pressed (e, Gdk.ModifierType.SHIFT_MASK)) {
254 video_player.rewind_seconds (REWIND_LONG);
255 } else {
256 video_player.rewind_seconds (REWIND_SHORT);
257 }
253 break;258 break;
254 case Gdk.Key.a:259 case Gdk.Key.a:
255 next_audio ();260 next_audio ();
@@ -597,6 +602,11 @@
597 }602 }
598 }603 }
599604
605 private bool modifier_is_pressed (Gdk.EventKey event, Gdk.ModifierType modifier)
606 {
607 return (event.state & modifier) == modifier;
608 }
609
600 internal void open_file (string filename, bool dont_modify=false)610 internal void open_file (string filename, bool dont_modify=false)
601 {611 {
602 var file = File.new_for_commandline_arg (filename);612 var file = File.new_for_commandline_arg (filename);
603613
=== modified file 'src/Consts.vala'
--- src/Consts.vala 2013-03-31 21:46:37 +0000
+++ src/Consts.vala 2014-05-04 14:17:09 +0000
@@ -2,5 +2,6 @@
2namespace Audience {2namespace Audience {
3 3
4 public const int CONTROLS_HEIGHT = 32;4 public const int CONTROLS_HEIGHT = 32;
55 public const int REWIND_SHORT = 5;
6 public const int REWIND_LONG = 60;
6}7}
78
=== modified file 'src/Widgets/VideoPlayer.vala'
--- src/Widgets/VideoPlayer.vala 2014-04-28 12:58:09 +0000
+++ src/Widgets/VideoPlayer.vala 2014-05-04 14:17:09 +0000
@@ -592,5 +592,21 @@
592 }592 }
593 } catch (Error e) { warning (e.message); }593 } catch (Error e) { warning (e.message); }
594 }594 }
595
596 public void rewind_seconds (int seconds)
597 {
598 int64 position;
599 playbin.query_position (Gst.Format.TIME, out position);
600
601 var gst_seconds = 1000000000 * (int64)seconds;
602 var new_position = position + gst_seconds;
603
604 if (new_position < 0) {
605 playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, 1);
606 return;
607 }
608
609 playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, new_position);
610 }
595 }611 }
596}
597\ No newline at end of file612\ No newline at end of file
613}

Subscribers

People subscribed via source and target branches