void
moTimelineRuler::OnTimer( wxTimerEvent &event) {

	m_play_value = moGetTicks();
	Refresh();

}
Beispiel #2
0
int moEffect::luaGetTicks(moLuaVirtualMachine& vm)
{
    lua_State *luastate = (lua_State *) vm;

    lua_pushnumber(luastate, (lua_Number) moGetTicks() );

    return 1;
}
Beispiel #3
0
void moEventPacket::ClearPacket()
{
	for(int i=0;i<maxEventNum;i++) buffer_events[i] = empty_event;

	num_events = 0;
	packet_full = false;

    time0 = moGetTicks() / 1000.0;
}
Beispiel #4
0
bool moEventPacket::ReadyToSend()
{
	float time1 = moGetTicks() / 1000.0;
	return (sendInterval <= time1 - time0) || packet_full;
}
void moPostEffectDebug::Draw( moTempo* tempogral,moEffectState* parentstate)
{

	//calculamos ticks y frames x seg
	moTextArray TextArray;
    MOulong timecodeticks;
    int w;
    int h;

    BeginDraw( tempogral, parentstate);

    if (m_pResourceManager) {
        w = m_pResourceManager->GetRenderMan()->ScreenWidth();
        h = m_pResourceManager->GetRenderMan()->ScreenHeight();
    }




	ticksprevious = ticks;
	ticks = moGetTicksAbsolute();
	tickselapsed = ticks - ticksprevious;

	fps_current = 1000.0 / tickselapsed;
	fps_mean += fps_current;

	fps_count++;
	if (fps_count % 10 == 0)
	{
		fps_mean /= 10;
		fps_text = moText("FPS = ") + (moText)FloatToStr(fps_mean);
		fps_mean = 0;
		fps_count = 0;
	}
	TextArray.Add(fps_text);



/*
    for(int g=560;g>=80 ;g-=20) {
        //glPrint(0,g,MODebug2->Pop(),0,1.0,1.0);
        //glPrint(0,g,moText("test"),0,1.0,1.0);

    }
*/


	/*
	moText state_datos;
	moText state_luminosidad;
	moText state_colorido;
	moText state_magnitude;

	state_datos+= "SINC: ";
	state_datos+= IntToStr(state.synchronized);
	state_datos+= " FAC: ";
	state_datos+= FloatToStr(m_EffectState.tempo.factor,4);
	state_datos+= " SYNCRO: ";
	state_datos+= FloatToStr(m_EffectState.tempo.syncro,4);

	state_luminosidad+="ALPHA:";
	state_luminosidad+= FloatToStr(state.alpha,4);
	state_luminosidad+="LUM:";
	state_luminosidad+= FloatToStr(state.tint,4);

	state_colorido+="ALPHA:";
	state_colorido+= FloatToStr(state.tintc,4);
	state_colorido+="SAT:";
	state_colorido+= FloatToStr(state.tints,4);

	state_magnitude+="DELTA:";
	state_magnitude+= FloatToStr(m_EffectState.tempo.delta,4);
	state_magnitude+="AMP:";
	state_magnitude+= FloatToStr(state.amplitude,4);


	MODebug2->Push(state_datos);
	MODebug2->Push(state_luminosidad);
	MODebug2->Push(state_colorido);
	MODebug2->Push(state_magnitude);
*/


    moFont mFont = m_Config.Font( moR(DEBUG_FONT) );

    PreDraw( tempogral, parentstate);

    // Cambiar la proyeccion para una vista ortogonal //
	glDisable(GL_DEPTH_TEST);							// Disables Depth Testing
	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix
	glLoadIdentity();									// Reset The Projection Matrix
	glOrtho(0,w,0,h,-1,1);                              // Set Up An Ortho Screen
    glMatrixMode(GL_MODELVIEW);                         // Select The Modelview Matrix
	glLoadIdentity();									// Reset The View


    glEnable(GL_BLEND);

    //color
    SetColor( m_Config[moR(DEBUG_COLOR)], m_Config[moR(DEBUG_ALPHA)], m_EffectState );

    moText Texto = moText("");


    int minutes;
    int seconds;
    int frames;

    //if (mFont) {
        /*
        pFont->Draw(    0.0,
                        0.0,
                        Texto,
                        m_Config[moR(DEBUG_FONT)][MO_SELECTED][2].Int(),
                        0 );
                        */

        Texto+= fps_text;

        timecodeticks = moGetTicks();
        minutes = timecodeticks / (1000*60);
        seconds = (timecodeticks - minutes*1000*60) / 1000;
        frames = (timecodeticks - minutes*1000*60 - seconds*1000 ) * 25 / 1000;

        Texto+= moText(" ticks: ") + (moText)IntToStr(timecodeticks,10) +
                moText(" ang: ") + (moText)FloatToStr((float)tempogral->ang) +
                moText(" timecode: ") + (moText)IntToStr(minutes, 2) + moText(":") + (moText)IntToStr(seconds,2) + moText(":") + (moText)IntToStr(frames,2);

        //glTranslatef( 0.0, 2.0, 0.0 );
        mFont.Draw(    0.0,
                        0.0,
                        Texto,
                        m_Config[moR(DEBUG_FONT)][MO_SELECTED][2].Int(),
                        0 );


        moText  Final;

        int cint = 0;
        //Final = moText("Debug ");
        //for( int i=0; i<MODebug2->Count(); i++ ) {
        //    cint++;
            //Final = MODebug2->GetMessages().Get(i);
        //}

        cint = MODebug2->Count();
        //Final = Final + moText("(")+IntToStr( cint ) + moText("):");
        //if (cint>0) Final = Final + (moText)MODebug2->GetLast();


        /*
        for( int i=0; i<(cint-1); i++ ) {
            Final = MODebug2->Pop();
        }
        */
        mFont.Draw( 0.0, 48.0, Final );

        //moText infod = moText("screen width:")+IntToStr(w)+moText(" screen height:")+IntToStr(h);
        //pFont->Draw( 0, 0, infod, m_Config[moR(TEXT_FONT)][MO_SELECTED][2].Int(), 0, 2.0, 2.0, 0.0);
    //}

	glMatrixMode(GL_MODELVIEW);							// Select The Modelview Matrix
	glPopMatrix();										// Restore The Old Projection Matrix
	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix
	glPopMatrix();										// Restore The Old Projection Matrix

}