Source code for platypush.message.event.sound
from abc import ABC
from typing import Optional, Tuple, Union
from platypush.message.event import Event
[docs]
class SoundEvent(Event, ABC):
"""Base class for sound events"""
[docs]
def __init__(
self, *args, device: Optional[Union[str, Tuple[str, str]]] = None, **kwargs
):
super().__init__(*args, device=device, **kwargs)
[docs]
class SoundEventWithResource(SoundEvent, ABC):
"""Base class for sound events with resource names attached"""
[docs]
def __init__(self, *args, resource: Optional[str] = None, **kwargs):
super().__init__(*args, resource=resource, **kwargs)
[docs]
class SoundPlaybackStartedEvent(SoundEventWithResource):
"""
Event triggered when a new sound playback starts
"""
[docs]
class SoundPlaybackStoppedEvent(SoundEventWithResource):
"""
Event triggered when the sound playback stops
"""
[docs]
class SoundPlaybackPausedEvent(SoundEventWithResource):
"""
Event triggered when the sound playback pauses
"""
[docs]
class SoundPlaybackResumedEvent(SoundEventWithResource):
"""
Event triggered when the sound playback resumsed from a paused state
"""
[docs]
class SoundRecordingStartedEvent(SoundEventWithResource):
"""
Event triggered when a new recording starts
"""
[docs]
class SoundRecordingStoppedEvent(SoundEventWithResource):
"""
Event triggered when a sound recording stops
"""
[docs]
class SoundRecordingPausedEvent(SoundEventWithResource):
"""
Event triggered when a sound recording pauses
"""
[docs]
class SoundRecordingResumedEvent(SoundEvent):
"""
Event triggered when a sound recording resumes from a paused state
"""
# vim:sw=4:ts=4:et: