aboutsummaryrefslogtreecommitdiffstats
path: root/core/device.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-04-26 07:56:00 -0700
committerChris Robinson <[email protected]>2021-04-26 08:04:50 -0700
commit22a8ebff8094785ec53aadef8489dc60f6939d55 (patch)
treed5297c7fa444e1ac3e2980a2d49cae50f041ddc3 /core/device.h
parent2479483645bf719233fa5d39bc91682f12d71350 (diff)
Move GetChannelIdxByName and clean up some more includes
Diffstat (limited to 'core/device.h')
-rw-r--r--core/device.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/device.h b/core/device.h
index bc6bae52..4cc822cc 100644
--- a/core/device.h
+++ b/core/device.h
@@ -271,4 +271,20 @@ struct DeviceBase {
DISABLE_ALLOC()
};
+
+/* Must be less than 15 characters (16 including terminating null) for
+ * compatibility with pthread_setname_np limitations. */
+#define MIXER_THREAD_NAME "alsoft-mixer"
+
+#define RECORD_THREAD_NAME "alsoft-record"
+
+
+/**
+ * Returns the index for the given channel name (e.g. FrontCenter), or
+ * INVALID_CHANNEL_INDEX if it doesn't exist.
+ */
+inline uint GetChannelIdxByName(const RealMixParams &real, Channel chan) noexcept
+{ return real.ChannelIndex[chan]; }
+#define INVALID_CHANNEL_INDEX ~0u
+
#endif /* CORE_DEVICE_H */