-
Notifications
You must be signed in to change notification settings - Fork 1
/
SettingsPanels.py
107 lines (78 loc) · 4.97 KB
/
SettingsPanels.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
import tkinter as tk
from tkinter import *
import Widgets as cw
class SpectrumMenu(tk.Frame):
def __init__(self, parent, screen):
self.screen = screen
self.parent = parent
tk.Frame.__init__(self, parent)
tk.Label(self, text=self.screen.name).grid(row=0, column=0, columnspan=2, pady=2)
# Colour Mode Settings
cw.ColourModeSettings(self, self.screen).grid(row=1, column=0, columnspan=2, sticky=W, pady=2)
# Delay Settings
cw.DelaySettings(self, self.screen).grid(row=2, column=0, columnspan=2, sticky=W, pady=2)
# Sensitivity Settings
cw.SensitivitySettings(self, self.screen).grid(row=3, column=0, columnspan=2, sticky=W, pady=2)
# Beat Detection Sensitivity Settings
cw.BeatSensitivitySettings(self, self.screen).grid(row=4, column=0, columnspan=2, sticky=W, pady=2)
# Beat Detection Bar Settings
cw.BeatBarSettings(self, self.screen).grid(row=5, column=0, sticky=W, pady=2)
# Beat Detection Threshold Settings
cw.BeatThresholdSettings(self, self.screen).grid(row=5, column=1, sticky=W, pady=2)
# Colour Crossfade Sensitivity Settings
cw.CrossfadeSpeedSettings(self, self.screen).grid(row=6, column=0, columnspan=2, sticky=W, pady=2)
# Dimension Settings
cw.DimensionChangeSettings(self, self.screen, self.screen.changeSize, title="Dimensions",
placeholder=screen.size).grid(row=7, column=0, columnspan=2, sticky=W, pady=2)
cw.DimensionChangeSettings(self, self.screen, self.screen.changePixel, title="Pixel Size",
placeholder=screen.pixel).grid(row=8, column=0, columnspan=2, sticky=W, pady=2)
cw.DimensionChangeSettings(self, self.screen, self.screen.changeDist, title="Pixel Distance",
secondDimension=False, placeholder=screen.pxDist).grid(row=9, column=0, columnspan=2,
sticky=W, pady=2)
class LineMenu(tk.Frame):
def __init__(self, parent, screen):
self.screen = screen
self.parent = parent
tk.Frame.__init__(self, parent)
tk.Label(self, text=self.screen.name).grid(row=0, column=0)
# Colour Mode Settings
cw.ColourModeSettings(self, self.screen).grid(row=1, column=0, sticky=W)
# Delay Settings
cw.DelaySettings(self, self.screen).grid(row=2, column=0, sticky=W)
# SpectrumBar Direction Settings
if str(type(screen)) == "<class 'Spectrums.SpectrumBar'>":
cw.LineAlignSettings(self, self.screen).grid(row=3, column=0, sticky=W)
# Sensitivity Settings
cw.SensitivitySettings(self, self.screen).grid(row=4, column=0, sticky=W)
# Beat Detection Sensitivity Settings
cw.BeatSensitivitySettings(self, self.screen).grid(row=5, column=0, sticky=W)
# Beat Detection Threshold Settings
cw.BeatThresholdSettings(self, self.screen).grid(row=6, column=0, sticky=W)
# Colour Crossfade Sensitivity Settings
cw.CrossfadeSpeedSettings(self, self.screen).grid(row=7, column=0, sticky=W)
# Changing Frequency Settings
cw.BarFreqSettings(self, self.screen).grid(row=8, column=0, sticky=W)
# Dimension Settings
cw.DimensionChangeSettings(self, self.screen, self.screen.changeSize, title="Dimension", secondDimension=False,
placeholder=screen.size.inverse()).grid(row=9, column=0, columnspan=2, sticky=W,
pady=2)
cw.DimensionChangeSettings(self, self.screen, self.screen.changePixel, title="Pixel Size",
placeholder=screen.pixel).grid(row=10, column=0, columnspan=2, sticky=W, pady=2)
cw.DimensionChangeSettings(self, self.screen, self.screen.changeDist, title="Pixel Distance",
secondDimension=False, placeholder=screen.pxDist).grid(row=11, column=0, columnspan=2,
sticky=W, pady=2)
class BeatDetectorTCPMenu(tk.Frame):
def __init__(self, parent, screen):
self.screen = screen
self.parent = parent
tk.Frame.__init__(self, parent)
tk.Label(self, text=self.screen.name).grid(row=0, column=0, columnspan=2, pady=5)
# Changing Frequency Settings
cw.BarFreqSettings(self, self.screen).grid(row=1, column=0, sticky=W, pady=5)
# Dimension Settings
cw.DimensionChangeSettings(self, self.screen, self.screen.changePixel, title="Pixel Size",
placeholder=screen.pixel).grid(row=2, column=0, columnspan=2, sticky=W, pady=5)
# Connection Settings
tcpSet = cw.TCPSettings(self, self.screen)
self.write_console = tcpSet.write_console
tcpSet.grid(row=3, column=0, columnspan=2, sticky="nsew", pady=5)