Added handling of normal tapes
This commit is contained in:
parent
c75075ae9c
commit
621a303553
|
@ -98,6 +98,9 @@ if not drive then
|
||||||
isReady = function()
|
isReady = function()
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
|
getLabel = function()
|
||||||
|
return "Dummy drive tape"
|
||||||
|
end,
|
||||||
_tick = function()
|
_tick = function()
|
||||||
if drive._state == "PLAYING" then
|
if drive._state == "PLAYING" then
|
||||||
drive.read(600)
|
drive.read(600)
|
||||||
|
@ -504,6 +507,21 @@ function()
|
||||||
local offset = read32()
|
local offset = read32()
|
||||||
local length = read32()
|
local length = read32()
|
||||||
local title = drive.read(117)
|
local title = drive.read(117)
|
||||||
|
if offset > drive.getSize() or length > drive.getSize() then
|
||||||
|
mplayer.songs = {
|
||||||
|
{
|
||||||
|
title = tape.getLabel(),
|
||||||
|
offset = 0,
|
||||||
|
length = tape.getSize() - 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = "[ !!! ] It's just a regular tape",
|
||||||
|
offset = tape.getSize() - 10,
|
||||||
|
length = 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
end
|
||||||
title = title:sub(1, title:find("\x00"))
|
title = title:sub(1, title:find("\x00"))
|
||||||
if length > 0 and offset > 0 then
|
if length > 0 and offset > 0 then
|
||||||
mplayer.songs[i] = {
|
mplayer.songs[i] = {
|
||||||
|
|
Loading…
Reference in New Issue