diff options
author | Matti Lehtimäki <matti.lehtimaki@gmail.com> | 2013-01-07 21:29:45 +0200 |
---|---|---|
committer | Matti Lehtimäki <matti.lehtimaki@gmail.com> | 2013-01-07 21:29:45 +0200 |
commit | c6ffcc01aa82582b119de294ff40aac915c88e19 (patch) | |
tree | ac6881e6c72f9f2511bcbff7d5d29607a9ff9711 /tools.c | |
download | vdr-plugin-history-c6ffcc01aa82582b119de294ff40aac915c88e19.tar.gz vdr-plugin-history-c6ffcc01aa82582b119de294ff40aac915c88e19.tar.bz2 |
Initial commit. Version 0.0.3.v0.0.3
Diffstat (limited to 'tools.c')
-rwxr-xr-x | tools.c | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -0,0 +1,38 @@ +/* + * tools.c: History plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + */ + +#include "tools.h" + +// +// File type detection code adapted from RSS Reader plugin for VDR +// http://www.saunalahti.fi/~rahrenbe/vdr/rssreader/ +// by Rolf Ahrenberg +// + +bool isimage(const char *text) +{ + if (endswith(text, ".jpg") || endswith(text, ".gif") || endswith(text, ".png")) + return true; + return false; +} + +bool isvideo(const char *text) +{ + if (endswith(text, ".mpg") || endswith(text, ".avi") || endswith(text, ".ts") || + endswith(text, ".mkv") || endswith(text, ".flv") || endswith(text, ".wmv") || + endswith(text, ".mp4")) + return true; + return false; +} + +bool ismusic(const char *text) +{ + if (endswith(text, ".mp3") || endswith(text, ".wav") || endswith(text, ".ogg") || + endswith(text, ".flac")) + return true; + return false; +} |