static bool certHasProperty(NPObject *npobj, NPIdentifier name) {
    _log("name=%s", toString(name).c_str());
    return
        name == toIdentifier("id") ||
        name == toIdentifier("cert") ||
        name == toIdentifier("certificateAsHex");
}
static bool certGetProperty(NPObject *npobj, NPIdentifier name, NPVariant *variant) {
    CertInstance *obj = (CertInstance*)npobj;
    _log("name=%s", toString(name).c_str());
    std::string result;
    if (name == toIdentifier("id")) {
        result = BinaryUtils::bin2hex(md5(obj->parent->certInfo));
    }
    else if (name == toIdentifier("certificateAsHex") ||
             name == toIdentifier("cert")) {
        result = BinaryUtils::bin2hex(obj->parent->certInfo);
    }
    if (result.empty())
        return false;
    return setValue(variant, result.c_str());
}
Exemple #3
0
void ProtoApp::init(){
	// setup audio
	if(usingAudio()){
		gam::Sync::master().spu(audioIO().fps());
	}

	// setup GUI
	mAppLabel.setValue(App::name());

	mGUI << mGUITable;

	mTopBar.arrange();
	mParamPanel.arrange();
	mGUITable.arrange();

	// setup model manager
	if(!App::name().empty()){
		glv::ModelManager& MM = mGUI.modelManager();
		
		//
		std::string idName = App::name();
		toIdentifier(idName);
		
		MM.name(idName + "Presets");
		MM.fileDir(mResourceDir);
		
		mGUI.refreshModels();
		MM.add("pose", *new PoseModel(nav()));
		
		paramPanel().presetControl()
			.modelManager(MM)
			.loadFile()
		;
	}
}
Exemple #4
0
void ProtoApp::init(
	const Window::Dim& dim,
	const std::string& title,
	double fps,
	Window::DisplayMode mode,
	double sampleRate,
	int blockSize,
	int chansOut,
	int chansIn
){

	initAudio(sampleRate, blockSize, chansOut, chansIn);

	// setup audio
	if(usingAudio()){
		//gam::Sync::master().spu(audioIO().fps());
	}


	Window * win = initWindow(dim, title, fps, mode);
	mGUI.parentWindow(*win);

	// setup GUI
	mAppLabel.setValue(App::name());

	mGUI << mGUITable;

	mTopBar.arrange();
	mParamPanel.arrange();
	mGUITable.arrange();

	// setup model manager
	if(!App::name().empty()){
		glv::ModelManager& MM = mGUI.modelManager();
		
		//
		std::string idName = App::name();
		toIdentifier(idName);
		
		MM.name(idName + "Presets");
		MM.fileDir(mResourceDir);
		
		mGUI.refreshModels();
		MM.add("pose", *new PoseModel(nav()));
		
		paramPanel().presetControl()
			.modelManager(MM)
			.loadFile()
		;
	}
}