From f1f8b556bf86d2cde86582e98d0d7fab1547a8c5 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 14 Apr 2006 22:35:39 +0000 Subject: [PATCH] pass down VideoProvider in open audio from video path Originally committed to SVN as r326. --- core/audio_display.cpp | 6 +++--- core/audio_display.h | 3 ++- core/audio_provider.cpp | 2 +- core/audio_provider.h | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/audio_display.cpp b/core/audio_display.cpp index e12a67eac..2c593a4c3 100644 --- a/core/audio_display.cpp +++ b/core/audio_display.cpp @@ -802,7 +802,7 @@ void AudioDisplay::SetScale(float _scale) { ////////////////// // Load from file -void AudioDisplay::SetFile(wxString file) { +void AudioDisplay::SetFile(wxString file, VideoProvider *vprovider) { // Unload if (file.IsEmpty()) { if (player) player->CloseStream(); @@ -820,7 +820,7 @@ void AudioDisplay::SetFile(wxString file) { SetFile(_T("")); try { // Get provider - provider = AudioProvider::GetAudioProvider(file, this); + provider = AudioProvider::GetAudioProvider(file, this, vprovider); // Get player player = AudioPlayer::GetAudioPlayer(); @@ -856,7 +856,7 @@ void AudioDisplay::SetFromVideo() { extension.LowerCase(); if (extension != _T(".d2v")) - SetFile(video->videoName); + SetFile(video->videoName, video->provider); } } diff --git a/core/audio_display.h b/core/audio_display.h index 51832c8e9..ab8e9c692 100644 --- a/core/audio_display.h +++ b/core/audio_display.h @@ -52,6 +52,7 @@ class SubtitlesGrid; class AudioBox; class AudioKaraoke; class VideoDisplay; +class VideoProvider; ///////////////// @@ -133,7 +134,7 @@ public: void SetPosition(int pos); void SetSamplesPercent(int percent,bool update=true,float pivot=0.5); void SetScale(float scale); - void SetFile(wxString file); + void SetFile(wxString file,VideoProvider *vprovider=NULL); void SetFromVideo(); void UpdateScrollbar(); void SetDialogue(SubtitlesGrid *_grid=NULL,AssDialogue *diag=NULL,int n=-1); diff --git a/core/audio_provider.cpp b/core/audio_provider.cpp index e9138139d..76bc6d595 100644 --- a/core/audio_provider.cpp +++ b/core/audio_provider.cpp @@ -162,7 +162,7 @@ void AudioProvider::GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int //////////////// // Get provider -AudioProvider *AudioProvider::GetAudioProvider(wxString filename, AudioDisplay *display) { +AudioProvider *AudioProvider::GetAudioProvider(wxString filename, AudioDisplay *display, VideoProvider *vprovider) { // Prepare provider AudioProvider *provider = NULL; diff --git a/core/audio_provider.h b/core/audio_provider.h index 09cc45127..7ae9683bd 100644 --- a/core/audio_provider.h +++ b/core/audio_provider.h @@ -45,6 +45,7 @@ ////////////// // Prototypes class AudioDisplay; +class VideoProvider; //////////////////////// @@ -75,5 +76,5 @@ public: int GetBytesPerSample(); 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); };