Merge lp:~artem-anufrij/audience/dont-autoplay-on-startup into lp:~audience-members/audience/trunk

Proposed by Artem Anufrij
Status: Superseded
Proposed branch: lp:~artem-anufrij/audience/dont-autoplay-on-startup
Merge into: lp:~audience-members/audience/trunk
Diff against target: 219 lines (+25/-31)
2 files modified
src/Audience.vala (+12/-18)
src/Widgets/VideoPlayer.vala (+13/-13)
To merge this branch: bzr merge lp:~artem-anufrij/audience/dont-autoplay-on-startup
Reviewer Review Type Date Requested Status
Cody Garver Needs Fixing
Review via email: mp+261433@code.launchpad.net

This proposal supersedes a proposal from 2015-04-23.

This proposal has been superseded by a proposal from 2015-09-10.

Description of the change

Don't autoplay on startup

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote : Posted in a previous version of this proposal

Controls are hidden until you mouse hover, it's supposed to always show while paused

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

No controls visible when Audience starts paused

review: Needs Fixing
528. By Launchpad Translations on behalf of audience-members

Launchpad automatic translations update.

529. By Launchpad Translations on behalf of audience-members

Launchpad automatic translations update.

530. By Launchpad Translations on behalf of audience-members

Launchpad automatic translations update.

531. By Fabio Zaramella

fix icon in about dialog

532. By Launchpad Translations on behalf of audience-members

Launchpad automatic translations update.

533. By Launchpad Translations on behalf of audience-members

Launchpad automatic translations update.

534. By Cody Garver

Release 0.1.0.2

535. By Launchpad Translations on behalf of audience-members

Launchpad automatic translations update.

536. By Artem Anufrij

added a menu item 'Resume last video' if last video wasn't finished

537. By Artem Anufrij

playbin.set_state (Gst.State.PAUSED); -> playing = false;

