How to use the munch.ITSampleData function in munch

To help you get started, we’ve selected a few munch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iamgreaser / it2everything / munch.py View on Github external
if self.flags & 0x20:
			if self.susbeg > self.susend:
				print "WARNING: Susloop start is greater than susloop end"
			if self.susend > self.length:
				print "WARNING: Susloop end is greater than length"
		
		if self.length == 0:
			if (self.flags & 1):
				print "WARNING: Sample data is supposed to exist but length is 0."
				self.flags &= ~1
		
		if (self.flags & 1):
			fp.seek(smpptr)
			if smpptr == 0:
				print "WARNING: Many trackers/players don't load sampledata with a pointer of 0."
			self.smpdata = ITSampleData(self, fp, self.length, self.cvt, self.flags)
		elif smpptr != 0:
			print "WARNING: Sample pointer is nonzero but bit 0 of flags is clear."
			print "Either your tracker is broken, or you've packed this already."
			self.smpdata = None
		
		self.currently_used = False