melunko@250
|
1 |
/**
|
melunko@250
|
2 |
* GMyth Library
|
melunko@250
|
3 |
*
|
melunko@250
|
4 |
* @file gmyth/gmyth_upnp.h
|
melunko@250
|
5 |
*
|
melunko@250
|
6 |
* @brief <p> GMythUPnP allows that a MythTV frontend discovers a
|
melunko@250
|
7 |
* MythTV backend, using the UPnP architecture.
|
melunko@250
|
8 |
*
|
melunko@250
|
9 |
* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
|
melunko@250
|
10 |
* @author Rosfran Lins Borges <rosfran.borges@indt.org.br>
|
melunko@250
|
11 |
*
|
melunko@250
|
12 |
* This program is free software; you can redistribute it and/or modify
|
melunko@250
|
13 |
* it under the terms of the GNU Lesser General Public License as published by
|
melunko@250
|
14 |
* the Free Software Foundation; either version 2 of the License, or
|
melunko@250
|
15 |
* (at your option) any later version.
|
melunko@250
|
16 |
*
|
melunko@250
|
17 |
* This program is distributed in the hope that it will be useful,
|
melunko@250
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
melunko@250
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
melunko@250
|
20 |
* GNU General Public License for more details.
|
melunko@250
|
21 |
*
|
melunko@250
|
22 |
* You should have received a copy of the GNU Lesser General Public License
|
melunko@250
|
23 |
* along with this program; if not, write to the Free Software
|
melunko@250
|
24 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
melunko@250
|
25 |
*
|
melunko@250
|
26 |
*/
|
melunko@250
|
27 |
|
melunko@250
|
28 |
#ifndef _GMYTH_UPNP_H_
|
melunko@250
|
29 |
#define _GMYTH_UPNP_H_
|
melunko@250
|
30 |
|
melunko@250
|
31 |
#include <glib.h>
|
melunko@250
|
32 |
#include <glib-object.h>
|
melunko@250
|
33 |
|
melunko@250
|
34 |
#include <stdlib.h>
|
melunko@250
|
35 |
#include <stdio.h>
|
melunko@250
|
36 |
#include <string.h>
|
melunko@250
|
37 |
|
melunko@250
|
38 |
#include <cybergarage/upnp/cupnp.h>
|
rosfran@260
|
39 |
#include <gmyth/gmyth_backendinfo.h>
|
melunko@250
|
40 |
|
melunko@250
|
41 |
G_BEGIN_DECLS
|
melunko@250
|
42 |
#define GMYTH_UPNP_TYPE (gmyth_upnp_get_type ())
|
melunko@250
|
43 |
#define GMYTH_UPNP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_UPNP_TYPE, GMythUPnP))
|
melunko@250
|
44 |
#define GMYTH_UPNP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_UPNP_TYPE, GMythUPnPClass))
|
melunko@250
|
45 |
#define IS_GMYTH_UPNP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_UPNP_TYPE))
|
melunko@250
|
46 |
#define IS_GMYTH_UPNP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_UPNP_TYPE))
|
melunko@250
|
47 |
#define GMYTH_UPNP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_UPNP_TYPE, GMythUPnPClass))
|
renatofilho@754
|
48 |
typedef struct _GMythUPnP GMythUPnP;
|
renatofilho@754
|
49 |
typedef struct _GMythUPnPClass GMythUPnPClass;
|
renatofilho@754
|
50 |
typedef struct _GMythUPnPPrivate GMythUPnPPrivate;
|
melunko@250
|
51 |
|
melunko@250
|
52 |
/****************************************
|
melunko@250
|
53 |
* Data Type
|
melunko@250
|
54 |
****************************************/
|
melunko@250
|
55 |
|
rosfran@696
|
56 |
typedef enum upnp_device_list_status {
|
renatofilho@754
|
57 |
GMYTH_UPNP_DEVICE_ADDED = 0,
|
renatofilho@754
|
58 |
GMYTH_UPNP_DEVICE_UPDATED,
|
renatofilho@754
|
59 |
GMYTH_UPNP_DEVICE_REMOVED
|
rosfran@696
|
60 |
} GMythUPnPDeviceStatus;
|
rosfran@696
|
61 |
|
renatofilho@754
|
62 |
typedef void (*GMythUPnPDeviceListener) (GMythUPnP * gmyth_upnp,
|
renatofilho@754
|
63 |
GMythUPnPDeviceStatus status,
|
renatofilho@754
|
64 |
gchar * dev);
|
rosfran@696
|
65 |
|
renatofilho@754
|
66 |
struct _GMythUPnPClass {
|
renatofilho@754
|
67 |
GObjectClass parent_class;
|
melunko@250
|
68 |
|
renatofilho@754
|
69 |
/*
|
renatofilho@754
|
70 |
* callbacks
|
renatofilho@754
|
71 |
*/
|
renatofilho@754
|
72 |
guint device_found_handler_signal_id;
|
rosfran@696
|
73 |
|
renatofilho@754
|
74 |
GMythUPnPDeviceListener device_found_handler;
|
rosfran@696
|
75 |
|
renatofilho@754
|
76 |
/*
|
renatofilho@754
|
77 |
* no one for now
|
renatofilho@754
|
78 |
*/
|
melunko@250
|
79 |
};
|
melunko@250
|
80 |
|
rosfran@696
|
81 |
struct _GMythUPnPDevice {
|
renatofilho@754
|
82 |
gchar *uri;
|
renatofilho@754
|
83 |
gchar *host;
|
renatofilho@754
|
84 |
gint port;
|
renatofilho@754
|
85 |
gchar *protocol;
|
rosfran@696
|
86 |
};
|
rosfran@696
|
87 |
|
rosfran@696
|
88 |
typedef struct _GMythUPnPDevice GMythUPnPDevice;
|
rosfran@696
|
89 |
|
melunko@250
|
90 |
struct _GMythUPnP {
|
rosfran@696
|
91 |
|
renatofilho@754
|
92 |
GObject parent;
|
renatofilho@754
|
93 |
GMythUPnPPrivate *priv;
|
rosfran@696
|
94 |
|
renatofilho@754
|
95 |
|
renatofilho@754
|
96 |
CgUpnpControlPoint *control_point;
|
renatofilho@754
|
97 |
|
renatofilho@754
|
98 |
gchar *udn;
|
renatofilho@754
|
99 |
|
renatofilho@754
|
100 |
GMythBackendInfo *backend_info;
|
renatofilho@754
|
101 |
|
renatofilho@754
|
102 |
gboolean upnp_dev_found;
|
melunko@250
|
103 |
};
|
melunko@250
|
104 |
|
renatofilho@754
|
105 |
GType gmyth_upnp_get_type(void);
|
renatofilho@754
|
106 |
GMythUPnP *gmyth_upnp_new(GMythBackendInfo * gmyth_backend_info,
|
renatofilho@754
|
107 |
GMythUPnPDeviceListener handler);
|
rosfran@699
|
108 |
|
renatofilho@754
|
109 |
GList *gmyth_upnp_do_search_sync(GMythUPnP * gmyth_upnp);
|
rosfran@699
|
110 |
|
renatofilho@754
|
111 |
GMythBackendInfo *gmyth_upnp_get_backend_info(GMythUPnP * gmyth_upnp);
|
melunko@250
|
112 |
|
renatofilho@754
|
113 |
gchar *gmyth_upnp_device_status_to_string(GMythUPnPDeviceStatus
|
renatofilho@754
|
114 |
status);
|
rosfran@706
|
115 |
|
melunko@250
|
116 |
G_END_DECLS
|
renatofilho@754
|
117 |
#endif /* _GMYTH_UPNP_H_ */
|