nsxivff2ce99
Merge djhejna/floatdelay
+17 −9
6 files changed
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION := git-20161129 | |
| 1 | + | VERSION := git-20161201 | |
| 2 | 2 | ||
| 3 | 3 | PREFIX := /usr/local | |
| 4 | 4 | MANPREFIX := $(PREFIX)/share/man | |
| @@ -429,8 +429,8 @@ bool ci_slideshow(arg_t _) | |||
| 429 | 429 | { | |
| 430 | 430 | if (prefix > 0) { | |
| 431 | 431 | img.ss.on = true; | |
| 432 | − | img.ss.delay = prefix; | |
| 433 | − | set_timeout(slideshow, img.ss.delay * 1000, true); | |
| 432 | + | img.ss.delay = prefix * 10; | |
| 433 | + | set_timeout(slideshow, img.ss.delay * 100, true); | |
| 434 | 434 | } else if (img.ss.on) { | |
| 435 | 435 | img.ss.on = false; | |
| 436 | 436 | reset_timeout(slideshow); | |
| @@ -76,7 +76,7 @@ void img_init(img_t *img, win_t *win) | |||
| 76 | 76 | img->gamma = MIN(MAX(options->gamma, -GAMMA_RANGE), GAMMA_RANGE); | |
| 77 | 77 | ||
| 78 | 78 | img->ss.on = options->slideshow > 0; | |
| 79 | − | img->ss.delay = options->slideshow > 0 ? options->slideshow : SLIDESHOW_DELAY; | |
| 79 | + | img->ss.delay = options->slideshow > 0 ? options->slideshow : SLIDESHOW_DELAY * 10; | |
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | 82 | #if HAVE_LIBEXIF | |
| @@ -371,8 +371,12 @@ void update_info(void) | |||
| 371 | 371 | bar_put(r, "%s%0*d/%d", mark, fw, fileidx + 1, filecnt); | |
| 372 | 372 | } else { | |
| 373 | 373 | bar_put(r, "%s", mark); | |
| 374 | − | if (img.ss.on) | |
| 375 | − | bar_put(r, "%ds | ", img.ss.delay); | |
| 374 | + | if (img.ss.on) { | |
| 375 | + | if (img.ss.delay % 10 != 0) | |
| 376 | + | bar_put(r, "%2.1fs | ", (float)img.ss.delay / 10); | |
| 377 | + | else | |
| 378 | + | bar_put(r, "%ds | ", img.ss.delay / 10); | |
| 379 | + | } | |
| 376 | 380 | if (img.gamma != 0) | |
| 377 | 381 | bar_put(r, "G%+d | ", img.gamma); | |
| 378 | 382 | bar_put(r, "%3d%% | ", (int) (img.zoom * 100.0)); | |
| @@ -403,7 +407,7 @@ void redraw(void) | |||
| 403 | 407 | if (mode == MODE_IMAGE) { | |
| 404 | 408 | img_render(&img); | |
| 405 | 409 | if (img.ss.on) { | |
| 406 | − | t = img.ss.delay * 1000; | |
| 410 | + | t = img.ss.delay * 100; | |
| 407 | 411 | if (img.multi.cnt > 0 && img.multi.animate) | |
| 408 | 412 | t = MAX(t, img.multi.length); | |
| 409 | 413 | set_timeout(slideshow, t, false); | |
| @@ -136,7 +136,7 @@ void parse_options(int argc, char **argv) | |||
| 136 | 136 | _options.recursive = true; | |
| 137 | 137 | break; | |
| 138 | 138 | case 'S': | |
| 139 | − | n = strtol(optarg, &end, 0); | |
| 139 | + | n = strtof(optarg, &end) * 10; | |
| 140 | 140 | if (*end != '\0' || n <= 0) | |
| 141 | 141 | error(EXIT_FAILURE, 0, "Invalid argument for option -S: %s", optarg); | |
| 142 | 142 | _options.slideshow = n; | |
| @@ -87,7 +87,11 @@ Be quiet, disable warnings to standard error stream. | |||
| 87 | 87 | Search the given directories recursively for images to view. | |
| 88 | 88 | .TP | |
| 89 | 89 | .BI "\-S " DELAY | |
| 90 | − | Start in slideshow mode. Set the delay between images to DELAY seconds. | |
| 90 | + | Start in slideshow mode. Set the delay between images to | |
| 91 | + | .I DELAY | |
| 92 | + | seconds. | |
| 93 | + | .I DELAY | |
| 94 | + | may be a floating point number. | |
| 91 | 95 | .TP | |
| 92 | 96 | .BI "\-s " MODE | |
| 93 | 97 | Set scale mode according to MODE character. Supported modes are: [d]own, | |