Subtitle API

Ian Monroe ian at monroe.nu
Wed Jun 30 23:18:27 BST 2010


On Wed, Jun 30, 2010 at 5:01 PM, Tanguy Krotoff <tkrotoff at gmail.com> wrote:
> On Wed, Jun 30, 2010 at 2:08 AM, Ian Monroe <ian at monroe.nu> wrote:
>> Good point I completely forgot that we already have a subtitle API.
>
> Probably better to rework/clarify current API before to add new functions
> that will complexify phonon :)
>
>> Which is funny since I think I wrote it. So I'm concerned with how
>> these two APIs will interact. Does the subtitle get added to the
>> available subtitles?
>
> I didn't get your question.

MediaController::currentSubtitle() and availableSubtitles() need to do
something reasonable when you have a subtitle loaded from an external
file.

> To sum up here is a diagram of current Phonon subtitle API and the way it is
> used by phonon-mplayer:
> http://gitorious.org/phonon/phonon-mplayer/blobs/raw/master/mplayer/doc/phonon-subtitles.png
>
> About setSubtitleEncoding, I checked MPlayer documentation and there is a
> parameter to specify this. Btw the specification seems to be unclear cf
> http://lists.mplayerhq.hu/pipermail/mplayer-docs/2004-May/001541.html
>
> If we want to be able to change subtitle encoding, I think a separated
> function setSubtitleEncoding() is probably a bad idea. It should be a
> parameter to setSubtitleFile() instead otherwise this won't work:
> [...]
> setSubtitleFIle()
> setSubtitleEncoding()
> [...]
> Or you need to re-read the subtitle inside the function
> setSubtitleEncoding().
>
> On the other hand a function like setSubtitleFont() can be separated since
> it won't require to re-read the subtitle.

mplayer is such a strange backend since it uses IPC not a library, I'm
not sure if we should take much stock in what works with it. Having
setSubtitleEncoding separate supports the use case of a user changing
the encoding from a menu item after loading the subtitle, which seems
reasonable.

Ian



More information about the kde-multimedia mailing list