Commit 3a83de21 authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Fix: Coding Rules useless OpenViBE types

parent 2e1d7425
...@@ -86,7 +86,7 @@ bool CShooterApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex ...@@ -86,7 +86,7 @@ bool CShooterApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
return true; return true;
} }
void CShooterApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame) void CShooterApplication::processFrame(uint32_t ui32CurrentFrame)
{ {
CApplication::processFrame(ui32CurrentFrame); CApplication::processFrame(ui32CurrentFrame);
m_poShip->processFrame( ui32CurrentFrame ); m_poShip->processFrame( ui32CurrentFrame );
...@@ -106,7 +106,7 @@ void CShooterApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame) ...@@ -106,7 +106,7 @@ void CShooterApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame)
} }
} }
void CShooterApplication::addTarget(OpenViBE::uint32 ui32TargetPosition) void CShooterApplication::addTarget(uint32_t ui32TargetPosition)
{ {
m_oTargets.push_back( CShooterTarget::createTarget( Ogre::Radian( Math::PI * 2 / 360 * 45 * ui32TargetPosition ) ) ); m_oTargets.push_back( CShooterTarget::createTarget( Ogre::Radian( Math::PI * 2 / 360 * 45 * ui32TargetPosition ) ) );
} }
......
...@@ -30,14 +30,14 @@ namespace OpenViBESSVEP ...@@ -30,14 +30,14 @@ namespace OpenViBESSVEP
void startExperiment(); void startExperiment();
void addTarget(OpenViBE::uint32 ui32TargetPosition); void addTarget(uint32_t ui32TargetPosition);
bool m_bTargetRequest; bool m_bTargetRequest;
private: private:
bool m_bActive; bool m_bActive;
void processFrame(OpenViBE::uint32 ui32CurrentFrame); void processFrame(uint32_t ui32CurrentFrame);
CEGUI::Window* m_poInstructionsReady; CEGUI::Window* m_poInstructionsReady;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
using namespace OpenViBESSVEP; using namespace OpenViBESSVEP;
using namespace Ogre; using namespace Ogre;
CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<OpenViBE::uint32, OpenViBE::uint32> >* pFrequencies) : CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<uint32_t, uint32_t> >* pFrequencies) :
m_rCurrentAngle( 0 ), m_rCurrentAngle( 0 ),
m_iCurrentRotationCount( 0 ), m_iCurrentRotationCount( 0 ),
m_bIsShooting( false ) m_bIsShooting( false )
...@@ -130,7 +130,7 @@ CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, ...@@ -130,7 +130,7 @@ CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode,
} }
void CStarShip::processFrame( OpenViBE::uint32 ui32CurrentFrame ) void CStarShip::processFrame( uint32_t ui32CurrentFrame )
{ {
m_poShipCannon->processFrame(); m_poShipCannon->processFrame();
m_poShipLeftWing->processFrame(); m_poShipLeftWing->processFrame();
......
...@@ -14,8 +14,8 @@ namespace OpenViBESSVEP ...@@ -14,8 +14,8 @@ namespace OpenViBESSVEP
class CStarShip class CStarShip
{ {
public: public:
CStarShip( CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<OpenViBE::uint32, OpenViBE::uint32> >* pFrequencies); CStarShip( CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<uint32_t, uint32_t> >* pFrequencies);
void processFrame( OpenViBE::uint32 ui32CurrentFrame ); void processFrame( uint32_t ui32CurrentFrame );
void rotate( int iRotationCount ); void rotate( int iRotationCount );
......
...@@ -41,9 +41,9 @@ bool CTrainerApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex ...@@ -41,9 +41,9 @@ bool CTrainerApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
// paint targets // paint targets
OpenViBE::uint32 l_ui32TargetCount = (OpenViBE::uint32)(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}")); uint32_t l_ui32TargetCount = (uint32_t)(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
for (OpenViBE::uint32 i = 0; i < l_ui32TargetCount; i++) for (uint32_t i = 0; i < l_ui32TargetCount; i++)
{ {
this->addObject(CTrainerFlickeringObject::createTrainerFlickeringObject(i)); this->addObject(CTrainerFlickeringObject::createTrainerFlickeringObject(i));
} }
...@@ -85,7 +85,7 @@ bool CTrainerApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex ...@@ -85,7 +85,7 @@ bool CTrainerApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
} }
void CTrainerApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame) void CTrainerApplication::processFrame(uint32_t ui32CurrentFrame)
{ {
CApplication::processFrame(ui32CurrentFrame); CApplication::processFrame(ui32CurrentFrame);
...@@ -94,7 +94,7 @@ void CTrainerApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame) ...@@ -94,7 +94,7 @@ void CTrainerApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame)
return; return;
} }
for (OpenViBE::uint32 i = 0; i < m_oObjects.size(); i++) for (uint32_t i = 0; i < m_oObjects.size(); i++)
{ {
m_oObjects[i]->processFrame(); m_oObjects[i]->processFrame();
} }
...@@ -106,12 +106,12 @@ void CTrainerApplication::addObject(CTrainerFlickeringObject* poObject) ...@@ -106,12 +106,12 @@ void CTrainerApplication::addObject(CTrainerFlickeringObject* poObject)
poObject->setVisible( true ); poObject->setVisible( true );
} }
void CTrainerApplication::setTarget(OpenViBE::int32 i32Target) void CTrainerApplication::setTarget(int32_t i32Target)
{ {
OpenViBE::uint32 l_ui32CurrentTime = (OpenViBE::int32)(time(NULL) - m_ttStartTime); uint32_t l_ui32CurrentTime = (int32_t)(time(NULL) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Target set to " << i32Target << "\n"; (*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Target set to " << i32Target << "\n";
for (OpenViBE::int32 i = 0; i < int(m_oObjects.size()); i++) for (int32_t i = 0; i < int(m_oObjects.size()); i++)
{ {
m_oObjects[i]->setTarget( i32Target == i ); m_oObjects[i]->setTarget( i32Target == i );
} }
...@@ -129,18 +129,18 @@ void CTrainerApplication::startExperiment() ...@@ -129,18 +129,18 @@ void CTrainerApplication::startExperiment()
void CTrainerApplication::startFlickering() void CTrainerApplication::startFlickering()
{ {
OpenViBE::uint32 l_ui32CurrentTime = (OpenViBE::uint32)(time(NULL) - m_ttStartTime); uint32_t l_ui32CurrentTime = (uint32_t)(time(NULL) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Starting Visual Stimulation\n"; (*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Starting Visual Stimulation\n";
m_bActive = true; m_bActive = true;
} }
void CTrainerApplication::stopFlickering() void CTrainerApplication::stopFlickering()
{ {
OpenViBE::uint32 l_ui32CurrentTime = (OpenViBE::uint32)(time(NULL) - m_ttStartTime); uint32_t l_ui32CurrentTime = (uint32_t)(time(NULL) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Stopping Visual Stimulation\n"; (*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Stopping Visual Stimulation\n";
m_bActive = false; m_bActive = false;
for (OpenViBE::uint32 i = 0; i < m_oObjects.size(); i++) for (uint32_t i = 0; i < m_oObjects.size(); i++)
{ {
m_oObjects[i]->setVisible(true); m_oObjects[i]->setVisible(true);
} }
......
...@@ -17,7 +17,7 @@ namespace OpenViBESSVEP ...@@ -17,7 +17,7 @@ namespace OpenViBESSVEP
~CTrainerApplication() {}; ~CTrainerApplication() {};
bool setup(OpenViBE::Kernel::IKernelContext* poKernelContext); bool setup(OpenViBE::Kernel::IKernelContext* poKernelContext);
void setTarget(OpenViBE::int32 i32Target); void setTarget(int32_t i32Target);
void startExperiment(); void startExperiment();
void startFlickering(); void startFlickering();
...@@ -26,7 +26,7 @@ namespace OpenViBESSVEP ...@@ -26,7 +26,7 @@ namespace OpenViBESSVEP
private: private:
bool m_bActive; bool m_bActive;
void processFrame(OpenViBE::uint32 ui32CurrentFrame); void processFrame(uint32_t ui32CurrentFrame);
void addObject(CTrainerFlickeringObject *target); void addObject(CTrainerFlickeringObject *target);
std::vector<CTrainerFlickeringObject*> m_oObjects; std::vector<CTrainerFlickeringObject*> m_oObjects;
......
...@@ -11,8 +11,8 @@ SceneNode* CTrainerFlickeringObject::m_poParentNode = nullptr; ...@@ -11,8 +11,8 @@ SceneNode* CTrainerFlickeringObject::m_poParentNode = nullptr;
CBasicPainter* CTrainerFlickeringObject::m_poPainter = nullptr; CBasicPainter* CTrainerFlickeringObject::m_poPainter = nullptr;
ColourValue CTrainerFlickeringObject::m_oLightColour = ColourValue(1.0f, 1.0f, 1.0f); ColourValue CTrainerFlickeringObject::m_oLightColour = ColourValue(1.0f, 1.0f, 1.0f);
ColourValue CTrainerFlickeringObject::m_oDarkColour = ColourValue(0.0f, 0.0f, 0.0f); ColourValue CTrainerFlickeringObject::m_oDarkColour = ColourValue(0.0f, 0.0f, 0.0f);
OpenViBE::float32 CTrainerFlickeringObject::m_f32TargetWidth = 0.2f; float CTrainerFlickeringObject::m_f32TargetWidth = 0.2f;
OpenViBE::float32 CTrainerFlickeringObject::m_f32TargetHeight = 0.2f; float CTrainerFlickeringObject::m_f32TargetHeight = 0.2f;
CTrainerApplication* CTrainerFlickeringObject::m_poApplication = nullptr; CTrainerApplication* CTrainerFlickeringObject::m_poApplication = nullptr;
void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication ) void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication )
...@@ -23,8 +23,8 @@ void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication ) ...@@ -23,8 +23,8 @@ void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication )
m_poPainter = poApplication->getPainter(); m_poPainter = poApplication->getPainter();
m_poParentNode = poApplication->getSceneNode(); m_poParentNode = poApplication->getSceneNode();
m_f32TargetWidth = (OpenViBE::float32)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetWidth}")); m_f32TargetWidth = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetWidth}"));
m_f32TargetHeight = (OpenViBE::float32)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetHeight}")); m_f32TargetHeight = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetHeight}"));
m_oLightColour = ColourValue( m_oLightColour = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}")), (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}")),
...@@ -38,7 +38,7 @@ void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication ) ...@@ -38,7 +38,7 @@ void CTrainerFlickeringObject::initialize( CTrainerApplication* poApplication )
} }
CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObject( OpenViBE::uint32 l_i32TargetId ) CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObject( uint32_t l_i32TargetId )
{ {
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = m_poApplication->getConfigurationManager(); OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = m_poApplication->getConfigurationManager();
...@@ -51,10 +51,10 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec ...@@ -51,10 +51,10 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec
OpenViBE::CIdentifier l_oTargetId = l_poConfigurationManager->createConfigurationToken("SSVEPTarget_Id", OpenViBE::CString(l_sTargetIdString)); OpenViBE::CIdentifier l_oTargetId = l_poConfigurationManager->createConfigurationToken("SSVEPTarget_Id", OpenViBE::CString(l_sTargetIdString));
OpenViBE::float32 l_f32TargetX = (OpenViBE::float32)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_X_${SSVEPTarget_Id}}")); float l_f32TargetX = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_X_${SSVEPTarget_Id}}"));
OpenViBE::float32 l_f32TargetY = (OpenViBE::float32)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_Y_${SSVEPTarget_Id}}")); float l_f32TargetY = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_Y_${SSVEPTarget_Id}}"));
OpenViBE::uint32 l_ui32FramesL = (*(m_poApplication->getFrequencies()))[ l_i32TargetId ].first; uint32_t l_ui32FramesL = (*(m_poApplication->getFrequencies()))[ l_i32TargetId ].first;
OpenViBE::uint32 l_ui32FramesD = (*(m_poApplication->getFrequencies()))[ l_i32TargetId ].second; uint32_t l_ui32FramesD = (*(m_poApplication->getFrequencies()))[ l_i32TargetId ].second;
m_poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "New trainer object : id=" << l_i32TargetId << " litFrames=" << l_ui32FramesL << " darkFrames=" << l_ui32FramesD << "\n"; m_poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "New trainer object : id=" << l_i32TargetId << " litFrames=" << l_ui32FramesL << " darkFrames=" << l_ui32FramesD << "\n";
...@@ -69,7 +69,7 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec ...@@ -69,7 +69,7 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec
} }
} }
CTrainerFlickeringObject::CTrainerFlickeringObject( OpenViBE::float32 f32PosX, OpenViBE::float32 f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, OpenViBE::uint8 ui8DarkFrames ) : CTrainerFlickeringObject::CTrainerFlickeringObject( float f32PosX, float f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, uint8_t ui8DarkFrames ) :
CSSVEPFlickeringObject( NULL, ui8LitFrames, ui8DarkFrames ) CSSVEPFlickeringObject( NULL, ui8LitFrames, ui8DarkFrames )
{ {
Ogre::SceneNode* l_poPointerNode; Ogre::SceneNode* l_poPointerNode;
......
...@@ -17,13 +17,13 @@ namespace OpenViBESSVEP ...@@ -17,13 +17,13 @@ namespace OpenViBESSVEP
class CTrainerFlickeringObject : public CSSVEPFlickeringObject class CTrainerFlickeringObject : public CSSVEPFlickeringObject
{ {
public: public:
static CTrainerFlickeringObject* createTrainerFlickeringObject( OpenViBE::uint32 ); static CTrainerFlickeringObject* createTrainerFlickeringObject( uint32_t );
static void initialize( CTrainerApplication* poApplication ); static void initialize( CTrainerApplication* poApplication );
void connectToNode( Ogre::SceneNode* poSceneNode ); void connectToNode( Ogre::SceneNode* poSceneNode );
void setTarget( OpenViBE::boolean bIsTarget ); void setTarget( bool bIsTarget );
OpenViBE::boolean isTarget() bool isTarget()
{ {
return m_poPointer->getVisible(); return m_poPointer->getVisible();
} }
...@@ -32,12 +32,12 @@ namespace OpenViBESSVEP ...@@ -32,12 +32,12 @@ namespace OpenViBESSVEP
static CTrainerApplication* m_poApplication; static CTrainerApplication* m_poApplication;
static Ogre::SceneNode* m_poParentNode; static Ogre::SceneNode* m_poParentNode;
static CBasicPainter* m_poPainter; static CBasicPainter* m_poPainter;
static OpenViBE::float32 m_f32TargetWidth; static float m_f32TargetWidth;
static OpenViBE::float32 m_f32TargetHeight; static float m_f32TargetHeight;
static Ogre::ColourValue m_oLightColour; static Ogre::ColourValue m_oLightColour;
static Ogre::ColourValue m_oDarkColour; static Ogre::ColourValue m_oDarkColour;
CTrainerFlickeringObject( OpenViBE::float32 f32PosX, OpenViBE::float32 f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, OpenViBE::uint8 ui8DarkFrames ); CTrainerFlickeringObject( float f32PosX, float f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, uint8_t ui8DarkFrames );
Ogre::SceneNode* m_poElementNode; Ogre::SceneNode* m_poElementNode;
......
...@@ -129,26 +129,26 @@ bool CApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext) ...@@ -129,26 +129,26 @@ bool CApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext)
// create the vector of stimulation frequencies // create the vector of stimulation frequencies
m_f64ScreenRefreshRate = (OpenViBE::uint32)(l_poConfigurationManager->expandAsUInteger("${SSVEP_ScreenRefreshRate}")); m_f64ScreenRefreshRate = (uint32_t)(l_poConfigurationManager->expandAsUInteger("${SSVEP_ScreenRefreshRate}"));
(*m_poLogManager) << LogLevel_Info << "Specified screen refresh rate :" << m_f64ScreenRefreshRate << "Hz\n"; (*m_poLogManager) << LogLevel_Info << "Specified screen refresh rate :" << m_f64ScreenRefreshRate << "Hz\n";
OpenViBE::uint32 i = 1; uint32_t i = 1;
char l_sFrequencyString[32] = "1"; char l_sFrequencyString[32] = "1";
CIdentifier l_oFrequencyId = l_poConfigurationManager->createConfigurationToken("SSVEP_FrequencyId", CString(l_sFrequencyString)); CIdentifier l_oFrequencyId = l_poConfigurationManager->createConfigurationToken("SSVEP_FrequencyId", CString(l_sFrequencyString));
m_oFrequencies.push_back(std::pair<OpenViBE::uint32, OpenViBE::uint32>(30, 30)); m_oFrequencies.push_back(std::pair<uint32_t, uint32_t>(30, 30));
while (l_poConfigurationManager->lookUpConfigurationTokenIdentifier(l_poConfigurationManager->expand("SSVEP_Frequency_${SSVEP_FrequencyId}")) != OV_UndefinedIdentifier) while (l_poConfigurationManager->lookUpConfigurationTokenIdentifier(l_poConfigurationManager->expand("SSVEP_Frequency_${SSVEP_FrequencyId}")) != OV_UndefinedIdentifier)
{ {
std::pair<OpenViBE::uint32, OpenViBE::uint32> l_oFrequency; std::pair<uint32_t, uint32_t> l_oFrequency;
OpenViBE::float64 l_f64CurrentFrequency; double l_f64CurrentFrequency;
OpenViBE::float64 l_f64ApproximatedFrameCount; double l_f64ApproximatedFrameCount;
l_f64CurrentFrequency = (OpenViBE::float64)(l_poConfigurationManager->expandAsFloat("${SSVEP_Frequency_${SSVEP_FrequencyId}}")); l_f64CurrentFrequency = (double)(l_poConfigurationManager->expandAsFloat("${SSVEP_Frequency_${SSVEP_FrequencyId}}"));
l_f64ApproximatedFrameCount= m_f64ScreenRefreshRate / l_f64CurrentFrequency; l_f64ApproximatedFrameCount= m_f64ScreenRefreshRate / l_f64CurrentFrequency;
...@@ -248,7 +248,7 @@ void CApplication::resizeViewport() ...@@ -248,7 +248,7 @@ void CApplication::resizeViewport()
); );
} }
void CApplication::processFrame(OpenViBE::uint32 ui32CurrentFrame) void CApplication::processFrame(uint32_t ui32CurrentFrame)
{ {
if (m_ui32WindowWidth != m_poWindow->getWidth() || m_ui32WindowHeight != m_poWindow->getHeight()) if (m_ui32WindowWidth != m_poWindow->getWidth() || m_ui32WindowHeight != m_poWindow->getHeight())
{ {
...@@ -283,7 +283,7 @@ bool CApplication::frameStarted(const Ogre::FrameEvent &evt) ...@@ -283,7 +283,7 @@ bool CApplication::frameStarted(const Ogre::FrameEvent &evt)
this->processFrame(m_ui32CurrentFrame); this->processFrame(m_ui32CurrentFrame);
for (OpenViBE::uint32 i = 0; i < m_oCommands.size(); i++) for (uint32_t i = 0; i < m_oCommands.size(); i++)
{ {
m_oCommands[i]->processFrame(); m_oCommands[i]->processFrame();
} }
......
...@@ -70,7 +70,7 @@ namespace OpenViBESSVEP ...@@ -70,7 +70,7 @@ namespace OpenViBESSVEP
return &(m_poKernelContext->getConfigurationManager()); return &(m_poKernelContext->getConfigurationManager());
} }
std::vector<std::pair<OpenViBE::uint32, OpenViBE::uint32> >* getFrequencies() std::vector<std::pair<uint32_t, uint32_t> >* getFrequencies()
{ {
return &m_oFrequencies; return &m_oFrequencies;
} }
...@@ -82,11 +82,11 @@ namespace OpenViBESSVEP ...@@ -82,11 +82,11 @@ namespace OpenViBESSVEP
OpenViBE::Kernel::IKernelContext* m_poKernelContext; OpenViBE::Kernel::IKernelContext* m_poKernelContext;