diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-12-21 10:18:56 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-12-21 10:18:56 +0000 |
| commit | 85bca8926d7d6e7f01f0e1f0dd08471053874bd2 (patch) | |
| tree | edaf73ef8bb29aa3af2debad9729e55235d7026d /src/lib/util.cc | |
| parent | b2a2de40b0fbba16da9f863512ed227d4a9237ad (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.cc | 12 |
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(); |
