Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update config.cpp #489

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,34 @@ static int parse_outputs(libconfig::Setting& outs, channel_t* channel, int i, in
fdata->append = (!outs[o].exists("append")) || (bool)(outs[o]["append"]);
fdata->split_on_transmission = outs[o].exists("split_on_transmission") ? (bool)(outs[o]["split_on_transmission"]) : false;
fdata->include_freq = outs[o].exists("include_freq") ? (bool)(outs[o]["include_freq"]) : false;

// Add reading of timing parameters with defaults
if (outs[o].exists("minimum_transmission_sec")) {
if (outs[o]["minimum_transmission_sec"].getType() == libconfig::Setting::TypeFloat) {
fdata->minimum_transmission_sec = (double)outs[o]["minimum_transmission_sec"];
} else if (outs[o]["minimum_transmission_sec"].getType() == libconfig::Setting::TypeInt) {
fdata->minimum_transmission_sec = (double)((int)outs[o]["minimum_transmission_sec"]);
} else {
cerr << "Configuration error: minimum_transmission_sec must be a number\n";
error();
}
} else {
fdata->minimum_transmission_sec = 1.5; // default
}

if (outs[o].exists("transmission_delay_sec")) {
if (outs[o]["transmission_delay_sec"].getType() == libconfig::Setting::TypeFloat) {
fdata->transmission_delay_sec = (double)outs[o]["transmission_delay_sec"];
} else if (outs[o]["transmission_delay_sec"].getType() == libconfig::Setting::TypeInt) {
fdata->transmission_delay_sec = (double)((int)outs[o]["transmission_delay_sec"]);
} else {
cerr << "Configuration error: transmission_delay_sec must be a number\n";
error();
}
} else {
fdata->transmission_delay_sec = 1.0; // default
}

channel->need_mp3 = 1;

if (fdata->split_on_transmission) {
Expand Down