mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
xx
This commit is contained in:
parent
b90853f431
commit
1a1c3a6c9f
@ -516,8 +516,20 @@ end
|
||||
-- @return #MSRS self
|
||||
function MSRS:SetBackend(Backend)
|
||||
self:F( {Backend=Backend} )
|
||||
self.backend=Backend or MSRS.Backend.SRSEXE
|
||||
|
||||
Backend = Backend or MSRS.Backend.SRSEXE -- avoid nil
|
||||
local function Checker(back)
|
||||
local ok = false
|
||||
for _,_backend in pairs(MSRS.Backend) do
|
||||
if tostring(back) == _backend then ok = true end
|
||||
end
|
||||
return ok
|
||||
end
|
||||
|
||||
if Checker(Backend) then
|
||||
self.backend=Backend
|
||||
else
|
||||
MESSAGE:New("ERROR: Backend "..tostring(Backend).." is not supported!",30,"MSRS",true):ToLog():ToAll()
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
@ -1184,8 +1196,8 @@ end
|
||||
-- @param Core.Point#COORDINATE Coordinate Coordinate.
|
||||
-- @return #MSRS self
|
||||
function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate)
|
||||
self:F( {Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate} )
|
||||
|
||||
self:T(( {Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate} )
|
||||
self:T((self.lid.."Backend "..self.backend)
|
||||
if Delay and Delay>0 then
|
||||
self:ScheduleOnce(Delay, MSRS.PlayTextExt, self, Text, 0, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate)
|
||||
else
|
||||
@ -1205,6 +1217,7 @@ function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture
|
||||
self:_ExecCommand(command)
|
||||
|
||||
elseif self.backend==MSRS.Backend.GRPC then
|
||||
BASE:I("MSRS.Backend.GRPC")
|
||||
|
||||
self:_DCSgRPCtts(Text, Frequencies, Gender, Culture, Voice, Volume, Label, Coordinate)
|
||||
|
||||
@ -1831,7 +1844,7 @@ end
|
||||
-- @param #MSRSQUEUE self
|
||||
-- @return #MSRSQUEUE self The MSRSQUEUE object.
|
||||
function MSRSQUEUE:Clear()
|
||||
self:I(self.lid.."Clearing MSRSQUEUE")
|
||||
self:T((self.lid.."Clearing MSRSQUEUE")
|
||||
self.queue={}
|
||||
return self
|
||||
end
|
||||
@ -1842,7 +1855,6 @@ end
|
||||
-- @param #MSRSQUEUE.Transmission transmission The transmission data table.
|
||||
-- @return #MSRSQUEUE self
|
||||
function MSRSQUEUE:AddTransmission(transmission)
|
||||
|
||||
-- Init.
|
||||
transmission.isplaying=false
|
||||
transmission.Tstarted=nil
|
||||
@ -1921,20 +1933,20 @@ function MSRSQUEUE:NewTransmission(text, duration, msrs, tstart, interval, subgr
|
||||
transmission.Tplay=tstart or timer.getAbsTime()
|
||||
transmission.subtitle=subtitle
|
||||
transmission.interval=interval or 0
|
||||
transmission.frequency=frequency
|
||||
transmission.modulation=modulation
|
||||
transmission.frequency=frequency or msrs.frequencies
|
||||
transmission.modulation=modulation or msrs.modulations
|
||||
transmission.subgroups=subgroups
|
||||
if transmission.subtitle then
|
||||
transmission.subduration=subduration or transmission.duration
|
||||
else
|
||||
transmission.subduration=0 --nil
|
||||
end
|
||||
transmission.gender = gender
|
||||
transmission.culture = culture
|
||||
transmission.voice = voice
|
||||
transmission.volume = volume
|
||||
transmission.label = label
|
||||
transmission.coordinate = coordinate
|
||||
transmission.gender = gender or msrs.gender
|
||||
transmission.culture = culture or msrs.culture
|
||||
transmission.voice = voice or msrs.voice
|
||||
transmission.volume = volume or msrs.volume
|
||||
transmission.label = label or msrs.Label
|
||||
transmission.coordinate = coordinate or msrs.coordinate
|
||||
|
||||
-- Add transmission to queue.
|
||||
self:AddTransmission(transmission)
|
||||
@ -1946,7 +1958,8 @@ end
|
||||
-- @param #MSRSQUEUE self
|
||||
-- @param #MSRSQUEUE.Transmission transmission The transmission.
|
||||
function MSRSQUEUE:Broadcast(transmission)
|
||||
|
||||
self:T((self.lid.."Broadcast")
|
||||
|
||||
if transmission.frequency then
|
||||
transmission.msrs:PlayTextExt(transmission.text, nil, transmission.frequency, transmission.modulation, transmission.gender, transmission.culture, transmission.voice, transmission.volume, transmission.label, transmission.coordinate)
|
||||
else
|
||||
@ -2115,7 +2128,7 @@ function MSRSQUEUE:_CheckRadioQueue(delay)
|
||||
-- Found a new transmission.
|
||||
if next~=nil and not playing then
|
||||
-- Debug info.
|
||||
self:T(self.lid..string.format("Broadcasting text=\"%s\" at T=%.3f", next.text, time))
|
||||
self:T((self.lid..string.format("Broadcasting text=\"%s\" at T=%.3f", next.text, time))
|
||||
|
||||
-- Call SRS.
|
||||
self:Broadcast(next)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user