Ejemplo n.º 1
0
	def stopReplay(self):
		if self.replayActive:
			AudioPlayer.ogg_closeFile()
			AudioPlayer.audio_stop()
			self.replayActive=False
		
		self.active_checkBox.setEnabled(True)
Ejemplo n.º 2
0
	def switchToOgg(self, newOgg, onlyIfPlaysUntilTime):
		if (self.currentFile!=newOgg):
			if (self.currentFile!=None):
				AudioPlayer.ogg_closeFile()
			
			if (newOgg!=None):
				AudioPlayer.ogg_openFile(str(self.dataDirectory+newOgg[0]))
				AudioPlayer.ogg_startDecoding()
			
			self.currentFile=newOgg

			return newOgg!=None
		
		return False
Ejemplo n.º 3
0
	def loadRecording(self, dataDirectory):
		self.active_checkBox.setChecked(False)
		
		#create list of available ogg files in current recording
		self.dataDirectory=dataDirectory+self.name+"/"
		self.setEnabled(os.path.isdir(self.dataDirectory))
		if not os.path.isdir(self.dataDirectory):
			self.oggFiles=[]
			return
		
		self.oggFiles=[[f,parseAudioFileNameTime(f)] for f in os.listdir(self.dataDirectory) if (f[f.rfind('.'):].lower()==".ogg")]
		self.setEnabled(self.oggFiles!=[])
		if self.oggFiles==[]:
			return
		
		for oggFile in self.oggFiles:
			AudioPlayer.ogg_openFile(str(self.dataDirectory+oggFile[0]))
			oggFile.append(AudioPlayer.ogg_getLength())
			AudioPlayer.ogg_closeFile()
		
		self.active_checkBox.setChecked(True)
		
		self.currentFile=None
		self.replayActive=False