Unmerged revisions

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-07-28 06:24:05 +0000
3+++ src/Audience.vala 2015-09-10 20:17:24 +0000
4@@ -128,7 +128,7 @@
5 settings = new Settings ();
6 mainwindow = new Gtk.Window ();
7 video_player = Widgets.VideoPlayer.get_default ();
8- video_player.notify["playing"].connect (() => {bottom_bar.toggle_play_pause ();});
9+ video_player.notify["playing"].connect (() => { bottom_bar.toggle_play_pause (); });
10
11 clutter = new GtkClutter.Embed ();
12
13@@ -339,7 +339,7 @@
14 });
15
16 //save position in video when not finished playing
17- mainwindow.destroy.connect (() => {on_destroy ();});
18+ mainwindow.destroy.connect (() => { on_destroy (); });
19
20 //playlist wants us to open a file
21 playlist.play.connect ((file) => {
22@@ -354,7 +354,7 @@
23 }
24 });
25
26- stage.notify["allocation"].connect (() => {allocate_bottombar ();});
27+ stage.notify["allocation"].connect (() => { allocate_bottombar (); });
28 }
29
30 private void allocate_bottombar () {
31@@ -412,7 +412,7 @@
32 restore_playlist ();
33 open_file (filename);
34 video_player.playing = false;
35- Idle.add (() => {video_player.progress = settings.last_stopped; return false;});
36+ Idle.add (() => { video_player.progress = settings.last_stopped; return false; });
37 video_player.playing = true;
38 break;
39 case 2:
40@@ -420,7 +420,7 @@
41 clutter.show_all ();
42 open_file (playlist.get_first_item ().get_path ());
43 video_player.playing = false;
44- Idle.add (() => {video_player.progress = 0; return false;});
45+ Idle.add (() => { video_player.progress = 0; return false; });
46 video_player.playing = true;
47 break;
48 case 3:
49@@ -445,7 +445,6 @@
50
51 if (d.run () == Gtk.ResponseType.OK) {
52 open_file (entry.text, true);
53- video_player.playing = !settings.playback_wait;
54 welcome.hide ();
55 clutter.show_all ();
56 }
57@@ -760,7 +759,6 @@
58
59 var root = volume.get_mount ().get_default_location ();
60 open_file (root.get_uri (), true);
61- video_player.playing = !settings.playback_wait;
62
63 welcome.hide ();
64 clutter.show_all ();
65@@ -782,7 +780,7 @@
66 return (event.state & modifier) == modifier;
67 }
68
69- internal void open_file (string filename, bool dont_modify = false) {
70+ internal void open_file (string filename, bool play = true) {
71 var file = File.new_for_commandline_arg (filename);
72
73 if (file.query_file_type (0) == FileType.DIRECTORY) {
74@@ -791,12 +789,12 @@
75 });
76
77 file = playlist.get_first_item ();
78- play_file (file.get_uri ());
79+ play_file (file.get_uri (), play);
80 } else if (is_subtitle (filename) && video_player.playing) {
81 video_player.set_subtitle_uri (filename);
82 } else {
83 playlist.add_item (file);
84- play_file (file.get_uri ());
85+ play_file (file.get_uri (), play);
86 }
87 }
88
89@@ -830,7 +828,7 @@
90 return false;
91 }
92
93- public void play_file (string uri) {
94+ public void play_file (string uri, bool play = true) {
95 debug ("Opening %s", uri);
96 video_player.uri = uri;
97 playlist.set_current (uri);
98@@ -841,7 +839,7 @@
99 video_player.set_subtitle_uri (sub_uri);
100
101 mainwindow.title = get_title (uri);
102- video_player.playing = !settings.playback_wait;
103+ video_player.playing = play;
104
105 Gtk.RecentManager recent_manager = Gtk.RecentManager.get_default ();
106 recent_manager.add_item (uri);
107@@ -861,12 +859,8 @@
108 restore_playlist ();
109
110 if (settings.last_stopped > 0) {
111- welcome.hide ();
112- clutter.show_all ();
113- open_file (settings.current_video);
114- video_player.playing = false;
115- Idle.add (() => {video_player.progress = settings.last_stopped; return false;});
116- video_player.playing = !settings.playback_wait;
117+ open_file (settings.current_video, false);
118+ Idle.add (() => { video_player.progress = settings.last_stopped; return false; });
119 }
120 }
121 }
122
123=== modified file 'src/Widgets/VideoPlayer.vala'
124--- src/Widgets/VideoPlayer.vala 2015-05-16 10:13:38 +0000
125+++ src/Widgets/VideoPlayer.vala 2015-09-10 20:17:24 +0000
126@@ -120,7 +120,7 @@
127 at_end = false;
128
129 relayout ();
130- playing = true;
131+ playbin.set_state (Gst.State.PAUSED);
132 }
133 }
134
135@@ -187,7 +187,7 @@
136 public signal void configure_window (uint video_w, uint video_h);
137 public signal void progression_changed (double current_time, double total_time);
138 public signal void external_subtitle_changed (string? uri);
139-
140+
141 private VideoPlayer () {
142 video = new Clutter.Texture ();
143
144@@ -255,9 +255,9 @@
145 GLib.Error e; string detail;
146 msg.parse_error (out e, out detail);
147 playbin.set_state (Gst.State.NULL);
148-
149+
150 warning (detail);
151-
152+
153 show_error (e.message);
154 break;
155 case Gst.MessageType.EOS:
156@@ -266,19 +266,19 @@
157 case Gst.MessageType.ELEMENT:
158 if (msg.get_structure () == null)
159 break;
160-
161+
162 if (Gst.PbUtils.is_missing_plugin_message (msg)) {
163 error ();
164 playbin.set_state (Gst.State.NULL);
165-
166+
167 handle_missing_plugin (msg);
168 /*TODO } else { //may be navigation command
169 var nav_msg = Gst.Navigation.message_get_type (msg);
170-
171+
172 if (nav_msg == Gst.NavigationMessageType.COMMANDS_CHANGED) {
173 var q = Gst.Navigation.query_new_commands ();
174 pipeline.query (q);
175-
176+
177 uint n;
178 gst_navigation_query_parse_commands_length (q, out n);
179 for (var i=0;i<n;i++) {
180@@ -379,10 +379,10 @@
181 var grid = new Gtk.Grid ();
182 var err = new Gtk.Image.from_icon_name ("dialog-error", Gtk.IconSize.DIALOG);
183 err.margin_right = 12;
184-
185+
186 var err_label = new Gtk.Label ("");
187 err_label.set_markup ("<b>%s</b>".printf (_("Oops! Audience can't play this file!")));
188-
189+
190 grid.margin = 12;
191 grid.attach (err, 0, 0, 1, 1);
192 grid.attach (err_label, 1, 0, 1, 1);
193@@ -448,7 +448,7 @@
194 //prevent screenlocking in Gnome 3 using org.gnome.SessionManager
195 void set_screenlock (bool enable) {
196 try {
197- session_manager = Bus.get_proxy_sync (BusType.SESSION,
198+ session_manager = Bus.get_proxy_sync (BusType.SESSION,
199 "org.gnome.SessionManager", "/org/gnome/SessionManager");
200 if (enable) {
201 session_manager.Uninhibit (inhibit_cookie);
202@@ -471,7 +471,7 @@
203 playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, int64.max (new_position, 1));
204 return;
205 }
206-
207+
208 playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, new_position);
209 }
210
211@@ -500,7 +500,7 @@
212 if (font == "") {
213 var gnome_settings = new GLib.Settings ("org.gnome.desktop.interface");
214 font = gnome_settings.get_string ("font-name");
215- }
216+ }
217 subtitle_font = font;
218 }
219 }

Subscribers

People subscribed via source and target branches