@@ -275,6 +275,12 @@ def update_title(self):
275
275
rect = self .centeredViewport (self .width (), self .height ())
276
276
scale = self .devicePixelRatioF ()
277
277
278
+ # Display the playback speed in widget title
279
+ speed = 0.0
280
+ mode = self .win .preview_thread .player .Mode ()
281
+ if mode != openshot .PLAYBACK_PAUSED :
282
+ speed = self .win .preview_thread .player .Speed ()
283
+
278
284
# Find parent dockWidget (if any)
279
285
dock = None
280
286
if self .parent () and self .parent ().parent ():
@@ -286,12 +292,15 @@ def update_title(self):
286
292
287
293
if self .settings .get ("preview-fps" ):
288
294
# Update window title with FPS output
289
- dock .setWindowTitle (_ ("Video Preview" ) + " " + _ ("(Paint: %d FPS, Render: %d FPS, %dx%d)" )
290
- % (self .paint_fps , self .present_fps ,
295
+ dock .setWindowTitle (_ ("Video Preview " ) + _ ("(Speed: %dx, Paint: %d FPS, Render: %d FPS, %dx%d)" )
296
+ % (speed , self .paint_fps , self .present_fps ,
291
297
rect .width () * scale , rect .height () * scale ))
292
298
else :
293
299
# Restore window title
294
- dock .setWindowTitle (_ ("Video Preview" ))
300
+ if not speed in [1 , 0 , - 1 ]:
301
+ dock .setWindowTitle (_ ("Video Preview" ) + f" ({ speed } x)" )
302
+ else :
303
+ dock .setWindowTitle (_ ("Video Preview" ))
295
304
296
305
def paintEvent (self , event , * args ):
297
306
""" Custom paint event """
@@ -1465,6 +1474,13 @@ def __init__(self, watch_project=True, *args):
1465
1474
# Get a reference to the window object
1466
1475
self .win = get_app ().window
1467
1476
1477
+ # Update title whenever playback speed changes.
1478
+ self .win .PlaySignal .connect (self .update_title , Qt .QueuedConnection )
1479
+ self .win .PlaySignal .connect (self .update_title , Qt .QueuedConnection )
1480
+ self .win .PauseSignal .connect (self .update_title , Qt .QueuedConnection )
1481
+ self .win .SpeedSignal .connect (self .update_title , Qt .QueuedConnection )
1482
+ self .win .StopSignal .connect (self .update_title , Qt .QueuedConnection )
1483
+
1468
1484
# Show Property timer
1469
1485
# Timer to use a delay before sending MaxSizeChanged signals (so we don't spam libopenshot)
1470
1486
self .delayed_resize_timer = QTimer (self )
0 commit comments