@@ -372,8 +372,8 @@ def update_transition_data(self, transition_json, only_basic_props=True, ignore_
372
372
existing_item .data ["start" ] = transition_data ["start" ]
373
373
existing_item .data ["end" ] = transition_data ["end" ]
374
374
375
- log .info ('transition start: %s' % transition_data ["start" ])
376
- log .info ('transition end: %s' % transition_data ["end" ])
375
+ log .debug ('transition start: %s' % transition_data ["start" ])
376
+ log .debug ('transition end: %s' % transition_data ["end" ])
377
377
378
378
if brightness :
379
379
existing_item .data ["brightness" ] = brightness
@@ -395,7 +395,7 @@ def contextMenuEvent(self, event):
395
395
# Javascript callable function to show clip or transition content menus, passing in type to show
396
396
@pyqtSlot (float )
397
397
def ShowPlayheadMenu (self , position = None ):
398
- log .info ('ShowPlayheadMenu: %s' % position )
398
+ log .debug ('ShowPlayheadMenu: %s' % position )
399
399
400
400
# Get translation method
401
401
_ = get_app ()._tr
@@ -429,7 +429,7 @@ def ShowPlayheadMenu(self, position=None):
429
429
430
430
@pyqtSlot (str )
431
431
def ShowEffectMenu (self , effect_id = None ):
432
- log .info ('ShowEffectMenu: %s' % effect_id )
432
+ log .debug ('ShowEffectMenu: %s' % effect_id )
433
433
434
434
# Set the selected clip (if needed)
435
435
self .window .addSelection (effect_id , 'effect' , True )
@@ -445,7 +445,7 @@ def ShowEffectMenu(self, effect_id=None):
445
445
446
446
@pyqtSlot (float , int )
447
447
def ShowTimelineMenu (self , position , layer_id ):
448
- log .info ('ShowTimelineMenu: position: %s, layer: %s' % (position , layer_id ))
448
+ log .debug ('ShowTimelineMenu: position: %s, layer: %s' % (position , layer_id ))
449
449
450
450
# Get translation method
451
451
_ = get_app ()._tr
@@ -469,7 +469,7 @@ def ShowTimelineMenu(self, position, layer_id):
469
469
470
470
@pyqtSlot (str )
471
471
def ShowClipMenu (self , clip_id = None ):
472
- log .info ('ShowClipMenu: %s' % clip_id )
472
+ log .debug ('ShowClipMenu: %s' % clip_id )
473
473
474
474
# Get translation method
475
475
_ = get_app ()._tr
@@ -939,7 +939,7 @@ def ShowClipMenu(self, clip_id=None):
939
939
return menu .popup (QCursor .pos ())
940
940
941
941
def Transform_Triggered (self , action , clip_ids ):
942
- log .info ("Transform_Triggered" )
942
+ log .debug ("Transform_Triggered" )
943
943
944
944
# Emit signal to transform this clip (for the 1st clip id)
945
945
if clip_ids :
@@ -1020,7 +1020,7 @@ def Thumbnail_Updated(self, clip_id):
1020
1020
1021
1021
def Split_Audio_Triggered (self , action , clip_ids ):
1022
1022
"""Callback for split audio context menus"""
1023
- log .info ("Split_Audio_Triggered" )
1023
+ log .debug ("Split_Audio_Triggered" )
1024
1024
1025
1025
# Get translation method
1026
1026
_ = get_app ()._tr
@@ -1095,7 +1095,7 @@ def Split_Audio_Triggered(self, action, clip_ids):
1095
1095
1096
1096
# Loop through each channel
1097
1097
for channel in range (0 , channels ):
1098
- log .info ("Adding clip for channel %s" % channel )
1098
+ log .debug ("Adding clip for channel %s" % channel )
1099
1099
1100
1100
# Each clip is filtered to a different channel
1101
1101
p = openshot .Point (1 , channel , openshot .CONSTANT )
@@ -1159,7 +1159,7 @@ def Split_Audio_Triggered(self, action, clip_ids):
1159
1159
1160
1160
def Layout_Triggered (self , action , clip_ids ):
1161
1161
"""Callback for the layout context menus"""
1162
- log .info (action )
1162
+ log .debug (action )
1163
1163
1164
1164
# Loop through each selected clip
1165
1165
for clip_id in clip_ids :
@@ -1234,7 +1234,7 @@ def Layout_Triggered(self, action, clip_ids):
1234
1234
1235
1235
def Animate_Triggered (self , action , clip_ids , position = "Entire Clip" ):
1236
1236
"""Callback for the animate context menus"""
1237
- log .info (action )
1237
+ log .debug (action )
1238
1238
1239
1239
# Loop through each selected clip
1240
1240
for clip_id in clip_ids :
@@ -1421,7 +1421,7 @@ def Animate_Triggered(self, action, clip_ids, position="Entire Clip"):
1421
1421
1422
1422
def Copy_Triggered (self , action , clip_ids , tran_ids ):
1423
1423
"""Callback for copy context menus"""
1424
- log .info (action )
1424
+ log .debug (action )
1425
1425
1426
1426
# Empty previous clipboard
1427
1427
self .copy_clipboard = {}
@@ -1493,7 +1493,7 @@ def Copy_Triggered(self, action, clip_ids, tran_ids):
1493
1493
1494
1494
def Paste_Triggered (self , action , position , layer_id , clip_ids , tran_ids ):
1495
1495
"""Callback for paste context menus"""
1496
- log .info (action )
1496
+ log .debug (action )
1497
1497
1498
1498
# Get list of clipboard items (that are complete clips or transitions)
1499
1499
# i.e. ignore partial clipboard items (keyframes / effects / etc...)
@@ -1605,7 +1605,7 @@ def Paste_Triggered(self, action, position, layer_id, clip_ids, tran_ids):
1605
1605
1606
1606
def Nudge_Triggered (self , action , clip_ids , tran_ids ):
1607
1607
"""Callback for clip nudges"""
1608
- log .info ("Nudging clip(s) and/or transition(s)" )
1608
+ log .debug ("Nudging clip(s) and/or transition(s)" )
1609
1609
left_edge = - 1.0
1610
1610
right_edge = - 1.0
1611
1611
@@ -1616,7 +1616,7 @@ def Nudge_Triggered(self, action, clip_ids, tran_ids):
1616
1616
nudgeDistance /= 2.0 # 1/2 frame
1617
1617
if abs (nudgeDistance ) < 0.01 :
1618
1618
nudgeDistance = 0.01 * action # nudge is less than the minimum of +/- 0.01s
1619
- log .info ("Nudging by %s sec" % nudgeDistance )
1619
+ log .debug ("Nudging by %s sec" % nudgeDistance )
1620
1620
1621
1621
# Loop through each selected clip (find furthest left and right edge)
1622
1622
for clip_id in clip_ids :
@@ -1692,7 +1692,7 @@ def Nudge_Triggered(self, action, clip_ids, tran_ids):
1692
1692
1693
1693
def Align_Triggered (self , action , clip_ids , tran_ids ):
1694
1694
"""Callback for alignment context menus"""
1695
- log .info (action )
1695
+ log .debug (action )
1696
1696
1697
1697
left_edge = - 1.0
1698
1698
right_edge = - 1.0
@@ -1775,7 +1775,7 @@ def Align_Triggered(self, action, clip_ids, tran_ids):
1775
1775
1776
1776
def Fade_Triggered (self , action , clip_ids , position = "Entire Clip" ):
1777
1777
"""Callback for fade context menus"""
1778
- log .info (action )
1778
+ log .debug (action )
1779
1779
1780
1780
# Get FPS from project
1781
1781
fps = get_app ().project .get ("fps" )
@@ -2004,7 +2004,7 @@ def Slice_Triggered(self, action, clip_ids, trans_ids, playhead_position=0):
2004
2004
2005
2005
def Volume_Triggered (self , action , clip_ids , position = "Entire Clip" ):
2006
2006
"""Callback for volume context menus"""
2007
- log .info (action )
2007
+ log .debug (action )
2008
2008
2009
2009
# Callback function, to redraw audio data after an update
2010
2010
def callback (self , clip_id , callback_data ):
@@ -2141,7 +2141,7 @@ def callback(self, clip_id, callback_data):
2141
2141
2142
2142
def Rotate_Triggered (self , action , clip_ids , position = "Start of Clip" ):
2143
2143
"""Callback for rotate context menus"""
2144
- log .info (action )
2144
+ log .debug (action )
2145
2145
2146
2146
# Loop through each selected clip
2147
2147
for clip_id in clip_ids :
@@ -2181,7 +2181,7 @@ def Rotate_Triggered(self, action, clip_ids, position="Start of Clip"):
2181
2181
2182
2182
def Time_Triggered (self , action , clip_ids , speed = "1X" , playhead_position = 0.0 ):
2183
2183
"""Callback for time context menus"""
2184
- log .info (action )
2184
+ log .debug (action )
2185
2185
2186
2186
# Get FPS from project
2187
2187
fps = get_app ().project .get ("fps" )
@@ -2219,8 +2219,9 @@ def Time_Triggered(self, action, clip_ids, speed="1X", playhead_position=0.0):
2219
2219
if "original_data" in clip .data .keys ():
2220
2220
original_duration = clip .data ["original_data" ]["duration" ]
2221
2221
2222
- log .info ('ORIGINAL DURATION: %s' % original_duration )
2223
- log .info (clip .data )
2222
+ log .info ('Updating timing for clip ID {}, original duration: {}'
2223
+ .format (clip .id , original_duration ))
2224
+ log .debug (clip .data )
2224
2225
2225
2226
# Extend end & duration (due to freeze)
2226
2227
clip .data ["end" ] = float (clip .data ["end" ]) + freeze_seconds
@@ -2979,8 +2980,8 @@ def callback(self, effect_names, callback_data):
2979
2980
<= js_position
2980
2981
<= clip .data ["position" ] + (clip .data ["end" ] - clip .data ["start" ])
2981
2982
):
2982
- log .info ("Applying effect to clip" )
2983
- log .info (clip )
2983
+ log .info ("Applying effect {} to clip ID {}" . format ( name , clip . id ) )
2984
+ log .debug (clip )
2984
2985
2985
2986
# Create Effect
2986
2987
effect = openshot .EffectInfo ().CreateEffect (name )
@@ -3015,6 +3016,9 @@ def dragMoveEvent(self, event):
3015
3016
def dropEvent (self , event ):
3016
3017
log .info ("Dropping item on timeline - item_id: %s, item_type: %s" % (self .item_id , self .item_type ))
3017
3018
3019
+ # Accept event
3020
+ event .accept ()
3021
+
3018
3022
# Get position of cursor
3019
3023
pos = event .posF ()
3020
3024
@@ -3034,28 +3038,31 @@ def dropEvent(self, event):
3034
3038
# Add clips for each file dropped
3035
3039
for uri in event .mimeData ().urls ():
3036
3040
filepath = uri .toLocalFile ()
3037
- if os .path .exists (filepath ) and os .path .isfile (filepath ):
3038
- # Valid file, so create clip for it
3039
- log .info ('Adding clip for {}' .format (os .path .basename (filepath )))
3040
- for file in File .filter (path = filepath ):
3041
- # Insert clip for this file at this position
3042
- self .addClip ([file .id ], pos )
3041
+ if not os .path .exists (filepath ) or not os .path .isfile (filepath ):
3042
+ continue
3043
+
3044
+ # Valid file, so create clip for it
3045
+ log .debug ('Adding clip for {}' .format (os .path .basename (filepath )))
3046
+ for file in File .filter (path = filepath ):
3047
+ # Insert clip for this file at this position
3048
+ self .addClip ([file .id ], pos )
3043
3049
3044
3050
# Clear new clip
3045
3051
self .new_item = False
3046
3052
self .item_type = None
3047
3053
self .item_id = None
3048
3054
3049
- # Accept event
3050
- event .accept ()
3051
-
3052
3055
# Update the preview and reselct current frame in properties
3053
3056
get_app ().window .refreshFrameSignal .emit ()
3054
3057
get_app ().window .propertyTableView .select_frame (self .window .preview_thread .player .Position ())
3055
3058
3056
3059
def dragLeaveEvent (self , event ):
3057
3060
"""A drag is in-progress and the user moves mouse outside of timeline"""
3058
- log .info ('dragLeaveEvent - Undo drop' )
3061
+ log .debug ('dragLeaveEvent - Undo drop' )
3062
+
3063
+ # Accept event
3064
+ event .accept ()
3065
+
3059
3066
if self .item_type == "clip" :
3060
3067
get_app ().window .actionRemoveClip .trigger ()
3061
3068
elif self .item_type == "transition" :
@@ -3066,12 +3073,9 @@ def dragLeaveEvent(self, event):
3066
3073
self .item_type = None
3067
3074
self .item_id = None
3068
3075
3069
- # Accept event
3070
- event .accept ()
3071
-
3072
3076
def redraw_audio_onTimeout (self ):
3073
3077
"""Timer is ready to redraw audio (if any)"""
3074
- log .info ('redraw_audio_onTimeout' )
3078
+ log .debug ('redraw_audio_onTimeout' )
3075
3079
3076
3080
# Stop timer
3077
3081
self .redraw_audio_timer .stop ()
0 commit comments