Browse Source

Fix newSource table;

bjorn 4 years ago
parent
commit
3a668bc208
2 changed files with 57 additions and 4 deletions
  1. 54 1
      api/init.lua
  2. 3 3
      api/lovr/audio/newSource.lua

+ 54 - 1
api/init.lua

@@ -1262,6 +1262,23 @@ return {
                   name = "filename",
                   name = "filename",
                   type = "string",
                   type = "string",
                   description = "The filename of the sound to load."
                   description = "The filename of the sound to load."
+                },
+                {
+                  name = "options",
+                  type = "table",
+                  description = "Optional options.",
+                  table = {
+                    {
+                      name = "decode",
+                      type = "boolean",
+                      description = "Whether to immediately decode compressed sounds."
+                    },
+                    {
+                      name = "effects",
+                      type = "table",
+                      description = "A table of `Effect`s to enable.  Keys can be integers (list) or effect names (map), or a combination of both.  The special value `false` can be used to completely disable effects, bypassing the spatializer entirely."
+                    }
+                  }
                 }
                 }
               },
               },
               returns = {
               returns = {
@@ -1278,6 +1295,23 @@ return {
                   name = "blob",
                   name = "blob",
                   type = "Blob",
                   type = "Blob",
                   description = "The Blob containing the Source data."
                   description = "The Blob containing the Source data."
+                },
+                {
+                  name = "options",
+                  type = "table",
+                  description = "Optional options.",
+                  table = {
+                    {
+                      name = "decode",
+                      type = "boolean",
+                      description = "Whether to immediately decode compressed sounds."
+                    },
+                    {
+                      name = "effects",
+                      type = "table",
+                      description = "A table of `Effect`s to enable.  Keys can be integers (list) or effect names (map), or a combination of both.  The special value `false` can be used to completely disable effects, bypassing the spatializer entirely."
+                    }
+                  }
                 }
                 }
               },
               },
               returns = {
               returns = {
@@ -1289,7 +1323,26 @@ return {
               }
               }
             },
             },
             {
             {
-              arguments = {},
+              arguments = {
+                nil,
+                {
+                  name = "options",
+                  type = "table",
+                  description = "Optional options.",
+                  table = {
+                    {
+                      name = "decode",
+                      type = "boolean",
+                      description = "Whether to immediately decode compressed sounds."
+                    },
+                    {
+                      name = "effects",
+                      type = "table",
+                      description = "            A table of `Effect`s to enable.  Keys can be integers (list) or effect names (map), or a\n            combination of both.  The special value `false` can be used to completely disable\n            effects, bypassing the spatializer entirely.\n          "
+                    }
+                  }
+                }
+              },
               returns = {
               returns = {
                 {
                 {
                   name = "source",
                   name = "source",

+ 3 - 3
api/lovr/audio/newSource.lua

@@ -44,15 +44,15 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'filename' },
+      arguments = { 'filename', 'options' },
       returns = { 'source' }
       returns = { 'source' }
     },
     },
     {
     {
-      arguments = { 'blob' },
+      arguments = { 'blob', 'options' },
       returns = { 'source' }
       returns = { 'source' }
     },
     },
     {
     {
-      arguments = { 'sound' },
+      arguments = { 'sound', 'options' },
       returns = { 'source' }
       returns = { 'source' }
     }
     }
   },
   },