forked from yaribussi/Blindo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStaticParameter.py
192 lines (139 loc) · 7.46 KB
/
StaticParameter.py
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
'''
ATTENZIONE ABILITARE LE LINEE [5 6 7] PER UTILIZZO SU PC
'''
path_punto_accesso_chiavette = r"/home/elena/PycharmProjects/Blindo/fileAudioFromChiavetta"
# path_punto_accesso_chiavette = r"D:\Matteo\Scuola\Università\Terzo anno 22-23\Blindo\usb"
path_che_simula_la_memoria_interna_del_raspberry = r"/home/elena/PycharmProjects/Blindo/fileAudioRSPmemory"
# path_che_simula_la_memoria_interna_del_raspberry = r"D:\Matteo\Scuola\Università\Terzo anno 22-23\Blindo\recording"
path_liste = r"/home/elena/PycharmProjects/Blindo/Liste"
# path_liste = r"D:\Matteo\Scuola\Università\Terzo anno 22-23\Blindo\liste"
'''
ATTENZIONE ABILITARE LE LINEE [14 15 16 17 18] PER UTILIZZO SU RASPBERRY
ABILITARE NEL FILE "RECORD_VIEW" L'IMPORT ALLA RIGA 5
'''
# import GPIOmanaging
# path_punto_accesso_chiavette = "/media/pi"
# path_che_simula_la_memoria_interna_del_raspberry = "/home/pi/Documents/fileAudio"
# path_liste ="/home/pi/Documents/Lists"
# os.chdir("/home/pi/Desktop/Main/")
# subprocess.Popen(['unclutter','-idle','0']) #comando per rimuovere il cursore
import os
# VARIABILI GLOBALI
# formati audio disponibili
audio_formats = [".mp3", ".wav", ".wma", ".ogg", ".flac"]
# caratteristiche font
font_keyboard_key = 13
font_size_small = 20
font_size_medium = 33
font_size_large = 80
font_style = "Helvetica"
keyboard_key_font = (font_style, font_keyboard_key)
font_small = (font_style, font_size_small)
font_medium = (font_style, font_size_medium)
font_large = (font_style, font_size_large)
# testo visualizzato nel pulsante che torna al menu principale
exit_text = "Torna al menu principale"
# stile bordi pulsanti
bord_styles_set = ["flat", "groove", "raised", "ridge", "solid", "sunken"]
# grandezza bordi pulsanti
bord_size = 5
# scelta del bordo "RAISED"
bord_style = bord_styles_set[2]
# numero di pulsanti collegati
number_of_physical_button = 10
# nome di default del file registrato
name_recoded_file = "reg.wav"
# abilita fullscreen con True, disabilita con False
full_screen_option = False
# messaggi interazione utente
message_label_quit_device = "Vuoi spegnere il dispositivo?"
message_text_button_confirm = "Conferma"
message_text_button_abort = "Annulla"
# questo è il nome della cartella contenente le sottocartelle delle singole liste esportate
export_folder_name = "Liste"
initial_volume_set = 0.5
# colori GUI
button_background_color_grey_scale = "#404040"
active_background_color_gray_scale = "#C8D7DC"
root_background_color_gray_scale = "#708090"
button_font_color_gray_scale = "black"
default_sysyem_element = "#BDC3C7"
pop_up_colour_background = "#BDC3C7"
root_font_color = "black"
recode_view_button_color = "#C0392B"
import_export_button_color = "#5499C7"
list_association_button_color = "#27AE60"
setting_button_color = "#767676"
utility_button_color = "#2D42E7"
archive_manager_button_color = "#F7DC6F"
recode_view_root_color = "#D98880"
import_export_root_color = "#85C1E9"
list_association_root_color = "#58D68D"
setting_root_color = default_sysyem_element
utility_root_color = default_sysyem_element
archive_manager_root_color = "#F9E79F"
key_keyboard_color = "#5499C7"
root_keyboard_color = "#B989C4"
cascade_main_menu = default_sysyem_element
cascade_list_association_menu = "#554F9F"
import_button_color = import_export_button_color
export_button_color = import_export_button_color
import_root_color = import_export_root_color
export_root_color = import_export_root_color
green = "#27AE60"
red = "#C0392B"
# 0 for default theme - 1 for coloured theme
current_theme = 1
theme = {
"confirm_button_background": [button_background_color_grey_scale, green],
"delete_button_background": [button_background_color_grey_scale, red],
"pop_up_background_color": [button_background_color_grey_scale, default_sysyem_element],
"exit_button_with_text": [button_background_color_grey_scale, default_sysyem_element],
"import_button_background": [button_background_color_grey_scale, import_button_color],
"export_button_background": [button_background_color_grey_scale, export_button_color],
"import_root_background": [root_background_color_gray_scale, import_root_color],
"export_root_background": [root_background_color_gray_scale, export_root_color],
"key_button_background": [button_background_color_grey_scale, key_keyboard_color],
"root_keyboard": [root_background_color_gray_scale, root_keyboard_color],
"usb_key_button": [button_background_color_grey_scale, key_keyboard_color],
"setting_main_menu": [root_background_color_gray_scale, cascade_main_menu],
"root_setting_view": [root_background_color_gray_scale, setting_root_color],
"frame_setting_view": [root_background_color_gray_scale, setting_root_color],
"label_setting_view": [root_background_color_gray_scale, setting_root_color],
"button_setting_view": [button_background_color_grey_scale, setting_button_color],
"root_list_association_view": [root_background_color_gray_scale, list_association_root_color],
"frame_list_association_view": [root_background_color_gray_scale, list_association_root_color],
"label_list_association_view": [root_background_color_gray_scale, list_association_root_color],
"button_list_association_view": [button_background_color_grey_scale, list_association_button_color],
"listbox_list_association_view": [root_background_color_gray_scale, list_association_root_color],
"menu_list_association_view": [root_background_color_gray_scale, list_association_button_color],
"root_utility_view": [root_background_color_gray_scale, utility_root_color],
"frame_utility_view": [root_background_color_gray_scale, utility_root_color],
"label_utility_view": [root_background_color_gray_scale, utility_root_color],
"button_utility_view": [button_background_color_grey_scale, utility_button_color],
"listbox_utility_view": [root_background_color_gray_scale, utility_root_color],
"root_import_export_view": [root_background_color_gray_scale, import_export_root_color],
"frame_import_export_view": [root_background_color_gray_scale, import_export_root_color],
"label_import_export_view": [root_background_color_gray_scale, import_export_root_color],
"button_import_export_view": [button_background_color_grey_scale, import_export_button_color],
"root_record_view": [root_background_color_gray_scale, recode_view_root_color],
"frame_record_view": [root_background_color_gray_scale, recode_view_root_color],
"label_record_view": [root_background_color_gray_scale, recode_view_root_color],
"button_record_view": [button_background_color_grey_scale, recode_view_button_color],
"root_archive_manager_view": [root_background_color_gray_scale, archive_manager_root_color],
"frame_archive_manager_view": [root_background_color_gray_scale, archive_manager_root_color],
"label_archive_manager_view": [root_background_color_gray_scale, archive_manager_root_color],
"button_archive_manager_view": [button_background_color_grey_scale, archive_manager_button_color],
"listbox_archive_manager_view": [button_background_color_grey_scale, archive_manager_root_color]
}
def standard_color_setting(guiObjectName):
return theme[guiObjectName].__getitem__(current_theme)
# funzione che modifica la grandezza del bordi dei pulsanti
def set_bord_size(new_size):
global bord_size
bord_size = new_size
# funzione che modifica lo stile dei bordi dei pulsanti
def set_bord_style(chosen_style): # 0-5
bord_styles_set = ["flat", "groove", "raised", "ridge", "solid", "sunken"]
global bord_style
bord_style = bord_styles_set[chosen_style]