openshot.code team mailing list archive
-
openshot.code team
-
Mailing list archive
-
Message #00452
[Branch ~openshot.code/openshot/main] Rev 662: Ignore the track audio settings when previewing a file in the project tree.
------------------------------------------------------------
revno: 662
fixes bug: https://launchpad.net/bugs/986199
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Tue 2012-05-01 23:21:32 +0100
message:
Ignore the track audio settings when previewing a file in the project tree.
modified:
openshot/classes/clip.py
--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main
Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/classes/clip.py'
--- openshot/classes/clip.py 2012-04-17 22:07:00 +0000
+++ openshot/classes/clip.py 2012-05-01 22:21:32 +0000
@@ -503,40 +503,42 @@
if self.has_audio():
# Only add volume nodes, if the clip might have audio
- if self.play_audio == False or self.parent.play_audio == False:
- # MUTE
- filter = dom.createElement("filter")
- filter.setAttribute("mlt_service", "volume")
- filter.setAttribute("in", str(int(round(trans_in_frame_number))))
- filter.setAttribute("out", str(int(round(trans_out_frame_number))))
- filter.setAttribute("track", str(track_index_flipped))
- filter.setAttribute("gain", locale.str(0))
-
- # add volume filter to tractor
- tractor_node.appendChild(filter)
- else:
-
- # any fade in?
- if self.audio_fade_in:
-
- # FADE IN
+ # ignore audio settings when previewing a clip
+ if preview_mode != "trimming":
+ if self.play_audio == False or self.parent.play_audio == False:
+ # MUTE
filter = dom.createElement("filter")
filter.setAttribute("mlt_service", "volume")
- filter.setAttribute("in", str(int(round(current_audio_frame))))
- if current_audio_frame + (self.audio_fade_in_amount * fps) <= trans_out_frame_number:
- # ADD FADE AMOUNT
- current_audio_frame = current_audio_frame + round(self.audio_fade_in_amount * fps)
- filter.setAttribute("out", str(int(round(current_audio_frame))))
- else:
- # ADJUST FADE AMOUNT TO FIT SMALLER TIME
- current_audio_frame = trans_out_frame_number
- filter.setAttribute("out", str(int(round(current_audio_frame))))
+ filter.setAttribute("in", str(int(round(trans_in_frame_number))))
+ filter.setAttribute("out", str(int(round(trans_out_frame_number))))
filter.setAttribute("track", str(track_index_flipped))
filter.setAttribute("gain", locale.str(0))
- filter.setAttribute("end", locale.str(self.volume / 100))
-
+
# add volume filter to tractor
tractor_node.appendChild(filter)
+ else:
+
+ # any fade in?
+ if self.audio_fade_in:
+
+ # FADE IN
+ filter = dom.createElement("filter")
+ filter.setAttribute("mlt_service", "volume")
+ filter.setAttribute("in", str(int(round(current_audio_frame))))
+ if current_audio_frame + (self.audio_fade_in_amount * fps) <= trans_out_frame_number:
+ # ADD FADE AMOUNT
+ current_audio_frame = current_audio_frame + round(self.audio_fade_in_amount * fps)
+ filter.setAttribute("out", str(int(round(current_audio_frame))))
+ else:
+ # ADJUST FADE AMOUNT TO FIT SMALLER TIME
+ current_audio_frame = trans_out_frame_number
+ filter.setAttribute("out", str(int(round(current_audio_frame))))
+ filter.setAttribute("track", str(track_index_flipped))
+ filter.setAttribute("gain", locale.str(0))
+ filter.setAttribute("end", locale.str(self.volume / 100))
+
+ # add volume filter to tractor
+ tractor_node.appendChild(filter)
# SET REGULAR VOLUME (length between the 2 fade volume nodes)