Esempio n. 1
0
 def grid_dato(self, grid, fila, oColumna):
     clave = oColumna.clave
     reg = self.liSonidos[fila]
     if clave == "DURACION":
         return "%02d:%02d:%02d" % Sound.msc(reg.centesimas)
     elif clave == "NOMBRE":
         return reg.name
 def grid_dato(self, grid, row, o_column):
     key = o_column.key
     reg = self.liSonidos[row]
     if key == "DURACION":
         return "%02d:%02d:%02d" % Sound.msc(reg.centesimas)
     elif key == "NOMBRE":
         return reg.name
    def grid_dato(self, grid, row, o_column):
        key = o_column.key
        li = self.liSonidos[row]
        if key == "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 = Sound.TallerSonido(wav)
                        t = ts.centesimas
                return "%02d:%02d:%02d" % Sound.msc(t)

        else:
            return li[1]
Esempio n. 4
0
    def grid_dato(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 = Sound.TallerSonido(wav)
                        t = ts.centesimas
                return "%02d:%02d:%02d" % Sound.msc(t)

        else:
            return li[1]
 def play(self):
     if self.grid.recno() >= 0:
         reg = self.db[self.grid.recno()]
         wav = reg.wav
         ts = Sound.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 = Sound.TallerSonido(wav)
             ts.playInicio(0, ts.centesimas)
             self.siPlay = True
             while self.siPlay:
                 siSeguir, pos = ts.play()
                 if not siSeguir:
                     break
             ts.playFinal()
Esempio n. 7
0
def init():
    if not Code.DEBUG:
        sys.stderr = Util.Log("bug.log")

    main_procesador = Procesador.Procesador()
    main_procesador.set_version(Code.VERSION)
    run_sound = Sound.RunSound()
    resp = Gui.run_gui(main_procesador)
    run_sound.close()
    # Added by GON
    main_procesador.desactivarDGT()
    # ------------
    main_procesador.pararMotores()
    main_procesador.kibitzers_manager.close()

    if resp == OUT_REINIT:
        if sys.argv[0].endswith(".py"):
            exe = os.path.abspath(sys.argv[0])
        else:
            exe = "LucasR.exe" if Code.is_windows else "LucasR"
        Code.startfile(exe)
    def __init__(self, owner, titulo, wav=None, maxTime=None, name=None):

        # titulo = _("Sound edition" )
        icono = Iconos.S_Play()
        extparam = "sound"
        QTVarios.WDialogo.__init__(self, owner, titulo, icono, extparam)

        self.confich = Code.configuration.ficheroDirSound

        # toolbar
        self.tb = QtWidgets.QToolBar("BASIC", self)
        self.tb.setIconSize(QtCore.QSize(32, 32))
        self.tb.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
        self.prepare_toolbar()

        # Nombre
        siNombre = name is not None
        if siNombre:
            lbNom = Controles.LB(self, _("Name") + ":")
            self.edNom = Controles.ED(self, name).anchoMinimo(180)
            lyNom = Colocacion.H().control(lbNom).control(self.edNom).relleno()

        # MesaSonido
        self.mesa = MesaSonido(self)
        self.taller = Sound.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.restore_video(siTam=False)