string
Content::technical_summary () const
{
- return String::compose ("%1 %2 %3", path(), digest(), position());
+ return String::compose ("%1 %2 %3", path_summary(), digest(), position());
}
Time
signal_changed (ContentProperty::PATH);
}
-
+string
+Content::path_summary () const
+{
+ /* XXX: should handle multiple paths more gracefully */
+
+ string s = path(0).filename().string ();
+ if (number_of_paths() > 1) {
+ s += " ...";
+ }
+
+ return s;
+}
boost::shared_ptr<Content> clone () const;
void set_path (boost::filesystem::path);
-
- boost::filesystem::path path () const {
- boost::mutex::scoped_lock lm (_mutex);
- return _paths.front ();
- }
+
+ std::string path_summary () const;
size_t number_of_paths () const {
boost::mutex::scoped_lock lm (_mutex);
av_dict_set (&options, "probesize", lexical_cast<string> (5 * 60 * 1e6).c_str(), 0);
}
- if (avformat_open_input (&_format_context, _ffmpeg_content->path().string().c_str(), 0, &options) < 0) {
- throw OpenFileError (_ffmpeg_content->path().string ());
+ if (avformat_open_input (&_format_context, _ffmpeg_content->path(0).string().c_str(), 0, &options) < 0) {
+ throw OpenFileError (_ffmpeg_content->path(0).string ());
}
if (avformat_find_stream_info (_format_context, 0) < 0) {
FFmpegContent::summary () const
{
/* Get the string() here so that the name does not have quotes around it */
- return String::compose (_("%1 [movie]"), path().filename().string());
+ return String::compose (_("%1 [movie]"), path_summary ());
}
string
string
ImageContent::summary () const
{
+ string s = path_summary () + " ";
/* Get the string() here so that the name does not have quotes around it */
if (still ()) {
- return String::compose (_("%1 [still]"), path().filename().string());
+ s += _("[still]");
+ } else {
+ s += _("[moving images]");
}
- return String::compose (_("%1 [moving images]"), path().filename().string());
+ return s;
}
string
SndfileContent::summary () const
{
/* Get the string() here so that the name does not have quotes around it */
- return String::compose (_("%1 [audio]"), path().filename().string());
+ return String::compose (_("%1 [audio]"), path_summary ());
}
string
, _deinterleave_buffer (0)
{
_info.format = 0;
- _sndfile = sf_open (_sndfile_content->path().string().c_str(), SFM_READ, &_info);
+ _sndfile = sf_open (_sndfile_content->path(0).string().c_str(), SFM_READ, &_info);
if (!_sndfile) {
throw DecodeError (_("could not open audio file for reading"));
}
_content_changed_connection = _content->Changed.connect (bind (&AudioDialog::content_changed, this, _2));
- SetTitle (wxString::Format (_("DCP-o-matic audio - %s"), std_to_wx(_content->path().filename().string()).data()));
+ SetTitle (wxString::Format (_("DCP-o-matic audio - %s"), std_to_wx(_content->path_summary()).data()));
}
void
return;
}
- old_content->set_path (new_content->path ());
+ old_content->set_path (new_content->path (0));
}
ContentList content = film->content ();
int vob = 0;
for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
- if (boost::algorithm::starts_with ((*i)->path().filename().string(), "VTS_")) {
+ if (boost::algorithm::starts_with ((*i)->path(0).filename().string(), "VTS_")) {
++vob;
}
}
gc->StrokePath (path);
gc->FillPath (path);
- wxString name = wxString::Format (wxT ("%s [%s]"), std_to_wx (cont->path().filename().string()).data(), type().data());
+ wxString name = wxString::Format (wxT ("%s [%s]"), std_to_wx (cont->path_summary()).data(), type().data());
wxDouble name_width;
wxDouble name_height;
wxDouble name_descent;