def on_seconds(self, value): if self.duration != 0: self.timer = int(value) self.timerevent = True self.time_ = '-' + utils.mpdtime_to_upnptime( str(self.duration - int(value)), self.transportstate) else: self.time_ = utils.mpdtime_to_upnptime(value, self.transportstate)
def on_seconds(self, value): if self.duration != 0: self.timer = int(value) self.timerevent = True self.time_ = '-' + utils.mpdtime_to_upnptime( str(self.duration - int(value)), self.transportstate) else: self.time_ = utils.mpdtime_to_upnptime( value, self.transportstate)
def get_reltime(self, fmt='UPNP'): if self.timer is not None: if fmt == 'UPNP': t = mpdtime_to_upnptime(self.timer.get()) elif fmt == 'seconds': t = int(self.timer.get()) else: # msec t = self.timer.get() else: if fmt == 'UPNP': t = self.reltime else: t = self.seconds return t
def set_reltime(self, t): self.seconds = int(float(t)) self.reltime = mpdtime_to_upnptime(t) # log.err('seconds: %s' % t) self.timer = None