diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-05-04 18:01:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-05-04 18:01:19 +0100 |
| commit | 9bb87e91c0930f16cf615cfc374089912440e5e0 (patch) | |
| tree | ad25f85cd9616d46a3af1aadbfb772a802af8319 /src/lib/playlist.cc | |
| parent | 8a1042b767e2604b0af4850dd69fd6a848fd6ffe (diff) | |
Add primitive description of what the playlist is doing. Add missing de-interleave of multi-channel audio sources.
Diffstat (limited to 'src/lib/playlist.cc')
| -rw-r--r-- | src/lib/playlist.cc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 63b44f9d6..6913874b9 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -30,12 +30,15 @@ #include "imagemagick_content.h" #include "job.h" +#include "i18n.h" + using std::list; using std::cout; using std::vector; using std::min; using std::max; using std::string; +using std::stringstream; using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; @@ -427,3 +430,51 @@ Playlist::has_subtitles () const return !fc->subtitle_streams().empty(); } + +string +Playlist::description () const +{ + stringstream s; + + if (_video.empty ()) { + s << _("There is no video.") << "\n"; + } else { + s << _("Video will come from "); + list<shared_ptr<const VideoContent> >::const_iterator i = _video.begin(); + while (i != _video.end ()) { + s << (*i)->file().filename().string(); + ++i; + if (i != _video.end ()) { + s << ", "; + } + } + if (_video.size() > 1) { + s << " " << _("in sequence."); + } + s << "\n"; + } + + if (_audio.empty ()) { + s << _("There is no audio.") << "\n"; + } else { + if (_audio_from == AUDIO_FFMPEG) { + s << _("Audio will come from the video files.") << "\n"; + } else { + s << _("Audio will come from "); + list<shared_ptr<const AudioContent> >::const_iterator i = _audio.begin(); + while (i != _audio.end ()) { + s << (*i)->file().filename().string(); + ++i; + if (i != _audio.end ()) { + s << ", "; + } + } + if (_audio.size() > 1) { + s << _(" run simultaneously."); + } + s << "\n"; + } + } + + return s.str (); +} |
