diff general/fileutils/music_files.m @ 4:e44f49929e56

Adding reorganised general toolbox, now in several subdirectories.
author samer
date Sat, 12 Jan 2013 19:21:22 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/general/fileutils/music_files.m	Sat Jan 12 19:21:22 2013 +0000
@@ -0,0 +1,15 @@
+% music_files - search for audio files under music directory
+%
+% music_files :: 
+%    string ~'Path based at ~/Music'
+%    options {
+%       pattern :: string/'*' ~'filename matching patter';
+%       rec     :: bool/0     ~'recurse into subdirs?'
+%    }
+% -> cells {string}.
+%
+% This function assumes that the HOME environment variable points to the
+% user's home directory and that there exists there a directory called 'Music'.
+
+function L=music_files(d,varargin)
+	L=listfiles([getenv('HOME'),filesep,'Music',filesep,d],'regexp','.*\.(mp3|ogg|m4a|wav|au|flac)',varargin{:});