[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-multimedia
Subject:    Re: [Phonon][Patch] add a method to get the current frame number
From:       "Sylvain \"Skarsnik\" Colinet" <scolinet () gmail ! com>
Date:       2008-03-29 12:35:59
Message-ID: 903bdef20803290535o2f76a84eu46571c905e659492 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sat, Mar 29, 2008 at 12:15 PM, Matthias Kretz <kretz@kde.org> wrote:

> On Friday 28 March 2008, Tanguy Krotoff wrote:
> > On Thu, Mar 20, 2008 at 7:40 PM, Matthias Kretz <kretz@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();
>

Yes that why I choose this long name


> > 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).
>
>
>
I like the enum idea.I will try to rewrite the pos thing like this. maybe a
setDefaultTimecode()
can be usefull?
For the binary compatibiliy prob, is there a document that explain thing to
do or not, to keep
compatibility?

Thanks for comment.

-- 
Sylvain "Skarsnik" Colinet

Victory was near but the power of the ring couldn't be undone

[Attachment #5 (text/html)]

On Sat, Mar 29, 2008 at 12:15 PM, Matthias Kretz &lt;<a \
href="mailto:kretz@kde.org">kretz@kde.org</a>&gt; wrote:<br><div \
class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid \
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div \
class="Ih2E3d">On Friday 28 March 2008, Tanguy Krotoff wrote:<br> &gt; On Thu, Mar \
20, 2008 at 7:40 PM, Matthias Kretz &lt;<a \
href="mailto:kretz@kde.org">kretz@kde.org</a>&gt; wrote:<br> &gt; &gt; &nbsp;Perhaps \
it should be called currentVideoFrame() since there are also<br> &gt; &gt; audio \
frames (just 48000 per second instead of ~25). And I omitted<br> &gt; &gt; \
&quot;Number&quot; to not make the function name too long.<br> &gt;<br>
&gt; I think term Number is good since currentVideoFrame() can &quot;mean&quot; \
something<br> &gt; else like:<br>
&gt; qint64 videoFrameId = obj-&gt;currentVideoFrame();<br>
&gt; or<br>
&gt; VideoFrame videoFrame = obj-&gt;currentVideoFrame();<br>
&gt; videoFrame-&gt;size();</div></blockquote><div><br>Yes that why I choose this \
long name<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 \
class="Ih2E3d"><br> &gt; Why not Nb?<br>
&gt; Number is used by Qt API, not Nb<br>
&gt; cf <a href="http://doc.trolltech.com/main-snapshot/functions.html" \
target="_blank">http://doc.trolltech.com/main-snapshot/functions.html</a><br> \
&gt;<br> &gt; &gt; &nbsp;Other functions that could be added later are:<br>
&gt; &gt; &nbsp;qint64 videoFrameCount()<br>
&gt; &gt; &nbsp;void seekToVideoFrame(qint64)<br>
&gt;<br>
&gt; seekToVideoFrameNumber()<br>
&gt; to make it symmetric, even a longer name :/<br>
<br>
</div>The rule is to not use abreviations in class/function names. And with \
&#39;Number&#39;<br> it really gets long. More general idea:<br>
<br>
enum Timecode<br>
{<br>
 &nbsp; &nbsp;SmpteTimecode,<br>
 &nbsp; &nbsp;VideoFrameNumber,<br>
 &nbsp; &nbsp;AudioFrameNumber,<br>
 &nbsp; &nbsp;Microseconds,<br>
 &nbsp; &nbsp;Milliseconds,<br>
 &nbsp; &nbsp;Seconds<br>
};<br>
<br>
ok, that&#39;s pushing it a bit, but I just tried to come up with a little more<br>
than two entries :-)<br>
<br>
class MediaObject<br>
{<br>
...<br>
 &nbsp; &nbsp;&lt;some type&gt; currentTime(Timecode) const;<br>
 &nbsp; &nbsp;&lt;some type&gt; totalTime(Timecode) const;<br>
 &nbsp; &nbsp;void seek(Timecode, &lt;some type&gt;);<br>
 &nbsp; &nbsp;&lt;some type&gt; convertTimecodeTo(Timecode, &lt;some type&gt;);<br>
...<br>
};<br>
<br>
Where &lt;some type&gt; could either be quint64, QVariant or a more<br>
specialized/simple class (don&#39;t know SMPTE well enough).<br>
<div><div></div><div class="Wj3C7c"><br><br></div></div></blockquote></div><br>I like \
the enum idea.I will try to rewrite the pos thing like this. maybe a \
setDefaultTimecode()<br>can be usefull?<br>For the binary compatibiliy prob, is there \
a document that explain thing to do or not, to keep<br> compatibility?<br><br>Thanks \
for comment.<br clear="all"><br>-- <br>Sylvain &quot;Skarsnik&quot; \
Colinet<br><br>Victory was near but the power of the ring couldn&#39;t be undone



_______________________________________________
kde-multimedia mailing list
kde-multimedia@kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic