Skip to content

Commit

Permalink
Update videobox.cpp
Browse files Browse the repository at this point in the history
Ref: #331
  • Loading branch information
rodlie committed Nov 20, 2024
1 parent d28f819 commit bb9a61b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/core/Boxes/videobox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,26 @@ const VideoBox::VideoSpecs VideoBox::getSpecs()
return specs;
}

void VideoBox::soundDataChanged() {
void VideoBox::soundDataChanged()
{
const auto pScene = getParentScene();
const auto soundHandler = mFileHandler ?
mFileHandler->getSoundHandler() : nullptr;
const auto durRect = getDurationRectangle();
if(soundHandler) {
if(!mSound->SWT_isVisible()) {
if(pScene) {
pScene->getSoundComposition()->addSound(mSound);
}
if (soundHandler) {
if (!mSound->SWT_isVisible()) {
if (pScene) { pScene->getSoundComposition()->addSound(mSound); }
}
durRect->setSoundCacheHandler(&soundHandler->getCacheHandler());
} else {
if(mSound->SWT_isVisible()) {
if(pScene) {
pScene->getSoundComposition()->removeSound(mSound);
}
if (mSound->SWT_isVisible()) {
if (pScene) { pScene->getSoundComposition()->removeSound(mSound); }
}
durRect->setSoundCacheHandler(nullptr);
}
mSound->setSoundDataHandler(soundHandler);
mSound->SWT_setVisible(soundHandler);
mSound->setVisible(soundHandler);

// why? this does not make any sense to me
//mSound->setVisible(soundHandler);
}

0 comments on commit bb9a61b

Please sign in to comment.