[Phonon][Patch] add a method to get the current frame number
Matthias Kretz
kretz at kde.org
Sat Mar 29 11:15:04 GMT 2008
On Friday 28 March 2008, Tanguy Krotoff wrote:
> On Thu, Mar 20, 2008 at 7:40 PM, Matthias Kretz <kretz at kde.org> wrote:
> > Perhaps it should be called currentVideoFrame() since there are also
> > audio frames (just 48000 per second instead of ~25). And I omitted
> > "Number" to not make the function name too long.
>
> I think term Number is good since currentVideoFrame() can "mean" something
> else like:
> qint64 videoFrameId = obj->currentVideoFrame();
> or
> VideoFrame videoFrame = obj->currentVideoFrame();
> videoFrame->size();
>
> Why not Nb?
> Number is used by Qt API, not Nb
> cf http://doc.trolltech.com/main-snapshot/functions.html
>
> > Other functions that could be added later are:
> > qint64 videoFrameCount()
> > void seekToVideoFrame(qint64)
>
> seekToVideoFrameNumber()
> to make it symmetric, even a longer name :/
The rule is to not use abreviations in class/function names. And with 'Number'
it really gets long. More general idea:
enum Timecode
{
SmpteTimecode,
VideoFrameNumber,
AudioFrameNumber,
Microseconds,
Milliseconds,
Seconds
};
ok, that's pushing it a bit, but I just tried to come up with a little more
than two entries :-)
class MediaObject
{
...
<some type> currentTime(Timecode) const;
<some type> totalTime(Timecode) const;
void seek(Timecode, <some type>);
<some type> convertTimecodeTo(Timecode, <some type>);
...
};
Where <some type> could either be quint64, QVariant or a more
specialized/simple class (don't know SMPTE well enough).
--
________________________________________________________
Matthias Kretz (Germany) <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20080329/a49ae704/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia
More information about the kde-multimedia
mailing list