I’m trying to make Python bindings for Tracktion Engine. I start the code off with
Engine engine {juce::String("Soundshop")};
Edit edit{ engine, Edit::EditRole::forEditing };
TransportControl& transport{ edit.getTransport() };
which I got from Render Example? - #3 by bwall and tracktion_engine/tutorials/03 - StepSequencerDemo.md at develop · Tracktion/tracktion_engine · GitHub
And I get the errors when trying to build in Visual Studio:
unresolved external symbol "public: __cdecl tracktion::engine::Engine::~Engine(void)" (??1Engine@engine@tracktion@@QEAA@XZ)
unresolved external symbol "public: __cdecl tracktion::engine::Engine::Engine(class juce::String)" (??0Engine@engine@tracktion@@QEAA@VString@juce@@@Z)
unresolved external symbol "public: virtual __cdecl tracktion::engine::Edit::~Edit(void)" (??1Edit@engine@tracktion@@UEAA@XZ)
unresolved external symbol "public: __cdecl tracktion::engine::Edit::Edit(class tracktion::engine::Engine &,enum tracktion::engine::Edit::EditRole)" (??0Edit@engine@tracktion@@QEAA@AEAVEngine@12@W4EditRole@012@@Z)
4 unresolved externals
Here’s the complete code:
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "tracktion_engine/tracktion_engine.h"
namespace py = pybind11;
using namespace tracktion::engine;
Engine engine {juce::String("Soundshop")};
Edit edit{ engine, Edit::EditRole::forEditing };
TransportControl& transport{ edit.getTransport() };
PYBIND11_MODULE(tracktion_engine, m) {
m.doc() = "Python bindings for Tracktion Engine, a framework for building DAW-like audio applications.";
// Track class binding
py::class_<Track, std::unique_ptr<Track, py::nodelete>>(m, "Track")
.def("get_name", &Track::getName, "Returns the name of the track.");
// AudioTrack class binding (inherits from Track)
py::class_<AudioTrack, Track, std::unique_ptr<AudioTrack, py::nodelete>>(m, "AudioTrack")
;
// Clip class binding
py::class_<Clip, std::unique_ptr<Clip, py::nodelete>>(m, "Clip")
.def("get_name", &Clip::getName, "Returns the name of the clip.")
.def("get_position", &Clip::getPosition, "Returns the position of the clip in seconds.");
// ValueTree class binding (used for Edit state)
py::class_<juce::ValueTree>(m, "ValueTree")
.def(py::init<juce::Identifier>(), py::arg("type"), "Creates a ValueTree with the specified type.")
.def("set_property", &juce::ValueTree::setProperty, py::arg("name"), py::arg("value"), py::arg("undo_manager") = nullptr,
"Sets a property on the ValueTree.");
}
I tried ‘rebuild solution’ and still get the errors. Halp! Thanks.