… | |
… | |
253 | my ($ob, $arg) = @_; |
253 | my ($ob, $arg) = @_; |
254 | |
254 | |
255 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
255 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
256 | unless $arg > 0; |
256 | unless $arg > 0; |
257 | |
257 | |
|
|
258 | # minimum is 2k/s |
258 | $ob->contr->ns->max_rate ($arg * $cf::TICK); |
259 | $ob->contr->ns->max_rate ((List::Util::max 2048, $arg) * $cf::TICK); |
259 | $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); |
260 | $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); |
260 | |
261 | |
261 | 1 |
262 | 1 |
262 | }; |
263 | }; |
263 | |
264 | |
… | |
… | |
274 | }; |
275 | }; |
275 | |
276 | |
276 | cf::register_command 'output-sync' => sub { |
277 | cf::register_command 'output-sync' => sub { |
277 | my ($ob, $arg) = @_; |
278 | my ($ob, $arg) = @_; |
278 | |
279 | |
279 | return $ob->reply (undef, "Output sync time is presently " . $ob->contr->outputs_sync) |
280 | return $ob->reply (undef, sprintf "Output sync time is presently %.1fs", $ob->contr->outputs_sync * $cf::TICK) |
280 | unless $arg > 0; |
281 | unless length $arg; |
281 | |
282 | |
282 | $ob->contr->outputs_sync ($arg); |
283 | $ob->contr->outputs_sync ($arg / $cf::TICK); |
283 | $ob->reply (undef, "Output sync time now set to " . $ob->contr->outputs_sync); |
284 | $ob->reply (undef, sprintf "Output sync time now set to %.1fs", $ob->contr->outputs_sync * $cf::TICK); |
284 | |
285 | |
285 | 1 |
286 | 1 |
286 | }; |
287 | }; |
287 | |
288 | |
288 | # XXX: This has a bug. After one sets his wimpy level to 0 and resets it to |
289 | # XXX: This has a bug. After one sets his wimpy level to 0 and resets it to |