… | |
… | |
248 | my ($ob, $arg) = @_; |
248 | my ($ob, $arg) = @_; |
249 | |
249 | |
250 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
250 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
251 | unless $arg > 0; |
251 | unless $arg > 0; |
252 | |
252 | |
253 | # minimum is 5k/s |
253 | $ob->contr->ns->max_rate ((cf::clamp $arg, $OUTPUT_RATE_MIN, $OUTPUT_RATE_MAX) * $TICK); |
254 | # maximum is 100k/s, this should be configurable |
|
|
255 | $ob->contr->ns->max_rate ((List::Util::max 5000, List::Util::min 100000, $arg) * $cf::TICK); |
|
|
256 | $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); |
254 | $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $TICK); |
257 | }; |
255 | }; |
258 | |
256 | |
259 | cf::register_command 'output-count' => sub { |
257 | cf::register_command 'output-count' => sub { |
260 | my ($ob, $arg) = @_; |
258 | my ($ob, $arg) = @_; |
261 | |
259 | |