Пример #1
0
 def gridDato(self, grid, fila, oColumna):
     clave = oColumna.clave
     reg = self.liSonidos[fila]
     if clave == "DURACION":
         return "%02d:%02d:%02d" % Sonido.msc(reg.centesimas)
     elif clave == "NOMBRE":
         return reg.nombre
Пример #2
0
def init():
    # Needed for feedback
    if not DEBUG:
        try:
            ferr = open("bug.log", "at")
            sys.stderr = ferr
            okFerr = True
        except:
            okFerr = False

    mainProcesador = Procesador.Procesador()
    mainProcesador.setVersion(VERSION)
    runSound = Sonido.RunSound()
    resp = Gui.lanzaGUI(mainProcesador)
    runSound.close()
    mainProcesador.pararMotores()
    mainProcesador.quitaKibitzers()

    # Needed for feedback
    if not DEBUG:
        if okFerr:
            ferr.close()

    if resp == kFinReinicio:
        if sys.argv[0].endswith(".py"):
            exe = "./%s" % sys.argv[0]
        else:
            exe = "Lucas.exe" if VarGen.isWindows else "Lucas"
        VarGen.startfile(exe)
Пример #3
0
 def gridDato(self, grid, fila, oColumna):
     clave = oColumna.clave
     reg = self.liSonidos[fila]
     if clave == "DURACION":
         return "%02d:%02d:%02d" % Sonido.msc(reg.centesimas)
     elif clave == "NOMBRE":
         return reg.nombre
Пример #4
0
    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]
Пример #5
0
 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()
Пример #6
0
 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()
Пример #7
0
    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()
Пример #8
0
def init():
    if not DEBUG:
        sys.stderr = Util.Log("bug.log")

    mainProcesador = Procesador.Procesador()
    mainProcesador.setVersion(VERSION)
    runSound = Sonido.RunSound()
    resp = Gui.lanzaGUI(mainProcesador)
    runSound.close()
    mainProcesador.pararMotores()
    mainProcesador.quitaKibitzers()

    if resp == kFinReinicio:
        if sys.argv[0].endswith(".py"):
            exe = os.path.abspath(sys.argv[0])
        else:
            exe = "Lucas.exe" if VarGen.isWindows else "Lucas"
        VarGen.startfile(exe)
Пример #9
0
    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)
Пример #10
0
    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]