Skip to content

Commit

Permalink
Merge pull request #2 from rdkcentral/sprint/24Q2
Browse files Browse the repository at this point in the history
Rebase with remote sprint/24Q2
  • Loading branch information
ramkumarpraba authored May 24, 2024
2 parents 9b6e781 + 1169392 commit ebe7665
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SystemAudioPlayer/impl/AudioPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ void AudioPlayer::setVolume( int thisVol)
g_object_set(G_OBJECT(m_audioVolume), "stream-volume", (double)thisVol/100, NULL);
}
#elif defined(PLATFORM_REALTEK)
g_object_set(G_OBJECT(m_audioVolume), "volume", (double) 4.0 * (thisVol/100), NULL);
g_object_set(G_OBJECT(m_audioVolume), "volume", (double)thisVol/100, NULL);
#elif defined(PLATFORM_BROADCOM)
g_object_set(G_OBJECT(m_audioVolume), "volume", (double)thisVol/100, NULL);
#endif
Expand Down
1 change: 1 addition & 0 deletions Tests/L1Tests/tests/test_RDKShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ TEST_F(RDKShellTest, RegisteredMethods){
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("addAnimation")));
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("addKeyIntercept")));
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("addKeyIntercepts")));
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("setKeyIntercepts")));
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("addKeyListener")));
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("addKeyMetadataListener")));
EXPECT_EQ(Core::ERROR_NONE, handler.Exists(_T("exitAgingMode")));
Expand Down
4 changes: 4 additions & 0 deletions Tests/mocks/rdkshell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ bool CompositorController::addKeyIntercept(const std::string& client, const uint
{
return impl->addKeyIntercept(client, keyCode, flags);
}
bool CompositorController::setKeyIntercept(const std::string& client, const uint32_t& keyCode, const uint32_t& flags, const bool always)
{
return impl->setKeyIntercept(client, keyCode, flags, always);
}
bool CompositorController::removeKeyIntercept(const std::string& client, const uint32_t& keyCode, const uint32_t& flags)
{
return impl->removeKeyIntercept(client, keyCode, flags);
Expand Down
2 changes: 2 additions & 0 deletions Tests/mocks/rdkshell.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ namespace RdkShell
virtual bool addNativeKeyListener(const std::string& client, const uint32_t& keyCode, const uint32_t& flags, std::map<std::string, RdkShellData> &listenerProperties) = 0;
virtual bool addKeyListener(const std::string& client, const uint32_t& keyCode, const uint32_t& flags, std::map<std::string, RdkShellData> &listenerProperties) = 0;
virtual bool addKeyIntercept(const std::string& client, const uint32_t& keyCode, const uint32_t& flags) = 0;
virtual bool setKeyIntercept(const std::string& client, const uint32_t& keyCode, const uint32_t& flags, const bool always) = 0;
virtual bool kill(const std::string& client) = 0;
virtual void setInactivityInterval(const double minutes) = 0;
};
Expand All @@ -284,6 +285,7 @@ namespace RdkShell
static bool getFocused(std::string& client);
static bool kill(const std::string& client);
static bool addKeyIntercept(const std::string& client, const uint32_t& keyCode, const uint32_t& flags);
static bool setKeyIntercept(const std::string& client, const uint32_t& keyCode, const uint32_t& flags, const bool always);
static bool removeKeyIntercept(const std::string& client, const uint32_t& keyCode, const uint32_t& flags);
static bool addKeyListener(const std::string& client, const uint32_t& keyCode, const uint32_t& flags, std::map<std::string, RdkShellData> &listenerProperties);
static bool addNativeKeyListener(const std::string& client, const uint32_t& keyCode, const uint32_t& flags, std::map<std::string, RdkShellData> &listenerProperties);
Expand Down
1 change: 1 addition & 0 deletions Tests/mocks/rdkshellmock.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class CompositorImplMock : public RdkShell::CompositorControllerImpl {
MOCK_METHOD(bool, addNativeKeyListener, (const std::string& client, const uint32_t& keyCode, const uint32_t& flags, (std::map<std::string, RdkShell::RdkShellData> &listenerProperties)), (override));
MOCK_METHOD(bool, addKeyListener, (const std::string& client, const uint32_t& keyCode, const uint32_t& flags, (std::map<std::string, RdkShell::RdkShellData> &listenerProperties)), (override));
MOCK_METHOD(bool, addKeyIntercept, (const std::string& client, const uint32_t& keyCode, const uint32_t& flags), (override));
MOCK_METHOD(bool, setKeyIntercept, (const std::string& client, const uint32_t& keyCode, const uint32_t& flags, const bool always), (override));
MOCK_METHOD(bool, kill, (const std::string& client), (override));
MOCK_METHOD(void, setInactivityInterval, (const double minutes), (override));
};
Expand Down
21 changes: 18 additions & 3 deletions TextToSpeech/impl/TTSURLConstructer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *use
return size * nmemb;
}

static const std::map<std::string, int> speechRateMap = {
{"slow", 25},
{"medium", 50},
{"fast", 75},
{"faster", 90},
{"fastest", 100}
};

namespace TTS
{

Expand Down Expand Up @@ -45,9 +53,16 @@ std::string TTSURLConstructer::httpgetURL(TTSConfiguration &config, std::string
ttsRequest.append(config.language());
}

if(!isLocal && ((config.endPointType().compare("TTS2")) == 0)) {
ttsRequest.append("&speaking_rate=");
ttsRequest.append(config.speechRate());
if(((config.endPointType().compare("TTS2")) == 0)) {
if(!isLocal) {
ttsRequest.append("&speaking_rate=");
ttsRequest.append(config.speechRate());
} else {
//rate mapping for offline VG
ttsRequest.append("&rate=");
auto it = speechRateMap.find(config.speechRate());
ttsRequest.append(std::to_string((speechRateMap.end() != it ) ? it->second : 50));
}
} else {
// Rate / speed
ttsRequest.append("&rate=");
Expand Down

0 comments on commit ebe7665

Please sign in to comment.