Add xterm-white.theme
[cmus.git] / track_info.h
blob9149dac640c97639ab98368c39b1ec0e0be311b3
1 /*
2 * Copyright 2004-2005 Timo Hirvonen
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 * 02111-1307, USA.
20 #ifndef _TRACK_INFO_H
21 #define _TRACK_INFO_H
23 #include <time.h>
25 struct track_info {
26 struct keyval *comments;
27 time_t mtime;
28 int duration;
29 int ref;
30 char filename[0];
33 #define TI_MATCH_ARTIST (1 << 0)
34 #define TI_MATCH_ALBUM (1 << 1)
35 #define TI_MATCH_TITLE (1 << 2)
37 /* initializes only filename and ref */
38 extern struct track_info *track_info_new(const char *filename);
40 extern void track_info_ref(struct track_info *ti);
41 extern void track_info_unref(struct track_info *ti);
44 * returns: 1 if @ti has any of the following tags: artist, album, title
45 * 0 otherwise
47 extern int track_info_has_tag(const struct track_info *ti);
50 * @flags: TI_MATCH_*
52 * returns: 1 if all words in @text are found to match defined fields (@flags) in @ti
53 * 0 otherwise
55 extern int track_info_matches(struct track_info *ti, const char *text, unsigned int flags);
57 #endif