I have a controller class that opens a te::Edi
from a file into songEdit
in its constructor like so:
Controller::Controller(File editFile) :
engine(ProjectInfo::projectName, nullptr, std::make_unique<CustomEngineBehaviour>()),
songEdit(te::Edit::Options {
engine,
te::loadEditFromFile(engine, editFile, {}),
te::ProjectItemID::createNewID(0),
te::Edit::forEditing,
nullptr,
te::Edit::getDefaultNumUndoLevels(),
[editFile] { return editFile; }
})
{
/* constructor code... */
}
Now I’d like to open a different edit file without closing and re-opening the window. I tried creating a new te::Edit
and assigning songEdit
to it like this:
te::Edit newSongEdit(te::Edit::Options {
engine,
te::loadEditFromFile(engine, songEditFile, {}),
te::ProjectItemID::createNewID(0),
te::Edit::forEditing,
nullptr,
te::Edit::getDefaultNumUndoLevels(),
[songEditFile] { return songEditFile; }
});
songEdit = newSongEdit;
But I get the error "tracktion_engine::Edit &tracktion_engine::Edit::operator=(const tracktion_engine::Edit &)" is inaccessible
.
How should I load a different edit into one that’s already loaded?