Commit ae65fea1 authored by Yann Renard's avatar Yann Renard

merged wip-yrenard branch to trunc -r 900:1139 for openvibe

merged wip-yrenard branch to trunc -r 912:1139 for openvibe-kernel
merged wip-yrenard branch to trunc -r 921:1139 for openvibe-applications-designer

openvibe :
 - removed static targets from the CMakeLists.txt
 + added header files to source GLOB so to have headers in visual studio generated projects
 + added macro definitions to help creating ovp_main for plugin projects
 + added algorithm interface functionnalities to get details/enumerate parameters and triggers
 + added player interface functionnality play/stop/pause etc..
 + added player interface external time support
 + added visit pattern to get serialization of kernel objects
 + doxygen class API documentation
 + doxygen css rendering
 + enhanced TParameterHandler behavior for setting / getting reference targets
 * slightly modified some sources in order to compile with g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
 * modified plugin objects enumeartion behavior (no more callback)
 * modified scenario enumeration behavior (no more callback)

openvibe-kernel :
 - removed static targets from the CMakeLists.txt
 - removed OpenMASK dependency
 + added header files to source GLOB so to have headers in visual studio generated projects
 + added generic template based enumeration function in the tools part
 + added algorithm functionnalities to get details/enumerate parameters and triggers
 + added player functionnality play/stop/pause etc..
 + added player external time support
 + added player capability to load external configuration file for each box algorithm
 + added visit pattern to get serialization of kernel objects
 + added a cache for chunks in the scheduler
 + added test on duplicate plugin object / plugin object descriptor ids
 * corrected bug on clock activation
 * scenario components no longer use object factory to create final object instances and store this instances in their final class form
 * modified error lookup function on windows when plugin loading did not work in order to remove cariage returns
 * slightly modified some sources in order to compile with g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
 * better log messages
 * corrected bug at algorithm creation
 * spied algorithm initialization/uninitialization
 * modified several log levels to get lower information quantity default configuration
 * activated scope tester at debug level
 * corrected bug that caused crash when IBoxAlgorithm instance could not be created
 * corrected bug on most of the enumeration functions
 * enhanced TKernelObject base class of all kernel objects
 * modified heritage scheme, no more virtual inheritance
 * modified plugin objects enumeartion behavior (no more callback)
 * modified scenario enumeration behavior (no more callback)
 * solved portability issues on windows

openvibe-applications-designer :
 + added header files to source GLOB so to have headers in visual studio generated projects
 + added sleep call when no player is running
 + added exception catcher at top application level
 + added fast forward functionnality
 + added time display in the top button bar
 + added per box algorithm configuration file support
 + added connector editor
 * externally managed time computation (sent to player)


