Bases: AbstractToolbarSettings
Methods:
Attributes:
Source code
| def __init__(self, parent: type[AbstractToolbar] | AbstractToolbar) -> None:
self.parent_toolbar_type = parent if isinstance(parent, type) else parent.__class__
super().__init__()
|
BICUBIC_KERNELS = {
"mitchell": {"b": 1 / 3, "c": 1 / 3},
"hermite": {"b": 0, "c": 0.0},
"catrom": {"b": 0, "c": 0.5},
"spline": {"b": 1, "c": 0.0},
}
CHECKERBOARD_ENABLED = True
CHECKERBOARD_TILE_COLOR_1 = white
CHECKERBOARD_TILE_COLOR_2 = lightGray
CHECKERBOARD_TILE_SIZE = 8
FPS_AVERAGING_WINDOW_SIZE = Frame(100)
FPS_REFRESH_INTERVAL = 150
parent_toolbar_type = parent if isinstance(parent, type) else __class__
playback_buffer_size: int
get_separator(horizontal: bool = False) -> QFrame
Source code
| def get_separator(self, horizontal: bool = False) -> QFrame:
separator = QFrame(self)
separator.setFrameShape(QFrame.Shape.HLine if horizontal else QFrame.Shape.VLine)
separator.setFrameShadow(QFrame.Shadow.Sunken)
return separator
|
Source code
| def set_defaults(self) -> None:
self.buffer_size_spinbox.setValue(MainSettings.get_usable_cpus_count())
self.dither_type_combobox.setCurrentValue(DitherType.ERROR_DIFFUSION)
self.kernel_combobox.setCurrentIndex(0)
|
set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292 | def set_qobject_names(self) -> None:
if not hasattr(self, '__slots__'):
return
slots = list(self.__slots__)
if isinstance(self, AbstractToolbar) and 'main' in slots:
slots.remove('main')
for attr_name in slots:
attr = getattr(self, attr_name)
if not isinstance(attr, QObject):
continue
attr.setObjectName(type(self).__name__ + '.' + attr_name)
|
Source code
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 | def setup_ui(self) -> None:
from ...core import main_window
super().setup_ui()
self.buffer_size_spinbox = SpinBox(self, 1, MainSettings.get_usable_cpus_count())
self.dither_type_combobox = ComboBox[str](
self, model=GeneralModel[str]([x.value for x in DitherType][1:]),
currentIndex=3, sizeAdjustPolicy=QComboBox.SizeAdjustPolicy.AdjustToContents
)
self.kernel_combobox = ComboBox[str](
self, model=GeneralModel[str](list(self.BICUBIC_KERNELS.keys())),
currentIndex=0, sizeAdjustPolicy=QComboBox.SizeAdjustPolicy.AdjustToContents
)
self.dither_type_combobox.currentTextChanged.connect(lambda _: main_window().refresh_video_outputs())
self.kernel_combobox.currentTextChanged.connect(lambda _: main_window().refresh_video_outputs())
HBoxLayout(self.vlayout, [QLabel('Playback buffer size (frames)'), self.buffer_size_spinbox])
HBoxLayout(self.vlayout, [QLabel('Dithering Type'), self.dither_type_combobox])
HBoxLayout(self.vlayout, [QLabel('Resample kernel (chroma)'), self.kernel_combobox])
|