author | melunko |
Fri Feb 08 00:03:03 2008 +0000 (2008-02-08) | |
branch | trunk |
changeset 913 | c0f13b16964f |
child 922 | 04cd5e61dca3 |
permissions | -rw-r--r-- |
1 #include <glib.h>
3 #include "gmyth_upnp.h"
5 static void
6 _device_found_cb (GMythUPnP *upnp,
7 GMythBackendInfo *info,
8 gpointer data)
9 {
10 g_debug ("BACKEND FOUND: %s", info->hostname);
11 }
13 static void
14 _device_lost_cb (GMythUPnP *upnp,
15 GMythBackendInfo *info,
16 gpointer data)
17 {
18 g_debug ("BACKEND LOST: %s", info->hostname);
19 }
23 int main (int argc, char** argv)
24 {
25 GMythUPnP *o;
26 GMainLoop *loop;
28 g_type_init ();
29 g_thread_init (NULL);
31 o = gmyth_upnp_get_instance ();
32 g_signal_connect (o,
33 "device-found",
34 G_CALLBACK (_device_found_cb),
35 NULL);
36 g_signal_connect (o,
37 "device-lost",
38 G_CALLBACK (_device_lost_cb),
39 NULL);
42 gmyth_upnp_search (o);
44 loop = g_main_loop_new (NULL, FALSE);
45 g_main_loop_run (loop);
46 g_object_unref (o);
48 return 0;
49 }