Browse Source

lovr.audio.getSpatializer;

bjorn 4 years ago
parent
commit
c3d9b66320
3 changed files with 39 additions and 33 deletions
  1. 23 20
      api/init.lua
  2. 16 0
      api/lovr/audio/getSpatializer.lua
  3. 0 13
      api/lovr/audio/isSpatialized.lua

+ 23 - 20
api/init.lua

@@ -1012,6 +1012,29 @@ return {
             }
           }
         },
+        {
+          name = "getSpatializer",
+          tag = "listener",
+          summary = "Get the name of the active spatializer",
+          description = "Returns the name of the active spatializer (`simple`, `oculus`, or `phonon`).",
+          key = "lovr.audio.getSpatializer",
+          module = "lovr.audio",
+          related = {
+            "lovr.conf"
+          },
+          variants = {
+            {
+              arguments = {},
+              returns = {
+                {
+                  name = "spatializer",
+                  type = "string",
+                  description = "The name of the active spatializer."
+                }
+              }
+            }
+          }
+        },
         {
           name = "getVelocity",
           tag = "listener",
@@ -1064,26 +1087,6 @@ return {
             }
           }
         },
-        {
-          name = "isSpatialized",
-          tag = "listener",
-          summary = "Check if audio is spatialized.",
-          description = "Returns whether or not audio is currently spatialized with HRTFs.",
-          key = "lovr.audio.isSpatialized",
-          module = "lovr.audio",
-          variants = {
-            {
-              arguments = {},
-              returns = {
-                {
-                  name = "spatialized",
-                  type = "boolean",
-                  description = "Whether or not audio is spatialized."
-                }
-              }
-            }
-          }
-        },
         {
           name = "newSource",
           tag = "sources",

+ 16 - 0
api/lovr/audio/getSpatializer.lua

@@ -0,0 +1,16 @@
+return {
+  tag = 'listener',
+  summary = 'Get the name of the active spatializer',
+  description = 'Returns the name of the active spatializer (`simple`, `oculus`, or `phonon`).',
+  arguments = {},
+  returns = {
+    {
+      name = 'spatializer',
+      type = 'string',
+      description = 'The name of the active spatializer.'
+    }
+  },
+  related = {
+    'lovr.conf'
+  }
+}

+ 0 - 13
api/lovr/audio/isSpatialized.lua

@@ -1,13 +0,0 @@
-return {
-  tag = 'listener',
-  summary = 'Check if audio is spatialized.',
-  description = 'Returns whether or not audio is currently spatialized with HRTFs.',
-  arguments = {},
-  returns = {
-    {
-      name = 'spatialized',
-      type = 'boolean',
-      description = 'Whether or not audio is spatialized.'
-    }
-  }
-}