// Default empty project template #include "AppName.hpp" #include #include #include //Remove if unable to run////////////// #include #include #include #include #include #include /////////////////////////////////////// using namespace bb::cascades; using namespace bb::cascades::multimedia; // Remove if unable to run///////////// using namespace bb::system; /////////////////////////////////////// AppName::AppName(bb::cascades::Application *app) : QObject(app) { qmlRegisterType < Camera > ("bb.cascades.multimedia", 1, 0, "Camera"); // create scene document from main.qml asset // set parent to created document to ensure it exists for the whole application lifetime QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this); qml->setContextProperty("photoBomber", this); // create root object for the UI //AbstractPane *root = qml->createRootObject(); // Remove if unable to run///////////// Page *appPage = qml->createRootObject(); /////////////////////////////////////// // set created root object as a scene fprintf(stderr, "Before setting scene"); app->setScene(appPage); fprintf(stderr, "After setting scene"); // Remove if unable to run///////////// Camera *camera = appPage->findChild("myCamera"); fprintf(stderr, "\n Camera variable: %s", camera->isCameraAccessible(CameraUnit::Front)); // This doesn't print to console camera->open(CameraUnit::Front); fprintf(stderr, "Gets to the end"); /////////////////////////////////////// }