Merge lp:~chk2k2/me-tv/me-tv into lp:me-tv

Proposed by Christian
Status: Merged
Merged at revision: 58
Proposed branch: lp:~chk2k2/me-tv/me-tv
Merge into: lp:me-tv
Diff against target: 701 lines (+403/-51)
14 files modified
client/Makefile.am (+2/-0)
client/inhibitscreensaver.cc (+257/-0)
client/inhibitscreensaver.h (+74/-0)
client/main_window.cc (+5/-0)
client/main_window.h (+2/-1)
client/me-tv-client.1 (+16/-8)
client/me-tv-client.cc (+1/-30)
client/me-tv.cc (+0/-4)
client/me-tv.h (+0/-4)
configure.ac (+1/-1)
server/channel_manager.cc (+17/-0)
server/channel_manager.h (+1/-0)
server/me-tv-server.1 (+10/-2)
server/request_handler.cc (+17/-1)
To merge this branch: bzr merge lp:~chk2k2/me-tv/me-tv
Reviewer Review Type Date Requested Status
Frédéric Côté Approve
Review via email: mp+255217@code.launchpad.net

Description of the change

fixes 3 bugs:
Bug #769574: reordering channels doesn't work
Bug #983673: me-tv-client doesn't interrupt screensaver
Bug #1414449: Help screen shows wrong version

