- kompletní informace (je právě 12 hodin 30 minut, v cíli budete v 16 hodin 55 minut, do cíle zbývá 4 hodiny 25 minut, do cíle zbývá 350 kilometrů.)
- čas dojezdu a vzdálenost (v cíli budete v 16 hodin 55 minut, do cíle zbývá 350 kilometrů.)
- čas dojezdu (v cíli budete v 16 hodin 55 minut.)
- vzdálenost (do cíle zbývá 350 kilometrů.)
- čas do cíle (do cíle zbývá 4 hodiny 25 minut.)
- aktuální ulice
- kde se nacházím
kompletní obsah tts_by_wiman.lua
- Kód: Vybrat vše
MODEL.SETPERSISTENT.lua.distancetts = INT_MODEL(0)
MODEL.SETPERSISTENT.lua.witts = INT_MODEL(1)
MODEL.SETPERSISTENT.lua.changeINfo = INT_MODEL(0)
MODEL.SETPERSISTENT.lua.dismantts = INT_MODEL(0)
MODEL.SETPERSISTENT.lua.cityON = INT_MODEL(0)
sc_start_customize = function()
sc_wi_timer()
end
sc_wiman_tts_OnRelease = function()
sc_NextStateAnim(st_tts_wi_Settings, "horz_scroll", 1, "")
end
createState("st_tts_wi_Settings")
st_tts_wi_Settings:useLayers(backgroundLayers, ui_tts_wi_Settings)
st_tts_wi_Settings.init = function()
txtTitle:SET(m_i18n("TTS"))
end
sc_Changepar_pio = function(pio)
return (tostring(pio).."min")
end
sc_wsayspeech = function(text,prio,boostedprio)
if MODEL.regional.current_voice.is_tts() and not (wDASpeakingID or wSpeedCameraSpeakingID or MODEL.sound.os_muted() or MODEL.sound.voice_muted() or MODEL.sound.speech.is_say_bool() and MODEL.sound.speech.saying_source() == "voice.guidance") then
if wRealSpeakingID then
PromptCancel(wRealSpeakingID)
wRealSpeakingID = 0
end
wRealSpeakingID = MODEL.sound.speech.say("voice.ui", text, {priority = prio, boosted_priority = boostedprio, callback = function(res) if res > 1 then wRealSpeakingID = 0 end end})
end
end
sc_wGetTextWhereIAm = function()
local currentAddress, currentStreet = L"", L""
if not MODEL.navigation.car.is_incity() then
currentAddress = sc_TransformStreetName(MODEL.navigation.car.current_street())
elseif MODEL.navigation.car.address.city() then
if MODEL.navigation.car.address.street() ~= L"" then
currentStreet = sc_TransformStreetName(MODEL.navigation.car.address.street())
else
currentStreet = sc_TransformStreetName(MODEL.navigation.car.current_street())
end
currentAddress = sc_wGetTextWhereIAmCountry() .. L" " .. sc_TransformStreetName(MODEL.navigation.car.address.city()) .. L" " .. currentStreet
else
currentAddress = sc_wGetTextWhereIAmCountry()
end
if string.find(MODEL.regional.current_voice.key(), "_loq_", 1, true) == nil then
currentAddress = gTTS_AddressMode .. L" " .. currentAddress .. L" " .. gTTS_NormalMode
end
return currentAddress
end
sc_wGetTextWhereIAmCountry = function()
local country = MODEL.navigation.car.last_known_countrycode()
return (country == "" or not MODEL.regional.is_it_voice_localizable(country)) and MODEL.navigation.car.address.loccountrylong() or translate_voice(country)
end
sc_wReadOutDestinationInfoSupported = function()
return MODEL.regional.is_it_voice_localizable(m_i18n_voice("Arrival to destination at %s.")) and MODEL.regional.is_it_voice_localizable(m_i18n_voice("Distance %s.")) and MODEL.regional.current_voice.is_tts()
end
sc_wi_wReadOutDestinationInfo = function()
if sc_wReadOutDestinationInfoSupported() then
local distphrasepart = MODEL.lua.wCorrectionDistanceUnit() and sc_wCorrectionDistanceUnitSupported() and 2 or 0
local distphraseunit = MODEL.lua.wCorrectionDistanceUnit() and sc_wCorrectionDistanceUnitSupported() and sc_wtranslateunit(MODEL.other.format_distance(MODEL.navigation.distance_to_destination(), MODEL.regional.units(), MODEL.regional.distance_display_mode(), 1), wdistance_units) or L""
if MODEL.lua.changeINfo() == 0 then
sc_wsayspeech(translated_voice_format(m_i18n_voice("Current time %s."), MODEL.other.format_time_dayperiod(MODEL.gps.current_time(), MODEL.regional.timeformat(), 0)) .. translated_voice_format(m_i18n_voice("Arrival to destination at %s."), MODEL.other.format_time_dayperiod(MODEL.navigation.eta_at_destination(), MODEL.regional.timeformat(), 0)) .. translated_voice_format(m_i18n_voice("Time to destination %s."), MODEL.other.format_timespan(MODEL.navigation.time_to_destination(), 5, MODEL.regional.timeformat(), 0)) .. translated_voice_format(m_i18n_voice("Distance %s."), MODEL.other.format_distance(MODEL.navigation.distance_to_destination(), MODEL.regional.units(), MODEL.regional.distance_display_mode(), distphrasepart) .. distphraseunit),21,25)
elseif MODEL.lua.changeINfo() == 1 then
sc_wsayspeech(translated_voice_format(m_i18n_voice("Arrival to destination at %s."), MODEL.other.format_time_dayperiod(MODEL.navigation.eta_at_destination(), MODEL.regional.timeformat(), 0)) .. translated_voice_format(m_i18n_voice("Distance %s."), MODEL.other.format_distance(MODEL.navigation.distance_to_destination(), MODEL.regional.units(), MODEL.regional.distance_display_mode(), distphrasepart) .. distphraseunit),21,25)
elseif MODEL.lua.changeINfo() == 2 then
sc_wsayspeech(translated_voice_format(m_i18n_voice("Arrival to destination at %s."), MODEL.other.format_time_dayperiod(MODEL.navigation.eta_at_destination(), MODEL.regional.timeformat(), 0)))
elseif MODEL.lua.changeINfo() == 3 then
sc_wsayspeech(translated_voice_format(m_i18n_voice("Distance to destination %s."), MODEL.other.format_distance(MODEL.navigation.distance_to_destination(), MODEL.regional.units(), MODEL.regional.distance_display_mode(), distphrasepart) .. distphraseunit),21,25)
elseif MODEL.lua.changeINfo() == 4 then
sc_wsayspeech(translated_voice_format(m_i18n_voice("Time to destination %s."), MODEL.other.format_timespan(MODEL.navigation.time_to_destination(), 5, MODEL.regional.timeformat(), 0)))
end
end
end
sc_wi_timer = function()
doDelayed(50, "sc_wi_timer()")
if MODEL.navigation.car.current_speed()> 0 and vActiveState() == "st_easynav" then
sc_distts()
sc_city_ready()
end
end
sc_wi_city_read = function()
return sc_wsayspeech(translated_voice_format(m_i18n_voice("You are passing near by")) .. sc_TransformStreetName(MODEL.navigation.car.address.city()),21,25)
end
local wicheck = MODEL.navigation.car.address.city()
sc_city_ready = function()
local wifind = tostring(MODEL.navigation.car.address.city())
if MODEL.lua.cityON() ==1 then
adres = MODEL.navigation.car.address.city() ~= L""
elseif MODEL.lua.cityON() == 2 then
adres = MODEL.navigation.car.address.street() ~= L"" and MODEL.navigation.car.is_incity()
end
if adres then
if MODEL.lua.cityON() >= 1 and MODEL.navigation.car.address.city() ~= wicheck and string.find(wifind,"gmina") == nil then
sc_wi_city_read()
wicheck = MODEL.navigation.car.address.city()
end
end
end
wicounter = MODEL.lua.witts()*60
sc_distts = function(reset)
local wi = MODEL.lua.witts()*60
local wir = 6
if MODEL.lua.distancetts() == 1 and MODEL.navigation.distance_to_maneuver() >= MODEL.lua.dismantts() and MODEL.navigation.distance_to_destination() < MODEL.navigation.distance_total() then
wicounter = wicounter - 1
end
if wicounter == 0 or reset == 1 then
if not MODEL.sound.speech.is_say_bool() then
wicounter = wi
sc_MyRouteCockpit_wi_Onlongclick()
else
wicounter = wir
end
end
end
sc_MyRouteCockpit_wi_Onlongclick = function()
sc_wi_wReadOutDestinationInfo()
sc_otherttsinfo()
end
sc_otherttsinfo = function()
local currentStreet = sc_TransformStreetName(MODEL.navigation.car.current_street())
local currentAddress = sc_TransformStreetName(MODEL.navigation.car.address.city())
if MODEL.lua.changeINfo() == 5 then
sc_wsayspeech(sc_wGetTextWhereIAm(),21,25) -- kraj,miejscowość,ulica
elseif MODEL.lua.changeINfo() == 6 then
sc_wsayspeech(currentStreet,21,25) -- miejscowość,ulica,numer
end
end
kompletní obsah tts_by_wiman.ui
- Kód: Vybrat vše
<modify soundSettingList>
<insert>
<row text="TTS by Wiman" type="_btn" onrelease=sc_wiman_tts_OnRelease>
</insert>
</modify>
<userlist ttswiSettingsList text="str" icon="str" onrelease="ui" type="str" model="str" enabled="bool" value="str" visible="bool">
<view visibility_filter=visible />
<default onrelease=undef value="" model="" visible=1 enabled=1 type="_chk"/>
<view visibility_filter=visible/>
<row text="Read Out Destination Info" icon="ico_SoundandWarnings_sml.bmp#3" value="Disabled|0|Enabled|1" model="lua.distancetts" type="_sldicon">
<row text="Read Out Info" value="Current street|6|Where Am I|5|Time to destination|4|Distance|3|Arrival time|2|Arrival time and distance|1|Complete information|0" model="lua.changeINfo" type="_sld">
<row type="_piotts">
<row text="Stop countdown before maneuver" icon="ico_Exit_mid.bmp" value="800m|800|600m|600|400m|400|300m|300|200m|200|100m|100|50m|50|Disabled|0" model="lua.dismantts" type="_sldicon">
<row text="Read the town name" icon="ico_Exit_mid.bmp" value="main|2|all|1|Disabled|0" model="lua.cityON" type="_sldicon">
</userlist>
<element_template et_Wi_sldicon>
<SLIDER class="listitem icon" left=0 top=0 align="RIGHT" value=%*.value valuemodel=%*.model enable=%*.enabled onrelease=%*.onrelease>
<SPRITE class=icon_list z=20 bmp=%*.icon>
<TEXT class="name icon" text=%*.text right=30%>
</SLIDER>
</element_template>
<element_template et_Wi_sld>
<SLIDER class=listitem left=0 top=0 align="RIGHT" value=%*.value valuemodel=%*.model enable=%*.enabled onrelease=%*.onrelease>
<TEXT class=name text=%*.text>
</SLIDER>
</element_template>
<element_template et_Wi_piotts>
<SPRITE class=listitem enable=%*.enabled>
<TEXT class="name font_main textpadding_small" left=2% right=72% text="Repeat every" wordwrap=3>
<TEXT class="r2l font_main bd color_btn_sec" left=27% right=58% top=0 h=100% z=16 padding=0 align="CENTER" valign="CENTER" text=(sc_Changepar_pio(%lua.witts))>
<HSMARTSCROLL class=scroll left=40% top=20% min=1 max=60 step=1 dragable=1 valuemodel="lua.witts" onrelease='sc_distts(1)'>
</SPRITE>
</element_template>
<layer ui_tts_wi_Settings z=160>
<DIV class=list>
<SPRITE class=list_panel>
<LIST2 class=list_control SMOOTHSCROLLING TEMPLATE_TYPE_MODEL="*.type">
<LISTMODEL listmodel="ui.ttswiSettingsList" element_template="et_Wi"/>
<VSMARTSCROLL>
<WHEEL>
<BUTTON class="btn_scrollup list">
<BUTTON class="btn_scrolldown list">
</LIST2>
</DIV>
</layer>
Takto by měly pro tuto upravenou ux utilitu vypadat všechny zápisy do dictionary.lang
- Kód: Vybrat vše
Read Out Destination Info="Číst informaci o cíli"
Read Out Info="Číst informaci"
Arrival time="Čas dojezdu"
Arrival time and distance="Čas dojezdu a vzdálenost"
Stop countdown before maneuver="Nehlásit, jeli manévr blíž než:"
Repeat every="Opakovat po:"
Read the town name="Číst názvy obcí a jejich okolí:"
all="obce i okolí"
main="jen obce"
Time to destination="Čas do cíle"
Complete information="Kompletní informace"
- Kód: Vybrat vše
Distance to destination %s.="do cíle zbývá %s."
You are passing near by="obec"
Current time %s.="je právě %s."
Time to destination %s.="do cíle zbývá %s."