diff --git a/bindings/yarp.i b/bindings/yarp.i index 6cb19c610e7..4940fe46046 100644 --- a/bindings/yarp.i +++ b/bindings/yarp.i @@ -82,8 +82,9 @@ %include %include -// Try to translate std::string to native equivalents +// Try to translate std::string and std::pair to native equivalents %include "std_string.i" +%include "std_pair.i" #if defined(SWIGCSHARP) // Get .NET pointers instead of swig generated types (useful when dealing with images) @@ -427,6 +428,9 @@ MAKE_COMMS(Bottle) %include %include %include +%include +%include +%include %include #ifndef YARP_NO_DEPRECATED // Since YARP 3.5.0 @@ -440,6 +444,8 @@ MAKE_COMMS(Bottle) %template(SVector) std::vector; %template(IVector) std::vector; %template(ShortVector) std::vector; +%template() std::pair; +%template(SPairVector) std::vector>; #ifdef SWIGMATLAB // Extend IVector for handling conversion of vectors from and to Matlab @@ -818,6 +824,9 @@ typedef yarp::os::BufferedPort BufferedPortImageRgbFloat; CAST_POLYDRIVER_TO_INTERFACE(IPositionDirect) CAST_POLYDRIVER_TO_INTERFACE(IRemoteVariables) CAST_POLYDRIVER_TO_INTERFACE(IAxisInfo) + CAST_POLYDRIVER_TO_INTERFACE(ISpeechSynthesizer) + CAST_POLYDRIVER_TO_INTERFACE(ISpeechTranscription) + CAST_POLYDRIVER_TO_INTERFACE(ILLM) // These views are currently disabled in SWIG + java generator since they are // useless without the EXTENDED_ANALOG_SENSOR_INTERFACE part. @@ -1543,6 +1552,44 @@ typedef yarp::os::BufferedPort BufferedPortImageRgbFloat; } } +%extend yarp::dev::ISpeechSynthesizer { + bool getLanguage(std::vector& language) { + return self->getLanguage(language[0]); + } + + bool getVoice(std::vector& voice) { + return self->getVoice(voice[0]); + } + + bool getSpeed(std::vector& speed) { + return self->getSpeed(speed[0]); + } + + bool getPitch(std::vector& pitch) { + return self->getPitch(pitch[0]); + } +} + +%extend yarp::dev::ISpeechTranscription { + bool getLanguage(std::vector& language) { + return self->getLanguage(language[0]); + } + + bool transcribe(const yarp::sig::Sound& sound, std::vector& transcription, std::vector& score) { + return self->transcribe(sound, transcription[0], score[0]); + } +} + +%extend yarp::dev::ILLM { + bool readPrompt(std::vector& oPropmt) { + return self->readPrompt(oPropmt[0]); + } + + bool ask(const std::string& question, std::vector& answer) { + return self->ask(question, answer[0]); + } +} + // This is part is currently broken in SWIG + java generator since SWIG 3.0.3 // (last swig version tested: 3.0.12) // See also https://github.com/robotology/yarp/issues/1770 diff --git a/src/libYARP_dev/src/yarp/dev/all.h b/src/libYARP_dev/src/yarp/dev/all.h index 0244470f6e2..dcc148ca09a 100644 --- a/src/libYARP_dev/src/yarp/dev/all.h +++ b/src/libYARP_dev/src/yarp/dev/all.h @@ -37,6 +37,9 @@ #include #include #include +#include +#include +#include #ifndef YARP_NO_DEPRECATED // since YARP 3.5 #define YARP_INCLUDING_DEPRECATED_HEADER_YARP_DEV_FRAMEGRABBER_H_ON_PURPOSE