def play(self): if self.grid.recno() >= 0: reg = self.db[self.grid.recno()] wav = reg.wav ts = Sonido.TallerSonido(wav) ts.playInicio(0, ts.centesimas) self.siPlay = True while self.siPlay: siSeguir, pos = ts.play() if not siSeguir: break ts.playFinal()
def play(self): li = self.liSonidos[self.grid.recno()] if li[0]: wav = self.db[li[0]] if wav is not None: ts = Sonido.TallerSonido(wav) ts.playInicio(0, ts.centesimas) self.siPlay = True while self.siPlay: siSeguir, pos = ts.play() if not siSeguir: break ts.playFinal()
def beginListen(self): self.setEstado(self.ST_LISTENING) self.siSeguimos = True tallerSonido = Sonido.TallerSonido(None) tallerSonido.leeWAV(self.ficheroWav) tallerSonido.playInicio(0, tallerSonido.centesimas) siSeguir = True while self.siSeguimos and siSeguir: siSeguir, pos = tallerSonido.play() QTUtil.refreshGUI() tallerSonido.playFinal() self.endListen()
def __init__(self, owner, titulo, wav=None, maxTime=None, nombre=None): # titulo = _("Sound edition" ) icono = Iconos.S_Play() extparam = "sound" super().__init__(parent=owner, titulo=titulo, icono=icono, extparam=extparam) self.confich = VarGen.configuracion.ficheroDirSound # toolbar self.tb = QtWidgets.QToolBar("BASICO", self) self.tb.setIconSize(QtCore.QSize(32, 32)) self.tb.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon) self.preparaTB() # Nombre siNombre = nombre is not None if siNombre: lbNom = Controles.LB(self, _("Name") + ":") self.edNom = Controles.ED(self, nombre).anchoMinimo(180) lyNom = Colocacion.H().control(lbNom).control(self.edNom).relleno() # MesaSonido self.mesa = MesaSonido(self) self.taller = Sonido.TallerSonido(wav) self.mesa.ponCentesimas(self.taller.centesimas) self.maxTime = maxTime if maxTime else 300.0 # segundos=5 minutos layout = Colocacion.V().control(self.tb) if siNombre: layout.otro(lyNom) layout.control(self.mesa).margen(3) self.setLayout(layout) self.ponBaseTB() self.recuperarVideo(siTam=False)
def gridDato(self, grid, fila, oColumna): clave = oColumna.clave li = self.liSonidos[fila] if clave == "DURACION": if li[0] is None: return "" else: t = li[2] if t is None: wav = self.db[li[0]] if wav is None: t = 0 else: ts = Sonido.TallerSonido(wav) t = ts.centesimas return "%02d:%02d:%02d" % Sonido.msc(t) else: return li[1]