Пример #1
0
	def modback(self,button):
		if self.modspause!=-1:
			if self.modspause==0:
				os.kill(self.modspid,signal.SIGTSTP);
				self.modspause=1;
			else:
				os.kill(self.modspid,signal.SIGCONT);
				self.modspause=0;
			return 
		listfile=[]
		for i in range(3):
			if self.modlist[i].get_active():
				filename=self.filechooser[i].get_filename()
				if not  filename:
					print "give the filename please"
					return 
				listfile.append(i)
		if len(listfile)==0:
			return;
		new=[]
		for i in listfile:
			newobj=backend.yogesh(self.filechooser[i].get_filename())
			print self.filechooser[i].get_filename()
			newobj.amp(self.amplist[i].get_value())
			newobj.shift(self.timeshiftlist[i].get_value())
			newobj.timescale(self.timescalelist[i].get_value())
			if self.timerevlist[i].get_active():
				newobj.timereverse()
			new.append(newobj)
		for i in range(len(new)-1):
			print 'mod with 0 and ',i+1
			new[0].modulation(new[i+1])
		new[0].write("mod.wav")
		pid=os.fork()
		if pid==0:
			play.play("mod.wav")
			self.modspause=-1;
			self.modspid=-1;
			sys.exit(0)
			return 0;
		else:
			self.modspause=0;
			self.modspid=pid;
Пример #2
0
 def modback(self, button):
     if self.modspause != -1:
         if self.modspause == 0:
             os.kill(self.modspid, signal.SIGTSTP)
             self.modspause = 1
         else:
             os.kill(self.modspid, signal.SIGCONT)
             self.modspause = 0
         return
     listfile = []
     for i in range(3):
         if self.modlist[i].get_active():
             filename = self.filechooser[i].get_filename()
             if not filename:
                 print "give the filename please"
                 return
             listfile.append(i)
     if len(listfile) == 0:
         return
     new = []
     for i in listfile:
         newobj = backend.yogesh(self.filechooser[i].get_filename())
         print self.filechooser[i].get_filename()
         newobj.amp(self.amplist[i].get_value())
         newobj.shift(self.timeshiftlist[i].get_value())
         newobj.timescale(self.timescalelist[i].get_value())
         if self.timerevlist[i].get_active():
             newobj.timereverse()
         new.append(newobj)
     for i in range(len(new) - 1):
         print 'mod with 0 and ', i + 1
         new[0].modulation(new[i + 1])
     new[0].write("mod.wav")
     pid = os.fork()
     if pid == 0:
         play.play("mod.wav")
         self.modspause = -1
         self.modspid = -1
         sys.exit(0)
         return 0
     else:
         self.modspause = 0
         self.modspid = pid
Пример #3
0
	def callback(self,button,i):
		print i,"was cliked\n"
		if self.playing[i]!=-1:
			return
		#print   self.filechooser[i].get_filename()		
		filename=self.filechooser[i].get_filename()		
		self.playing[i]=filename
		#print self.amplist[i].get_value()
		amplitudevalue = self.amplist[i].get_value()
		print self.timeshiftlist[i].get_value()
		
		timeshiftvalue=self.timeshiftlist[i].get_value()
#		print self.timescalelist[i].get_value()
		timescalevalue= self.timescalelist[i].get_value()
	#	print self.timerevlist[i].get_active()
		reverseornot=self.timerevlist[i].get_active()
		if filename:
			newob=backend.yogesh(filename);
			newob.amp(amplitudevalue)
			newob.shift(int(timeshiftvalue))
			newob.timescale(timescalevalue)
			if reverseornot :
				newob.timereverse()
			newob.write("final.wav")
			pid=os.fork()
			self.processpid=pid;
			if pid==0:
				print "over"
				play.play("final.wav")
				self.playing[i]=-1
				self.pause[i]=-1
				sys.exit(0)
			else:
				print "over"
				self.playing[i]=pid;
				self.pause[i]=0
Пример #4
0
    def callback(self, button, i):
        print i, "was cliked\n"
        if self.playing[i] != -1:
            return
        #print   self.filechooser[i].get_filename()
        filename = self.filechooser[i].get_filename()
        self.playing[i] = filename
        #print self.amplist[i].get_value()
        amplitudevalue = self.amplist[i].get_value()
        print self.timeshiftlist[i].get_value()

        timeshiftvalue = self.timeshiftlist[i].get_value()
        #		print self.timescalelist[i].get_value()
        timescalevalue = self.timescalelist[i].get_value()
        #	print self.timerevlist[i].get_active()
        reverseornot = self.timerevlist[i].get_active()
        if filename:
            newob = backend.yogesh(filename)
            newob.amp(amplitudevalue)
            newob.shift(int(timeshiftvalue))
            newob.timescale(timescalevalue)
            if reverseornot:
                newob.timereverse()
            newob.write("final.wav")
            pid = os.fork()
            self.processpid = pid
            if pid == 0:
                print "over"
                play.play("final.wav")
                self.playing[i] = -1
                self.pause[i] = -1
                sys.exit(0)
            else:
                print "over"
                self.playing[i] = pid
                self.pause[i] = 0