- custom sounds
This commit is contained in:
Frank 2024-06-08 22:34:09 +02:00
parent a6568a955f
commit 08745c910c
3 changed files with 12 additions and 19 deletions

View File

@ -7,7 +7,7 @@
-- Implementation is based on the [Simple Range Script](https://forums.eagle.ru/showthread.php?t=157991) by Ciribob, which itself was motivated -- Implementation is based on the [Simple Range Script](https://forums.eagle.ru/showthread.php?t=157991) by Ciribob, which itself was motivated
-- by a script by SNAFU [see here](https://forums.eagle.ru/showthread.php?t=109174). -- by a script by SNAFU [see here](https://forums.eagle.ru/showthread.php?t=109174).
-- --
-- [476th - Air Weapons Range Objects mod](http://www.476vfightergroup.com/downloads.php?do=file&id=287) is highly recommended for this class. -- [476th - Air Weapons Range Objects mod](https://www.476vfightergroup.com/downloads.php?do=download&downloadid=482) is highly recommended for this class.
-- --
-- **Main Features:** -- **Main Features:**
-- --

View File

@ -897,6 +897,7 @@ ATIS.version = "1.0.0"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO: Correct fog for elevation. -- TODO: Correct fog for elevation.
-- TODO: Generalize sound files input to be able to use custom made sounds.
-- DONE: Option to add multiple frequencies for SRS -- DONE: Option to add multiple frequencies for SRS
-- DONE: Zulu time --> Zulu in output. -- DONE: Zulu time --> Zulu in output.
-- DONE: Fix for AB not having a runway - Helopost like Naqoura -- DONE: Fix for AB not having a runway - Helopost like Naqoura
@ -1089,8 +1090,9 @@ function ATIS:SetSoundfilesPath( path )
end end
--- Set the path to the csv file that contains information about the used sound files. --- Set the path to the csv file that contains information about the used sound files.
-- The parameter file has to be located on your local disk (**not** inside the miz file).
-- @param #ATIS self -- @param #ATIS self
-- @param #string csvfile Full path to the csv file on your local disk (not in the miz file). -- @param #string csvfile Full path to the csv file on your local disk.
-- @return #ATIS self -- @return #ATIS self
function ATIS:SetSoundfilesInfoFile( csvfile ) function ATIS:SetSoundfilesInfoFile( csvfile )
@ -1100,31 +1102,25 @@ function ATIS:SetSoundfilesInfoFile( csvfile )
local soundfile=_soundfile --#ATIS.Soundfile local soundfile=_soundfile --#ATIS.Soundfile
if filename==soundfile.filename then if filename==soundfile.filename then
return soundfile return soundfile
end end
end end
return nil return nil
end end
-- Read csv file
local data=UTILS.ReadCSV(csvfile) local data=UTILS.ReadCSV(csvfile)
if data then if data then
for i,sound in pairs(data) do
env.info("FF sound info")
local soundfiles={}
for i,soundinfo in pairs(data) do
local sound=soundinfo --#Soundinfo
-- Get the ATIS.Soundfile
local soundfile=getSound(sound.filename..".ogg") --#ATIS.Soundfile local soundfile=getSound(sound.filename..".ogg") --#ATIS.Soundfile
if soundfile then if soundfile then
-- Set duration -- Set duration
soundfile.duration=tonumber(soundinfo.duration) soundfile.duration=tonumber(sound.duration)
self:I(soundfile)
else else
self:E(string.format("ERROR: Could not get info for sound file %s", sound.filename)) self:E(string.format("ERROR: Could not get info for sound file %s", sound.filename))
@ -1132,7 +1128,7 @@ function ATIS:SetSoundfilesInfoFile( csvfile )
end end
else else
self:E("ERROR: Could not read sound csv file!") self:E(string.format("ERROR: Could not read sound csv file!"))
end end
@ -2619,13 +2615,10 @@ function ATIS:onafterBroadcast( From, Event, To )
local subtitle = "" local subtitle = ""
if runwayLanding then if runwayLanding then
local actrun = self.gettext:GetEntry("ACTIVELANDING",self.locale) local actrun = self.gettext:GetEntry("ACTIVELANDING",self.locale)
--subtitle=string.format("Active runway landing %s", runwayLanding)
subtitle=string.format("%s %s", actrun, runwayLanding) subtitle=string.format("%s %s", actrun, runwayLanding)
if rwyLandingLeft==true then if rwyLandingLeft==true then
--subtitle=subtitle.." Left"
subtitle=subtitle.." "..self.gettext:GetEntry("LEFT",self.locale) subtitle=subtitle.." "..self.gettext:GetEntry("LEFT",self.locale)
elseif rwyLandingLeft==false then elseif rwyLandingLeft==false then
--subtitle=subtitle.." Right"
subtitle=subtitle.." "..self.gettext:GetEntry("RIGHT",self.locale) subtitle=subtitle.." "..self.gettext:GetEntry("RIGHT",self.locale)
end end
alltext = alltext .. ";\n" .. subtitle alltext = alltext .. ";\n" .. subtitle
@ -2698,6 +2691,7 @@ function ATIS:onafterBroadcast( From, Event, To )
alltext = alltext .. ";\n" .. subtitle alltext = alltext .. ";\n" .. subtitle
end end
end end
-- Airfield elevation -- Airfield elevation
if self.elevation then if self.elevation then

View File

@ -485,7 +485,6 @@ end
--- Check radio queue for transmissions to be broadcasted. --- Check radio queue for transmissions to be broadcasted.
-- @param #RADIOQUEUE self -- @param #RADIOQUEUE self
function RADIOQUEUE:_CheckRadioQueue() function RADIOQUEUE:_CheckRadioQueue()
env.info("FF check radio queue "..self.alias)
-- Check if queue is empty. -- Check if queue is empty.
if #self.queue==0 then if #self.queue==0 then