From 93477952c09152b0c2e02371bc0760a0e9b07029 Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Thu, 23 Jul 2009 20:17:09 +0000 Subject: [PATCH] Factor a few things out of the QT video provider into a common QT class in preparation for eventually adding an audio provider sometime down the line. Originally committed to SVN as r3225. --- aegisub/src/video_provider_quicktime.cpp | 16 +--------------- aegisub/src/video_provider_quicktime.h | 2 -- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/aegisub/src/video_provider_quicktime.cpp b/aegisub/src/video_provider_quicktime.cpp index 9a8ba8254..551fec812 100644 --- a/aegisub/src/video_provider_quicktime.cpp +++ b/aegisub/src/video_provider_quicktime.cpp @@ -126,15 +126,8 @@ bool QuickTimeVideoProvider::CanOpen(const Handle& dataref, const OSType dataref void QuickTimeVideoProvider::LoadVideo(const wxString _filename) { Close(); - // convert filename, first to a CFStringRef... - wxString wx_filename = wxFileName(_filename).GetShortPath(); - CFStringRef qt_filename = CFStringCreateWithCString(NULL, wx_filename.utf8_str(), kCFStringEncodingUTF8); - - // and then to a data reference OSType in_dataref_type; - qt_err = QTNewDataReferenceFromFullPathCFString(qt_filename, kQTNativeDefaultPathStyle, 0, - &in_dataref, &in_dataref_type); - QTCheckError(qt_err, wxString(_T("Failed to convert filename to data reference"))); + wxStringToDataRef(_filename, &in_dataref, &in_dataref_type); // verify that file is openable if (!CanOpen(in_dataref, in_dataref_type)) @@ -294,13 +287,6 @@ const AegiVideoFrame QuickTimeVideoProvider::GetFrame(int n) { /////////////// // Utility functions - -void QuickTimeVideoProvider::QTCheckError(OSErr err, wxString errmsg) { - if (err != noErr) - throw errmsg; - /* CheckError(err, errmsg.c_str()); // I wonder if this actually works on Mac, and if so, what it does */ -} - int QuickTimeVideoProvider::GetWidth() { return w; } diff --git a/aegisub/src/video_provider_quicktime.h b/aegisub/src/video_provider_quicktime.h index a79ec2d44..86fe2b33b 100644 --- a/aegisub/src/video_provider_quicktime.h +++ b/aegisub/src/video_provider_quicktime.h @@ -70,8 +70,6 @@ private: std::vector IndexFile(); void Close(); - void QTCheckError(OSErr err, wxString errmsg); - public: QuickTimeVideoProvider(wxString filename); ~QuickTimeVideoProvider();