Skip to content

Commit

Permalink
Fix audio file switch not redrawing
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaker authored May 21, 2022
1 parent 7d19071 commit d16d379
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/modalWindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, master=None, controller=None, sequencedClips=[], dubFile=None

self.player = mpv.MPV(loop='inf',
mute=False,
volume=10,
volume=0,
autofit_larger='1280', wid=str(self.playerwid))

self.currentTotalDuration=None
Expand All @@ -137,9 +137,6 @@ def __init__(self, master=None, controller=None, sequencedClips=[], dubFile=None
self.entrydubFile.grid(row=3,column=1,sticky='ew')


if self.dubFile.get() is not None and os.path.exists(self.dubFile.get()):
self.entrydubFile.config(text=os.path.basename(self.dubFile.get()))


self.labelpostSeekOffset = ttk.Label(self)
self.labelpostSeekOffset.config(anchor='e', text='Edit Seek Offset')
Expand All @@ -158,8 +155,12 @@ def __init__(self, master=None, controller=None, sequencedClips=[], dubFile=None
increment=5)
Tooltip(self.entrypostAudioVolume,text='Audio Volume.')
self.entrypostAudioVolume.grid(row=3,column=5,sticky='ew')
self.volumeVar.set(0)
self.volumeVar.trace('w',self.valueChangeVolume)
self.volumeVar.set(0)

if self.dubFile.get() is not None and os.path.exists(self.dubFile.get()):
self.entrydubFile.config(text=os.path.basename(self.dubFile.get()))
self.volumeVar.set(20)


self.labelpostAudioOverrideDelay = ttk.Label(self)
Expand Down Expand Up @@ -367,7 +368,7 @@ def generateSpectrum_async(self):
orig_currentTotalDuration = (self.xCoordToSeconds(orig_width)-self.xCoordToSeconds(0))


proc = sp.Popen(['ffmpeg', '-y', '-i', self.dubFile.get(), '-filter_complex', "[0:a]atrim={}:{},bass=g=3,showwavespic=s={}x80:colors=5C5CAE".format(orig_startoffset,orig_currentTotalDuration+orig_startoffset,orig_width), '-c:v', 'ppm', '-f', 'rawvideo', '-'],stdout=sp.PIPE)
proc = sp.Popen(['ffmpeg', '-y', '-i', cleanFilenameForFfmpeg(self.dubFile.get()), '-filter_complex', "[0:a]atrim={}:{},bass=g=3,showwavespic=s={}x80:colors=5C5CAE".format(orig_startoffset,orig_currentTotalDuration+orig_startoffset,orig_width), '-c:v', 'ppm', '-f', 'rawvideo', '-'],stdout=sp.PIPE)
outs,errs = proc.communicate()

startoffset=self.xCoordToSeconds(0)
Expand Down Expand Up @@ -409,7 +410,7 @@ def selectAudioOverride(self):
else:
self.entrydubFile.config(text=os.path.basename(str(files)))
self.dubFile.set(str(files))

self.recalculateEDLTimings()
self.generateSpectrum()

def updateRegionsOnDrag(self,index,timestamp):
Expand Down

0 comments on commit d16d379

Please sign in to comment.