Commit 03510651 authored by RIOU Cedric's avatar RIOU Cedric

[plugins] adapt Stream switch to the new sdk that manager auto update

 - update the metabox exmaple to the new XML format
parent c398a2c2
<OpenViBE-Scenario>
<FormatVersion>1</FormatVersion>
<Creator>Designer</Creator>
<CreatorVersion>2.0.0</CreatorVersion>
<FormatVersion>2</FormatVersion>
<Creator>OpenViBE Designer</Creator>
<CreatorVersion>2.1.0</CreatorVersion>
<Settings>
<Setting>
<Identifier>(0x723cc5dc, 0xd72a7577)</Identifier>
<TypeIdentifier>(0x007deef9, 0x2f3e95c6)</TypeIdentifier>
<Name>LowCutFrequency</Name>
<DefaultValue>1</DefaultValue>
<Value>1</Value>
</Setting>
<Setting>
<Identifier>(0xbf54d1a1, 0x0c166380)</Identifier>
<TypeIdentifier>(0x007deef9, 0x2f3e95c6)</TypeIdentifier>
<Name>HighCutFrequency</Name>
<DefaultValue>100</DefaultValue>
<Value>100</Value>
</Setting>
<Setting>
<Identifier>(0xda5a9fd6, 0x031776d3)</Identifier>
<TypeIdentifier>(0x007deef9, 0x2f3e95c6)</TypeIdentifier>
<Name>NotchLowFrequency</Name>
<DefaultValue>48</DefaultValue>
<Value>48</Value>
</Setting>
<Setting>
<Identifier>(0xd54babd2, 0xf724c3df)</Identifier>
<TypeIdentifier>(0x007deef9, 0x2f3e95c6)</TypeIdentifier>
<Name>NotchHighFrequency</Name>
<DefaultValue>52</DefaultValue>
......@@ -30,6 +34,7 @@
</Settings>
<Inputs>
<Input>
<Identifier>(0x69d00e6d, 0x100f7176)</Identifier>
<TypeIdentifier>(0x5ba36127, 0x195feae1)</TypeIdentifier>
<Name>Input Signal</Name>
<LinkedBoxIdentifier>(0x0d17e04a, 0x1c8eee27)</LinkedBoxIdentifier>
......@@ -38,6 +43,7 @@
</Inputs>
<Outputs>
<Output>
<Identifier>(0x644ec1cc, 0x0a13512c)</Identifier>
<TypeIdentifier>(0x5ba36127, 0x195feae1)</TypeIdentifier>
<Name>Filtered Signal</Name>
<LinkedBoxIdentifier>(0x7ebeb131, 0x19f98c70)</LinkedBoxIdentifier>
......@@ -307,4 +313,4 @@ tutorial at &lt;i&gt;http://openvibe.inria.fr/designer-tutorial-5-metaboxes#Crea
<Value></Value>
</Attribute>
</Attributes>
</OpenViBE-Scenario>
</OpenViBE-Scenario>
\ No newline at end of file
......@@ -82,10 +82,32 @@ namespace OpenViBEPlugins
char l_sName[1024];
::sprintf(l_sName, "Switch stim for output %i", ui32Index+1);
rBox.addSetting(l_sName, OV_TypeId_Stimulation,"OVTK_StimulationId_Label_00");
char l_sValue[128];
::sprintf(l_sValue, "OVTK_StimulationId_Label_%02i", ui32Index+1);
rBox.addSetting(l_sName, OV_TypeId_Stimulation,l_sValue,ui32Index+1,false);
return true;
};
virtual OpenViBE::boolean onSettingAdded(OpenViBE::Kernel::IBox& rBox, const OpenViBE::uint32 ui32Index)
{
// the output must have the same type as the input
OpenViBE::CIdentifier l_oIdentifier;
rBox.getInputType(1,l_oIdentifier);
rBox.addOutput("New output",l_oIdentifier,OV_UndefinedIdentifier,false);
char l_sName[1024];
::sprintf(l_sName, "Switch stim for output %i", ui32Index);
//rBox.addSetting(l_sName, OV_TypeId_Stimulation,"OVTK_StimulationId_Label_00",ui32Index, false);
rBox.setSettingName(ui32Index, l_sName);
rBox.setSettingType(ui32Index, OV_TypeId_Stimulation);
char l_sValue[128];
::sprintf(l_sValue, "OVTK_StimulationId_Label_%02i", ui32Index);
rBox.setSettingDefaultValue(ui32Index, l_sValue);
return true;
};
virtual OpenViBE::boolean onOutputRemoved(OpenViBE::Kernel::IBox& rBox, const OpenViBE::uint32 ui32Index)
{
......@@ -100,6 +122,13 @@ namespace OpenViBEPlugins
}
return true;
}
virtual OpenViBE::boolean onSettingRemoved(OpenViBE::Kernel::IBox& rBox, const OpenViBE::uint32 ui32Index)
{
rBox.removeOutput(ui32Index-1); // -1 for the first setting which doesn't correspond to a stream
return true;
}
_IsDerivedFromClass_Final_(OpenViBEToolkit::TBoxListener < OpenViBE::Plugins::IBoxListener >, OV_UndefinedIdentifier);
};
......@@ -145,18 +174,24 @@ namespace OpenViBEPlugins
rBoxAlgorithmPrototype.addOutput("Output",OV_TypeId_StreamedMatrix);
rBoxAlgorithmPrototype.addOutput("Output",OV_TypeId_StreamedMatrix);
//rBoxAlgorithmPrototype.addFlag(OpenViBE::Kernel::BoxFlag_CanModifyOutput);
rBoxAlgorithmPrototype.addFlag(OpenViBE::Kernel::BoxFlag_CanModifyOutput);
rBoxAlgorithmPrototype.addFlag(OpenViBE::Kernel::BoxFlag_CanAddOutput);
rBoxAlgorithmPrototype.addSetting("Default to output 1", OV_TypeId_Boolean, "false");
rBoxAlgorithmPrototype.addSetting("Switch stim for output 1",OV_TypeId_Stimulation,"OVTK_StimulationId_Label_00");
rBoxAlgorithmPrototype.addSetting("Switch stim for output 2",OV_TypeId_Stimulation,"OVTK_StimulationId_Label_01");
//rBoxAlgorithmPrototype.addFlag(OpenViBE::Kernel::BoxFlag_CanModifySetting);
//rBoxAlgorithmPrototype.addFlag(OpenViBE::Kernel::BoxFlag_CanAddSetting);
rBoxAlgorithmPrototype.addFlag(OpenViBE::Kernel::BoxFlag_CanModifySetting);
rBoxAlgorithmPrototype.addFlag(OpenViBE::Kernel::BoxFlag_CanAddSetting);
//rBoxAlgorithmPrototype.addFlag(OV_AttributeId_Box_FlagIsUnstable);
rBoxAlgorithmPrototype.addInputSupport(OV_TypeId_StreamedMatrix);
rBoxAlgorithmPrototype.addInputSupport(OV_TypeId_Signal);
rBoxAlgorithmPrototype.addOutputSupport(OV_TypeId_StreamedMatrix);
rBoxAlgorithmPrototype.addOutputSupport(OV_TypeId_Signal);
return true;
}
_IsDerivedFromClass_Final_(OpenViBE::Plugins::IBoxAlgorithmDesc, OVP_ClassId_BoxAlgorithm_StreamedMatrixSwitchDesc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment