Handle streams separately in tree_add_track()
[cmus.git] / input.h
blobe391f44d1f16cfade01a949ed96300ecee7e6f5b
1 /*
2 * Copyright 2005 Timo Hirvonen
3 */
5 #ifndef _INPUT_H
6 #define _INPUT_H
8 #include "comment.h"
9 #include "sf.h"
11 struct input_plugin;
13 void ip_load_plugins(void);
16 * allocates new struct input_plugin.
17 * never fails. does not check if the file is really playable
19 struct input_plugin *ip_new(const char *filename);
22 * frees struct input_plugin closing it first if necessary
24 void ip_delete(struct input_plugin *ip);
27 * errors: IP_ERROR_{ERRNO, FILE_FORMAT, SAMPLE_FORMAT}
29 int ip_open(struct input_plugin *ip);
31 void ip_setup(struct input_plugin *ip);
34 * errors: none?
36 int ip_close(struct input_plugin *ip);
39 * errors: IP_ERROR_{ERRNO, FILE_FORMAT}
41 int ip_read(struct input_plugin *ip, char *buffer, int count);
44 * errors: IP_ERROR_{FUNCTION_NOT_SUPPORTED}
46 int ip_seek(struct input_plugin *ip, double offset);
49 * errors: IP_ERROR_{ERRNO}
51 int ip_read_comments(struct input_plugin *ip, struct keyval **comments);
53 int ip_duration(struct input_plugin *ip);
55 sample_format_t ip_get_sf(struct input_plugin *ip);
56 const char *ip_get_filename(struct input_plugin *ip);
57 const char *ip_get_metadata(struct input_plugin *ip);
58 int ip_is_remote(struct input_plugin *ip);
59 int ip_metadata_changed(struct input_plugin *ip);
60 int ip_eof(struct input_plugin *ip);
61 char *ip_get_error_msg(struct input_plugin *ip, int rc, const char *arg);
62 char **ip_get_supported_extensions(void);
63 void ip_dump_plugins(void);
65 #endif