Merge lp:~prsyahmi/audience/audience into lp:~audience-members/audience/trunk

Proposed by Syahmi Azhar
Status: Work in progress
Proposed branch: lp:~prsyahmi/audience/audience
Merge into: lp:~audience-members/audience/trunk
Diff against target: 136 lines (+13/-23)
2 files modified
src/Audience.vala (+9/-21)
src/Widgets/VideoPlayer.vala (+4/-2)
To merge this branch: bzr merge lp:~prsyahmi/audience/audience
Reviewer Review Type Date Requested Status
Audience Members Pending
Review via email: mp+246030@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

hello Syahmi,
would it be better if instead of

} else if (is_subtitle (filename)) {
  if (video_player.uri != null) {
  video_player.set_subtitle_uri (filename);
  }
}

just do

} else if (is_subtitle (filename) && video_player.uri != null) {
     video_player.set_subtitle_uri (filename);
}

Thanks

Revision history for this message
Syahmi Azhar (prsyahmi) wrote :

> hello Syahmi,
> would it be better if instead of
>
> } else if (is_subtitle (filename)) {
> if (video_player.uri != null) {
> video_player.set_subtitle_uri (filename);
> }
> }
>
> just do
>
> } else if (is_subtitle (filename) && video_player.uri != null) {
> video_player.set_subtitle_uri (filename);
> }
>
> Thanks

Hi Viko Adi Rahmawan,

You are right. I'm not sure why I'm doing that in the first place, perhaps I'm doing multiple checks before committing. Thank you.

Regards.

Unmerged revisions

483. By Syahmi Azhar <email address hidden>

Fixed loading/dropping non media file cause welcome screen become hidden

482. By Syahmi Azhar <email address hidden>

