Commit 280d9761 authored by Serrière Guillaume's avatar Serrière Guillaume
parent edbe07b1
......@@ -82,13 +82,14 @@ namespace OpenViBE
virtual __BridgeImplFunc2__((*m_pBox), boolean, setOutputName, , return false, const uint32, ui32OutputIndex, const CString&, rName);
virtual __BridgeImplFunc5__((*m_pBox), boolean, addSetting, , return false, const CString&, sName, const CIdentifier&, rTypeIdentifier, const CString&, sDefaultValue, const int32, i32Index, const boolean, bModifiability);
virtual __BridgeImplFunc1__((*m_pBox), boolean, addInputSupport, , return false, const CIdentifier&, rTypeIdentifier);
virtual __BridgeImplFunc1__((*m_pBox), boolean, addInputAndDerivedSupport, , return false, const CIdentifier&, rTypeIdentifier);
virtual __BridgeImplFunc1__((*m_pBox), boolean, hasInputSupport, const, return false, const CIdentifier&, rTypeIdentifier);
virtual __BridgeImplFunc1__((*m_pBox), boolean, addOutputSupport, , return false, const CIdentifier&, rTypeIdentifier);
virtual __BridgeImplFunc1__((*m_pBox), boolean, addOutputAndDerivedSupport, , return false, const CIdentifier&, rTypeIdentifier);
virtual __BridgeImplFunc1__((*m_pBox), boolean, hasOutputSupport, const, return false, const CIdentifier&, rTypeIdentifier);
virtual __BridgeImplFunc1__((*m_pBox), boolean, setSupportTypeFromAlgorithmIdentifier, , return false, const CIdentifier&, rTypeIdentifier);
virtual __BridgeImplFunc1__((*m_pBox), boolean, removeSetting, , return false, const uint32, ui32Index);
virtual __BridgeBindFunc0__((*m_pBox), uint32, getSettingCount, const);
......
......@@ -10,6 +10,7 @@
namespace{
//This class is used to set up the restriction of a stream type for input and output.
class CBoxProtoRestriction : public OpenViBE::Kernel::CBoxProto
{
public:
......@@ -714,6 +715,17 @@ boolean CBox::hasOutputSupport(const OpenViBE::CIdentifier& rTypeIdentifier) con
return false;
}
boolean CBox::setSupportTypeFromAlgorithmIdentifier(const CIdentifier &rTypeIdentifier)
{
const IPluginObjectDesc* l_pPluginObjectDescriptor=getKernelContext().getPluginManager().getPluginObjectDescCreating(rTypeIdentifier);
const IBoxAlgorithmDesc *l_pBoxAlgorithmDescriptor=dynamic_cast<const IBoxAlgorithmDesc*>(l_pPluginObjectDescriptor);
CBoxProtoRestriction oTempProto(this->getKernelContext(), *this);
l_pBoxAlgorithmDescriptor->getBoxPrototype(oTempProto);
return true;
}
//___________________________________________________________________//
// //
......
......@@ -73,6 +73,8 @@ namespace OpenViBE
const OpenViBE::CIdentifier& rTypeIdentifier);
virtual OpenViBE::boolean hasOutputSupport(
const OpenViBE::CIdentifier& rTypeIdentifier) const;
virtual OpenViBE::boolean setSupportTypeFromAlgorithmIdentifier(
const OpenViBE::CIdentifier& rTypeIdentifier);
//messages input
......
......@@ -491,6 +491,17 @@ namespace OpenViBE
const OpenViBE::CIdentifier& rTypeIdentifier) const =0;
//@}
/**
* \brief Set the supported stream type for input and output according
* to the restriction of the algorithm whose identifier is given in parameter.
* \param rTypeIdentifier [in] : identifier of the algorithm
* \return \e true in case of success.
* \return \e false in case of error.
* \note The supported stream list is not reset.
*/
virtual OpenViBE::boolean setSupportTypeFromAlgorithmIdentifier(
const OpenViBE::CIdentifier& rTypeIdentifier)=0;
/** \name Message input management */
//@{
/**
......
......@@ -271,6 +271,7 @@ boolean CAlgorithmScenarioImporter::process(void)
// it is important to set box algorithm at
// last so the box listener is never called
l_pBox->setAlgorithmClassIdentifier(b->m_oAlgorithmClassIdentifier);
l_pBox->setSupportTypeFromAlgorithmIdentifier(b->m_oAlgorithmClassIdentifier);
}
l_vBoxIdMapping[b->m_oIdentifier]=l_oNewBoxIdentifier;
}
......
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