Skip to content

Commit

Permalink
cleanup and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
randaz81 committed Jan 22, 2025
1 parent 11197c1 commit 20a1afb
Show file tree
Hide file tree
Showing 42 changed files with 235 additions and 226 deletions.
9 changes: 9 additions & 0 deletions doc/release/master.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@ New Features

* added new datatype `yarp::sig::LayeredImage`
* added `yarp::sig::utils::sum()` to transform `yarp::sig::LayeredImage` to `yarp::sig::Image`

#### `libYARP_dev`

* added new class `yarp::dev::ReturnValue`
* modified interfaces `yarp::dev::ISpeechSynthesizer`,`yarp::dev::ISpeechTranscription` to use the new class ReturnValue.

#### `devices`

* modified devices implementing `yarp::dev::ISpeechSynthesizer`,`yarp::dev::ISpeechTranscription` to use the new class ReturnValue.
38 changes: 19 additions & 19 deletions src/devices/fake/fakeSpeechSynthesizer/FakeSpeechSynthesizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,67 +40,67 @@ bool FakeSpeechSynthesizer::close()
return true;
}

yarp_ret_value FakeSpeechSynthesizer::setLanguage(const std::string& language)
ReturnValue FakeSpeechSynthesizer::setLanguage(const std::string& language)
{
m_language=language;
yCInfo(FAKE_SPEECHSYN) << "Language set to" << language;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp_ret_value FakeSpeechSynthesizer::getLanguage(std::string& language)
ReturnValue FakeSpeechSynthesizer::getLanguage(std::string& language)
{
language = m_language;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp_ret_value FakeSpeechSynthesizer::setVoice(const std::string& voice)
ReturnValue FakeSpeechSynthesizer::setVoice(const std::string& voice)
{
m_voice = voice;
yCInfo(FAKE_SPEECHSYN) << "Voice set to" << voice;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp_ret_value FakeSpeechSynthesizer::getVoice(std::string& voice)
ReturnValue FakeSpeechSynthesizer::getVoice(std::string& voice)
{
voice = m_voice;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp_ret_value FakeSpeechSynthesizer::setSpeed(const double speed)
ReturnValue FakeSpeechSynthesizer::setSpeed(const double speed)
{
m_speed = speed;
yCInfo(FAKE_SPEECHSYN) << "Speed set to" << speed;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp_ret_value FakeSpeechSynthesizer::getSpeed(double& speed)
ReturnValue FakeSpeechSynthesizer::getSpeed(double& speed)
{
speed = m_speed;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp_ret_value FakeSpeechSynthesizer::setPitch(const double pitch)
ReturnValue FakeSpeechSynthesizer::setPitch(const double pitch)
{
m_pitch = pitch;
yCInfo(FAKE_SPEECHSYN) << "Pitch set to" << pitch;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp_ret_value FakeSpeechSynthesizer::getPitch(double& pitch)
ReturnValue FakeSpeechSynthesizer::getPitch(double& pitch)
{
pitch = m_pitch;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp_ret_value FakeSpeechSynthesizer::synthesize(const std::string& text, yarp::sig::Sound& sound)
ReturnValue FakeSpeechSynthesizer::synthesize(const std::string& text, yarp::sig::Sound& sound)
{
if (text == "")
{
yCError(FAKE_SPEECHSYN) << "Text is empty";
return yarp_ret_value::return_code::return_value_error_method_failed;
return ReturnValue::return_code::return_value_error_method_failed;
}

sound.resize(100,2);

return yarp_ret_value_ok;
return ReturnValue_ok;
}
18 changes: 9 additions & 9 deletions src/devices/fake/fakeSpeechSynthesizer/FakeSpeechSynthesizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ class FakeSpeechSynthesizer :
bool open(yarp::os::Searchable& config) override;
bool close() override;

virtual yarp::dev::yarp_ret_value setLanguage(const std::string& language) override;
virtual yarp::dev::yarp_ret_value getLanguage(std::string& language) override;
virtual yarp::dev::yarp_ret_value setVoice(const std::string& voice) override;
virtual yarp::dev::yarp_ret_value getVoice(std::string& voice) override;
virtual yarp::dev::yarp_ret_value setSpeed(const double speed) override;
virtual yarp::dev::yarp_ret_value getSpeed(double& voice) override;
virtual yarp::dev::yarp_ret_value setPitch(const double pitch) override;
virtual yarp::dev::yarp_ret_value getPitch(double& voice) override;
virtual yarp::dev::yarp_ret_value synthesize(const std::string& text, yarp::sig::Sound& sound) override;
virtual yarp::dev::ReturnValue setLanguage(const std::string& language) override;
virtual yarp::dev::ReturnValue getLanguage(std::string& language) override;
virtual yarp::dev::ReturnValue setVoice(const std::string& voice) override;
virtual yarp::dev::ReturnValue getVoice(std::string& voice) override;
virtual yarp::dev::ReturnValue setSpeed(const double speed) override;
virtual yarp::dev::ReturnValue getSpeed(double& voice) override;
virtual yarp::dev::ReturnValue setPitch(const double pitch) override;
virtual yarp::dev::ReturnValue getPitch(double& voice) override;
virtual yarp::dev::ReturnValue synthesize(const std::string& text, yarp::sig::Sound& sound) override;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,31 @@ bool FakeSpeechTranscription::close()
return true;
}

yarp::dev::yarp_ret_value FakeSpeechTranscription::setLanguage(const std::string& language)
yarp::dev::ReturnValue FakeSpeechTranscription::setLanguage(const std::string& language)
{
m_language=language;
yCInfo(FAKE_SPEECHTR) << "Language set to" << language;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp::dev::yarp_ret_value FakeSpeechTranscription::getLanguage(std::string& language)
yarp::dev::ReturnValue FakeSpeechTranscription::getLanguage(std::string& language)
{
language = m_language;
return yarp_ret_value_ok;
return ReturnValue_ok;
}

yarp::dev::yarp_ret_value FakeSpeechTranscription::transcribe(const yarp::sig::Sound& sound, std::string& transcription, double& score)
yarp::dev::ReturnValue FakeSpeechTranscription::transcribe(const yarp::sig::Sound& sound, std::string& transcription, double& score)
{
if (sound.getSamples() == 0 ||
sound.getChannels() == 0)
{
yCError(FAKE_SPEECHTR) << "Invalid Sound sample received";
transcription = "";
score = 0.0;
return yarp_ret_value::return_code::return_value_error_method_failed;
return ReturnValue::return_code::return_value_error_method_failed;
}

transcription = "hello world";
score = 1.0;
return yarp_ret_value_ok;
return ReturnValue_ok;
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class FakeSpeechTranscription :
bool open(yarp::os::Searchable& config) override;
bool close() override;

virtual yarp::dev::yarp_ret_value setLanguage(const std::string& language) override;
virtual yarp::dev::yarp_ret_value getLanguage(std::string& language) override;
virtual yarp::dev::yarp_ret_value transcribe(const yarp::sig::Sound& sound, std::string& transcription, double& score) override;
virtual yarp::dev::ReturnValue setLanguage(const std::string& language) override;
virtual yarp::dev::ReturnValue getLanguage(std::string& language) override;
virtual yarp::dev::ReturnValue transcribe(const yarp::sig::Sound& sound, std::string& transcription, double& score) override;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct yarp_sig_Sound {

struct yReturnValue {
} (
yarp.name = "yarp::dev::yarp_ret_value"
yarp.name = "yarp::dev::ReturnValue"
yarp.includefile = "yarp/dev/ReturnValue.h"
)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 20a1afb

Please sign in to comment.