Fix build break for rpm
[framework/connectivity/bluez.git] / audio / source.h
1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2006-2010  Nokia Corporation
6  *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
7  *  Copyright (C) 2009  Joao Paulo Rechi Vita
8  *
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the Free Software
22  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23  *
24  */
25
26 #define AUDIO_SOURCE_INTERFACE "org.bluez.AudioSource"
27
28 typedef enum {
29         SOURCE_STATE_DISCONNECTED,
30         SOURCE_STATE_CONNECTING,
31         SOURCE_STATE_CONNECTED,
32         SOURCE_STATE_PLAYING,
33 } source_state_t;
34
35 typedef void (*source_state_cb) (struct audio_device *dev,
36                                 source_state_t old_state,
37                                 source_state_t new_state,
38                                 void *user_data);
39
40 unsigned int source_add_state_cb(source_state_cb cb, void *user_data);
41 gboolean source_remove_state_cb(unsigned int id);
42
43 struct source *source_init(struct audio_device *dev);
44 void source_unregister(struct audio_device *dev);
45 gboolean source_is_active(struct audio_device *dev);
46 source_state_t source_get_state(struct audio_device *dev);
47 gboolean source_new_stream(struct audio_device *dev, struct avdtp *session,
48                                 struct avdtp_stream *stream);
49 gboolean source_setup_stream(struct source *source, struct avdtp *session);
50 gboolean source_shutdown(struct source *source);