1
/*
2
 * Copyright 2008-2011 Various Authors
3
 * Copyright 2005 Timo Hirvonen
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License as
7
 * published by the Free Software Foundation; either version 2 of the
8
 * License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful, but
11
 * WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
#ifndef _INPUT_H
20
#define _INPUT_H
21
22
#include "keyval.h"
23
#include "sf.h"
24
#include "channelmap.h"
25
26
struct input_plugin;
27
28
void ip_load_plugins(void);
29
30
/*
31
 * allocates new struct input_plugin.
32
 * never fails. does not check if the file is really playable
33
 */
34
struct input_plugin *ip_new(const char *filename);
35
36
/*
37
 * frees struct input_plugin closing it first if necessary
38
 */
39
void ip_delete(struct input_plugin *ip);
40
41
/*
42
 * errors: IP_ERROR_{ERRNO, FILE_FORMAT, SAMPLE_FORMAT}
43
 */
44
int ip_open(struct input_plugin *ip);
45
46
void ip_setup(struct input_plugin *ip);
47
48
/*
49
 * errors: none?
50
 */
51
int ip_close(struct input_plugin *ip);
52
53
/*
54
 * errors: IP_ERROR_{ERRNO, FILE_FORMAT}
55
 */
56
int ip_read(struct input_plugin *ip, char *buffer, int count);
57
58
/*
59
 * errors: IP_ERROR_{FUNCTION_NOT_SUPPORTED}
60
 */
61
int ip_seek(struct input_plugin *ip, double offset);
62
63
/*
64
 * errors: IP_ERROR_{ERRNO}
65
 */
66
int ip_read_comments(struct input_plugin *ip, struct keyval **comments);
67
68
int ip_duration(struct input_plugin *ip);
69
int ip_bitrate(struct input_plugin *ip);
70
int ip_current_bitrate(struct input_plugin *ip);
71
char *ip_codec(struct input_plugin *ip);
72
char *ip_codec_profile(struct input_plugin *ip);
73
74
sample_format_t ip_get_sf(struct input_plugin *ip);
75
void ip_get_channel_map(struct input_plugin *ip, channel_position_t *channel_map);
76
const char *ip_get_filename(struct input_plugin *ip);
77
const char *ip_get_metadata(struct input_plugin *ip);
78
int ip_is_remote(struct input_plugin *ip);
79
int ip_metadata_changed(struct input_plugin *ip);
80
int ip_eof(struct input_plugin *ip);
81
void ip_add_options(void);
82
char *ip_get_error_msg(struct input_plugin *ip, int rc, const char *arg);
83
char **ip_get_supported_extensions(void);
84
void ip_dump_plugins(void);
85
86
#endif