QTKit: QTMovieTimeDidChangeNotification

  • Hi all,

    can anybody tell me, when QTMovieTimeDidChangeNotification is fired? I
    was hoping it will be posted, when the timecode of a movie is changed,
    that is as a new frame is being displayed but that doesn't seem to be
    the case.

    Is there another way (*except using the callback mechanism in the
    standard quicktime controller*) to be notified of a movie's progress?
    Also, I'd prefer not to use an NSTimer as that will fire even when the
    movie's not playing.

    The reason for my asking is that I need to display the movie's current
    time (plus a certain offset) in a text field.

    Thanks

    chris
  • > can anybody tell me, when QTMovieTimeDidChangeNotification is fired? I
    > was hoping it will be posted, when the timecode of a movie is changed,
    > that is as a new frame is being displayed but that doesn't seem to be
    > the case.

    As a rule of thumb: not when you would expect. For instance if you
    have a movie, a selection, "plays selection only" and you play the
    notification will be sent *before* any frame is displayed. If you ask
    the movie for its current time upon receiving the notification you'll
    see that it has not changed! Seems pretty useless as it is now, if
    we're not mistaken.

    > Is there another way (*except using the callback mechanism in the
    > standard quicktime controller*) to be notified of a movie's progress?
    > Also, I'd prefer not to use an NSTimer as that will fire even when the
    > movie's not playing.

    We ended up using a Timer. You can always start and stop your timer.

    marco

    Marco Scheurer
    Sen:te, Lausanne, Switzerland  http://www.sente.ch
  • Marco,

    thanks for your answer.

    I reverted to using the callback mechanism in QT's movie controller
    which actually is pretty straight forward. If anybody's interested in
    the code, mail me.

    chris

    On 5/11/05, Marco Scheurer <marco...> wrote:
    >> can anybody tell me, when QTMovieTimeDidChangeNotification is fired? I
    >> was hoping it will be posted, when the timecode of a movie is changed,
    >> that is as a new frame is being displayed but that doesn't seem to be
    >> the case.
    >
    > As a rule of thumb: not when you would expect. For instance if you
    > have a movie, a selection, "plays selection only" and you play the
    > notification will be sent *before* any frame is displayed. If you ask
    > the movie for its current time upon receiving the notification you'll
    > see that it has not changed! Seems pretty useless as it is now, if
    > we're not mistaken.
    >
    >> Is there another way (*except using the callback mechanism in the
    >> standard quicktime controller*) to be notified of a movie's progress?
    >> Also, I'd prefer not to use an NSTimer as that will fire even when the
    >> movie's not playing.
    >
    > We ended up using a Timer. You can always start and stop your timer.
    >
    > marco
    >
    >
    > Marco Scheurer
    > Sen:te, Lausanne, Switzerland  http://www.sente.ch
    >
    >
  • On May 11, 2005, at 10:25 AM, Christian Schneider wrote:

    > can anybody tell me, when QTMovieTimeDidChangeNotification is fired? I
    > was hoping it will be posted, when the timecode of a movie is changed,
    > that is as a new frame is being displayed but that doesn't seem to be
    > the case.
    >
    > Is there another way (*except using the callback mechanism in the
    > standard quicktime controller*) to be notified of a movie's progress?
    > Also, I'd prefer not to use an NSTimer as that will fire even when the
    > movie's not playing.
    >
    > The reason for my asking is that I need to display the movie's current
    > time (plus a certain offset) in a text field.

    Sorry to take so long to answer this; the
    QTMovieTimeDidChangeNotification is fired whenever the movie time
    changes to a time ***other than what it would be during normal
    playback***. So it's not fired every frame. Some examples are: the user
    clicks in the movie controller bar to change the movie time, or a wired
    action changes the movie time.

    I think an NSTimer is the solution you are looking for.

    I'll make sure the documentation is updated to reflect this more
    refined notion of time-did-change.

    HTH,

    Tim Monroe
    QuickTime Engineering
    <monroe...>
  • On 5/16/05, Tim Monroe <timmon...> wrote:
    >
    > On May 11, 2005, at 10:25 AM, Christian Schneider wrote:
    >
    >>
    >> The reason for my asking is that I need to display the movie's current
    >> time (plus a certain offset) in a text field.
    >
    > Sorry to take so long to answer this; the
    > QTMovieTimeDidChangeNotification is fired whenever the movie time
    > changes to a time ***other than what it would be during normal
    > playback***. So it's not fired every frame. Some examples are: the user
    > clicks in the movie controller bar to change the movie time, or a wired
    > action changes the movie time.
    >

    Thanks for clearing that up.

    > I think an NSTimer is the solution you are looking for.
    >

    Really? I am quite happy with the movie controller's callbacks. Is
    there any reason not to use those?

    chris
previous month may 2005 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today
MindNode
MindNode offered a free license !