Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Checks data sound is valid to save. Issue #957 (#971)

jabarrera53e290644ccd
diff --git a/toonz/sources/sound/aiff/tsio_aiff.cpp b/toonz/sources/sound/aiff/tsio_aiff.cpp
index ba04c99e3..b27f12255 100644
--- a/toonz/sources/sound/aiff/tsio_aiff.cpp
+++ b/toonz/sources/sound/aiff/tsio_aiff.cpp
@@ -457,7 +457,9 @@ TSoundTrackWriterAiff::TSoundTrackWriterAiff(const TFilePath &fp)
//------------------------------------------------------------------------------
bool TSoundTrackWriterAiff::save(const TSoundTrackP &st) {
- assert(st);
+ if (!st)
+ throw TException(L"Unable to save the soundtrack: " +
+ m_path.getWideString());
TSoundTrackP sndtrack;
if (st->getBitPerSample() == 8 && !st->isSampleSigned())
diff --git a/toonz/sources/toonzlib/sceneresources.cpp b/toonz/sources/toonzlib/sceneresources.cpp
index 5d73d425e..0a9b611e3 100644
--- a/toonz/sources/toonzlib/sceneresources.cpp
+++ b/toonz/sources/toonzlib/sceneresources.cpp
@@ -14,6 +14,8 @@
#include "toonz/preferences.h"
#include "tpalette.h"
+#include "tmsgcore.h"
+
#include "tconvert.h"
#include "tlogger.h"
#include "tsystem.h"
@@ -429,7 +431,8 @@ void SceneSound::save() {
TSystem::copyFile(actualFp, m_oldActualPath);
}
} catch (...) {
- TLogger::error() << "Can't save " << actualFp;
+ DVGui::warning(QObject::tr("Can't save") +
+ QString::fromStdWString(L": " + actualFp.getLevelNameW()));
}
}