From 8175c317334eabd7a6842db36157e1a0888de929 Mon Sep 17 00:00:00 2001 From: hkc Date: Tue, 17 Oct 2023 15:45:22 +0300 Subject: [PATCH] maybe just print less for now............ --- tape-playlist.lua | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/tape-playlist.lua b/tape-playlist.lua index 067d5f6..13f762d 100644 --- a/tape-playlist.lua +++ b/tape-playlist.lua @@ -18,14 +18,6 @@ local function read32() return v end -local function readstr(len) - local out = "" - for i = 1, len do - out = out .. drive.read() - end - return out -end - local function bytes2time(b) local s = math.floor(b / 6000) if s < 60 then return string.format("%ds", s) end @@ -36,10 +28,6 @@ end parallel.waitForAll( function() while running do - for i, track in ipairs(table_of_contents) do - term.setCursorPos(1, i) - term.write(string.format("%s", track.title)) - end os.sleep(0.1) end end, @@ -53,13 +41,14 @@ function() elseif ev == "tape_present" then table_of_contents = {} if evd[1] then + drive.stop() drive.seek(-drive.getSize()) for i = 1, 48 do local offset = read32() local length = read32() - local title = readstr(117) + print(string.format("%d: %d + %d", i, offset, length)) table.insert(table_of_contents, { - title = title, + title = "", -- TODO offset = offset, length = length, ending = offset + length