mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 19:39:56 -05:00
Merge pull request #1754 from OpenSpace/issue/1735
Removed hard-coded path expectations to allow drag & drop playback
This commit is contained in:
@@ -42,5 +42,5 @@ elseif extension == ".asset" then
|
||||
return [[openspace.printInfo("Adding asset: ']] .. filename .. [[' (drag-and-drop)");
|
||||
openspace.asset.add("]] .. filename .. [[");]] .. ReloadUIScript
|
||||
elseif extension == ".osrec" or extension == ".osrectxt" then
|
||||
return [[openspace.sessionRecording.startPlayback("]] .. basename .. [[")]]
|
||||
return [[openspace.sessionRecording.startPlayback("]] .. filename .. [[")]]
|
||||
end
|
||||
|
||||
@@ -355,15 +355,15 @@ bool SessionRecording::startPlayback(std::string& filename,
|
||||
bool loop)
|
||||
{
|
||||
std::string absFilename;
|
||||
// Run through conversion in case file is older. Does nothing if the file format
|
||||
// is up-to-date
|
||||
filename = convertFile(filename);
|
||||
if (std::filesystem::is_regular_file(filename)) {
|
||||
absFilename = filename;
|
||||
}
|
||||
else {
|
||||
absFilename = absPath("${RECORDINGS}/" + filename).string();
|
||||
}
|
||||
// Run through conversion in case file is older. Does nothing if the file format
|
||||
// is up-to-date
|
||||
absFilename = convertFile(absFilename);
|
||||
|
||||
if (_state == SessionState::Recording) {
|
||||
LERROR("Unable to start playback while in session recording mode");
|
||||
@@ -2201,7 +2201,7 @@ void SessionRecording::readFileIntoStringStream(std::string filename,
|
||||
std::ifstream& inputFstream,
|
||||
std::stringstream& stream)
|
||||
{
|
||||
std::filesystem::path conversionInFilename = absPath("${RECORDINGS}/" + filename);
|
||||
std::filesystem::path conversionInFilename = absPath(filename);
|
||||
if (!std::filesystem::is_regular_file(conversionInFilename)) {
|
||||
throw ConversionError(fmt::format(
|
||||
"Cannot find the specified playback file {} to convert", conversionInFilename
|
||||
|
||||
Reference in New Issue
Block a user