+//---------------------------------------------------------------------------
+// wxQTMediaBackend::GetDataSizeFromStart
+//
+// Calls either GetMovieDataSize or GetMovieDataSize64 with a value
+// of 0 for the starting value
+//---------------------------------------------------------------------------
+wxLongLong wxQTMediaBackend::GetDataSizeFromStart(TimeValue end)
+{
+#if 0 // old pre-qt4 way
+ return ::GetMovieDataSize(m_movie, 0, end)
+#else // qt4 way
+ wide llDataSize;
+ ::GetMovieDataSize64(m_movie, 0, end, &llDataSize);
+ return wxLongLong(llDataSize.hi, llDataSize.lo);
+#endif
+}
+
+//---------------------------------------------------------------------------
+// wxQTMediaBackend::GetDownloadProgress
+//---------------------------------------------------------------------------
+wxLongLong wxQTMediaBackend::GetDownloadProgress()
+{
+#if 0 // hackish and slow
+ Handle hMovie = NewHandle(0);
+ PutMovieIntoHandle(m_movie, hMovie);
+ long lSize = GetHandleSize(hMovie);
+ DisposeHandle(hMovie);
+
+ return lSize;
+#else
+ TimeValue tv;
+ if (::GetMaxLoadedTimeInMovie(m_movie, &tv) != noErr)
+ {
+ wxLogDebug(wxT("GetMaxLoadedTimeInMovie failed"));
+ return 0;
+ }
+
+ return wxQTMediaBackend::GetDataSizeFromStart(tv);
+#endif
+}
+
+//---------------------------------------------------------------------------
+// wxQTMediaBackend::GetDownloadTotal
+//---------------------------------------------------------------------------
+wxLongLong wxQTMediaBackend::GetDownloadTotal()
+{
+ return wxQTMediaBackend::GetDataSizeFromStart( ::GetMovieDuration(m_movie) );
+}
+