fix: Add configuration parsing for Audio section

pull/23/head
Dave Behnke 1 month ago
parent f40c42fbaf
commit 5f488f304e

@ -91,6 +91,8 @@
#define JUSRP "USRP"
#define JWHITELISTPATH "WhitelistPath"
#define JXMLPATH "XmlPath"
#define JYSFAUTOLINKMOD "AutoLinkModule"
#define JAUDIO "Audio"
#define JYSF "YSF"
#define JYSFTXRXDB "YSF TX/RX DB"
@ -233,6 +235,8 @@ bool CConfigure::ReadData(const std::string &path)
section = ESection::ysffreq;
else if (0 == hname.compare(JFILES))
section = ESection::files;
else if (0 == hname.compare(JAUDIO))
section = ESection::audio;
else
{
std::cerr << "WARNING: unknown ini file section: " << line << std::endl;
@ -533,6 +537,14 @@ bool CConfigure::ReadData(const std::string &path)
else
badParam(key);
break;
case ESection::audio:
if (0 == key.compare(JENABLE))
data[g_Keys.audio.enable] = IS_TRUE(value[0]);
else if (0 == key.compare("Path"))
data[g_Keys.audio.path] = value;
else
badParam(key);
break;
default:
std::cout << "WARNING: parameter '" << line << "' defined before any [section]" << std::endl;
}

@ -25,7 +25,7 @@
enum class ErrorLevel { fatal, mild };
enum class ERefreshType { file, http, both };
enum class ESection { none, names, ip, modules, urf, dplus, dextra, dcs, g3, imrs, dmrplus, mmdvm, nxdn, bm, ysf, p25, m17, usrp, dmrid, nxdnid, ysffreq, files, tc, dashboard };
enum class ESection { none, names, ip, modules, urf, dplus, dextra, dcs, g3, imrs, dmrplus, mmdvm, nxdn, bm, ysf, p25, m17, usrp, dmrid, nxdnid, ysffreq, files, tc, dashboard, audio };
#define IS_TRUE(a) ((a)=='t' || (a)=='T' || (a)=='1')

Loading…
Cancel
Save

Powered by TurnKey Linux.