mirror of
https://github.com/ShaYmez/P25Clients.git
synced 2026-06-08 08:55:04 -04:00
Initial commit of new voice handling.
This commit is contained in:
+29
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015-2019 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,6 +30,7 @@ enum SECTION {
|
||||
SECTION_NONE,
|
||||
SECTION_GENERAL,
|
||||
SECTION_ID_LOOKUP,
|
||||
SECTION_VOICE,
|
||||
SECTION_LOG,
|
||||
SECTION_NETWORK
|
||||
};
|
||||
@@ -44,6 +45,9 @@ m_announcements(true),
|
||||
m_daemon(false),
|
||||
m_lookupName(),
|
||||
m_lookupTime(0U),
|
||||
m_voiceEnabled(true),
|
||||
m_voiceLanguage("en_GB"),
|
||||
m_voiceDirectory(),
|
||||
m_logFilePath(),
|
||||
m_logFileRoot(),
|
||||
m_networkPort(0U),
|
||||
@@ -82,6 +86,8 @@ bool CConf::read()
|
||||
section = SECTION_GENERAL;
|
||||
else if (::strncmp(buffer, "[Id Lookup]", 11U) == 0)
|
||||
section = SECTION_ID_LOOKUP;
|
||||
else if (::strncmp(buffer, "[Voice]", 7U) == 0)
|
||||
section = SECTION_VOICE;
|
||||
else if (::strncmp(buffer, "[Log]", 5U) == 0)
|
||||
section = SECTION_LOG;
|
||||
else if (::strncmp(buffer, "[Network]", 9U) == 0)
|
||||
@@ -118,6 +124,13 @@ bool CConf::read()
|
||||
m_lookupName = value;
|
||||
else if (::strcmp(key, "Time") == 0)
|
||||
m_lookupTime = (unsigned int)::atoi(value);
|
||||
} else if (section == SECTION_VOICE) {
|
||||
if (::strcmp(key, "Enabled") == 0)
|
||||
m_voiceEnabled = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "Language") == 0)
|
||||
m_voiceLanguage = value;
|
||||
else if (::strcmp(key, "Directory") == 0)
|
||||
m_voiceDirectory = value;
|
||||
} else if (section == SECTION_LOG) {
|
||||
if (::strcmp(key, "FilePath") == 0)
|
||||
m_logFilePath = value;
|
||||
@@ -190,6 +203,21 @@ unsigned int CConf::getLookupTime() const
|
||||
return m_lookupTime;
|
||||
}
|
||||
|
||||
bool CConf::getVoiceEnabled() const
|
||||
{
|
||||
return m_voiceEnabled;
|
||||
}
|
||||
|
||||
std::string CConf::getVoiceLanguage() const
|
||||
{
|
||||
return m_voiceLanguage;
|
||||
}
|
||||
|
||||
std::string CConf::getVoiceDirectory() const
|
||||
{
|
||||
return m_voiceDirectory;
|
||||
}
|
||||
|
||||
std::string CConf::getLogFilePath() const
|
||||
{
|
||||
return m_logFilePath;
|
||||
|
||||
Reference in New Issue
Block a user