-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix timer #275
Fix timer #275
Conversation
GTK 3 does not have DEFAULT_STYLE, the default now is EDGE: https://developer.gnome.org/gtk3/stable/GtkButtonBox.html#GtkButtonBoxStyle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to work on this!
I think that you can mitigate the threading issue with the following:
Class Player:
def __init__(self):
Gst.init()
self.player = Gst.ElementFactory.make('playbin', 'player')
self.player.connect('about-to-finish', self.stop_play)
def stop_play(self):
self.player.set_state(Gst.State.NULL)
Would you mind testing that?
Also, could you clean the imports such that it's
from gi.repository import Gst
and add to gourmet/__init__.py
require_version("Gst", "1.0")
gourmet/sound_gst.py
Outdated
self.player.set_state(Gst.State.PLAYING) | ||
|
||
def stop_play (self,path): | ||
def stop_play(self,path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def stop_play(self,path): | |
def stop_play(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the stop_play
methods as they are not used.
Thanks, I made those changes. With
Are all the different ways to play sound actually necessary (there's also |
I think only Gst should be used: the historical reason for having different players was that back in the days, sound handling was not that well integrated between user applications and the OS. Indeed, you could remove the other sound handlers. |
Great, that simplified things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cracking, thanks a lot!
Description
These changes fix various warnings and errors that occurred when using the timer and prevented it from ringing.
How Has This Been Tested?
I confirmed that the warnings disappeared and the timer can now ring, using both gstreamer or pyglet if that is available.
There is a threading issue when using pyglet and closing Gourmet after the timer has gone off, but I don't know how to solve that for now.
Screenshots (if appropriate):
Types of changes
Checklist: