GameSentenceMiner 2.15.0__py3-none-any.whl → 2.15.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- GameSentenceMiner/config_gui.py +1 -1
- GameSentenceMiner/obs.py +41 -4
- {gamesentenceminer-2.15.0.dist-info → gamesentenceminer-2.15.2.dist-info}/METADATA +1 -1
- {gamesentenceminer-2.15.0.dist-info → gamesentenceminer-2.15.2.dist-info}/RECORD +8 -8
- {gamesentenceminer-2.15.0.dist-info → gamesentenceminer-2.15.2.dist-info}/WHEEL +0 -0
- {gamesentenceminer-2.15.0.dist-info → gamesentenceminer-2.15.2.dist-info}/entry_points.txt +0 -0
- {gamesentenceminer-2.15.0.dist-info → gamesentenceminer-2.15.2.dist-info}/licenses/LICENSE +0 -0
- {gamesentenceminer-2.15.0.dist-info → gamesentenceminer-2.15.2.dist-info}/top_level.txt +0 -0
GameSentenceMiner/config_gui.py
CHANGED
@@ -2193,7 +2193,7 @@ class ConfigApp:
|
|
2193
2193
|
self.overlay_monitor = ttk.Combobox(overlay_frame, values=self.monitors, state="readonly")
|
2194
2194
|
self.overlay_monitor.grid(row=self.current_row, column=1, sticky='EW', pady=2)
|
2195
2195
|
# disable selection for now, default to value 1
|
2196
|
-
self.overlay_monitor.current(
|
2196
|
+
self.overlay_monitor.current(0)
|
2197
2197
|
self.overlay_monitor.config(state="disabled")
|
2198
2198
|
self.current_row += 1
|
2199
2199
|
|
GameSentenceMiner/obs.py
CHANGED
@@ -506,6 +506,39 @@ def set_fit_to_screen_for_scene_items(scene_name: str):
|
|
506
506
|
|
507
507
|
source_width = scene_item_transform.get('sourceWidth', None)
|
508
508
|
source_height = scene_item_transform.get('sourceHeight', None)
|
509
|
+
|
510
|
+
aspect_ratio_different = False
|
511
|
+
already_cropped = any([
|
512
|
+
scene_item_transform.get('cropLeft', 0) != 0,
|
513
|
+
scene_item_transform.get('cropRight', 0) != 0,
|
514
|
+
scene_item_transform.get('cropTop', 0) != 0,
|
515
|
+
scene_item_transform.get('cropBottom', 0) != 0,
|
516
|
+
])
|
517
|
+
|
518
|
+
if source_width and source_height and not already_cropped:
|
519
|
+
source_aspect_ratio = source_width / source_height
|
520
|
+
canvas_aspect_ratio = canvas_width / canvas_height
|
521
|
+
# Check if aspect ratio is different and if it's a standard aspect ratio
|
522
|
+
aspect_ratio_different = abs(source_aspect_ratio - canvas_aspect_ratio) > 0.01
|
523
|
+
|
524
|
+
# List of standard aspect ratios
|
525
|
+
standard_ratios = [
|
526
|
+
4 / 3,
|
527
|
+
16 / 9,
|
528
|
+
16 / 10,
|
529
|
+
21 / 9,
|
530
|
+
32 / 9,
|
531
|
+
5 / 4,
|
532
|
+
3 / 2,
|
533
|
+
]
|
534
|
+
|
535
|
+
def is_standard_ratio(ratio):
|
536
|
+
return any(abs(ratio - std) < 0.02 for std in standard_ratios)
|
537
|
+
|
538
|
+
# Only crop if both source and canvas are standard aspect ratios
|
539
|
+
if aspect_ratio_different:
|
540
|
+
if not (is_standard_ratio(source_aspect_ratio) and is_standard_ratio(canvas_aspect_ratio)):
|
541
|
+
aspect_ratio_different = False
|
509
542
|
|
510
543
|
# This transform object is the equivalent of "Fit to Screen"
|
511
544
|
fit_to_screen_transform = {
|
@@ -515,11 +548,15 @@ def set_fit_to_screen_for_scene_items(scene_name: str):
|
|
515
548
|
'boundsHeight': canvas_height,
|
516
549
|
'positionX': 0,
|
517
550
|
'positionY': 0,
|
518
|
-
'cropLeft': 0 if canvas_width >= source_width else (source_width - canvas_width) // 2,
|
519
|
-
'cropRight': 0 if canvas_width >= source_width else (source_width - canvas_width) // 2,
|
520
|
-
'cropTop': 0 if canvas_height >= source_height else (source_height - canvas_height) // 2,
|
521
|
-
'cropBottom': 0 if canvas_height >= source_height else (source_height - canvas_height) // 2,
|
522
551
|
}
|
552
|
+
|
553
|
+
if not already_cropped:
|
554
|
+
fit_to_screen_transform.update({
|
555
|
+
'cropLeft': 0 if not aspect_ratio_different or canvas_width > source_width else (source_width - canvas_width) // 2,
|
556
|
+
'cropRight': 0 if not aspect_ratio_different or canvas_width > source_width else (source_width - canvas_width) // 2,
|
557
|
+
'cropTop': 0 if not aspect_ratio_different or canvas_height > source_height else (source_height - canvas_height) // 2,
|
558
|
+
'cropBottom': 0 if not aspect_ratio_different or canvas_height > source_height else (source_height - canvas_height) // 2,
|
559
|
+
})
|
523
560
|
|
524
561
|
try:
|
525
562
|
client.set_scene_item_transform(
|
@@ -1,9 +1,9 @@
|
|
1
1
|
GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
GameSentenceMiner/anki.py,sha256=4Tq6OGjfN-5tYorYRWiih7FZjSKMG6amrLv6DFKkFQc,25344
|
3
|
-
GameSentenceMiner/config_gui.py,sha256=
|
3
|
+
GameSentenceMiner/config_gui.py,sha256=G36MLR1UcdiLB6V3T25_ggGVnt5B4Vj1pS76nQQMqpk,139669
|
4
4
|
GameSentenceMiner/gametext.py,sha256=fgBgLchezpauWELE9Y5G3kVCLfAneD0X4lJFoI3FYbs,10351
|
5
5
|
GameSentenceMiner/gsm.py,sha256=4mJn5v4WKqKAJEtph5e0v4YPVDOpvFN1ylV2vQvf_Dg,31913
|
6
|
-
GameSentenceMiner/obs.py,sha256=
|
6
|
+
GameSentenceMiner/obs.py,sha256=99V4WvBhbBTEGI1o3dlGzhqnktKFUxPc1-5vOBcV0lk,26296
|
7
7
|
GameSentenceMiner/vad.py,sha256=YCn4ZIc6_Q3IGOr5QNMiheVT3Ma5nisn8-V8xD53Mw4,19236
|
8
8
|
GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
GameSentenceMiner/ai/ai_prompting.py,sha256=41xdBzE88Jlt12A0D-T_cMfLO5j6MSxfniOptpwNZm0,24068
|
@@ -72,9 +72,9 @@ GameSentenceMiner/web/templates/index.html,sha256=LqXZx7-NE42pXSpHNZ3To680rD-vt9
|
|
72
72
|
GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
|
73
73
|
GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
|
74
74
|
GameSentenceMiner/wip/__init___.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
|
-
gamesentenceminer-2.15.
|
76
|
-
gamesentenceminer-2.15.
|
77
|
-
gamesentenceminer-2.15.
|
78
|
-
gamesentenceminer-2.15.
|
79
|
-
gamesentenceminer-2.15.
|
80
|
-
gamesentenceminer-2.15.
|
75
|
+
gamesentenceminer-2.15.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
76
|
+
gamesentenceminer-2.15.2.dist-info/METADATA,sha256=G5LgyYGod4vrUBzQESiCd7p8CQwBybDYTVXy7Fkv_M8,7317
|
77
|
+
gamesentenceminer-2.15.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
78
|
+
gamesentenceminer-2.15.2.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
|
79
|
+
gamesentenceminer-2.15.2.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
|
80
|
+
gamesentenceminer-2.15.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|