Remove Aegisub::String class as it's causing problems in wx2.9. The original plan was to have it so external modules wouldn't have to depend on wx. We'll think of a different solution when the time comes. closes #940

Originally committed to SVN as r3220.
This commit is contained in:
Amar Takhar 2009-07-23 15:16:53 +00:00
parent e496c0487d
commit a0370f9004
21 changed files with 53 additions and 68 deletions

View File

@ -52,7 +52,7 @@
//////////////
// Constructor
AvisynthAudioProvider::AvisynthAudioProvider(Aegisub::String _filename) {
AvisynthAudioProvider::AvisynthAudioProvider(wxString _filename) {
filename = _filename.c_str();
try {

View File

@ -56,7 +56,7 @@ private:
void Unload();
public:
AvisynthAudioProvider(Aegisub::String _filename);
AvisynthAudioProvider(wxString _filename);
~AvisynthAudioProvider();
wxString GetFilename();
@ -73,7 +73,7 @@ public:
// Factory
class AvisynthAudioProviderFactory : public AudioProviderFactory {
public:
AudioProvider *CreateProvider(Aegisub::String file) { return new AvisynthAudioProvider(file); }
AudioProvider *CreateProvider(wxString file) { return new AvisynthAudioProvider(file); }
};
#endif

View File

@ -50,7 +50,7 @@
///////////
// Constructor
FFmpegSourceAudioProvider::FFmpegSourceAudioProvider(Aegisub::String filename) {
FFmpegSourceAudioProvider::FFmpegSourceAudioProvider(wxString filename) {
COMInited = false;
#ifdef WIN32
HRESULT res;
@ -78,7 +78,7 @@ FFmpegSourceAudioProvider::FFmpegSourceAudioProvider(Aegisub::String filename) {
///////////
// Load audio file
void FFmpegSourceAudioProvider::LoadAudio(Aegisub::String filename) {
void FFmpegSourceAudioProvider::LoadAudio(wxString filename) {
// clean up
Close();

View File

@ -54,10 +54,10 @@ private:
bool COMInited;
void Close();
void LoadAudio(Aegisub::String filename);
void LoadAudio(wxString filename);
public:
FFmpegSourceAudioProvider(Aegisub::String filename);
FFmpegSourceAudioProvider(wxString filename);
virtual ~FFmpegSourceAudioProvider();
// FFMS always delivers samples in machine endian
@ -72,7 +72,7 @@ public:
// Factory
class FFmpegSourceAudioProviderFactory : public AudioProviderFactory {
public:
AudioProvider *CreateProvider(Aegisub::String file) { return new FFmpegSourceAudioProvider(file); }
AudioProvider *CreateProvider(wxString file) { return new FFmpegSourceAudioProvider(file); }
};
#endif /* WITH_FFMPEGSOURCE */

View File

@ -39,24 +39,9 @@
///////////////
// STL Headers
#include <vector>
#include <string>
#include <stdint.h>
////////////////////////////////
// Define types used by Aegisub
namespace Aegisub {
// String type
typedef wxString String;
// String array
typedef std::vector<String> StringArray;
// Integer array
typedef std::vector<int> IntArray;
};
///////////////////
// Aegisub headers
//#include "video_frame.h"

View File

@ -85,5 +85,5 @@ public:
class AudioProviderFactory {
public:
virtual ~AudioProviderFactory() {}
virtual AudioProvider *CreateProvider(Aegisub::String filename)=0;
virtual AudioProvider *CreateProvider(wxString filename)=0;
};

View File

@ -66,10 +66,10 @@ public:
virtual FrameRate GetTrueFrameRate()=0; // Returns magic VFR stuff
// Use this to set any post-loading warnings, such as "being loaded with unreliable seeking"
virtual Aegisub::String GetWarning() { return L""; }
virtual wxString GetWarning() { return L""; }
// Name of decoder, e.g. "Avisynth/FFMpegSource"
virtual Aegisub::String GetDecoderName() { return L"Unknown"; }
virtual wxString GetDecoderName() { return L"Unknown"; }
// How many frames does this provider want Aegisub to cache? Set to 0 if it doesn't require caching.
virtual int GetDesiredCacheSize() { return 0; }
@ -77,7 +77,7 @@ public:
// For "special" providers that don't deal well with VFR (i.e. Avisynth)
virtual bool NeedsVFRHack() { return false; }; // Returns true if provider needs special VFR treatment
virtual bool IsNativelyByFrames() { return true; };
virtual void OverrideFrameTimeList(Aegisub::IntArray list) {} // Override the list with the provided one, for VFR handling
virtual void OverrideFrameTimeList(std::vector<int> list) {} // Override the list with the provided one, for VFR handling
};
@ -86,5 +86,5 @@ public:
class VideoProviderFactory {
public:
virtual ~VideoProviderFactory() {}
virtual VideoProvider *CreateProvider(Aegisub::String video)=0;
virtual VideoProvider *CreateProvider(wxString video)=0;
};

View File

@ -410,7 +410,7 @@ int FrameRate::GetTimeAtFrame(int frame,bool start,bool exact) {
////////////////////////////////////////
// Get the current list of frames/times
Aegisub::IntArray FrameRate::GetFrameTimeList() {
std::vector<int> FrameRate::GetFrameTimeList() {
return Frame;
}

View File

@ -66,7 +66,7 @@ class FrameRate {
private:
double last_time;
int last_frame;
Aegisub::IntArray Frame;
std::vector<int> Frame;
// contains the assumed fps for v1 timecodes, average for v2 and actual fps for cfr
double AverageFrameRate;
@ -102,7 +102,7 @@ public:
ASS_FrameRateType GetFrameRateType() { return FrameRateType; };
wxString GetFilename() { return vfrFile; };
Aegisub::IntArray GetFrameTimeList();
std::vector<int> GetFrameTimeList();
double GetCommonFPS();
};

View File

@ -56,7 +56,7 @@
///////////////
// Constructor
AvisynthVideoProvider::AvisynthVideoProvider(Aegisub::String _filename) {
AvisynthVideoProvider::AvisynthVideoProvider(wxString _filename) {
AVSTRACE(wxString::Format(_T("AvisynthVideoProvider: Creating new AvisynthVideoProvider: \"%s\", \"%s\""), _filename, _subfilename));
bool mpeg2dec3_priority = true;
RGB32Video = NULL;
@ -95,7 +95,7 @@ AvisynthVideoProvider::~AvisynthVideoProvider() {
/////////////////////////////////////////
// Actually open the video into Avisynth
PClip AvisynthVideoProvider::OpenVideo(Aegisub::String _filename, bool mpeg2dec3_priority) {
PClip AvisynthVideoProvider::OpenVideo(wxString _filename, bool mpeg2dec3_priority) {
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Opening video"));
wxMutexLocker lock(AviSynthMutex);
AVSTRACE(_T("AvisynthVideoProvider::OpenVideo: Got AVS mutex"));
@ -368,7 +368,7 @@ void AvisynthVideoProvider::OverrideFrameTimeList(wxArrayInt list) {
///////////////
// Get warning
Aegisub::String AvisynthVideoProvider::GetWarning() {
wxString AvisynthVideoProvider::GetWarning() {
if (usedDirectShow) return L"Warning! The file is being opened using Avisynth's DirectShowSource, which has unreliable seeking. Frame numbers might not match the real number. PROCEED AT YOUR OWN RISK!";
else return L"";
}

View File

@ -50,8 +50,8 @@ private:
AegiVideoFrame iframe;
bool usedDirectShow;
Aegisub::String rendererCallString;
Aegisub::String decoderName;
wxString rendererCallString;
wxString decoderName;
int num_frames;
int last_fnum;
@ -67,10 +67,10 @@ private:
PClip RGB32Video;
PClip OpenVideo(Aegisub::String _filename, bool mpeg2dec3_priority = true);
PClip OpenVideo(wxString _filename, bool mpeg2dec3_priority = true);
public:
AvisynthVideoProvider(Aegisub::String _filename);
AvisynthVideoProvider(wxString _filename);
~AvisynthVideoProvider();
const AegiVideoFrame GetFrame(int n);
@ -90,8 +90,8 @@ public:
void OverrideFrameTimeList(wxArrayInt list);
bool IsNativelyByFrames() { return byFrame; }
bool NeedsVFRHack() { return true; }
Aegisub::String GetWarning();
Aegisub::String GetDecoderName() { return Aegisub::String(L"Avisynth/") + decoderName; }
wxString GetWarning();
wxString GetDecoderName() { return wxString(L"Avisynth/") + decoderName; }
};
@ -99,7 +99,7 @@ public:
// Factory
class AvisynthVideoProviderFactory : public VideoProviderFactory {
public:
VideoProvider *CreateProvider(Aegisub::String video) { return new AvisynthVideoProvider(video); }
VideoProvider *CreateProvider(wxString video) { return new AvisynthVideoProvider(video); }
};

View File

@ -161,7 +161,7 @@ wxArrayInt VideoProviderCache::GetKeyFrames() {
FrameRate VideoProviderCache::GetTrueFrameRate() {
return master->GetTrueFrameRate();
}
void VideoProviderCache::OverrideFrameTimeList(Aegisub::IntArray list) {
void VideoProviderCache::OverrideFrameTimeList(std::vector<int> list) {
master->OverrideFrameTimeList(list);
}
bool VideoProviderCache::IsNativelyByFrames() {
@ -170,9 +170,9 @@ bool VideoProviderCache::IsNativelyByFrames() {
bool VideoProviderCache::NeedsVFRHack() {
return master->NeedsVFRHack();
}
Aegisub::String VideoProviderCache::GetWarning() {
wxString VideoProviderCache::GetWarning() {
return master->GetWarning();
}
Aegisub::String VideoProviderCache::GetDecoderName() {
wxString VideoProviderCache::GetDecoderName() {
return master->GetDecoderName();
}

View File

@ -87,9 +87,9 @@ public:
virtual bool IsVFR();
virtual wxArrayInt GetKeyFrames();
virtual FrameRate GetTrueFrameRate();
virtual void OverrideFrameTimeList(Aegisub::IntArray list); // Override the list with the provided one, for VFR handling
virtual void OverrideFrameTimeList(std::vector<int> list); // Override the list with the provided one, for VFR handling
virtual bool IsNativelyByFrames();
virtual bool NeedsVFRHack();
virtual Aegisub::String GetWarning();
virtual Aegisub::String GetDecoderName();
virtual wxString GetWarning();
virtual wxString GetDecoderName();
};

View File

@ -122,7 +122,7 @@ void DummyVideoProvider::Create(double _fps, int frames, int _width, int _height
///////////////////////
// Parsing constructor
DummyVideoProvider::DummyVideoProvider(Aegisub::String _filename)
DummyVideoProvider::DummyVideoProvider(wxString _filename)
{
wxString filename = _filename.c_str();
wxString params;
@ -249,7 +249,7 @@ double DummyVideoProvider::GetFPS() {
////////////////////
// Get decoder name
Aegisub::String DummyVideoProvider::GetDecoderName() {
wxString DummyVideoProvider::GetDecoderName() {
return L"Dummy Video Provider";
}

View File

@ -60,7 +60,7 @@ private:
void Create(double fps, int frames, int _width, int _height, const wxColour &colour, bool pattern);
public:
DummyVideoProvider(Aegisub::String filename);
DummyVideoProvider(wxString filename);
DummyVideoProvider(double fps, int frames, int _width, int _height, const wxColour &colour, bool pattern);
~DummyVideoProvider();
@ -79,7 +79,7 @@ public:
bool IsVFR() { return false; };
FrameRate GetTrueFrameRate() { return FrameRate(); };
Aegisub::String GetDecoderName();
wxString GetDecoderName();
};
#endif

View File

@ -54,7 +54,7 @@
///////////////
// Constructor
FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(Aegisub::String filename) {
FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(wxString filename) {
COMInited = false;
#ifdef WIN32
HRESULT res;
@ -96,7 +96,7 @@ FFmpegSourceVideoProvider::~FFmpegSourceVideoProvider() {
///////////////
// Open video
void FFmpegSourceVideoProvider::LoadVideo(Aegisub::String filename) {
void FFmpegSourceVideoProvider::LoadVideo(wxString filename) {
// make sure we don't have anything messy lying around
Close();

View File

@ -64,13 +64,13 @@ private:
bool COMInited;
void LoadVideo(Aegisub::String filename);
void LoadVideo(wxString filename);
void Close();
protected:
public:
FFmpegSourceVideoProvider(Aegisub::String filename);
FFmpegSourceVideoProvider(wxString filename);
~FFmpegSourceVideoProvider();
const AegiVideoFrame GetFrame(int n);
@ -84,7 +84,7 @@ public:
wxArrayInt GetKeyFrames() { return KeyFramesList; };
bool IsVFR() { return true; };
FrameRate GetTrueFrameRate() { return Timecodes; };
Aegisub::String GetDecoderName() { return L"FFmpegSource"; }
wxString GetDecoderName() { return L"FFmpegSource"; }
int GetDesiredCacheSize() { return 8; }
};
@ -93,7 +93,7 @@ public:
// Factory
class FFmpegSourceVideoProviderFactory : public VideoProviderFactory {
public:
VideoProvider *CreateProvider(Aegisub::String video) { return new FFmpegSourceVideoProvider(video); }
VideoProvider *CreateProvider(wxString video) { return new FFmpegSourceVideoProvider(video); }
};

View File

@ -40,7 +40,7 @@
#include "aegisub_endian.h"
#include "video_provider_quicktime.h"
QuickTimeVideoProvider::QuickTimeVideoProvider(Aegisub::String filename) {
QuickTimeVideoProvider::QuickTimeVideoProvider(wxString filename) {
in_dataref = NULL;
movie = NULL;
gw = NULL;
@ -119,7 +119,7 @@ bool QuickTimeVideoProvider::CanOpen(const Handle& dataref, const OSType dataref
}
void QuickTimeVideoProvider::LoadVideo(const Aegisub::String _filename) {
void QuickTimeVideoProvider::LoadVideo(const wxString _filename) {
Close();
// convert filename, first to a CFStringRef...

View File

@ -89,14 +89,14 @@ private:
wxString errmsg; // aegisub error message
bool CanOpen(const Handle& dataref, const OSType dataref_type);
void LoadVideo(const Aegisub::String filename);
void LoadVideo(const wxString filename);
std::vector<int> IndexFile();
void Close();
void QTCheckError(OSErr err, wxString errmsg);
public:
QuickTimeVideoProvider(Aegisub::String filename);
QuickTimeVideoProvider(wxString filename);
~QuickTimeVideoProvider();
const AegiVideoFrame GetFrame(int n);
@ -110,7 +110,7 @@ public:
FrameRate GetTrueFrameRate();
wxArrayInt GetKeyFrames();
bool QuickTimeVideoProvider::AreKeyFramesLoaded();
Aegisub::String GetDecoderName() { return L"QuickTime"; };
wxString GetDecoderName() { return L"QuickTime"; };
bool IsNativelyByFrames() { return true; };
int GetDesiredCacheSize() { return 8; };
};
@ -118,7 +118,7 @@ public:
class QuickTimeVideoProviderFactory : public VideoProviderFactory {
public:
VideoProvider *CreateProvider(Aegisub::String video) { return new QuickTimeVideoProvider(video); }
VideoProvider *CreateProvider(wxString video) { return new QuickTimeVideoProvider(video); }
};

View File

@ -47,7 +47,7 @@
YUV4MPEGVideoProvider::YUV4MPEGVideoProvider(Aegisub::String filename) {
YUV4MPEGVideoProvider::YUV4MPEGVideoProvider(wxString filename) {
sf = NULL;
w = 0;
h = 0;
@ -82,7 +82,7 @@ YUV4MPEGVideoProvider::~YUV4MPEGVideoProvider() {
}
void YUV4MPEGVideoProvider::LoadVideo(const Aegisub::String _filename) {
void YUV4MPEGVideoProvider::LoadVideo(const wxString _filename) {
Close();
wxString filename = wxFileName(wxString(_filename.wc_str(), wxConvFile)).GetShortPath();

View File

@ -108,7 +108,7 @@ private:
wxString errmsg;
void LoadVideo(const Aegisub::String filename);
void LoadVideo(const wxString filename);
void Close();
void CheckFileFormat();
@ -118,7 +118,7 @@ private:
int IndexFile();
public:
YUV4MPEGVideoProvider(Aegisub::String filename);
YUV4MPEGVideoProvider(wxString filename);
~YUV4MPEGVideoProvider();
const AegiVideoFrame GetFrame(int n);
@ -132,7 +132,7 @@ public:
wxArrayInt GetKeyFrames() { return wxArrayInt(); }
bool IsVFR() { return false; };
FrameRate GetTrueFrameRate() { return FrameRate(); }
Aegisub::String GetDecoderName() { return L"YUV4MPEG"; }
wxString GetDecoderName() { return L"YUV4MPEG"; }
int GetDesiredCacheSize() { return 8; }
};