Merge pull request #356 from tigran123/master

Various cleanups.
This commit is contained in:
{Qingping,Dave} Hou
2012-10-03 02:42:09 -07:00
2 changed files with 11 additions and 2 deletions

View File

@@ -215,6 +215,9 @@ function InfoMessage:incrTTSspeed(direction) -- either +1 or -1
end
function InfoMessage:getTTSspeed()
if util.isEmulated() == 1 then
return 0
end
local tmp = io.popen('lipc-get-prop com.lab126.tts TtsISpeed', "r")
local speed = tmp:read("*number")
tmp:close()
@@ -234,6 +237,9 @@ function InfoMessage:incrSoundVolume(direction) -- either +1 or -1
end
function InfoMessage:getSoundVolume()
if util.isEmulated() == 1 then
return 0
end
local tmp = io.popen('lipc-get-prop com.lab126.audio Volume', "r")
local volume = tmp:read("*number")
tmp:close()

View File

@@ -1512,7 +1512,8 @@ end
-- change current page and cache next page after rendering
function UniReader:goto(no, is_ignore_jump)
if no < 1 or no > self.doc:getPages() then
local numpages = self.doc:getPages()
if no < 1 or no > numpages then
return
end
@@ -1529,9 +1530,11 @@ function UniReader:goto(no, is_ignore_jump)
-- TODO: move the following to a more appropriate place
-- into the caching section
if no < self.doc:getPages() then
if no < numpages then
if #self.bbox == 0 or not self.bbox.enabled then
-- pre-cache next page, but if we will modify bbox don't!
-- Tigran: I think we should _always_ precache the page
-- because of the benefits of pre-decoding it (for DjVu).
self:drawOrCache(no+1, true)
end
end