diff options
Diffstat (limited to 'opentrack-logic/selected-libraries.cpp')
-rw-r--r-- | opentrack-logic/selected-libraries.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/opentrack-logic/selected-libraries.cpp b/opentrack-logic/selected-libraries.cpp new file mode 100644 index 00000000..4a1a9f09 --- /dev/null +++ b/opentrack-logic/selected-libraries.cpp @@ -0,0 +1,37 @@ +#include "selected-libraries.hpp" +#include <QDebug> + +SelectedLibraries::SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dylibptr f) : + pTracker(nullptr), + pFilter(nullptr), + pProtocol(nullptr), + correct(false) +{ + pProtocol = make_dylib_instance<IProtocol>(p); + + if (!pProtocol) + { + qDebug() << "protocol dylib load failure"; + return; + } + + if(!pProtocol->correct()) + { + qDebug() << "protocol load failure"; + pProtocol = nullptr; + return; + } + + pTracker = make_dylib_instance<ITracker>(t); + pFilter = make_dylib_instance<IFilter>(f); + + if (!pTracker) + { + qDebug() << "tracker dylib load failure"; + return; + } + + pTracker->start_tracker(frame); + + correct = true; +} |