Allow adding of content.
[dcpomatic.git] / src / lib / sndfile_content.cc
index 8f5b2890170dc5e1b8dc2879664978d7982ceade..53df4deeacda2ea12d7fa127d80d39c3ac61f4e1 100644 (file)
@@ -5,6 +5,13 @@
 
 using namespace std;
 
+SndfileContent::SndfileContent (boost::filesystem::path f)
+       : Content (f)
+       , AudioContent (f)
+{
+
+}
+
 string
 SndfileContent::summary () const
 {
@@ -39,3 +46,12 @@ SndfileContent::audio_channel_layout () const
        return 0;
 }
        
+
+bool
+SndfileContent::valid_file (boost::filesystem::path f)
+{
+       /* XXX: more extensions */
+       string ext = f.extension().string();
+       transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
+       return (ext == ".wav" || ext == ".aif" || ext == ".aiff");
+}