| 1 | /* |
| 2 | * Copyright (c) 2015 Moritz Grimm <[email protected]> |
| 3 | * |
| 4 | * Permission to use, copy, modify, and distribute this software for any |
| 5 | * purpose with or without fee is hereby granted, provided that the above |
| 6 | * copyright notice and this permission notice appear in all copies. |
| 7 | * |
| 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 15 | */ |
| 16 | |
| 17 | #ifndef __STREAM_H__ |
| 18 | #define __STREAM_H__ |
| 19 | |
| 20 | #include <shout/shout.h> |
| 21 | |
| 22 | #include "cfg.h" |
| 23 | #include "mdata.h" |
| 24 | |
| 25 | typedef struct stream * stream_t; |
| 26 | |
| 27 | int stream_init(void); |
| 28 | void stream_exit(void); |
| 29 | |
| 30 | stream_t |
| 31 | stream_create(const char *); |
| 32 | void stream_destroy(stream_t *); |
| 33 | int stream_configure(stream_t); |
| 34 | |
| 35 | int stream_set_metadata(stream_t, mdata_t, char **); |
| 36 | |
| 37 | const char * |
| 38 | stream_get_name(stream_t); |
| 39 | int stream_get_connected(stream_t); |
| 40 | cfg_stream_t |
| 41 | stream_get_cfg_stream(stream_t); |
| 42 | cfg_intake_t |
| 43 | stream_get_cfg_intake(stream_t); |
| 44 | cfg_server_t |
| 45 | stream_get_cfg_server(stream_t); |
| 46 | |
| 47 | int stream_connect(stream_t); |
| 48 | void stream_disconnect(stream_t); |
| 49 | void stream_sync(stream_t); |
| 50 | int stream_send(stream_t, const char *, size_t); |
| 51 | |
| 52 | #endif /* __STREAM_H__ */ |