- int channels = 0;
-
- switch (_audio_from) {
- case AUDIO_FFMPEG:
- /* FFmpeg audio is sequential, so use the maximum channel count */
- for (list<shared_ptr<const AudioContent> >::const_iterator i = _audio.begin(); i != _audio.end(); ++i) {
- channels = max (channels, (*i)->audio_channels ());
- }
- break;
- case AUDIO_SNDFILE:
- /* Sndfile audio is simultaneous, so it's the sum of the channel counts */
- for (list<shared_ptr<const AudioContent> >::const_iterator i = _audio.begin(); i != _audio.end(); ++i) {
- channels += (*i)->audio_channels ();
+ list<shared_ptr<cxml::Node> > c = node->node_children ("Content");
+ for (list<shared_ptr<cxml::Node> >::iterator i = c.begin(); i != c.end(); ++i) {
+ string const type = (*i)->string_child ("Type");
+
+ boost::shared_ptr<Content> content;
+
+ if (type == "FFmpeg") {
+ content.reset (new FFmpegContent (film, *i));
+ } else if (type == "ImageMagick") {
+ content.reset (new ImageMagickContent (film, *i));
+ } else if (type == "Sndfile") {
+ content.reset (new SndfileContent (film, *i));