Browse Source

Dateien hochladen nach „src“

master
Tobias Baumann 2 years ago
parent
commit
16e6df36ed
3 changed files with 93 additions and 0 deletions
  1. 21
    0
      src/ovp_defines.h
  2. 22
    0
      src/ovp_main.cpp
  3. 50
    0
      src/utils.h

+ 21
- 0
src/ovp_defines.h View File

@@ -0,0 +1,21 @@
#pragma once
// Boxes
// The unique identifiers for the boxes and their descriptors.
// Identifier are randomly chosen by the skeleton-generator.
//---------------------------------------------------------------------------------------------------
#define OVP_ClassId_BoxAlgorithm_P300TactileVisualization OpenViBE::CIdentifier(0xd463df86, 0x7fbfdd81)
#define OVP_ClassId_BoxAlgorithm_P300TactileVisualizationDesc OpenViBE::CIdentifier(0x3e7f0ef5, 0x5ca2a1fc)
#define OVP_ClassId_BoxAlgorithm_UDPStimcodeSender OpenViBE::CIdentifier(0xc326e786, 0xcd512965)
#define OVP_ClassId_BoxAlgorithm_UDPStimcodeSenderDesc OpenViBE::CIdentifier(0x82aeb3c9, 0x37303d0e)
// Global defines
//---------------------------------------------------------------------------------------------------
#ifdef TARGET_HAS_ThirdPartyOpenViBEPluginsGlobalDefines
#include "ovp_global_defines.h"
#endif // TARGET_HAS_ThirdPartyOpenViBEPluginsGlobalDefines
#define OV_AttributeId_Box_FlagIsUnstable OpenViBE::CIdentifier(0x666FFFFF, 0x666FFFFF)

+ 22
- 0
src/ovp_main.cpp View File

@@ -0,0 +1,22 @@
//Tactile BCI Includes
#include <vector>
#include <openvibe/ov_all.h>
#include "ovp_defines.h"
#include "TactileVisualization/ovpCBoxAlgorithmP300TactileVisualization.h"
#include "UDPStimCodeSender/ovpCBoxAlgorithmUDPStimcodeSender.h"
namespace OpenViBE {
namespace Plugins {
namespace Tactilebci {
OVP_Declare_Begin()
OVP_Declare_New(CBoxAlgorithmP300TactileVisualizationDesc);
OVP_Declare_New(CBoxAlgorithmUDPStimcodeSenderDesc);
OVP_Declare_End()
} // namespace Tactilebci
} // namespace Plugins
} // namespace OpenViBE

+ 50
- 0
src/utils.h View File

@@ -0,0 +1,50 @@
#pragma once
#include <openvibe/ov_all.h>
#include <gtk/gtk.h>
#include <sstream>
//---------------------------------------------------------------------------------------------------
/// <summary> Initializes the color of the GDK. with old compiler as vs2013 we can't initialize structure easily.....</summary>
/// <param name="pixel"> For allocated colors, the pixel value used to draw this color on the screen.Not used anymore.</param>
/// <param name="r"> The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity.</param>
/// <param name="g"> The green component of the color.</param>
/// <param name="b"> The blue component of the color.</param>
/// <returns> The initialized color (</returns>
inline GdkColor InitGDKColor(const guint32 pixel = 0, const guint16 r = 0, const guint16 g = 0, const guint16 b = 0)
{
GdkColor c;
c.pixel = pixel;
c.red = r;
c.green = g;
c.blue = b;
return c;
}
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
class CGdkcolorAutoCast
{
public:
CGdkcolorAutoCast(const OpenViBE::Kernel::IBox& box, OpenViBE::Kernel::IConfigurationManager& configManager, const size_t index)
: m_configManager(configManager)
{
box.getSettingValue(index, m_settingValue);
m_settingValue = m_configManager.expand(m_settingValue);
}
operator GdkColor() const
{
std::stringstream ss(m_settingValue.toASCIIString());
int r = 0, g = 0, b = 0;
char c;
ss >> r >> c >> g >> c >> b;
return InitGDKColor(0, guint16(r * 655.35), guint16(g * 655.35), guint16(b * 655.35));
}
protected:
OpenViBE::Kernel::IConfigurationManager& m_configManager;
OpenViBE::CString m_settingValue;
};
//---------------------------------------------------------------------------------------------------

Loading…
Cancel
Save