def bwav_timecodeReference(self): ''' : PRO_PACK : if is BWaw return the internal timeReference ''' if self.pro_bwav: return self.pro_bwav.bwav_timecodeReference() else: raise r9Setup.ProPack_Error()
def bwav_timecodeMS(self): ''' : PRO_PACK : read the internal timecode reference from the bwav and convert that number into milliseconds ''' if self.pro_bwav: return self.pro_bwav.bwav_timecodeMS() else: raise r9Setup.ProPack_Error()
def isBwav(self): ''' : PRO_PACK : validate if the given source Wav is a BWav or not ''' if self.pro_bwav: return self.pro_bwav.isBwav() else: raise r9Setup.ProPack_Error()
def bwav_getHeader(self): ''' : PRO_PACK : get the internal BWav header data from the wav if found ''' if self.pro_bwav: self.bwav_HeaderData = self.pro_bwav.bwav_getHeader() return self.bwav_HeaderData else: raise r9Setup.ProPack_Error()
def bwav_sync_to_Timecode(self, offset=0): ''' : PRO_PACK : given that self is a Bwav and has timecode reference, sync it's position in the Maya timeline to match :param offset: offset to apply to the internal timecode of the given wav's ''' if self.isLoaded and self.pro_bwav and self.pro_bwav.isBwav(): self.startFrame = self.pro_audio.milliseconds_to_frame(self.pro_bwav.bwav_timecodeMS()) + offset else: raise r9Setup.ProPack_Error()
def bwav_timecodeFormatted(self, smpte=True, framerate=None): ''' : PRO_PACK : if is Bwav return the internal timecode & convert from milliseconds into timecode :param smpte: format the timecode HH:MM:SS:FF where FF is frames, else milliseconds :param framerate: when using smpte this is the framerate used in the FF block ''' if self.pro_bwav: return self.pro_bwav.bwav_timecodeFormatted(smpte=smpte, framerate=framerate) else: raise r9Setup.ProPack_Error()
def bwav_sync_to_dynamic(self, tc_node, bounds=[]): ''' like the baw_sync_to_timecode func this will sync this audio bwav node to a given timecode but the difference here is that that timecode is extracted dynamically from a given node, stamped with the Red9 timecode attrs. This also supports multiple timecode takes within the same node ''' if self.isLoaded and self.pro_bwav and self.pro_bwav.isBwav(): _timecode=self.pro_audio.Timecode(tc_node) if not bounds: bounds = _timecode.getTimecode_bounds() matchedStart_tc = _timecode.find_Timecode_frame(self.pro_bwav.bwav_timecodeFormatted(), bounds=bounds, set=False) if matchedStart_tc: self.startFrame = matchedStart_tc else: pass else: raise r9Setup.ProPack_Error()
def bwav_sync_to_Timecode(self, offset=0, timecodebase=None): ''' : PRO_PACK : given that self is a Bwav and has timecode reference, sync it's position in the Maya timeline to match :param offset: offset (in frames) to apply to the internal timecode of the given wav's :param timecodebase: optional mapping for a reference timecode so we can manipulate the offset relative to a given timecodebase rather than assuming that frame 1 = '00:00:00:00' ie, we set the timecodebase to '01:00:00:00' therefore day 1 timecode is stripped from all the calculations and a bwav who's timecode is '00:00:00:10' is set to frame 10 ''' if self.isLoaded and self.pro_bwav and self.pro_bwav.isBwav(): if timecodebase: offset = offset - self.pro_audio.timecode_to_frame(timecodebase) #print 'new timecode base given : %s : new offset = %s' % (timecodebase,offset) self.startFrame = self.pro_audio.milliseconds_to_frame(self.pro_bwav.bwav_timecodeMS()) + offset else: raise r9Setup.ProPack_Error()