Coder Social home page Coder Social logo

Slideshow option. about imv HOT 10 CLOSED

exec64 avatar exec64 commented on July 17, 2024
Slideshow option.

from imv.

Comments (10)

rien333 avatar rien333 commented on July 17, 2024 1

@eXeC64 a toggle command. Thanks for all the work that you've been putting into the 4.0 branch! (the round thing is a bit silly, but I don't use decimal places for slideshows anyway. Could be made a little more elegant tho)

toggle = exec ([ $(calc -p "round($imv_slideshow_duration)") -eq "0" ] && imv-msg $imv_pid "ss 2") || imv-msg $imv_pid "ss 0"

from imv.

eXeC64 avatar eXeC64 commented on July 17, 2024

This is one of those features that I'm not strongly opposed to, but I'm certainly hesitant about. Could you expand upon the use case for this? When would a user need this? For a custom electronic picture frame? As a screensaver of some sort?

I'm just struggling to see when this would be useful where imv would also be the appropriate tool for the job.

from imv.

hakoerber avatar hakoerber commented on July 17, 2024

My use case would be something like "Being at a family gathering and showing some images on a projector." I guess I could use a remote to switch between images, but a fixed delay works well in my experience. Electronic picture frame would be another example where this is useful (not for me but in general), as you said.

Right now I'm using feh for this, but if you think this feature could be useful to have imv, I'd give it a go.

from imv.

eXeC64 avatar eXeC64 commented on July 17, 2024

I'll accept it, but if done I think it should behave like this:

  • -t [time] option to set how long to show each image for
  • t key binding increases display time by 1 second
  • T key binding decreases display time by 1 second
  • If non-zero, the time left and display time should be shown in the overlay and window title in the form [display-time-so-far/display-time]
  • A display time of 0 indicates the slideshow is not active

This way, the speed can be adjusted at run-time, and playback even paused, with information about how much time is left.

from imv.

hakoerber avatar hakoerber commented on July 17, 2024

That sound good, I will try implementing this as soon as I have some time.

from imv.

rien333 avatar rien333 commented on July 17, 2024

Is their currently a way to pause the slideshow? I suppose you could set $imv_slideshow_duration to zero. But currently this variable is only mentioned in the docs.

EDIT:
rather hacky solution I came up with:

void command_pause(struct list *args, const char *argstr, void *data)
{
  (void)args;
  (void)argstr;
  struct imv *imv = data;
  imv->slideshow_image_duration = 0;
  imv->need_redraw = true;
}

Ideally, the previous image duration just would be restored (I think?) Would you be willing to implement a PR based on this code?

from imv.

eXeC64 avatar eXeC64 commented on July 17, 2024

There isn't a way to pause slideshows as of yet, but it's something that can go into v4. I'm going to be changing around the commands to make them more friendly, but I've not decided how to structure the slideshow commands, perhaps slideshow <n> to start the slideshow with a given duration, +- prefix to adjust the duration, and slideshow pause to pause/unpause. ss would probably be an alias for slideshow

from imv.

rien333 avatar rien333 commented on July 17, 2024

I like the current solution! You can do something like:

[alias]
pause = slideshow 0

And probably do something like a toggle too by inspecting the $imv_slideshow_duration

from imv.

eXeC64 avatar eXeC64 commented on July 17, 2024

I'm not sure it's possible to create a toggle bind/command without further extensions. Also, it's not documented, but ss is a builtin alias for slideshow so I do ss 0 to pause and ss 3 to resume, which I quite like.

from imv.

eXeC64 avatar eXeC64 commented on July 17, 2024

Neat! I think it wasn't possible before $imv_pid, but with that addition a whole bunch of scripting possibilities have opened up.

from imv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.