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

HorizontalSliderWithBrowser: slider with play button #4176

Merged
merged 12 commits into from
Oct 7, 2024

Conversation

EdgarGF93
Copy link
Contributor

@EdgarGF93 EdgarGF93 commented Sep 29, 2024

Checklist:


This PR provides:

  • A Play Button for the HorizontalSliderWithBrowser to play a "movie" with the frames along that axis
  • ContextMenu with a Lineedit to change the frame per seconds, (the maximum is set by the rendering time per frame)
  • ContextMenu with a SpinBox to set an interval between displayed frames (not one by one)

@EdgarGF93 EdgarGF93 changed the title slider with play button HorizontalSliderWithBrowser: slider with play button Sep 29, 2024
@EdgarGF93
Copy link
Contributor Author

EdgarGF93 commented Sep 29, 2024

silxplay

Copy link
Member

@t20100 t20100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, it's a nice feature!

I left a few comments, mainly:

  • Probably best to extend HorizontalSliderWithBrowser rather than using inheritance
  • Improve the play settings menu to be discoverable and only available on the play button.

src/silx/gui/widgets/FrameBrowser.py Outdated Show resolved Hide resolved
src/silx/gui/widgets/FrameBrowser.py Outdated Show resolved Hide resolved
src/silx/gui/widgets/FrameBrowser.py Outdated Show resolved Hide resolved
src/silx/gui/widgets/FrameBrowser.py Outdated Show resolved Hide resolved
src/silx/gui/widgets/FrameBrowser.py Outdated Show resolved Hide resolved
framerate = self.menu.getFrameRate()
waiting_time_ms = int(1 / framerate * 1e3)
self.__timer.start(waiting_time_ms)
self.playButton.setIcon(icons.getQIcon("close"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A square "stop" icon would makes more sense, or keeping the button checked while playing and uncheck it at the end.

src/silx/gui/widgets/FrameBrowser.py Outdated Show resolved Hide resolved
@EdgarGF93
Copy link
Contributor Author

EdgarGF93 commented Oct 4, 2024

Thanks Thomas, yesterday a user asked me if it would be possible to export this 'movie' as a file to use it in presentations. What do you think?

@t20100
Copy link
Member

t20100 commented Oct 4, 2024

That sounds interesting!

There's something like this in silx.gui.plot3d:

class VideoAction(Plot3DAction):

It rotates the 3D scene and saves it as a list of *.png or as a .mng (the multi-image version of png).
It's not the best output formats for videos (need to be converted), but it doesn't need extra dependencies ;).

It would be good to output in a more common file format yet without a too cumbersome dependency....
I propose to do this in a different PR.

@t20100
Copy link
Member

t20100 commented Oct 7, 2024

I made a few propositions of changes in EdgarGF93#2
I let you review it.

@EdgarGF93
Copy link
Contributor Author

Thanks, Thomas, looks good to me

Copy link
Member

@t20100 t20100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Nice feature!

@t20100 t20100 added this to the Next release milestone Oct 7, 2024
@t20100 t20100 merged commit 8d56b0f into silx-kit:main Oct 7, 2024
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants