summaryrefslogtreecommitdiff
path: root/src/lib/sndfile_content.cc
blob: 4794e4d3193e7f267e76b8f98917f3ed7d00dbb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "sndfile_content.h"
#include "compose.hpp"

#include "i18n.h"

using std::string;
using boost::shared_ptr;

SndfileContent::SndfileContent (boost::filesystem::path f)
	: Content (f)
	, AudioContent (f)
{

}

SndfileContent::SndfileContent (shared_ptr<const cxml::Node> node)
	: Content (node)
	, AudioContent (node)
		   
{

}

string
SndfileContent::summary () const
{
	return String::compose (_("Sound file: %1"), file().filename ());
}

int
SndfileContent::audio_channels () const
{
	/* XXX */
	return 0;
}

ContentAudioFrame
SndfileContent::audio_length () const
{
	/* XXX */
	return 0;
}

int
SndfileContent::audio_frame_rate () const
{
	/* XXX */
	return 0;
}

int64_t
SndfileContent::audio_channel_layout () const
{
	/* XXX */
	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");
}