Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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
Пример #4
0
 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
Пример #5
0
 def set_reltime(self, t):
     self.seconds = int(float(t))
     self.reltime = mpdtime_to_upnptime(t)
     #         log.err('seconds: %s' % t)
     self.timer = None
Пример #6
0
    def set_reltime(self, t):
        self.seconds = int(float(t))
        self.reltime = mpdtime_to_upnptime(t)
#         log.err('seconds: %s' % t)
        self.timer = None