Exemple #1
0
//-------------------------------------------------------------------------
void QGuidoPainter::startGuidoEngine()
{
	if ( !QGuidoPainter::isGuidoEngineStarted() )
	{
		QGuidoPainter::mSys = new GSystemQt(0);
		QGuidoPainter::mDev = mSys->CreateDisplayDevice();
		
		GuidoInitDesc gd = { QGuidoPainter::mDev , 0, "Guido2", "Times New Roman" };
		GuidoInit (&gd);             // Initialise the Guido Engine first
	}
}
Exemple #2
0
ofxGuido::ofxGuido(int w, int h) :
	mARHandler(0), mGRHandler(0), mW(w), mH(h), mBackground(){
	mGuidoDevice = mGuidoSystem.CreateMemoryDevice(w, h);
	mGuidoDevice->SelectFillColor(VGColor(0, 0, 0));
	mGuidoInitDesc.graphicDevice = mGuidoDevice;
	mGuidoInitDesc.musicFont = "guido2t.ttf";
	mGuidoInitDesc.textFont = "guidotext.ttf";
	GuidoInit(&mGuidoInitDesc);
	GuidoGetDefaultLayoutSettings(&mGuidoLayoutSettings);
	mGuidoOnDrawDesc.hdc = mGuidoDevice;
	mGuidoParser = GuidoOpenParser();
	// Setup a large default format to avoid system breaks. They can also be avoided
	// by using the GMN advanced tag \set<autoSystemBreak="off">
	// Extra right margin makes room for the systems brace.
	GuidoPageFormat gpf = { 5000, 5000, 150, 100, 100, 100 }; // w, h, ml, mt, mr, mb
	GuidoSetDefaultPageFormat(&gpf);
	mBackground.set(0, 0, 0, 0);
}
static jint guidoengine_guido_Init (JNIEnv * env, jstring guidofont, jstring textfont, bool antialiasing)
{
	static bool done = false;
	if (!done) {
		GuidoInitDesc desc;
		desc.graphicDevice = getInitDevice(antialiasing);
		desc.musicFont = env->GetStringUTFChars(guidofont, JNI_FALSE);
		desc.textFont  = env->GetStringUTFChars(textfont, JNI_FALSE);;
		GuidoErrCode errcode = GuidoInit (&desc);
		env->ReleaseStringUTFChars(guidofont, desc.musicFont);
		env->ReleaseStringUTFChars(textfont, desc.textFont);
		if (errcode != guidoNoErr) return errcode;
		done = true;

		gMusicXML = loadMusicxml();
	}
	return guidoNoErr;
}