git-svn-id: svn://scm.gforge.inria.fr/svn/openvibe@1140 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f
parent 0d64115b
......@@ -51,6 +51,7 @@ ADD_DEPENDENCIES(${PROJECT_NAME}-dynamic OpenViBE-toolkit-static)
INCLUDE("FindOpenViBE")
INCLUDE("FindOpenViBEToolkit")
INCLUDE("FindOpenViBEModuleSystem")
INCLUDE("FindThirdPartyGlade")
# ---------------------------------
......
#include "ovdCConnectorEditor.h"
#include <map>
#include <string>
using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBEDesigner;
using namespace std;
CConnectorEditor::CConnectorEditor(IKernel& rKernel, IBox& rBox, uint32 ui32ConnectorType, uint32 ui32ConnectorIndex, const char* sGUIFilename)
:m_rKernel(rKernel)
,m_rBox(rBox)
,m_ui32ConnectorType(ui32ConnectorType)
,m_ui32ConnectorIndex(ui32ConnectorIndex)
,m_sGUIFilename(sGUIFilename)
{
}
CConnectorEditor::~CConnectorEditor(void)
{
}
void CConnectorEditor::run(void)
{
t_getConnectorName getConnectorName=NULL;
t_setConnectorName setConnectorName=NULL;
t_getConnectorType getConnectorType=NULL;
t_setConnectorType setConnectorType=NULL;
switch(m_ui32ConnectorType)
{
case Connector_Input:
getConnectorName=&IBox::getInputName;
setConnectorName=&IBox::setInputName;
getConnectorType=&IBox::getInputType;
setConnectorType=&IBox::setInputType;
break;
case Connector_Output:
getConnectorName=&IBox::getOutputName;
setConnectorName=&IBox::setOutputName;
getConnectorType=&IBox::getOutputType;
setConnectorType=&IBox::setOutputType;
break;
default:
return;
}
CString l_oConnectorName;
CIdentifier l_oConnectorType;
(m_rBox.*getConnectorName)(m_ui32ConnectorIndex, l_oConnectorName);
(m_rBox.*getConnectorType)(m_ui32ConnectorIndex, l_oConnectorType);
::GladeXML* l_pGladeInterfaceConnector=glade_xml_new(m_sGUIFilename.c_str(), "openvibe_connector", NULL);
::GtkWidget* l_pConnectorDialog=glade_xml_get_widget(l_pGladeInterfaceConnector, "openvibe_connector");
::GtkEntry* l_pConnectorNameEntry=GTK_ENTRY(glade_xml_get_widget(l_pGladeInterfaceConnector, "connector_name_entry"));
::GtkComboBox* l_pConnectorTypeComboBox=GTK_COMBO_BOX(glade_xml_get_widget(l_pGladeInterfaceConnector,"connector_type_combobox"));
gtk_list_store_clear(GTK_LIST_STORE(gtk_combo_box_get_model(l_pConnectorTypeComboBox)));
gtk_window_set_title(GTK_WINDOW(l_pConnectorDialog), m_rBox.getName());
map<string, CIdentifier> m_vStreamTypes;
CIdentifier l_oCurrentTypeIdentifier;
gint l_iActive=-1;
while((l_oCurrentTypeIdentifier=m_rKernel.getContext()->getTypeManager().getNextTypeIdentifier(l_oCurrentTypeIdentifier))!=OV_UndefinedIdentifier)
{
if(m_rKernel.getContext()->getTypeManager().isStream(l_oCurrentTypeIdentifier))
{
gtk_combo_box_append_text(l_pConnectorTypeComboBox, m_rKernel.getContext()->getTypeManager().getTypeName(l_oCurrentTypeIdentifier).toASCIIString());
if(l_oCurrentTypeIdentifier==l_oConnectorType)
{
l_iActive=m_vStreamTypes.size();
gtk_combo_box_set_active(l_pConnectorTypeComboBox, l_iActive);
}
m_vStreamTypes[m_rKernel.getContext()->getTypeManager().getTypeName(l_oCurrentTypeIdentifier).toASCIIString()]=l_oCurrentTypeIdentifier;
}
}
gtk_entry_set_text(l_pConnectorNameEntry, l_oConnectorName.toASCIIString());
boolean l_bFinished=false;
while(!l_bFinished)
{
gint l_iResult=gtk_dialog_run(GTK_DIALOG(l_pConnectorDialog));
if(l_iResult==0) // revert
{
(m_rBox.*getConnectorName)(m_ui32ConnectorIndex, l_oConnectorName);
(m_rBox.*getConnectorType)(m_ui32ConnectorIndex, l_oConnectorType);
gtk_entry_set_text(l_pConnectorNameEntry, l_oConnectorName.toASCIIString());
gtk_combo_box_set_active(l_pConnectorTypeComboBox, l_iActive);
}
else if(l_iResult==GTK_RESPONSE_APPLY)
{
map<string, CIdentifier>::const_iterator it=m_vStreamTypes.find(gtk_combo_box_get_active_text(l_pConnectorTypeComboBox));
if(it!=m_vStreamTypes.end())
{
(m_rBox.*setConnectorType)(m_ui32ConnectorIndex, it->second);
(m_rBox.*setConnectorName)(m_ui32ConnectorIndex, gtk_entry_get_text(l_pConnectorNameEntry));
l_bFinished=true;
}
}
else
{
l_bFinished=true;
}
}
gtk_widget_destroy(l_pConnectorDialog);
g_object_unref(l_pGladeInterfaceConnector);
}
#ifndef __OpenViBEDesigner_CConnectorEditor_H__
#define __OpenViBEDesigner_CConnectorEditor_H__
#include "ovd_base.h"
#include <string>
namespace OpenViBEDesigner
{
class CConnectorEditor
{
public:
CConnectorEditor(OpenViBE::Kernel::IKernel& rKernel, OpenViBE::Kernel::IBox& rBox, OpenViBE::uint32 ui32ConnectorType, OpenViBE::uint32 ui32ConnectorIndex, const char* sGUIFilename);
virtual ~CConnectorEditor(void);
virtual void run(void);
protected:
OpenViBE::Kernel::IKernel& m_rKernel;
OpenViBE::Kernel::IBox& m_rBox;
OpenViBE::uint32 m_ui32ConnectorType;
OpenViBE::uint32 m_ui32ConnectorIndex;
const std::string m_sGUIFilename;
private:
typedef OpenViBE::uint32 (OpenViBE::Kernel::IBox::*t_getConnectorCount)(void) const;
typedef OpenViBE::boolean (OpenViBE::Kernel::IBox::*t_getConnectorType)(
const OpenViBE::uint32 ui32InputIndex,
OpenViBE::CIdentifier& rTypeIdentifier) const;
typedef OpenViBE::boolean (OpenViBE::Kernel::IBox::*t_getConnectorName)(
const OpenViBE::uint32 ui32InputIndex,
OpenViBE::CString& rName) const;
typedef OpenViBE::boolean (OpenViBE::Kernel::IBox::*t_setConnectorType)(
const OpenViBE::uint32 ui32InputIndex,
const OpenViBE::CIdentifier& rTypeIdentifier);
typedef OpenViBE::boolean (OpenViBE::Kernel::IBox::*t_setConnectorName)(
const OpenViBE::uint32 ui32InputIndex,
const OpenViBE::CString& rName);
};
};
#endif // __OpenViBEDesigner_CConnectorEditor_H__
#include "ovdCInterfacedScenario.h"
#include "ovdCBoxProxy.h"
#include "ovdCLinkProxy.h"
#include "ovdCConnectorEditor.h"
#include "ovdCSettingEditor.h"
#include "ovdCInterfacedObject.h"
#include "ovdTAttributeHandler.h"
......@@ -85,7 +86,6 @@ void menuitem_cb(::GtkMenuItem* pMenuItem, gpointer pUserData)
,m_rKernel(rKernel)
,m_rScenario(rScenario)
,m_pPlayer(NULL)
,m_bIsPaused(false)
,m_rNotebook(rNotebook)
,m_pVisualisationTree(NULL)
,m_pDesignerVisualisation(NULL)
......@@ -145,7 +145,7 @@ void menuitem_cb(::GtkMenuItem* pMenuItem, gpointer pUserData)
CIdentifier l_oIdentifier = l_pBox->getAlgorithmClassIdentifier();
const Plugins::IPluginObjectDesc* l_pPOD = m_rKernel.getContext()->getPluginManager().getPluginObjectDescCreating(l_oIdentifier);
if(l_pPOD->hasFunctionality(OpenViBE::Kernel::PluginFunctionality_Visualization))
if(l_pPOD && l_pPOD->hasFunctionality(OpenViBE::Kernel::PluginFunctionality_Visualization))
{
CIdentifier l_oIdentifier;
m_pVisualisationTree->addVisualisationWidget(
......@@ -542,6 +542,16 @@ void menuitem_cb(::GtkMenuItem* pMenuItem, gpointer pUserData)
if(m_pStencilBuffer) g_object_unref(m_pStencilBuffer);
m_pStencilBuffer=gdk_pixmap_new(NULL, x, y, 24);
::GdkGC* l_pStencilGC=gdk_gc_new(m_pStencilBuffer);
::GdkColor l_oColor={0, 0, 0, 0};
gdk_gc_set_rgb_fg_color(l_pStencilGC, &l_oColor);
gdk_draw_rectangle(
GDK_DRAWABLE(m_pStencilBuffer),
l_pStencilGC,
TRUE,
0, 0, x, y);
g_object_unref(l_pStencilGC);
if(this->isLocked())
{
::GdkColor l_oColor;
......@@ -636,7 +646,7 @@ void menuitem_cb(::GtkMenuItem* pMenuItem, gpointer pUserData)
const Plugins::IPluginObjectDesc* l_pPOD = m_rKernel.getContext()->getPluginManager().getPluginObjectDescCreating(l_oId);
//if a visualisation box was dropped, add it in window manager
if(l_pPOD->hasFunctionality(OpenViBE::Kernel::PluginFunctionality_Visualization))
if(l_pPOD && l_pPOD->hasFunctionality(OpenViBE::Kernel::PluginFunctionality_Visualization))
{
//generate a unique name so that it can be identified unambiguously
CString l_oBoxName;
......@@ -713,7 +723,7 @@ void menuitem_cb(::GtkMenuItem* pMenuItem, gpointer pUserData)
map<CIdentifier, boolean>::const_iterator i;
for(i=m_vCurrentObject.begin(); i!=m_vCurrentObject.end(); i++)
{
if(i->second)
if(i->second && m_rScenario.isBox(i->first))
{
CBoxProxy l_oBoxProxy(m_rScenario, i->first);
l_oBoxProxy.setCenter(
......@@ -734,6 +744,8 @@ void menuitem_cb(::GtkMenuItem* pMenuItem, gpointer pUserData)
if(this->isLocked()) return;
::GtkWidget* l_pTooltip=glade_xml_get_widget(m_pGladeTooltip, "openvibe_tooltip");
gtk_widget_hide(l_pTooltip);
gtk_widget_grab_focus(pWidget);
m_bButtonPressed|=((pEvent->type==GDK_BUTTON_PRESS)&&(pEvent->button==1));
......@@ -790,16 +802,28 @@ void menuitem_cb(::GtkMenuItem* pMenuItem, gpointer pUserData)
case GDK_2BUTTON_PRESS:
if(m_oCurrentObject.m_oIdentifier!=OV_UndefinedIdentifier)
{
IBox* l_pBox=m_rScenario.getBoxDetails(m_oCurrentObject.m_oIdentifier);
if(l_pBox)
{
m_ui32CurrentMode=Mode_EditSettings;
m_bShiftPressed=false;
m_bControlPressed=false;
m_bAltPressed=false;
m_ui32CurrentMode=Mode_EditSettings;
m_bShiftPressed=false;
m_bControlPressed=false;
m_bAltPressed=false;
CSettingEditor l_oSettingEditor(m_rKernel, *l_pBox, m_sGUIFilename.c_str());
l_oSettingEditor.run();
if(m_oCurrentObject.m_ui32ConnectorType==Connector_Input || m_oCurrentObject.m_ui32ConnectorType==Connector_Output)
{
IBox* l_pBox=m_rScenario.getBoxDetails(m_oCurrentObject.m_oIdentifier);
if(l_pBox)
{
CConnectorEditor l_oConnectorEditor(m_rKernel, *l_pBox, m_oCurrentObject.m_ui32ConnectorType, m_oCurrentObject.m_ui32ConnectorIndex, m_sGUIFilename.c_str());
l_oConnectorEditor.run();
}
}
else
{
IBox* l_pBox=m_rScenario.getBoxDetails(m_oCurrentObject.m_oIdentifier);
if(l_pBox)
{
CSettingEditor l_oSettingEditor(m_rKernel, *l_pBox, m_sGUIFilename.c_str());
l_oSettingEditor.run();
}
}
}
break;
......@@ -992,7 +1016,7 @@ void menuitem_cb(::GtkMenuItem* pMenuItem, gpointer pUserData)
map<CIdentifier, boolean>::const_iterator i;
for(i=m_vCurrentObject.begin(); i!=m_vCurrentObject.end(); i++)
{
if(i->second)
if(i->second && m_rScenario.isBox(i->first))
{
CBoxProxy l_oBoxProxy(m_rScenario, i->first);
l_oBoxProxy.setCenter(
......
......@@ -18,7 +18,7 @@ namespace OpenViBEDesigner
{
public:
CInterfacedScenario(OpenViBE::Kernel::IKernel& rKernel, OpenViBE::Kernel::IScenario& rScenario, OpenViBE::CIdentifier& rScenarioIdentifier,
CInterfacedScenario(OpenViBE::Kernel::IKernel& rKernel, OpenViBE::Kernel::IScenario& rScenario, OpenViBE::CIdentifier& rScenarioIdentifier,
::GtkNotebook& rNotebook, const char* sGUIFilename);
virtual ~CInterfacedScenario(void);
......@@ -47,11 +47,12 @@ namespace OpenViBEDesigner
void contextMenuModifyOutputCB(OpenViBE::uint32 ui32Index);
void contextMenuAddOutputCB(void);
void contextMenuRemoveOutputCB(void);
void createPlayerVisualisation(void);
void releasePlayerVisualisation(void);
private:
void generateDisplayPluginName(OpenViBE::Kernel::IBox* pDisplayBox, OpenViBE::CString& rDisplayBoxName);
public:
......@@ -62,7 +63,7 @@ namespace OpenViBEDesigner
OpenViBE::Kernel::IKernel& m_rKernel;
OpenViBE::Kernel::IScenario& m_rScenario;
OpenViBE::Kernel::IPlayer* m_pPlayer;
OpenViBE::boolean m_bIsPaused;
OpenViBE::uint64 m_ui64LastLoopTime;
::GtkNotebook& m_rNotebook;
OpenViBE::Kernel::IVisualisationTree* m_pVisualisationTree;
OpenViBEDesigner::CDesignerVisualisation* m_pDesignerVisualisation;
......@@ -95,7 +96,7 @@ namespace OpenViBEDesigner
OpenViBE::uint32 m_ui32InterfacedObjectId;
std::map<OpenViBE::uint32, OpenViBEDesigner::CInterfacedObject> m_vInterfacedObject;
std::map<OpenViBE::CIdentifier, OpenViBE::boolean> m_vCurrentObject;
OpenViBEDesigner::CInterfacedObject m_oCurrentObject;
OpenViBEDesigner::CInterfacedObject m_oCurrentObject;
};
};
......
......@@ -53,6 +53,11 @@ static void on_button_setting_filename_browse_pressed(::GtkButton* pButton, gpoi
gtk_widget_destroy(l_pWidgetDialogOpen);
}
static void on_file_override_check_toggled(::GtkToggleButton* pToggleButton, gpointer pUserData)
{
gtk_widget_set_sensitive((::GtkWidget*)pUserData, !gtk_toggle_button_get_active(pToggleButton));
}
// ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- ----------- -----------
CSettingEditor::CSettingEditor(IKernel& rKernel, IBox& rBox, const char* sGUIFilename)
......@@ -78,6 +83,8 @@ void CSettingEditor::run(void)
::GladeXML* l_pGladeInterfaceSetting=glade_xml_new(m_sGUIFilename.c_str(), "setting", NULL);
::GtkWidget* l_pSettingDialog=glade_xml_get_widget(l_pGladeInterfaceSetting, "setting");
::GtkTable* l_pSettingTable=GTK_TABLE(glade_xml_get_widget(l_pGladeInterfaceSetting, "table_setting"));
::GtkContainer* l_pFileOverrideContainer=GTK_CONTAINER(glade_xml_get_widget(l_pGladeInterfaceSetting, "hbox_filename_override"));
::GtkCheckButton* l_pFileOverrideCheck=GTK_CHECK_BUTTON(glade_xml_get_widget(l_pGladeInterfaceSetting, "checkbutton_filename_override"));
g_object_unref(l_pGladeInterfaceSetting);
gtk_table_resize(l_pSettingTable, m_rBox.getSettingCount(), 3);
......@@ -106,18 +113,43 @@ void CSettingEditor::run(void)
gtk_widget_unparent(l_pSettingName);
gtk_widget_unparent(l_pSettingValue);
gtk_widget_unparent(l_pSettingRevert);
gtk_table_attach(l_pSettingTable, l_pSettingName, 0, 1, i, i+1, ::GtkAttachOptions(GTK_FILL|GTK_EXPAND), ::GtkAttachOptions(GTK_FILL|GTK_EXPAND), 0, 0);
gtk_table_attach(l_pSettingTable, l_pSettingName, 0, 1, i, i+1, ::GtkAttachOptions(GTK_FILL), ::GtkAttachOptions(GTK_FILL), 0, 0);
gtk_table_attach(l_pSettingTable, l_pSettingValue, 1, 2, i, i+1, ::GtkAttachOptions(GTK_FILL|GTK_EXPAND), ::GtkAttachOptions(GTK_FILL|GTK_EXPAND), 0, 0);
gtk_table_attach(l_pSettingTable, l_pSettingRevert, 2, 3, i, i+1, ::GtkAttachOptions(GTK_SHRINK), ::GtkAttachOptions(GTK_SHRINK), 0, 0);
gtk_widget_unref(l_pSettingRevert);
gtk_widget_unref(l_pSettingValue);
gtk_widget_unref(l_pSettingName);
setValue(l_oSettingType, l_pSettingValue, l_oSettingValue);
l_vSettingValue.push_back(l_pSettingValue);
this->setValue(l_oSettingType, l_pSettingValue, l_oSettingValue);
gtk_label_set_text(GTK_LABEL(l_pSettingName), l_oSettingName);
}
l_vSettingValue.push_back(l_pSettingValue);
#if 1
g_signal_connect(G_OBJECT(l_pFileOverrideCheck), "toggled", G_CALLBACK(on_file_override_check_toggled), GTK_WIDGET(l_pSettingTable));
string l_sSettingOverrideWidgetName=getSettingWidgetName(OV_TypeId_Filename);
::GladeXML* l_pGladeInterfaceSettingCollection=glade_xml_new(m_sGUIFilename.c_str(), l_sSettingOverrideWidgetName.c_str(), NULL);
::GtkWidget* l_pSettingOverrideValue=glade_xml_get_widget(l_pGladeInterfaceSettingCollection, l_sSettingOverrideWidgetName.c_str());
g_object_unref(l_pGladeInterfaceSettingCollection);
gtk_widget_ref(l_pSettingOverrideValue);
gtk_widget_unparent(l_pSettingOverrideValue);
gtk_container_add(l_pFileOverrideContainer, l_pSettingOverrideValue);
gtk_widget_unref(l_pSettingOverrideValue);
if(m_rBox.hasAttribute(OVD_AttributeId_SettingOverrideFilename))
{
this->setValue(OV_TypeId_Filename, l_pSettingOverrideValue, m_rBox.getAttributeValue(OVD_AttributeId_SettingOverrideFilename));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(l_pFileOverrideCheck), true);
gtk_widget_set_sensitive(GTK_WIDGET(l_pSettingTable), false);
}
else
{
this->setValue(OV_TypeId_Filename, l_pSettingOverrideValue, "");
}
#endif
boolean l_bFinished=false;
while(!l_bFinished)
......@@ -131,14 +163,39 @@ void CSettingEditor::run(void)
m_rBox.getSettingDefaultValue(i, l_oSettingValue);
setValue(l_oSettingType, l_vSettingValue[i], l_oSettingValue);
}
if(m_rBox.hasAttribute(OVD_AttributeId_SettingOverrideFilename))
{
this->setValue(OV_TypeId_Filename, l_pSettingOverrideValue, m_rBox.getAttributeValue(OVD_AttributeId_SettingOverrideFilename));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(l_pFileOverrideCheck), true);
gtk_widget_set_sensitive(GTK_WIDGET(l_pSettingTable), false);
}
}
else if(l_iResult==GTK_RESPONSE_APPLY)
{
for(i=0; i<m_rBox.getSettingCount(); i++)
{
m_rBox.getSettingType(i, l_oSettingType);
m_rBox.setSettingValue(i, getValue(l_oSettingType, l_vSettingValue[i]));
m_rBox.setSettingValue(i, this->getValue(l_oSettingType, l_vSettingValue[i]));
}
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(l_pFileOverrideCheck)))
{
if(m_rBox.hasAttribute(OVD_AttributeId_SettingOverrideFilename))
{
m_rBox.setAttributeValue(OVD_AttributeId_SettingOverrideFilename, this->getValue(OV_TypeId_Filename, l_pSettingOverrideValue));
}
else
{
m_rBox.addAttribute(OVD_AttributeId_SettingOverrideFilename, this->getValue(OV_TypeId_Filename, l_pSettingOverrideValue));
}
}
else
{
if(m_rBox.hasAttribute(OVD_AttributeId_SettingOverrideFilename))
{
m_rBox.removeAttribute(OVD_AttributeId_SettingOverrideFilename);
}
}
l_bFinished=true;
}
else
......
......@@ -8,6 +8,8 @@
#define OVD_AttributeId_XLinkTargetPosition OpenViBE::CIdentifier(0x6267B5C5, 0x676E3E42)
#define OVD_AttributeId_YLinkTargetPosition OpenViBE::CIdentifier(0x3F0A3B27, 0x570913D2)
#define OVD_AttributeId_SettingOverrideFilename OpenViBE::CIdentifier(0x8D21FF41, 0xDF6AFE7E)
//Attributes of visualisation window :
#define OVD_AttributeId_VisualisationWindow_Width OpenViBE::CIdentifier(0x7B814CCA, 0x271DF6DD)
#define OVD_AttributeId_VisualisationWindow_Height OpenViBE::CIdentifier(0x4C90D4AD, 0x7A2554EC)
......
......@@ -9,13 +9,10 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME}-dynamic PROPERTIES
COMPILE_FLAGS "-DOVK_Exports -DOVK_Shared")
INCLUDE("FindOpenViBE")
INCLUDE("FindOpenViBEModuleEBML")
INCLUDE("FindOpenViBEModuleFS")
INCLUDE("FindOpenViBEModuleSocket")
INCLUDE("FindOpenViBEModuleSystem")
INCLUDE("FindOpenViBEModuleXML")
INCLUDE("FindThirdPartyGlade")
INCLUDE("FindThirdPartyOpenMASK")
# ---------------------------------
# Finds standard library dl
......
......@@ -2,6 +2,8 @@
#include "ovkCAlgorithmContext.h"
#include "ovkCAlgorithmProto.h"
#include "../../ovk_tools.h"
using namespace OpenViBE;
using namespace Kernel;
using namespace Plugins;
......@@ -9,6 +11,34 @@ using namespace std;
#define _MaxCrash_ 5
#define __proxy_func_0__(_func_, _message_, _before_, _after_) \
{ \
if(!m_bActive) \
{ \
return false; \
} \
/* getLogManager() << LogLevel_Debug << "CAlgorithm#1: " << _message_ << "\n"; */ \
CAlgorithmContext l_oAlgorithmContext(getKernelContext(), *this, m_rAlgorithmDesc); \
boolean l_bResult=false; \
try \
{ \
/* getLogManager() << LogLevel_Debug << "CAlgorithm#2: " << _message_ << "\n"; */ \
_before_; \
/* getLogManager() << LogLevel_Debug << "CAlgorithm#3: " << _message_ << "\n"; */ \
l_bResult=m_rAlgorithm._func_(l_oAlgorithmContext); \
/* getLogManager() << LogLevel_Debug << "CAlgorithm#4: " << _message_ << "\n"; */ \
_after_; \
/* getLogManager() << LogLevel_Debug << "CAlgorithm#5: " << _message_ << "\n"; */ \
} \
catch (...) \
{ \
this->handleCrash(_message_); \
return false; \
} \
/* getLogManager() << LogLevel_Debug << "CAlgorithm#6: " << _message_ << "\n"; */ \
return l_bResult; \
}
CAlgorithm::CAlgorithm(const IKernelContext& rKernelContext, IAlgorithm& rAlgorithm, const IAlgorithmDesc& rAlgorithmDesc)
:TKernelObject < IKernelObject >(rKernelContext)
,m_pInputConfigurable(NULL)
......@@ -32,6 +62,21 @@ CAlgorithm::~CAlgorithm(void)
getKernelContext().getKernelObjectFactory().releaseObject(m_pInputConfigurable);
}
IAlgorithm& CAlgorithm::getAlgorithm(void)
{
return m_rAlgorithm;
}
const IAlgorithm& CAlgorithm::getAlgorithm(void) const
{
return m_rAlgorithm;
}
const IAlgorithmDesc& CAlgorithm::getAlgorithmDesc(void) const
{
return m_rAlgorithmDesc;
}
boolean CAlgorithm::addInputParameter(
const CIdentifier& rInputParameterIdentifier,
const CString& sInputName,
......@@ -163,6 +208,12 @@ boolean CAlgorithm::addInputTrigger(
return true;
}
CIdentifier CAlgorithm::getNextInputTriggerIdentifier(
const CIdentifier& rPreviousInputTriggerIdentifier) const
{
return getNextIdentifier< pair<CString, boolean> >(m_vInputTrigger, rPreviousInputTriggerIdentifier);
}
CString CAlgorithm::getInputTriggerName(
const CIdentifier& rInputTriggerIdentifier) const
{
......@@ -223,6 +274,12 @@ boolean CAlgorithm::addOutputTrigger(
return true;
}
CIdentifier CAlgorithm::getNextOutputTriggerIdentifier(
const CIdentifier& rPreviousOutputTriggerIdentifier) const
{
return getNextIdentifier< pair<CString, boolean> >(m_vOutputTrigger, rPreviousOutputTriggerIdentifier);
}
CString CAlgorithm::getOutputTriggerName(
const CIdentifier& rOutputTriggerIdentifier) const
{
......@@ -273,68 +330,17 @@ boolean CAlgorithm::removeOutputTrigger(
boolean CAlgorithm::initialize(void)
{
if(!m_bActive)
{
return false;
}
CAlgorithmContext l_oAlgorithmContext(getKernelContext(), *this, m_rAlgorithmDesc);
boolean l_bResult=false;
try
{
l_bResult=m_rAlgorithm.initialize(l_oAlgorithmContext);
}
catch (...)
{
this->handleCrash("initialize callback");
return false;
}
return l_bResult;
__proxy_func_0__(initialize, "initialize callback", , );
}
boolean CAlgorithm::uninitialize(void)
{
if(!m_bActive)
{
return false;
}
CAlgorithmContext l_oAlgorithmContext(getKernelContext(), *this, m_rAlgorithmDesc);
boolean l_bResult=false;
try
{
l_bResult=m_rAlgorithm.uninitialize(l_oAlgorithmContext);
}
catch (...)
{
this->handleCrash("uninitialize callback");
return false;
}
return l_bResult;
__proxy_func_0__(uninitialize, "uninitialize callback", , );
}
boolean CAlgorithm::process(void)
{
if(!m_bActive)
{
return false;
}
CAlgorithmContext l_oAlgorithmContext(getKernelContext(), *this, m_rAlgorithmDesc);
boolean l_bResult=false;
try
{
this->setAllOutputTriggers(false);
l_bResult=m_rAlgorithm.process(l_oAlgorithmContext);
this->setAllInputTriggers(false);
}
catch (...)