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