pass down VideoProvider in open audio from video path

Originally committed to SVN as r326.
This commit is contained in:
David Lamparter 2006-04-14 22:35:39 +00:00
parent 71511a3950
commit f1f8b556bf
4 changed files with 8 additions and 6 deletions

View file

@ -802,7 +802,7 @@ void AudioDisplay::SetScale(float _scale) {
////////////////// //////////////////
// Load from file // Load from file
void AudioDisplay::SetFile(wxString file) { void AudioDisplay::SetFile(wxString file, VideoProvider *vprovider) {
// Unload // Unload
if (file.IsEmpty()) { if (file.IsEmpty()) {
if (player) player->CloseStream(); if (player) player->CloseStream();
@ -820,7 +820,7 @@ void AudioDisplay::SetFile(wxString file) {
SetFile(_T("")); SetFile(_T(""));
try { try {
// Get provider // Get provider
provider = AudioProvider::GetAudioProvider(file, this); provider = AudioProvider::GetAudioProvider(file, this, vprovider);
// Get player // Get player
player = AudioPlayer::GetAudioPlayer(); player = AudioPlayer::GetAudioPlayer();
@ -856,7 +856,7 @@ void AudioDisplay::SetFromVideo() {
extension.LowerCase(); extension.LowerCase();
if (extension != _T(".d2v")) if (extension != _T(".d2v"))
SetFile(video->videoName); SetFile(video->videoName, video->provider);
} }
} }

View file

@ -52,6 +52,7 @@ class SubtitlesGrid;
class AudioBox; class AudioBox;
class AudioKaraoke; class AudioKaraoke;
class VideoDisplay; class VideoDisplay;
class VideoProvider;
///////////////// /////////////////
@ -133,7 +134,7 @@ public:
void SetPosition(int pos); void SetPosition(int pos);
void SetSamplesPercent(int percent,bool update=true,float pivot=0.5); void SetSamplesPercent(int percent,bool update=true,float pivot=0.5);
void SetScale(float scale); void SetScale(float scale);
void SetFile(wxString file); void SetFile(wxString file,VideoProvider *vprovider=NULL);
void SetFromVideo(); void SetFromVideo();
void UpdateScrollbar(); void UpdateScrollbar();
void SetDialogue(SubtitlesGrid *_grid=NULL,AssDialogue *diag=NULL,int n=-1); void SetDialogue(SubtitlesGrid *_grid=NULL,AssDialogue *diag=NULL,int n=-1);

View file

@ -162,7 +162,7 @@ void AudioProvider::GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int
//////////////// ////////////////
// Get provider // Get provider
AudioProvider *AudioProvider::GetAudioProvider(wxString filename, AudioDisplay *display) { AudioProvider *AudioProvider::GetAudioProvider(wxString filename, AudioDisplay *display, VideoProvider *vprovider) {
// Prepare provider // Prepare provider
AudioProvider *provider = NULL; AudioProvider *provider = NULL;

View file

@ -45,6 +45,7 @@
////////////// //////////////
// Prototypes // Prototypes
class AudioDisplay; class AudioDisplay;
class VideoProvider;
//////////////////////// ////////////////////////
@ -75,5 +76,5 @@ public:
int GetBytesPerSample(); int GetBytesPerSample();
void GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int samples,float scale); void GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int samples,float scale);
static AudioProvider *GetAudioProvider(wxString filename, AudioDisplay *display); static AudioProvider *GetAudioProvider(wxString filename, AudioDisplay *display, VideoProvider *vprovider);
}; };