summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-03-17 16:49:59 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-03-17 16:49:59 (GMT)
commitc59996e6b1c8bd7b5f055b58610177d87a192a25 (patch)
tree7d8eff50101e19ebfd65cd881f4a81b7430ed2bd /Mac
parent19660049864fcf363b640c15f29d15c1e9ce36ab (diff)
downloadcpython-c59996e6b1c8bd7b5f055b58610177d87a192a25.zip
cpython-c59996e6b1c8bd7b5f055b58610177d87a192a25.tar.gz
cpython-c59996e6b1c8bd7b5f055b58610177d87a192a25.tar.bz2
Added a method GetMediaNextInterestingTimeOnly, which is like GetMediaNextInterestingTime without asking for the duration (which is, according to qt docs, expensive).
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Modules/qt/Qtmodule.c29
-rw-r--r--Mac/Modules/qt/qtsupport.py13
2 files changed, 42 insertions, 0 deletions
diff --git a/Mac/Modules/qt/Qtmodule.c b/Mac/Modules/qt/Qtmodule.c
index d374b45..a03286e 100644
--- a/Mac/Modules/qt/Qtmodule.c
+++ b/Mac/Modules/qt/Qtmodule.c
@@ -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}
};
diff --git a/Mac/Modules/qt/qtsupport.py b/Mac/Modules/qt/qtsupport.py
index f4186f7..9bf3ec7 100644
--- a/Mac/Modules/qt/qtsupport.py
+++ b/Mac/Modules/qt/qtsupport.py
@@ -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)