pass down VideoProvider in open audio from video path
Originally committed to SVN as r326.
This commit is contained in:
parent
71511a3950
commit
f1f8b556bf
4 changed files with 8 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue