Allow adding of content.
[dcpomatic.git] / src / lib / sndfile_content.cc
1 #include "sndfile_content.h"
2 #include "compose.hpp"
3
4 #include "i18n.h"
5
6 using namespace std;
7
8 SndfileContent::SndfileContent (boost::filesystem::path f)
9         : Content (f)
10         , AudioContent (f)
11 {
12
13 }
14
15 string
16 SndfileContent::summary () const
17 {
18         return String::compose (_("Sound file: %1"), file().filename ());
19 }
20
21 int
22 SndfileContent::audio_channels () const
23 {
24         /* XXX */
25         return 0;
26 }
27
28 ContentAudioFrame
29 SndfileContent::audio_length () const
30 {
31         /* XXX */
32         return 0;
33 }
34
35 int
36 SndfileContent::audio_frame_rate () const
37 {
38         /* XXX */
39         return 0;
40 }
41
42 int64_t
43 SndfileContent::audio_channel_layout () const
44 {
45         /* XXX */
46         return 0;
47 }
48         
49
50 bool
51 SndfileContent::valid_file (boost::filesystem::path f)
52 {
53         /* XXX: more extensions */
54         string ext = f.extension().string();
55         transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
56         return (ext == ".wav" || ext == ".aif" || ext == ".aiff");
57 }