summaryrefslogtreecommitdiff
path: root/libdleyna/renderer/upnp.h
blob: a6ea54ca77e9df76979930220c1cf4b0095cb17c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
 * dLeyna
 *
 * Copyright (C) 2012-2017 Intel Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU Lesser General Public License,
 * version 2.1, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Mark Ryan <mark.d.ryan@intel.com>
 *
 */

#ifndef DLR_UPNP_H__
#define DLR_UPNP_H__

#include <libgupnp/gupnp-context-manager.h>
#include <libdleyna/core/connector.h>

#include "server.h"
#include "task.h"

enum dlr_interface_type_ {
	DLR_INTERFACE_INFO_PROPERTIES,
	DLR_INTERFACE_INFO_ROOT,
	DLR_INTERFACE_INFO_PLAYER,
	DLR_INTERFACE_INFO_PUSH_HOST,
	DLR_INTERFACE_INFO_DEVICE,
	DLR_INTERFACE_INFO_MAX
};

typedef void (*dlr_upnp_callback_t)(const gchar *path);
typedef void (*dlr_upnp_task_complete_t)(dlr_task_t *task, GError *error);

dlr_upnp_t *dlr_upnp_new(dleyna_connector_id_t connection,
			 uint port,
			 uint push_host_port,
			 const dleyna_connector_dispatch_cb_t *dispatch_table,
			 dlr_upnp_callback_t found_server,
			 dlr_upnp_callback_t lost_server);

void dlr_upnp_delete(dlr_upnp_t *upnp);

GVariant *dlr_upnp_get_server_ids(dlr_upnp_t *upnp);

GHashTable *dlr_upnp_get_server_udn_map(dlr_upnp_t *upnp);

void dlr_upnp_set_prop(dlr_upnp_t *upnp, dlr_task_t *task,
		       dlr_upnp_task_complete_t cb);

void dlr_upnp_get_prop(dlr_upnp_t *upnp, dlr_task_t *task,
		       dlr_upnp_task_complete_t cb);

void dlr_upnp_get_all_props(dlr_upnp_t *upnp, dlr_task_t *task,
			    dlr_upnp_task_complete_t cb);

void dlr_upnp_play(dlr_upnp_t *upnp, dlr_task_t *task,
		   dlr_upnp_task_complete_t cb);

void dlr_upnp_pause(dlr_upnp_t *upnp, dlr_task_t *task,
		    dlr_upnp_task_complete_t cb);

void dlr_upnp_play_pause(dlr_upnp_t *upnp, dlr_task_t *task,
			 dlr_upnp_task_complete_t cb);

void dlr_upnp_stop(dlr_upnp_t *upnp, dlr_task_t *task,
		   dlr_upnp_task_complete_t cb);

void dlr_upnp_next(dlr_upnp_t *upnp, dlr_task_t *task,
		   dlr_upnp_task_complete_t cb);

void dlr_upnp_previous(dlr_upnp_t *upnp, dlr_task_t *task,
		       dlr_upnp_task_complete_t cb);

void dlr_upnp_open_uri(dlr_upnp_t *upnp, dlr_task_t *task,
		       dlr_upnp_task_complete_t cb);

void dlr_upnp_seek(dlr_upnp_t *upnp, dlr_task_t *task,
		   dlr_upnp_task_complete_t cb);

void dlr_upnp_set_position(dlr_upnp_t *upnp, dlr_task_t *task,
			   dlr_upnp_task_complete_t cb);

void dlr_upnp_goto_track(dlr_upnp_t *upnp, dlr_task_t *task,
			 dlr_upnp_task_complete_t cb);

void dlr_upnp_host_uri(dlr_upnp_t *upnp, dlr_task_t *task,
		       dlr_upnp_task_complete_t cb);

void dlr_upnp_remove_uri(dlr_upnp_t *upnp, dlr_task_t *task,
			 dlr_upnp_task_complete_t cb);

void dlr_upnp_get_icon(dlr_upnp_t *upnp, dlr_task_t *task,
		       dlr_upnp_task_complete_t cb);

void dlr_upnp_lost_client(dlr_upnp_t *upnp, const gchar *client_name);

void dlr_upnp_unsubscribe(dlr_upnp_t *upnp);

void dlr_upnp_rescan(dlr_upnp_t *upnp);

GUPnPContextManager *dlr_upnp_get_context_manager(dlr_upnp_t *upnp);

#endif /* DLR_UPNP_H__ */