def test_frames2seconds(self): s = mythtv.frames2seconds(1000, 29.97) log.debug('1000 frames @ 29.97fps = %s seconds' % s) self.assertEquals(33.37, s) s = mythtv.frames2seconds(0, 29.97) log.debug('0 frames @ 29.97fps = %s seconds' % s) self.assertEquals(0.0, s) s = mythtv.frames2seconds(99999999L, 29.97) log.debug('99999999L frames @ 29.97fps = %s seconds' % s) self.assertEquals(3336669.97, s)
def getBookmark(self): """Returns the bookmark in seconds as float value or 0.0 if a bookmark does not exist""" seconds = mythtv.frames2seconds(self._conn.getBookmark(self), self.getFrameRate()) if seconds: return seconds else: return 0.0;