]> granicus.if.org Git - python/commitdiff
Added a method GetMediaNextInterestingTimeOnly, which is like GetMediaNextInteresting...
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 17 Mar 2000 16:49:59 +0000 (16:49 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 17 Mar 2000 16:49:59 +0000 (16:49 +0000)
Mac/Modules/qt/Qtmodule.c
Mac/Modules/qt/qtsupport.py

index d374b45a40d75249292d4a5c7b51fafca766c915..a03286e49a6d81415d1d21732b6c0f11d68c2479 100644 (file)
@@ -64,6 +64,9 @@ staticforward int MovieCtlObj_Convert(PyObject *, TimeBase *);
 staticforward PyObject *TimeBaseObj_New(TimeBase);
 staticforward int TimeBaseObj_Convert(PyObject *, TimeBase *);
 
+/* Macro to allow us to GetNextInterestingTime without duration */
+#define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv)                  GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL)
+                       
 /*
 ** Parse/generate time records
 */
@@ -2746,6 +2749,30 @@ static PyObject *MediaObj_GetMediaPlayHints(_self, _args)
        return _res;
 }
 
+static PyObject *MediaObj_GetMediaNextInterestingTimeOnly(_self, _args)
+       MediaObject *_self;
+       PyObject *_args;
+{
+       PyObject *_res = NULL;
+       short interestingTimeFlags;
+       TimeValue time;
+       Fixed rate;
+       TimeValue interestingTime;
+       if (!PyArg_ParseTuple(_args, "hlO&",
+                             &interestingTimeFlags,
+                             &time,
+                             PyMac_GetFixed, &rate))
+               return NULL;
+       GetMediaNextInterestingTimeOnly(_self->ob_itself,
+                                       interestingTimeFlags,
+                                       time,
+                                       rate,
+                                       &interestingTime);
+       _res = Py_BuildValue("l",
+                            interestingTime);
+       return _res;
+}
+
 static PyMethodDef MediaObj_methods[] = {
        {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
         "(TimeValue time, TimeValue duration, long flags) -> None"},
@@ -2837,6 +2864,8 @@ static PyMethodDef MediaObj_methods[] = {
         "(long flags, long flagsMask) -> None"},
        {"GetMediaPlayHints", (PyCFunction)MediaObj_GetMediaPlayHints, 1,
         "() -> (long flags)"},
+       {"GetMediaNextInterestingTimeOnly", (PyCFunction)MediaObj_GetMediaNextInterestingTimeOnly, 1,
+        "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime)"},
        {NULL, NULL, 0}
 };
 
index f4186f7a1038fb1366465787efca4e080ac1f731..9bf3ec71cda9f05054e96f71f2b487776f030a69 100644 (file)
@@ -46,6 +46,10 @@ staticforward int MovieCtlObj_Convert(PyObject *, TimeBase *);
 staticforward PyObject *TimeBaseObj_New(TimeBase);
 staticforward int TimeBaseObj_Convert(PyObject *, TimeBase *);
 
+/* Macro to allow us to GetNextInterestingTime without duration */
+#define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) \
+                       GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL)
+                       
 /*
 ** Parse/generate time records
 */
@@ -261,6 +265,15 @@ f = Function(void, 'MoviesTask',
 )
 functions.append(f)
 
+# And we want a GetMediaNextInterestingTime without duration
+f = Method(void, 'GetMediaNextInterestingTimeOnly',
+    (Media, 'theMedia', InMode),
+    (short, 'interestingTimeFlags', InMode),
+    (TimeValue, 'time', InMode),
+    (Fixed, 'rate', InMode),
+    (TimeValue, 'interestingTime', OutMode),
+)
+Media_methods.append(f)
 
 # add the populated lists to the generator groups
 # (in a different wordl the scan program would generate this)