To post a comment you must log in.
Revision history for this message
Frédéric Côté (frederic-cote) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/Makefile.am'
2--- client/Makefile.am 2012-03-11 22:20:20 +0000
3+++ client/Makefile.am 2015-04-03 22:53:30 +0000
4@@ -32,6 +32,8 @@
5 epg_event_dialog.h \
6 gstreamer_engine.h \
7 gstreamer_engine.cc \
8+ inhibitscreensaver.h \
9+ inhibitscreensaver.cc \
10 me-tv-client.cc \
11 main_window.cc \
12 main_window.h \
13
14=== added file 'client/inhibitscreensaver.cc'
15--- client/inhibitscreensaver.cc 1970-01-01 00:00:00 +0000
16+++ client/inhibitscreensaver.cc 2015-04-03 22:53:30 +0000
17@@ -0,0 +1,257 @@
18+//
19+// Inhibit Screen Saver
20+//
21+// Copyright (C) Joachim Erbs, 2010-2011
22+//
23+// This file is part of Sinema.
24+//
25+// Sinema is free software: you can redistribute it and/or modify
26+// it under the terms of the GNU General Public License as published by
27+// the Free Software Foundation, either version 3 of the License, or
28+// (at your option) any later version.
29+//
30+// Sinema is distributed in the hope that it will be useful,
31+// but WITHOUT ANY WARRANTY; without even the implied warranty of
32+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33+// GNU General Public License for more details.
34+//
35+// You should have received a copy of the GNU General Public License
36+// along with Sinema. If not, see <http://www.gnu.org/licenses/>.
37+//
38+
39+#include "inhibitscreensaver.h"
40+
41+// -------------------------------------------------------------------
42+// Determine which ScreenSaver interface has to be used (Gnome or KDE):
43+// gdbus introspect --session --dest org.freedesktop.DBus --object-path /
44+// gdbus call --session --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner org.gnome.ScreenSaver
45+// gdbus call --session --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner org.freedesktop.ScreenSaver
46+//
47+// Accessing the ScreenSaver:
48+// gdbus introspect --session --dest org.gnome.ScreenSaver --object-path /
49+// gdbus introspect --session --dest org.freedesktop.ScreenSaver --object-path /ScreenSaver
50+// gdbus call --session --dest org.gnome.ScreenSaver --object-path / --method org.gnome.ScreenSaver.SimulateUserActivity
51+// gdbus call --session --dest org.freedesktop.ScreenSaver --object-path /ScreenSaver org.freedesktop.ScreenSaver.SimulateUserActivity
52+// At least the Gnome screen saver does not send a response for SimulateUserActivity.
53+//
54+// Monitoring DBus:
55+// gdbus monitor --session --dest org.gnome.ScreenSaver --object-path /
56+//
57+// Documentation:
58+// gdbus documentation: http://library.gnome.org/devel/gio/2.26/gdbus.html
59+
60+DBusScreenSaverInterface::DBusScreenSaverInterface()
61+ : proxyDBusDaemon(0),
62+ proxyScreenSaver(0),
63+ screenSaver(0),
64+ dbusDaemon
65+ {"org.freedesktop.DBus",
66+ "org.freedesktop.DBus",
67+ "/",
68+ "org.freedesktop.DBus.GetNameOwner",
69+ ""
70+ },
71+ freedesktopScreenSaver
72+ {"org.freedesktop.ScreenSaver",
73+ "org.freedesktop.ScreenSaver",
74+ "/ScreenSaver",
75+ "org.freedesktop.ScreenSaver.Inhibit",
76+ "org.freedesktop.ScreenSaver.UnInhibit"
77+ }
78+{
79+ g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION,
80+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
81+ NULL, // GDBusInterfaceInfo*
82+ dbusDaemon.bus_name,
83+ dbusDaemon.object_path,
84+ dbusDaemon.interface_name,
85+ NULL, // GCancellable*
86+ &wrapper<DBusScreenSaverInterface,
87+ &DBusScreenSaverInterface::finishProxyDBusDaemonNew>,
88+ this);
89+}
90+
91+DBusScreenSaverInterface::~DBusScreenSaverInterface()
92+{
93+ // Fixme: Cancel open asynchronous operations before deleting the object.
94+
95+ if (proxyDBusDaemon)
96+ g_object_unref(proxyDBusDaemon);
97+
98+ if (proxyScreenSaver)
99+ g_object_unref(proxyScreenSaver);
100+}
101+
102+void DBusScreenSaverInterface::finishProxyDBusDaemonNew(GObject*, // source_object
103+ GAsyncResult *res)
104+{
105+ GError* error = NULL;
106+ proxyDBusDaemon = g_dbus_proxy_new_for_bus_finish(res, &error);
107+ if (proxyDBusDaemon)
108+ {
109+ g_debug("DBus Proxy Daemon creation successfull");
110+ screenSaver = &freedesktopScreenSaver;
111+ sendDBusDaemonGetNameOwner();
112+ }
113+ else
114+ {
115+ g_debug("DBus Proxy Daemon creation successfull");
116+ }
117+}
118+
119+void DBusScreenSaverInterface::sendDBusDaemonGetNameOwner()
120+{
121+ g_debug("DBus Proxy checking: %s",screenSaver->bus_name);
122+ g_dbus_proxy_call(proxyDBusDaemon,
123+ dbusDaemon.method_name_inhibit,
124+ g_variant_new ("(s)", screenSaver->bus_name),
125+ G_DBUS_CALL_FLAGS_NO_AUTO_START,
126+ 500, // timeout in milliseconds, -1 use the proxy default timeout
127+ NULL, // GCancellable*
128+ &wrapper<DBusScreenSaverInterface,
129+ &DBusScreenSaverInterface::finishDBusDaemonGetNameOwner>,
130+ this);
131+}
132+
133+void DBusScreenSaverInterface::finishDBusDaemonGetNameOwner(GObject*, // source_object
134+ GAsyncResult *res)
135+{
136+ GError* error = NULL;
137+ GVariant* gvariant = g_dbus_proxy_call_finish(proxyDBusDaemon, res, &error);
138+
139+ if (error != NULL)
140+ {
141+ g_debug("DBus Proxy error callingdomain: %d, code: %d, message: %s", error->domain, error->code, error->message);
142+ g_error_free(error);
143+
144+ if (screenSaver == &freedesktopScreenSaver)
145+ {
146+ g_debug("DBus Proxy search failed: %s",screenSaver->bus_name);
147+// screenSaver = &gnomeScreenSaver;
148+// sendDBusDaemonGetNameOwner();
149+ }
150+ else
151+ {
152+ // No DBus screen saver found.
153+ g_debug("DBus Proxy search failed: %s",screenSaver->bus_name);
154+ }
155+ }
156+ else
157+ {
158+ g_debug("DBus Proxy found: %s",screenSaver->bus_name);
159+ if (gvariant)
160+ {
161+ g_variant_unref(gvariant);
162+ }
163+
164+ // Create DBus proxy for screen saver.
165+ g_dbus_proxy_new_for_bus(G_BUS_TYPE_SESSION,
166+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
167+ NULL, // GDBusInterfaceInfo*
168+ screenSaver->bus_name,
169+ screenSaver->object_path,
170+ screenSaver->interface_name,
171+ NULL, // GCancellable*
172+ &wrapper<DBusScreenSaverInterface,
173+ &DBusScreenSaverInterface::finishProxyScreenSaverNew>,
174+ this);
175+ }
176+}
177+
178+void DBusScreenSaverInterface::finishProxyScreenSaverNew(GObject*, // source_object
179+ GAsyncResult *res)
180+{
181+ GError* error = NULL;
182+ proxyScreenSaver = g_dbus_proxy_new_for_bus_finish(res, &error);
183+ if (error != NULL)
184+ {
185+ g_debug("DBus Proxy error callingdomain: %d, code: %d, message: %s", error->domain, error->code, error->message);
186+ g_error_free(error);
187+ }
188+ else if (proxyScreenSaver)
189+ {
190+ g_debug("DBus Proxy created: %s",screenSaver->bus_name);
191+ }
192+ else
193+ {
194+ g_debug("DBus Proxy creation failed: %s",screenSaver->bus_name);
195+ }
196+}
197+
198+void DBusScreenSaverInterface::inhibit()
199+{
200+ if (proxyScreenSaver)
201+ {
202+ g_debug("DBus Inhibit ScreenSaver");
203+ g_dbus_proxy_call(proxyScreenSaver,
204+ screenSaver->method_name_inhibit,
205+ g_variant_new("(ss)",
206+ g_get_application_name (),
207+ "showing TV stream"),
208+ G_DBUS_CALL_FLAGS_NO_AUTO_START,
209+ 500, // timeout in milliseconds, -1 use the proxy default timeout
210+ NULL, // GCancellable*
211+ &wrapper<DBusScreenSaverInterface,
212+ &DBusScreenSaverInterface::finishInhibit>,
213+ this);
214+ }
215+}
216+
217+void DBusScreenSaverInterface::finishInhibit (GObject * source_object, GAsyncResult * res)
218+{
219+ GError* error = NULL;
220+ GVariant *value;
221+
222+ value = g_dbus_proxy_call_finish (proxyScreenSaver, res, &error);
223+ if (!value) {
224+ g_warning ("Problem inhibiting the screensaver: %s", error->message);
225+ g_error_free (error);
226+ return;
227+ }
228+
229+ /* save the cookie */
230+ if (g_variant_is_of_type (value, G_VARIANT_TYPE ("(u)"))) {
231+ g_variant_get (value, "(u)", &cookie);
232+ }else
233+ cookie = 0;
234+
235+ g_debug("DBus Inhibit ScreenSaver successfull with cookie: %d",cookie);
236+ g_variant_unref (value);
237+}
238+
239+void DBusScreenSaverInterface::uninhibit()
240+{
241+ if (proxyScreenSaver && (cookie>0))
242+ {
243+ g_debug("DBus UnInhibit ScreenSaver");
244+ g_dbus_proxy_call(proxyScreenSaver,
245+ screenSaver->method_name_uninhibit,
246+ g_variant_new ("(u)", cookie),
247+ G_DBUS_CALL_FLAGS_NO_AUTO_START,
248+ 500, // timeout in milliseconds, -1 use the proxy default timeout
249+ NULL, // GCancellable*
250+ &wrapper<DBusScreenSaverInterface,
251+ &DBusScreenSaverInterface::finishUninhibit>,
252+ this);
253+ }
254+}
255+
256+void DBusScreenSaverInterface::finishUninhibit (GObject * source_object, GAsyncResult * res)
257+{
258+ GError* error = NULL;
259+ GVariant *value;
260+
261+ value = g_dbus_proxy_call_finish (proxyScreenSaver, res, &error);
262+ if (!value) {
263+ g_warning ("Problem uninhibiting the screensaver: %s", error->message);
264+ g_error_free (error);
265+ return;
266+ }
267+
268+ /* clear the cookie */
269+ cookie = 0;
270+
271+ g_debug("DBus UnInhibit ScreenSaver successfull");
272+ g_variant_unref (value);
273+}
274+// -------------------------------------------------------------------
275
276=== added file 'client/inhibitscreensaver.h'
277--- client/inhibitscreensaver.h 1970-01-01 00:00:00 +0000
278+++ client/inhibitscreensaver.h 2015-04-03 22:53:30 +0000
279@@ -0,0 +1,74 @@
280+//
281+// Inhibit Screen Saver
282+//
283+// Copyright (C) Joachim Erbs, 2010-2011
284+//
285+// This file is part of Sinema.
286+//
287+// Sinema is free software: you can redistribute it and/or modify
288+// it under the terms of the GNU General Public License as published by
289+// the Free Software Foundation, either version 3 of the License, or
290+// (at your option) any later version.
291+//
292+// Sinema is distributed in the hope that it will be useful,
293+// but WITHOUT ANY WARRANTY; without even the implied warranty of
294+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
295+// GNU General Public License for more details.
296+//
297+// You should have received a copy of the GNU General Public License
298+// along with Sinema. If not, see <http://www.gnu.org/licenses/>.
299+//
300+
301+#ifndef INHIBIT_SCREEN_SAVER_H
302+#define INHIBIT_SCREEN_SAVER_H
303+
304+#include <gio/gio.h>
305+
306+// -------------------------------------------------------------------
307+
308+class DBusScreenSaverInterface
309+{
310+public:
311+ DBusScreenSaverInterface();
312+ ~DBusScreenSaverInterface();
313+
314+ void inhibit();
315+ void uninhibit();
316+
317+private:
318+ template<typename C, void(C::*M)(GObject*, GAsyncResult*)>
319+ static void wrapper(GObject *source_object,
320+ GAsyncResult *res,
321+ gpointer user_data)
322+ {
323+ C* obj = (C*)user_data;
324+ (obj->*M)(source_object, res);
325+ }
326+
327+ struct DBusMethod
328+ {
329+ const gchar* bus_name;
330+ const gchar* interface_name;
331+ const gchar* object_path;
332+ const gchar* method_name_inhibit;
333+ const gchar* method_name_uninhibit;
334+ };
335+
336+ GDBusProxy* proxyDBusDaemon;
337+ GDBusProxy* proxyScreenSaver;
338+ const DBusMethod* screenSaver;
339+ guint32 cookie;
340+
341+ const DBusMethod dbusDaemon;
342+ const DBusMethod freedesktopScreenSaver;
343+
344+ void finishProxyDBusDaemonNew(GObject*, GAsyncResult *res);
345+ void sendDBusDaemonGetNameOwner();
346+ void finishDBusDaemonGetNameOwner(GObject*, GAsyncResult *res);
347+ void finishProxyScreenSaverNew(GObject*, GAsyncResult *res);
348+
349+ void finishUninhibit (GObject * source_object, GAsyncResult * res);
350+ void finishInhibit (GObject * source_object, GAsyncResult * res);
351+};
352+
353+#endif
354
355=== modified file 'client/main_window.cc'
356--- client/main_window.cc 2012-12-08 23:09:19 +0000
357+++ client/main_window.cc 2015-04-03 22:53:30 +0000
358@@ -94,6 +94,8 @@
359 GdkPixmap* pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1);
360 hidden_cursor = gdk_cursor_new_from_pixmap(pixmap, pixmap, &color, &color, 0, 0);
361
362+ inhibitScreenSaver = new DBusScreenSaverInterface();
363+
364 g_debug("Loading UI files");
365
366 add_accel_group(ui_manager->get_accel_group());
367@@ -281,6 +283,8 @@
368 void MainWindow::unfullscreen(gboolean restore_mode)
369 {
370 Gtk::Window::unfullscreen();
371+ inhibitScreenSaver->uninhibit();
372+
373 label_time->hide();
374
375 if (restore_mode)
376@@ -298,6 +302,7 @@
377 }
378 label_time->show();
379
380+ inhibitScreenSaver->inhibit();
381 Gtk::Window::fullscreen();
382 }
383
384
385=== modified file 'client/main_window.h'
386--- client/main_window.h 2011-12-24 22:18:13 +0000
387+++ client/main_window.h 2015-04-03 22:53:30 +0000
388@@ -23,7 +23,7 @@
389
390 #include "me-tv.h"
391 #include "engine.h"
392-#include <dbus/dbus.h>
393+#include "inhibitscreensaver.h"
394 #include <gtkmm/volumebutton.h>
395
396 typedef enum
397@@ -63,6 +63,7 @@
398 Gtk::Label* label_epg_page;
399 Gtk::Table* table_epg;
400 Gtk::ScrolledWindow* scrolled_window_epg;
401+ DBusScreenSaverInterface* inhibitScreenSaver;
402
403 void stop();
404 void set_view_mode(ViewMode display_mode);
405
406=== modified file 'client/me-tv-client.1'
407--- client/me-tv-client.1 2011-12-24 22:18:13 +0000
408+++ client/me-tv-client.1 2015-04-03 22:53:30 +0000
409@@ -1,22 +1,24 @@
410 .pc
411-.TH "ME TV" 1 "2011-03-31" "2.0.0" "Me TV Client Manual"
412+.TH "ME TV" 1 "2015-03-26" "1.4.0" "Me TV Client Manual"
413
414 .SH NAME
415 me-tv-client \- a digital television (DVB) viewer for GNOME
416
417 .SH SYNOPSIS
418-.B me-tv
419-.I [-?|--help]
420+.B me-tv-client
421+.I [-?|-h|--help]
422 .I [-v|--verbose]
423 .I [-s|--safe-mode]
424-.I [-m|--minimised]
425 .I [--disable-epg]
426+.I [--engine]
427 .I [--no-screensaver-inhibit]
428 .I [--display=DISPLAY]
429+.I [--server-host]
430+.I [--server-port]
431
432 .SH DESCRIPTION
433 Me TV is a GTK desktop application for watching digital television services
434-that use the DVB standard. Me TV works with DVB-T/C/S and ATSC cards that have
435+that use the DVB standard. Me TV works with DVB-T/C/S and ATSC cards that have
436 kernel driver support.
437
438 .SH OPTIONS
439@@ -30,17 +32,23 @@
440 .B -s|--safe-mode
441 Show the preferences dialog an don't show video upon start.
442 .TP
443-.B -m|--minimised-mode
444-Show minimised in notification area at startup.
445-.TP
446 .B --disable-epg
447 Stops the rendering of the EPG event buttons on the UI.
448 .TP
449+.B --engine
450+Specify engine type gstreamer or vlc (default: vlc).
451+.TP
452 .B --no-screensaver-inhibit
453 Tells Me TV not to call the screensaver Inhibit/UnInhibit methods for GNOME Screensaver.
454 .TP
455 .B --display=DISPLAY
456 X display to use
457+.TP
458+.B --server-host
459+Me TV server host (default: localhost)
460+.TP
461+.B --server-port
462+Me TV server port (default: 1999)
463
464 .SH AUTHOR
465 Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>.
466
467=== modified file 'client/me-tv-client.cc'
468--- client/me-tv-client.cc 2012-12-08 23:09:19 +0000
469+++ client/me-tv-client.cc 2015-04-03 22:53:30 +0000
470@@ -26,7 +26,6 @@
471 #include <glib/gprintf.h>
472 #include <X11/Xlib.h>
473 #include <unique/unique.h>
474-#include <dbus/dbus-glib.h>
475 #include "me-tv-ui.h"
476 #include "configuration_manager.h"
477 #include "../common/exception.h"
478@@ -45,7 +44,7 @@
479 UniqueResponse response = UNIQUE_RESPONSE_FAIL;
480
481 switch (command)
482- {
483+ {
484 case 1:
485 action_present->activate();
486 response = UNIQUE_RESPONSE_OK;
487@@ -101,15 +100,6 @@
488 safe_mode_option_entry.set_short_name('s');
489 safe_mode_option_entry.set_description(_("Start in safe mode"));
490
491- Glib::OptionEntry minimised_option_entry;
492- minimised_option_entry.set_long_name("minimised");
493- minimised_option_entry.set_short_name('m');
494- minimised_option_entry.set_description(_("Start minimised in notification area"));
495-
496- Glib::OptionEntry disable_epg_thread_option_entry;
497- disable_epg_thread_option_entry.set_long_name("disable-epg-thread");
498- disable_epg_thread_option_entry.set_description(_("Disable the EPG thread. Me TV will stop collecting EPG events."));
499-
500 Glib::OptionEntry disable_epg_option_entry;
501 disable_epg_option_entry.set_long_name("disable-epg");
502 disable_epg_option_entry.set_description(_("Stops the rendering of the EPG event buttons on the UI."));
503@@ -123,10 +113,6 @@
504 no_screensaver_inhibit_option_entry.set_long_name("no-screensaver-inhibit");
505 no_screensaver_inhibit_option_entry.set_description(_("Tells Me TV not to call the screensaver Inhibit/UnInhibit methods for GNOME Screensaver."));
506
507- Glib::OptionEntry devices_option_entry;
508- devices_option_entry.set_long_name("devices");
509- devices_option_entry.set_description(_("Only use the specified frontend devices (e.g. --devices=/dev/dvb/adapter0/frontend0,/dev/dvb/adapter0/frontend1)"));
510-
511 Glib::OptionEntry host_option_entry;
512 host_option_entry.set_long_name("server-host");
513 host_option_entry.set_description(_("Me TV server host (default: localhost)"));
514@@ -135,19 +121,11 @@
515 port_option_entry.set_long_name("server-port");
516 port_option_entry.set_description(_("Me TV server port (default: 1999)"));
517
518- Glib::OptionEntry read_timeout_option_entry;
519- read_timeout_option_entry.set_long_name("read-timeout");
520- read_timeout_option_entry.set_description(_("How long to wait (in seconds) before timing out while waiting for data from demuxer (default 5)."));
521-
522 Glib::OptionGroup option_group(PACKAGE_NAME, "", _("Show Me TV help options"));
523 option_group.add_entry(verbose_option_entry, verbose_logging);
524 option_group.add_entry(safe_mode_option_entry, safe_mode);
525- option_group.add_entry(minimised_option_entry, minimised_mode);
526- option_group.add_entry(disable_epg_thread_option_entry, disable_epg_thread);
527 option_group.add_entry(disable_epg_option_entry, disable_epg);
528 option_group.add_entry(no_screensaver_inhibit_option_entry, no_screensaver_inhibit);
529- option_group.add_entry(devices_option_entry, devices);
530- option_group.add_entry(read_timeout_option_entry, read_timeout);
531 option_group.add_entry(host_option_entry, server_host);
532 option_group.add_entry(port_option_entry, server_port);
533 option_group.add_entry(engine_option_entry, engine_type);
534@@ -235,13 +213,6 @@
535
536 ui_manager = Gtk::UIManager::create();
537 ui_manager->insert_action_group(action_group);
538-
539- GError *error = NULL;
540- DBusGConnection* dbus_connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
541- if (dbus_connection == NULL)
542- {
543- g_message(_("Failed to get DBus session"));
544- }
545
546 configuration_manager.initialise();
547 client.register_client(server_host, server_port);
548
549=== modified file 'client/me-tv.cc'
550--- client/me-tv.cc 2012-03-17 14:07:31 +0000
551+++ client/me-tv.cc 2015-04-03 22:53:30 +0000
552@@ -25,12 +25,8 @@
553
554 bool verbose_logging = false;
555 bool safe_mode = false;
556-bool minimised_mode = false;
557-bool disable_epg_thread = false;
558 bool disable_epg = false;
559 bool no_screensaver_inhibit = false;
560-Glib::ustring devices;
561-gint read_timeout = 5;
562 Glib::ustring server_host = "localhost";
563 gint server_port = 1999;
564 Glib::ustring engine_type = "vlc";
565
566=== modified file 'client/me-tv.h'
567--- client/me-tv.h 2012-03-11 22:20:20 +0000
568+++ client/me-tv.h 2015-04-03 22:53:30 +0000
569@@ -31,12 +31,8 @@
570
571 extern bool verbose_logging;
572 extern bool safe_mode;
573-extern bool minimised_mode;
574-extern bool disable_epg_thread;
575 extern bool disable_epg;
576 extern bool no_screensaver_inhibit;
577-extern Glib::ustring devices;
578-extern gint read_timeout;
579 extern Glib::ustring server_host;
580 extern gint server_port;
581 extern Glib::ustring engine_type;
582
583=== modified file 'configure.ac'
584--- configure.ac 2012-12-29 22:49:32 +0000
585+++ configure.ac 2015-04-03 22:53:30 +0000
586@@ -1,7 +1,7 @@
587 # Process this file with autoconf to produce a configure script.
588
589 AC_PREREQ(2.53)
590-AC_INIT([Me TV], [1.4.0.12], [http://launchpad.net/me-tv], me-tv)
591+AC_INIT([Me TV], [1.4.0.58], [http://launchpad.net/me-tv], me-tv)
592 AC_COPYRIGHT([Michael Lamothe <michael.lamothe@gmail.com>])
593 AM_INIT_AUTOMAKE([1.9 foreign])
594 AC_GNU_SOURCE
595
596=== modified file 'server/channel_manager.cc'
597--- server/channel_manager.cc 2012-06-10 20:50:55 +0000
598+++ server/channel_manager.cc 2015-04-03 22:53:30 +0000
599@@ -271,6 +271,23 @@
600 return *channel;
601 }
602
603+Channel& ChannelManager::get_channel_by_name(Glib::ustring name)
604+{
605+ Glib::RecMutex::Lock lock(mutex);
606+
607+ Channel* channel = NULL;
608+
609+ for (ChannelList::iterator iterator = channels.begin(); iterator != channels.end() && channel == NULL; iterator++)
610+ {
611+ if ((*iterator).name == name)
612+ {
613+ channel = &(*iterator);
614+ }
615+ }
616+
617+ return *channel;
618+}
619+
620 Channel& ChannelManager::get_channel_by_id(guint channel_id)
621 {
622 Glib::RecMutex::Lock lock(mutex);
623
624=== modified file 'server/channel_manager.h'
625--- server/channel_manager.h 2011-12-24 22:18:13 +0000
626+++ server/channel_manager.h 2015-04-03 22:53:30 +0000
627@@ -53,6 +53,7 @@
628
629 Channel& get_channel_by_id(guint channel_id);
630 Channel& get_channel_by_index(guint number);
631+ Channel& get_channel_by_name(Glib::ustring name);
632 Channel* find_channel(guint frequency, guint service_id);
633 Channel* find_channel(guint channel_id);
634
635
636=== modified file 'server/me-tv-server.1'
637--- server/me-tv-server.1 2011-12-24 22:18:13 +0000
638+++ server/me-tv-server.1 2015-04-03 22:53:30 +0000
639@@ -1,16 +1,18 @@
640 .pc
641-.TH "ME TV" 1 "2011-03-31" "2.0.0" "Me TV Server Manual"
642+.TH "ME TV" 1 "2015-03-26" "1.4.0" "Me TV Server Manual"
643
644 .SH NAME
645 me-tv-server \- a digital television (DVB) viewer for GNOME
646
647 .SH SYNOPSIS
648 .B me-tv-server
649-.I [-?|--help]
650+.I [-?|-h|--help]
651 .I [-v|--verbose]
652 .I [--disable-epg-thread]
653 .I [--devices]
654 .I [--read-timeout]
655+.I [--broadcast-address]
656+.I [--server-port]
657
658 .SH DESCRIPTION
659 Me TV is a GTK desktop application for watching digital television services
660@@ -35,6 +37,12 @@
661 .TP
662 .B --read-timeout
663 How long to wait (in seconds) before timing out while waiting for data from demuxer (default 5)
664+.TP
665+.B --broadcast-address
666+The network broadcast address to send video streams for clients to display (default 127.0.0.1).
667+.TP
668+.B --server-port
669+The network port for clients to connect to (default 1999).
670
671 .SH AUTHOR
672 Michael Lamothe (2007-2011) <michael.lamothe@gmail.com>.
673
674=== modified file 'server/request_handler.cc'
675--- server/request_handler.cc 2012-03-17 16:43:02 +0000
676+++ server/request_handler.cc 2015-04-03 22:53:30 +0000
677@@ -262,7 +262,23 @@
678 }
679 else if (command == "set_channel_order")
680 {
681-
682+ ChannelList newchannels;
683+
684+ NodeSet nodes = root_node->find("parameter");
685+ for (NodeSet::iterator i = nodes.begin(); i != nodes.end(); i++)
686+ {
687+ Node* node = *i;
688+
689+ const Glib::ustring& name = get_attribute_value(node, "@name");
690+ const Glib::ustring& value = get_attribute_value(node, "@value");
691+
692+ newchannels.push_back(channel_manager.get_channel_by_name(name));
693+
694+ Glib::ustring s = Glib::ustring::compose(" name=%1 -- value=%2", name, value);
695+ g_debug(s.c_str());
696+ }
697+
698+ channel_manager.set_channels(schema, connection, newchannels);
699 }
700 else if (command == "get_epg")
701 {

Subscribers

People subscribed via source and target branches