Ability to load subtitle regardless video state

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 2015-01-07 10:29:27 +0000
+++ src/Audience.vala 2015-01-10 10:25:41 +0000
@@ -223,6 +223,11 @@
223 bottom_bar.set_progression_time (current_time, total_time);223 bottom_bar.set_progression_time (current_time, total_time);
224 });224 });
225225
226 video_player.media_loading.connect (() => {
227 clutter.show ();
228 welcome.hide ();
229 });
230
226 //end231 //end
227 video_player.ended.connect (() => {232 video_player.ended.connect (() => {
228 Idle.add (() => {233 Idle.add (() => {
@@ -407,8 +412,6 @@
407 run_open_file ();412 run_open_file ();
408 break;413 break;
409 case 1:414 case 1:
410 welcome.hide ();
411 clutter.show_all ();
412 restore_playlist ();415 restore_playlist ();
413 open_file (filename);416 open_file (filename);
414 video_player.playing = false;417 video_player.playing = false;
@@ -417,8 +420,6 @@
417 break;420 break;
418 case 2:421 case 2:
419 case 3:422 case 3:
420 welcome.hide ();
421 clutter.show_all ();
422 open_file (playlist.get_first_item ().get_path ());423 open_file (playlist.get_first_item ().get_path ());
423 video_player.playing = false;424 video_player.playing = false;
424 Idle.add (() => {video_player.progress = 0; return false;});425 Idle.add (() => {video_player.progress = 0; return false;});
@@ -447,8 +448,6 @@
447 if (d.run () == Gtk.ResponseType.OK) {448 if (d.run () == Gtk.ResponseType.OK) {
448 open_file (entry.text, true);449 open_file (entry.text, true);
449 video_player.playing = !settings.playback_wait;450 video_player.playing = !settings.playback_wait;
450 welcome.hide ();
451 clutter.show_all ();
452 }451 }
453452
454 d.destroy ();453 d.destroy ();
@@ -577,9 +576,6 @@
577 foreach (var uri in sel.get_uris ()) {576 foreach (var uri in sel.get_uris ()) {
578 open_file (uri);577 open_file (uri);
579 }578 }
580
581 welcome.hide ();
582 clutter.show_all ();
583 });579 });
584 }580 }
585581
@@ -675,9 +671,6 @@
675 if (video_player.uri == null || welcome.is_visible ())671 if (video_player.uri == null || welcome.is_visible ())
676 open_file (file.get_uri ());672 open_file (file.get_uri ());
677673
678 welcome.hide ();
679 clutter.show_all ();
680
681 settings.last_folder = file.get_current_folder ();674 settings.last_folder = file.get_current_folder ();
682 }675 }
683676
@@ -704,9 +697,6 @@
704 var root = volume.get_mount ().get_default_location ();697 var root = volume.get_mount ().get_default_location ();
705 open_file (root.get_uri (), true);698 open_file (root.get_uri (), true);
706 video_player.playing = !settings.playback_wait;699 video_player.playing = !settings.playback_wait;
707
708 welcome.hide ();
709 clutter.show_all ();
710 }700 }
711701
712 private void toggle_fullscreen () {702 private void toggle_fullscreen () {
@@ -735,8 +725,10 @@
735725
736 file = playlist.get_first_item ();726 file = playlist.get_first_item ();
737 play_file (file.get_uri ());727 play_file (file.get_uri ());
738 } else if (is_subtitle (filename) && video_player.playing) {728 } else if (is_subtitle (filename)) {
739 video_player.set_subtitle_uri (filename);729 if (video_player.uri != null) {
730 video_player.set_subtitle_uri (filename);
731 }
740 } else {732 } else {
741 playlist.add_item (file);733 playlist.add_item (file);
742 play_file (file.get_uri ());734 play_file (file.get_uri ());
@@ -804,8 +796,6 @@
804 restore_playlist ();796 restore_playlist ();
805797
806 if (settings.last_stopped > 0) {798 if (settings.last_stopped > 0) {
807 welcome.hide ();
808 clutter.show_all ();
809 open_file (settings.current_video);799 open_file (settings.current_video);
810 video_player.playing = false;800 video_player.playing = false;
811 Idle.add (() => {video_player.progress = settings.last_stopped; return false;});801 Idle.add (() => {video_player.progress = settings.last_stopped; return false;});
@@ -819,8 +809,6 @@
819 if (mainwindow == null)809 if (mainwindow == null)
820 build ();810 build ();
821811
822 welcome.hide ();
823 clutter.show_all ();
824 foreach (var file in files) {812 foreach (var file in files) {
825 playlist.add_item (file);813 playlist.add_item (file);
826 }814 }
827815
=== modified file 'src/Widgets/VideoPlayer.vala'
--- src/Widgets/VideoPlayer.vala 2014-10-05 06:13:09 +0000
+++ src/Widgets/VideoPlayer.vala 2015-01-10 10:25:41 +0000
@@ -105,11 +105,12 @@
105 video_width = get_video_width (video_info);105 video_width = get_video_width (video_info);
106 }106 }
107 } catch (Error e) {107 } catch (Error e) {
108 error ();
109 warning (e.message);108 warning (e.message);
110 return;109 return;
111 }110 }
112111
112 media_loading ();
113
113 intial_relayout = true;114 intial_relayout = true;
114 playing = false;115 playing = false;
115 playbin.set_state (Gst.State.READY);116 playbin.set_state (Gst.State.READY);
@@ -176,6 +177,7 @@
176 public signal void configure_window (uint video_w, uint video_h);177 public signal void configure_window (uint video_w, uint video_h);
177 public signal void progression_changed (double current_time, double total_time);178 public signal void progression_changed (double current_time, double total_time);
178 public signal void external_subtitle_changed (string? uri);179 public signal void external_subtitle_changed (string? uri);
180 public signal void media_loading ();
179 181
180 private VideoPlayer () {182 private VideoPlayer () {
181 video = new Clutter.Texture ();183 video = new Clutter.Texture ();
@@ -477,4 +479,4 @@
477 return num / (double)denom;479 return num / (double)denom;
478 }480 }
479 }481 }
480}
481\ No newline at end of file482\ No newline at end of file
483}

Subscribers

People subscribed via source and target branches

to all changes: