<div class="gmail_quote">On Tue, Jun 29, 2010 at 11:45 PM, Martin Sandsmark <span dir="ltr"><<a href="mailto:sandsmark@samfundet.no" target="_blank">sandsmark@samfundet.no</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div style="font-family: 'Droid Sans Mono Slashed'; font-size: 9pt; font-weight: 400; font-style: normal;"><div>
<p style="margin: 0px; text-indent: 0px;">On Tuesday 29 June 2010 22:59:13 Ian Monroe wrote:</p>
<p style="margin: 0px; text-indent: 0px;">> setAutoDetectSubtitles should be setAutoDetectSubtitle I think. Or all</p>
<p style="margin: 0px; text-indent: 0px;">> the API should say "subtitles".</p>
<p style="margin: 0px; text-indent: 0px;"></p>
</div><p style="margin: 0px; text-indent: 0px;">Well, setAutoDetectSubtitles might possibly detect several possible subtitles, no?</p></div></blockquote><div><br>Usually works as follow: if the player detects a subtitle file that matches the video filename, then this subtitle file is loader automatically. Several possible subtitles means the user still must choose the right subtitle.<br>

<br>This feature can be very easily coded outside phonon (using QDir::entryList() + MediaController::setCurrentSubtitle()). If you add these functions to Phonon then all the backends should implement them. Kind of complete/complex API vs small/simple for me.<br>

<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="font-family: 'Droid Sans Mono Slashed'; font-size: 9pt; font-weight: 400; font-style: normal;">

<div>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">> I'm worried that setSubtitleEncoding is a bit Xine-specific. But text</p>
<p style="margin: 0px; text-indent: 0px;">> codecs suck, so perhaps there's no way around it.</p>
<p style="margin: 0px; text-indent: 0px;"></p>
</div><p style="margin: 0px; text-indent: 0px;">I can't find any libvlc API to specify it either, but I think it might warrant an addition.</p></div></blockquote><div><br>I don't remember MPlayer offering this feature.<br clear="all">

</div></div><br><br>About setFileSubtitle(const MediaSource &subtitle), I already use setCurrentSubtitle(const Phonon::SubtitleDescription &stream) to load a subtitle file:<br>
<br>QHash<QByteArray, QVariant> properties;<br>properties.insert("type", "file");<br>properties.insert("name", fileName);<br>Phonon::SubtitleDescription newSubtitle(newSubtitleId, properties);<br>

mediaController->setCurrentSubtitle(newSubtitle);<br><br>Later on inside the backend I read Phonon::SubtitleDescription, find the type and name and load the subtitle. "name" matching a fileName and "type" specifying a file is not normalized/documented.<br>
One could imagine to overload setCurrentsSubtitle with parameter MediaSource and let it build the right SubtitleDescription then no new function is added to the API. This would give something like this:<br><br>void setCurrentsSubtitle(const MediaSource & media) {<br>
  QHash<QByteArray, QVariant> properties;<br><br>  switch (media.type()) {<br>    case MediaSource::Url:<br>      properties.insert("type", "url");<br>      break;<br>    case MediaSource::File:<br>
      properties.insert("type", "file");<br>      break;<br>    [...]<br>  }<br><br>  properties.insert("name", media.fileName());<br>  Phonon::SubtitleDescription newSubtitle(newSubtitleId, properties);<br>
  setCurrentSubtitle(newSubtitle);<br>}<br><br><br>A long time ago I proposed a patch to uniformize the API inside MediaController.<br>If setCurrentSubtitle() takes a Phonon::SubtitleDescription, then setCurrentChapter() should take a Phonon::ChapterDescription, setCurrentTitle() a Phonon::TitleDescription ect...<br>
This gives more flexibility.<br>
See <a href="http://mail.kde.org/pipermail/phonon-backends/2008-April/000194.html">http://mail.kde.org/pipermail/phonon-backends/2008-April/000194.html</a><br>Unfortunately this patch breaks binary compatibility and needs to be reworked.<br>
<br>Regards,<br><br>-- <br>Tanguy Krotoff <<a href="mailto:tkrotoff@gmail.com" target="_blank">tkrotoff@gmail.com</a>><br>+33 6 68 42 70 24<br>