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
1=== modified file 'src/Audience.vala'
2--- src/Audience.vala 2015-01-07 10:29:27 +0000
3+++ src/Audience.vala 2015-01-10 10:25:41 +0000
4@@ -223,6 +223,11 @@
5 bottom_bar.set_progression_time (current_time, total_time);
6 });
7
8+ video_player.media_loading.connect (() => {
9+ clutter.show ();
10+ welcome.hide ();
11+ });
12+
13 //end
14 video_player.ended.connect (() => {
15 Idle.add (() => {
16@@ -407,8 +412,6 @@
17 run_open_file ();
18 break;
19 case 1:
20- welcome.hide ();
21- clutter.show_all ();
22 restore_playlist ();
23 open_file (filename);
24 video_player.playing = false;
25@@ -417,8 +420,6 @@
26 break;
27 case 2:
28 case 3:
29- welcome.hide ();
30- clutter.show_all ();
31 open_file (playlist.get_first_item ().get_path ());
32 video_player.playing = false;
33 Idle.add (() => {video_player.progress = 0; return false;});
34@@ -447,8 +448,6 @@
35 if (d.run () == Gtk.ResponseType.OK) {
36 open_file (entry.text, true);
37 video_player.playing = !settings.playback_wait;
38- welcome.hide ();
39- clutter.show_all ();
40 }
41
42 d.destroy ();
43@@ -577,9 +576,6 @@
44 foreach (var uri in sel.get_uris ()) {
45 open_file (uri);
46 }
47-
48- welcome.hide ();
49- clutter.show_all ();
50 });
51 }
52
53@@ -675,9 +671,6 @@
54 if (video_player.uri == null || welcome.is_visible ())
55 open_file (file.get_uri ());
56
57- welcome.hide ();
58- clutter.show_all ();
59-
60 settings.last_folder = file.get_current_folder ();
61 }
62
63@@ -704,9 +697,6 @@
64 var root = volume.get_mount ().get_default_location ();
65 open_file (root.get_uri (), true);
66 video_player.playing = !settings.playback_wait;
67-
68- welcome.hide ();
69- clutter.show_all ();
70 }
71
72 private void toggle_fullscreen () {
73@@ -735,8 +725,10 @@
74
75 file = playlist.get_first_item ();
76 play_file (file.get_uri ());
77- } else if (is_subtitle (filename) && video_player.playing) {
78- video_player.set_subtitle_uri (filename);
79+ } else if (is_subtitle (filename)) {
80+ if (video_player.uri != null) {
81+ video_player.set_subtitle_uri (filename);
82+ }
83 } else {
84 playlist.add_item (file);
85 play_file (file.get_uri ());
86@@ -804,8 +796,6 @@
87 restore_playlist ();
88
89 if (settings.last_stopped > 0) {
90- welcome.hide ();
91- clutter.show_all ();
92 open_file (settings.current_video);
93 video_player.playing = false;
94 Idle.add (() => {video_player.progress = settings.last_stopped; return false;});
95@@ -819,8 +809,6 @@
96 if (mainwindow == null)
97 build ();
98
99- welcome.hide ();
100- clutter.show_all ();
101 foreach (var file in files) {
102 playlist.add_item (file);
103 }
104
105=== modified file 'src/Widgets/VideoPlayer.vala'
106--- src/Widgets/VideoPlayer.vala 2014-10-05 06:13:09 +0000
107+++ src/Widgets/VideoPlayer.vala 2015-01-10 10:25:41 +0000
108@@ -105,11 +105,12 @@
109 video_width = get_video_width (video_info);
110 }
111 } catch (Error e) {
112- error ();
113 warning (e.message);
114 return;
115 }
116
117+ media_loading ();
118+
119 intial_relayout = true;
120 playing = false;
121 playbin.set_state (Gst.State.READY);
122@@ -176,6 +177,7 @@
123 public signal void configure_window (uint video_w, uint video_h);
124 public signal void progression_changed (double current_time, double total_time);
125 public signal void external_subtitle_changed (string? uri);
126+ public signal void media_loading ();
127
128 private VideoPlayer () {
129 video = new Clutter.Texture ();
130@@ -477,4 +479,4 @@
131 return num / (double)denom;
132 }
133 }
134-}
135\ No newline at end of file
136+}

Subscribers

People subscribed via source and target branches

to all changes: