add LightsDriver_Export
This commit is contained in:
@@ -196,6 +196,7 @@ MovieTexture += arch/MovieTexture/MovieTexture_FFMpeg.cpp arch/MovieTexture/Movi
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
Lights = arch/Lights/LightsDriver.h \
|
Lights = arch/Lights/LightsDriver.h \
|
||||||
|
arch/Lights/LightsDriver_Export.cpp arch/Lights/LightsDriver_Export.h \
|
||||||
arch/Lights/LightsDriver_SystemMessage.cpp arch/Lights/LightsDriver_SystemMessage.h
|
arch/Lights/LightsDriver_SystemMessage.cpp arch/Lights/LightsDriver_SystemMessage.h
|
||||||
|
|
||||||
MemoryCard = arch/MemoryCard/MemoryCardDriver.cpp arch/MemoryCard/MemoryCardDriver.h
|
MemoryCard = arch/MemoryCard/MemoryCardDriver.cpp arch/MemoryCard/MemoryCardDriver.h
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "LightsDriver_Export.h"
|
||||||
|
|
||||||
|
RageMutex LightsDriver_Export::m_Lock( "LightsDriver_Export");
|
||||||
|
LightsState LightsDriver_Export::m_State;
|
||||||
|
|
||||||
|
LightsDriver_Export::LightsDriver_Export()
|
||||||
|
{
|
||||||
|
memset( &m_State, 0, sizeof(m_State) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void LightsDriver_Export::Set( const LightsState *ls )
|
||||||
|
{
|
||||||
|
m_Lock.Lock();
|
||||||
|
m_State = *ls;
|
||||||
|
m_Lock.Unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
LightsState LightsDriver_Export::GetState()
|
||||||
|
{
|
||||||
|
m_Lock.Lock();
|
||||||
|
LightsState ret( m_State );
|
||||||
|
m_Lock.Unlock();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (c) 2006 Glenn Maynard
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||||
|
* whom the Software is furnished to do so, provided that the above
|
||||||
|
* copyright notice(s) and this permission notice appear in all copies of
|
||||||
|
* the Software and that both the above copyright notice(s) and this
|
||||||
|
* permission notice appear in supporting documentation.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||||
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||||
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||||
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/* LightsDriver_Export - Export lights data for other devices that supply lights as a secondary service. */
|
||||||
|
|
||||||
|
#ifndef LIGHTS_DRIVER_EXPORT_H
|
||||||
|
#define LIGHTS_DRIVER_EXPORT_H
|
||||||
|
|
||||||
|
#include "LightsDriver.h"
|
||||||
|
#include "RageThreads.h"
|
||||||
|
|
||||||
|
class LightsDriver_Export: public LightsDriver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LightsDriver_Export();
|
||||||
|
virtual void Set( const LightsState *ls );
|
||||||
|
|
||||||
|
/* Get the current lights state. This can be called from a thread. */
|
||||||
|
static LightsState GetState();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static RageMutex m_Lock;
|
||||||
|
static LightsState m_State;
|
||||||
|
};
|
||||||
|
#define USE_LIGHTS_DRIVER_EXPORT
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (c) 2006 Glenn Maynard
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||||
|
* whom the Software is furnished to do so, provided that the above
|
||||||
|
* copyright notice(s) and this permission notice appear in all copies of
|
||||||
|
* the Software and that both the above copyright notice(s) and this
|
||||||
|
* permission notice appear in supporting documentation.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||||
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||||
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||||
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
@@ -27,6 +27,9 @@ void MakeLightsDrivers( const RString &driver, vector<LightsDriver *> &Add )
|
|||||||
#ifdef USE_LIGHTS_DRIVER_WIN32_PARALLEL
|
#ifdef USE_LIGHTS_DRIVER_WIN32_PARALLEL
|
||||||
if( !driver.CompareNoCase("Parallel") ) ret = new LightsDriver_Win32Parallel;
|
if( !driver.CompareNoCase("Parallel") ) ret = new LightsDriver_Win32Parallel;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_LIGHTS_DRIVER_EXPORT
|
||||||
|
if( !driver.CompareNoCase("Export") ) ret = new LightsDriver_Export;
|
||||||
|
#endif
|
||||||
|
|
||||||
if( ret == NULL && driver.CompareNoCase("Null") )
|
if( ret == NULL && driver.CompareNoCase("Null") )
|
||||||
LOG->Trace( "Unknown lights driver name: %s", driver.c_str() );
|
LOG->Trace( "Unknown lights driver name: %s", driver.c_str() );
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* All use these. */
|
/* All use these. */
|
||||||
|
#include "Lights/LightsDriver_Export.h"
|
||||||
#include "Lights/LightsDriver_SystemMessage.h"
|
#include "Lights/LightsDriver_SystemMessage.h"
|
||||||
#include "Lights/LightsDriver_Null.h"
|
#include "Lights/LightsDriver_Null.h"
|
||||||
#include "LoadingWindow/LoadingWindow_Null.h"
|
#include "LoadingWindow/LoadingWindow_Null.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user