summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-12-21 10:18:56 +0000
committerCarl Hetherington <cth@carlh.net>2016-12-21 10:18:56 +0000
commit85bca8926d7d6e7f01f0e1f0dd08471053874bd2 (patch)
treeedaf73ef8bb29aa3af2debad9729e55235d7026d /src/lib/util.cc
parentb2a2de40b0fbba16da9f863512ed227d4a9237ad (diff)
Make "Add folder..." to accept a directory of WAV files (#942).
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 4eba58e05..3f0c34a15 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -558,6 +558,18 @@ valid_image_file (boost::filesystem::path f)
}
bool
+valid_sound_file (boost::filesystem::path f)
+{
+ if (boost::starts_with (f.leaf().string(), "._")) {
+ return false;
+ }
+
+ string ext = f.extension().string();
+ transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
+ return (ext == ".wav" || ext == ".mp3" || ext == ".aif" || ext == ".aiff");
+}
+
+bool
valid_j2k_file (boost::filesystem::path f)
{
string ext = f.extension().string();