auraenumerations.py 2.82 KB
Newer Older
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
43
44
45
46
47
48
49
50
51
52
53
#
#  engine
#
#  Playout Daemon for autoradio project
#
#
#  Copyright (C) 2017-2018 Gottfried Gaisbauer <gottfried.gaisbauer@servus.at>
#
#  This file is part of engine.
#
#  engine is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  any later version.
#
#  engine is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with engine. If not, see <http://www.gnu.org/licenses/>.
#

from enum import Enum


class TerminalColors(Enum):
    HEADER = "\033[95m"

    RED = "\033[31m"
    GREEN = "\033[32m"
    ORANGE = "\033[33m"
    BLUE = "\033[34m"
    PINK = "\033[35m"
    CYAN = "\033[36m"

    WARNING = "\033[31m"
    FAIL = "\033[41m"

    BOLD = "\033[1m"
    UNDERLINE = "\033[4m"

    ENDC = "\033[0m"


class RedisChannel(Enum):
    STANDARD = "aura"

    DPE_REPLY = "delete_playlist_entry_reply"
    FNP_REPLY = "fetch_new_programme_reply"
    GAP_REPLY = "get_act_programme_reply"
    GCS_REPLY = "get_connection_status_reply"
54
    GNF_REPLY = "get_next_file_reply"
55
56
    IPE_REPLY = "insert_playlist_entry_reply"
    IP_REPLY  = "init_player_reply"
57
    TS_REPLY  = "track_service_reply"
58
59
60
61
62
63
    MPE_REPLY = "move_playlist_entry_reply"
    PMQ_REPLY = "print_message_queue_reply"
    RDB_REPLY = "recreate_database_reply"
    SNF_REPLY = "get_next_file_reply"


64
65
66
67
68
69
70
71
class Channel(Enum):
    """
    Channel name mappings to the Liqidsoap channel IDs
    """
    FILESYSTEM_A = "in_filesystem_0"
    FILESYSTEM_B = "in_filesystem_1"
    STREAM_A  = "http_1"
    STREAM_B  = "http_2"
72
73
74
75
    LIVE_0 = "aura_linein_0"
    LIVE_1 = "aura_linein_1"
    LIVE_2 = "aura_linein_2"
    LIVE_3 = "aura_linein_3"
76
77
78
    LIVE_4 = "aura_linein_4"


79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
class ChannelType(Enum):
    """
    Engine channel types mapped to `Entry` source types.
    """
    FILESYSTEM = {
        "id": "fs",
        "channels": [Channel.FILESYSTEM_A, Channel.FILESYSTEM_B]
    }
    STREAM = {
        "id": "http",
        "channels": [Channel.STREAM_A, Channel.STREAM_B]
    }
    LIVE = {
        "id": "live",
        "channels": [
            Channel.LIVE_0, 
            Channel.LIVE_1,
            Channel.LIVE_2,
            Channel.LIVE_3,
            Channel.LIVE_4
        ]
    }


103
104
class FallbackType(Enum):
    SHOW = "show" # the first played when the show playlist fails
105
    TIMESLOT = "timeslot" # the second played when timeslot fallback fails
106
    STATION = "station" # the last played when everything else fails
107

108
109
110
111
112
113
114


class TimerType(Enum):
    SWITCH = "switch"
    FADEIN = "fadein"
    FADEOUT = "fadeout"