-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_types.py
More file actions
43 lines (34 loc) · 1.36 KB
/
app_types.py
File metadata and controls
43 lines (34 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from dataclasses import dataclass
from enum import Enum
class FilePlayMode(Enum):
"""
Dictates what happens when playback reaches end of current Sound
"""
DEFAULT = 0 # when playback reaches end of current sound, does nothing
REPEAT_SINGLE = 1 # when playback reaches end of current sound, repeats current file
TO_END = 2 # when playback reaches end of current sound, plays next file in directory
TO_END_REPEAT = 3 # when playback reaches end of current sound, plays next file in directory, and wraps around
RANDOM_NEXT = 4 # when playback reaches end of current sound, selects random file in directory, indefinitely
class SegmentPlayMode(Enum):
"""
"""
TO_END = 1 # stream plays segments only, stops at end of last segment
REPEAT_SINGLE = 2 # stream auto-repeats next or current segment
REPEAT_ALL = 3 # stream auto-repeats through all segments
# ---
@dataclass(frozen=True)
class SelectionBeginAction:
begin_position: float
is_silence_detect: bool
@dataclass(frozen=True)
class SelectionCompleteAction:
complete_position: float
begin_position: float
is_silence_detect: bool
@dataclass(frozen=True)
class SeekAction:
position: float
@dataclass(frozen=True)
class DeleteSelectionAction:
index: int
TimelineMouseAction = SelectionBeginAction | SelectionCompleteAction | SeekAction | DeleteSelectionAction