
thrust_sound = {
    table = {
        left = ad.getSoundentry("leftloop"),
        right = ad.getSoundentry("rightloop"),
        rev = ad.getSoundentry("revloop"),
        down = ad.getSoundentry("downloop"),
        up = ad.getSoundentry("uploop")
    },
sounds = {}
}

function thrust_sound:start(name)
    if(not mn.isInMission()) then
        return
    end

    local table_entry = self.table[name]
    local sound = self.sounds[name]
    if(table_entry and table_entry:isValid()) then
        --only if this sound has a valid entry
        if(sound == nil) then
            self.sounds[name] =  ad.playLoopingSound(table_entry)
        end
    end
end

function thrust_sound:stop(name)
    local sound = self.sounds[name]
    if(sound and sound:isValid() and sound:isPlaying()) then
        sound:stop()
        self.sounds[name]=nil;
    end
end
