void CExpressivePixelsApp::ProcessRendering()

in Firmware/ExpressivePixelsCore/EPXApp.cpp [768:830]


void CExpressivePixelsApp::ProcessRendering()
{
	switch (m_renderMode)
	{
	// If in regular animation mode
	case RENDERMODE_ANIMATE:
		// Pass down to the animation rendering class
		if (m_CAnimator.Process())
		{
			// When an animation has completed rendering
			bool restarted;
			
			DEBUGLOGLN("Animation COMPLETE ");

			// Process autoplay
			if (m_CAppStorage.IsAutoPlayActive() && m_CAppStorage.AutoPlaylistIterate(false, &restarted))
			{
				DEBUGLOGLN("Next AUTOPLAY %s", m_CAppStorage.AutoPlaylistCurrent()->pszGUID);
				ActivateSequenceFromID(m_CAppStorage.AutoPlaylistCurrent()->pszGUID);					
			}
			else
			{
				// If beacon activation is active and a trigger has been received play it
				if (m_bBeaconActivation && m_lastBeaconData > 0 && m_pActiveBeaconActivation != NULL && (m_pActiveBeaconActivation->m_beaconActivationBit  & m_lastBeaconData) != 0)
					ActivateSequenceFromName(m_pActiveBeaconActivation->szAnimationName);
				else if (m_bInvokedAutoPlay)
				{					
					AutoPlayClear();					
					if (m_connectedChannel == EPXAPP_CONNECTIONCHANNEL_NONE)
						PowerManage(false);
					m_bInvokedAutoPlay = false;					
				}
				else if (m_triggerPowerMode == EPXAPP_TRIGGERPOWERMODE_SINGLEANIMATION)
				{
					if (m_connectedChannel == EPXAPP_CONNECTIONCHANNEL_NONE)
						PowerManage(false);
					m_triggerPowerMode = EPXAPP_TRIGGERPOWERMODE_OFF;					
				}
				else
					m_CAnimator.Clear();
			}
		}
		break;

	case RENDERMODE_CHASER:
		if (millis() - m_FeatureMillis > 250)
		{
			m_CDisplayArray.Chase(false);
			m_FeatureMillis = millis();
		}
		break;
		
	case RENDERMODE_RAINBOWCYCLE:
		m_CDisplayArray.RainbowCycle(10); 
		break;
	}
	
	// Perform display power management
	if(m_CDisplayArray.Process())
        {
            tmallocstats();
        }
}