Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CMakeLists.txt5
-rw-r--r--plugins/HostLinux.cpp2
-rw-r--r--plugins/HostWindows.cpp2
-rw-r--r--plugins/MumbleAPI_v_1_0_x.h492
-rw-r--r--plugins/MumblePlugin_v_1_0_x.h402
-rw-r--r--plugins/PluginComponents_v_1_0_x.h411
-rw-r--r--plugins/Process.cpp2
-rw-r--r--plugins/ProcessWindows.cpp2
-rw-r--r--plugins/amongus/Game.cpp2
-rw-r--r--plugins/amongus/amongus.cpp6
-rw-r--r--plugins/aoc/aoc.cpp5
-rw-r--r--plugins/arma2/arma2.cpp5
-rw-r--r--plugins/bf1/bf1.cpp7
-rw-r--r--plugins/bf1942/bf1942.cpp5
-rw-r--r--plugins/bf2/bf2.cpp5
-rw-r--r--plugins/bf2142/bf2142.cpp7
-rw-r--r--plugins/bf3/bf3.cpp5
-rw-r--r--plugins/bf4/bf4.cpp7
-rw-r--r--plugins/bf4_x86/bf4_x86.cpp7
-rw-r--r--plugins/bfbc2/bfbc2.cpp5
-rw-r--r--plugins/bfheroes/bfheroes.cpp5
-rw-r--r--plugins/blacklight/blacklight.cpp5
-rw-r--r--plugins/borderlands/borderlands.cpp5
-rw-r--r--plugins/borderlands2/borderlands2.cpp5
-rw-r--r--plugins/breach/breach.cpp5
-rw-r--r--plugins/cod2/cod2.cpp6
-rw-r--r--plugins/cod4/cod4.cpp5
-rw-r--r--plugins/cod5/cod5.cpp5
-rw-r--r--plugins/codmw2/codmw2.cpp5
-rw-r--r--plugins/codmw2so/codmw2so.cpp5
-rw-r--r--plugins/cs/cs.cpp5
-rw-r--r--plugins/dys/dys.cpp5
-rw-r--r--plugins/etqw/etqw.cpp5
-rw-r--r--plugins/ffxiv/ffxiv.cpp7
-rw-r--r--plugins/gmod/gmod.cpp5
-rw-r--r--plugins/gtaiv/gtaiv.cpp5
-rw-r--r--plugins/gtasa/gtasa.cpp5
-rw-r--r--plugins/gtav/gtav.cpp7
-rw-r--r--plugins/gw/gw.cpp5
-rw-r--r--plugins/insurgency/insurgency.cpp5
-rw-r--r--plugins/jc2/jc2.cpp5
-rw-r--r--plugins/link/link-posix.cpp3
-rw-r--r--plugins/link/link.cpp3
-rw-r--r--plugins/lol/lol.cpp5
-rw-r--r--plugins/lotro/lotro.cpp5
-rw-r--r--plugins/mumble_legacy_plugin.h (renamed from plugins/mumble_plugin.h)19
-rw-r--r--plugins/mumble_positional_audio_linux.h (renamed from plugins/mumble_plugin_linux.h)12
-rw-r--r--plugins/mumble_positional_audio_main.h (renamed from plugins/mumble_plugin_main.h)15
-rw-r--r--plugins/mumble_positional_audio_utils.h (renamed from plugins/mumble_plugin_utils.h)6
-rw-r--r--plugins/mumble_positional_audio_win32.h (renamed from plugins/mumble_plugin_win32.h)10
-rw-r--r--plugins/mumble_positional_audio_win32_internals.h (renamed from plugins/mumble_plugin_win32_internals.h)6
-rw-r--r--plugins/null_plugin.cpp3
-rw-r--r--plugins/ql/ql.cpp7
-rw-r--r--plugins/rl/rl.cpp5
-rw-r--r--plugins/se/se.cpp6
-rw-r--r--plugins/sr/sr.cpp5
-rw-r--r--plugins/testPlugin/CMakeLists.txt9
-rw-r--r--plugins/testPlugin/testPlugin.cpp480
-rw-r--r--plugins/ut2004/ut2004.cpp5
-rw-r--r--plugins/ut3/ut3.cpp5
-rw-r--r--plugins/ut99/ut99.cpp7
-rw-r--r--plugins/wolfet/wolfet.cpp5
-rw-r--r--plugins/wow/wow.cpp7
-rw-r--r--plugins/wow_x64/wow_x64.cpp7
64 files changed, 2036 insertions, 93 deletions
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 41a45c6d4..e15043c85 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -30,6 +30,11 @@ foreach(ITEM ${ITEMS})
# PLUGIN_RETRACTED variable in the parent scope so that we can access it here
add_subdirectory(${ITEM})
+ if(${ITEM} STREQUAL "testPlugin" AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug)
+ # The testPlugin is only included in Debug builds
+ continue()
+ endif()
+
if(PLUGIN_RETRACTED AND NOT retracted-plugins)
# The included subdir didn't actually add a target since the associated plugin is retracted
# and therefore it should not be built.
diff --git a/plugins/HostLinux.cpp b/plugins/HostLinux.cpp
index 8d53155a5..58feb673e 100644
--- a/plugins/HostLinux.cpp
+++ b/plugins/HostLinux.cpp
@@ -5,7 +5,7 @@
#include "HostLinux.h"
-#include "mumble_plugin_utils.h"
+#include "mumble_positional_audio_utils.h"
#include <cstring>
#include <sstream>
diff --git a/plugins/HostWindows.cpp b/plugins/HostWindows.cpp
index c354b4657..1c0574fc5 100644
--- a/plugins/HostWindows.cpp
+++ b/plugins/HostWindows.cpp
@@ -5,7 +5,7 @@
#include "HostWindows.h"
-#include "mumble_plugin_utils.h"
+#include "mumble_positional_audio_utils.h"
#include <windows.h>
#include <tlhelp32.h>
diff --git a/plugins/MumbleAPI_v_1_0_x.h b/plugins/MumbleAPI_v_1_0_x.h
new file mode 100644
index 000000000..34b178f87
--- /dev/null
+++ b/plugins/MumbleAPI_v_1_0_x.h
@@ -0,0 +1,492 @@
+// Copyright 2021 The Mumble Developers. All rights reserved.
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file at the root of the
+// Mumble source tree or at <https://www.mumble.info/LICENSE>.
+
+/// This header file contains the definition of Mumble's API
+
+#ifndef MUMBLE_PLUGIN_API_H_
+#define MUMBLE_PLUGIN_API_H_
+
+#include "PluginComponents_v_1_0_x.h"
+#include <stdint.h>
+
+
+// API version
+#define MUMBLE_PLUGIN_API_MAJOR_MACRO 1
+#define MUMBLE_PLUGIN_API_MINOR_MACRO 0
+#define MUMBLE_PLUGIN_API_PATCH_MACRO 0
+
+constexpr int32_t MUMBLE_PLUGIN_API_MAJOR = MUMBLE_PLUGIN_API_MAJOR_MACRO;
+constexpr int32_t MUMBLE_PLUGIN_API_MINOR = MUMBLE_PLUGIN_API_MINOR_MACRO;
+constexpr int32_t MUMBLE_PLUGIN_API_PATCH = MUMBLE_PLUGIN_API_PATCH_MACRO;
+const mumble_version_t MUMBLE_PLUGIN_API_VERSION = { MUMBLE_PLUGIN_API_MAJOR, MUMBLE_PLUGIN_API_MINOR, MUMBLE_PLUGIN_API_PATCH };
+
+// Create macro for casting the pointer to the API object to the proper struct.
+// Note that this must only be used if the API uses MUMBLE_PLUGIN_API_VERSION of the API.
+#define MUMBLE_CONCAT_HELPER(a, b) a ## _ ## b
+#define MUMBLE_CONCAT(a, b) MUMBLE_CONCAT_HELPER(a, b)
+#define MUMBLE_API_STRUCT MUMBLE_CONCAT(MumbleAPI_v, MUMBLE_CONCAT(MUMBLE_PLUGIN_API_MAJOR_MACRO, MUMBLE_CONCAT(MUMBLE_PLUGIN_API_MINOR_MACRO, x)))
+#define MUMBLE_API_CAST(ptrName) ( *((struct MUMBLE_API_STRUCT *) ptrName) )
+
+
+struct MumbleAPI_v_1_0_x {
+ /////////////////////////////////////////////////////////
+ ////////////////////// GENERAL NOTES ////////////////////
+ /////////////////////////////////////////////////////////
+ //
+ // All functions that take in a connection as a paremeter may only be called **after** the connection
+ // has finished synchronizing. The only exception from this is isConnectionSynchronized.
+ //
+ // Strings returned by the API are UTF-8 encoded
+ // Strings passed to the API are expected to be UTF-8 encoded
+ //
+ // All API functions are synchronized and will be executed in Mumble's "main thread" from which most plugin
+ // callbacks are called as well. Note however that an API call is BLOCKING if invoked from a different
+ // thread. This means that they can cause deadlocks if used without caution. An example that will lead
+ // to a deadlock is:
+ // - plugin callback gets called from the main thread
+ // - callback messages a separate thread to do something and waits for the action to have completed
+ // - Separate thread calls an API function
+ // - The function blocks and waits to be executed in the main thread which is currently blocked waiting
+ // - deadlock
+
+
+ // -------- Memory management --------
+
+ /// Frees the given pointer.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param pointer The pointer to free
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *freeMemory)(mumble_plugin_id_t callerID, const void *pointer);
+
+
+
+ // -------- Getter functions --------
+
+ /// Gets the connection ID of the server the user is currently active on (the user's audio output is directed at).
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param[out] connection A pointer to the memory location the ID should be written to
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then it is valid to access the
+ /// value of the provided pointer
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getActiveServerConnection)(mumble_plugin_id_t callerID, mumble_connection_t *connection);
+
+ /// Checks whether the given connection has finished initializing yet.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param[out] A pointer to the boolean variable that'll hold the info whether the server has finished synchronization yet
+ /// after this function has executed successfully.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *isConnectionSynchronized)(mumble_plugin_id_t callerID, mumble_connection_t connection, bool *synchronized);
+
+ /// Fills in the information about the local user.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param[out] userID A pointer to the memory the user's ID shall be written to
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getLocalUserID)(mumble_plugin_id_t callerID, mumble_connection_t connection, mumble_userid_t *userID);
+
+ /// Fills in the information about the given user's name.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param userID The user's ID whose name should be obtained
+ /// @param[out] userName A pointer to where the pointer to the allocated string (C-encoded) should be written to. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getUserName)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_userid_t userID, const char **userName);
+
+ /// Fills in the information about the given channel's name.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param channelID The channel's ID whose name should be obtained
+ /// @param[out] channelName A pointer to where the pointer to the allocated string (C-ecoded) should be written to. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getChannelName)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_channelid_t channelID, const char **channelName);
+
+ /// Gets an array of all users that are currently connected to the provided server. Passing a nullptr as any of the out-parameter
+ /// will prevent that property to be set/allocated. If you are only interested in the user count you can thus pass nullptr as the
+ /// users parameter and save time on allocating + freeing the channels-array while still getting the size out.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param[out] users A pointer to where the pointer of the allocated array shall be written. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @param[out] userCount A pointer to where the size of the allocated user-array shall be written to
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getAllUsers)(mumble_plugin_id_t callerID, mumble_connection_t connection, mumble_userid_t **users,
+ size_t *userCount);
+
+ /// Gets an array of all channels on the provided server. Passing a nullptr as any of the out-parameter will prevent
+ /// that property to be set/allocated. If you are only interested in the channel count you can thus pass nullptr as the
+ /// channels parameter and save time on allocating + freeing the channels-array while still getting the size out.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param[out] channels A pointer to where the pointer of the allocated array shall be written. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @param[out] channelCount A pointer to where the size of the allocated channel-array shall be written to
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getAllChannels)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_channelid_t **channels, size_t *channelCount);
+
+ /// Gets the ID of the channel the given user is currently connected to.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param userID The ID of the user to search for
+ /// @param[out] A pointer to where the ID of the channel shall be written
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getChannelOfUser)(mumble_plugin_id_t callerID, mumble_connection_t connection, mumble_userid_t userID,
+ mumble_channelid_t *channel);
+
+ /// Gets an array of all users in the specified channel.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param channelID The ID of the channel whose users shall be retrieved
+ /// @param[out] userList A pointer to where the pointer of the allocated array shall be written. The allocated memory has
+ /// to be freed by a call to freeMemory by the plugin eventually. The memory will only be allocated if this function
+ /// returns STATUS_OK.
+ /// @param[out] userCount A pointer to where the size of the allocated user-array shall be written to
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getUsersInChannel)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_channelid_t channelID, mumble_userid_t **userList, size_t *userCount);
+
+ /// Gets the current transmission mode of the local user.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param[out] transmissionMode A pointer to where the transmission mode shall be written.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getLocalUserTransmissionMode)(mumble_plugin_id_t callerID, mumble_transmission_mode_t *transmissionMode);
+
+ /// Checks whether the given user is currently locally muted.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param userID The ID of the user to check for
+ /// @param[out] muted A pointer to where the local mute state of that user shall be written
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *isUserLocallyMuted)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_userid_t userID, bool *muted);
+
+ /// Checks whether the local user is currently muted.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param[out] muted A pointer to where the mute state of the local user shall be written
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *isLocalUserMuted)(mumble_plugin_id_t callerID, bool *muted);
+
+ /// Checks whether the local user is currently deafened.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param[out] deafened A pointer to where the deaf state of the local user shall be written
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *isLocalUserDeafened)(mumble_plugin_id_t callerID, bool *deafened);
+
+ /// Gets the hash of the given user (can be used to recognize users between restarts)
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param userID The ID of the user to search for
+ /// @param[out] hash A pointer to where the pointer to the allocated string (C-encoded) should be written to. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getUserHash)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_userid_t userID, const char **hash);
+
+ /// Gets the hash of the server for the given connection (can be used to recognize servers between restarts)
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection
+ /// @param[out] hash A pointer to where the pointer to the allocated string (C-encoded) should be written to. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getServerHash)(mumble_plugin_id_t callerID, mumble_connection_t connection, const char **hash);
+
+ /// Gets the comment of the given user. Note that a user might have a comment configured that hasn't been synchronized
+ /// to this client yet. In this case this function will return EC_UNSYNCHRONIZED_BLOB. As of now there is now way
+ /// to request the synchronization to happen via the Plugin-API.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection
+ /// @param userID the ID of the user whose comment should be obtained
+ /// @param[out] comment A pointer to where the pointer to the allocated string (C-encoded) should be written to. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getUserComment)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_userid_t userID, const char **comment);
+
+ /// Gets the description of the given channel. Note that a channel might have a description configured that hasn't been synchronized
+ /// to this client yet. In this case this function will return EC_UNSYNCHRONIZED_BLOB. As of now there is now way
+ /// to request the synchronization to happen via the Plugin-API.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection
+ /// @param channelID the ID of the channel whose comment should be obtained
+ /// @param[out] description A pointer to where the pointer to the allocated string (C-encoded) should be written to. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getChannelDescription)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_channelid_t channelID, const char **description);
+
+
+ // -------- Request functions --------
+
+ /// Requests Mumble to set the local user's transmission mode to the specified one. If you only need to temporarily set
+ /// the transmission mode to continous, use requestMicrophoneActivationOverwrite instead as this saves you the work of
+ /// restoring the previous state afterwards.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param transmissionMode The requested transmission mode
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *requestLocalUserTransmissionMode)(mumble_plugin_id_t callerID, mumble_transmission_mode_t transmissionMode);
+
+ /// Requests Mumble to move the given user into the given channel
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param userID The ID of the user that shall be moved
+ /// @param channelID The ID of the channel to move the user to
+ /// @param password The password of the target channel (UTF-8 encoded as a C-string). Pass NULL if the target channel does not require a
+ /// password for entering
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *requestUserMove)(mumble_plugin_id_t callerID, mumble_connection_t connection, mumble_userid_t userID,
+ mumble_channelid_t channelID, const char *password);
+
+ /// Requests Mumble to overwrite the microphone activation so that the microphone is always on (same as if the user had chosen
+ /// the continous transmission mode). If a plugin requests this overwrite, it is responsible for deactivating the overwrite again
+ /// once it is no longer required
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param activate Whether to activate the overwrite (false deactivates an existing overwrite)
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *requestMicrophoneActivationOvewrite)(mumble_plugin_id_t callerID, bool activate);
+
+ /// Requests Mumble to set the local mute state of the given client. Note that this only affects the **local** mute state
+ /// opposed to a server-mute (client is globally muted by the server) or the client's own mute-state (client has muted its
+ /// microphone and thus isn't transmitting any audio).
+ /// Furthermore it must be noted that muting the local user with this function does not work (it doesn't make sense). If
+ /// you try to do so, this function will fail. In order to make this work, this function will also fail if the server
+ /// has not finished synchronizing with the client yet.
+ /// For muting the local user, use requestLocalUserMute instead.
+ ///
+ /// @param callerID The ID of the plugin calling this function.
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param userID The ID of the user that shall be muted
+ /// @param muted Whether to locally mute the given client (opposed to unmuting it)
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *requestLocalMute)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ mumble_userid_t userID, bool muted);
+
+ /// Requests Mumble to set the mute state of the local user. In the UI this is referred to as "self-mute".
+ ///
+ /// @param callerID The ID of the plugin calling this function.
+ /// @param muted Whether to locally mute the local user (opposed to unmuting it)
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *requestLocalUserMute)(mumble_plugin_id_t callerID, bool muted);
+
+ /// Requests Mumble to set the deaf state of the local user. In the UI this is referred to as "self-deaf".
+ ///
+ /// @param callerID The ID of the plugin calling this function.
+ /// @param deafened Whether to locally deafen the local user (opposed to undeafening it)
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *requestLocalUserDeaf)(mumble_plugin_id_t callerID, bool deafened);
+
+ /// Sets the comment of the local user
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection
+ /// @param comment The new comment to use (C-encoded). A subset of HTML formatting is supported.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer
+ /// may be accessed
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *requestSetLocalUserComment)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ const char *comment);
+
+
+
+ // -------- Find functions --------
+
+ /// Fills in the information about a user with the specified name, if such a user exists. The search is case-sensitive.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param userName The respective user's name
+ /// @param[out] userID A pointer to the memory the user's ID shall be written to
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer may
+ /// be accessed.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *findUserByName)(mumble_plugin_id_t callerID, mumble_connection_t connection, const char *userName,
+ mumble_userid_t *userID);
+
+ /// Fills in the information about a channel with the specified name, if such a channel exists. The search is case-sensitive.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to use as a context
+ /// @param channelName The respective channel's name
+ /// @param[out] channelID A pointer to the memory the channel's ID shall be written to
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer may
+ /// be accessed.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *findChannelByName)(mumble_plugin_id_t callerID, mumble_connection_t connection,
+ const char *channelName, mumble_channelid_t *channelID);
+
+
+
+ // -------- Settings --------
+
+ /// Fills in the current value of the setting with the given key. Note that this function can only be used for settings whose value
+ /// is a bool!
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param key The key to the desired setting
+ /// @param[out] outValue A pointer to the memory the setting's value shall be written to.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer may
+ /// be accessed.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getMumbleSetting_bool)(mumble_plugin_id_t callerID, mumble_settings_key_t key, bool *outValue);
+
+ /// Fills in the current value of the setting with the given key. Note that this function can only be used for settings whose value
+ /// is an int!
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param key The key to the desired setting
+ /// @param[out] outValue A pointer to the memory the setting's value shall be written to.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer may
+ /// be accessed.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getMumbleSetting_int)(mumble_plugin_id_t callerID, mumble_settings_key_t key, int64_t *outValue);
+
+ /// Fills in the current value of the setting with the given key. Note that this function can only be used for settings whose value
+ /// is a double!
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param key The key to the desired setting
+ /// @param[out] outValue A pointer to the memory the setting's value shall be written to.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer may
+ /// be accessed.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getMumbleSetting_double)(mumble_plugin_id_t callerID, mumble_settings_key_t key, double *outValue);
+
+ /// Fills in the current value of the setting with the given key. Note that this function can only be used for settings whose value
+ /// is a String!
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param key The key to the desired setting
+ /// @param[out] outValue The memory address to which the pointer to the setting's value (the String) will be written. The
+ /// allocated memory has to be freed by a call to freeMemory by the plugin eventually. The memory will only be
+ /// allocated if this function returns STATUS_OK.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned. Only then the passed pointer may
+ /// be accessed.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *getMumbleSetting_string)(mumble_plugin_id_t callerID, mumble_settings_key_t key, const char **outValue);
+
+
+ /// Sets the value of the setting with the given key. Note that this function can only be used for settings whose value
+ /// is a bool!
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param key The key to the desired setting
+ /// @param value The value that should be set for the given setting
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *setMumbleSetting_bool)(mumble_plugin_id_t callerID, mumble_settings_key_t key, bool value);
+
+ /// Sets the value of the setting with the given key. Note that this function can only be used for settings whose value
+ /// is an int!
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param key The key to the desired setting
+ /// @param value The value that should be set for the given setting
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *setMumbleSetting_int)(mumble_plugin_id_t callerID, mumble_settings_key_t key, int64_t value);
+
+ /// Sets the value of the setting with the given key. Note that this function can only be used for settings whose value
+ /// is a double!
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param key The key to the desired setting
+ /// @param value The value that should be set for the given setting
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *setMumbleSetting_double)(mumble_plugin_id_t callerID, mumble_settings_key_t key, double value);
+
+ /// Sets the value of the setting with the given key. Note that this function can only be used for settings whose value
+ /// is a string!
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param key The key to the desired setting
+ /// @param value The value that should be set for the given setting
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *setMumbleSetting_string)(mumble_plugin_id_t callerID, mumble_settings_key_t key, const char *value);
+
+
+
+
+ // -------- Miscellaneous --------
+
+ /// Sends the provided data to the provided client(s). This kind of data can only be received by another plugin active
+ /// on that client. The sent data can be seen by any active plugin on the receiving client. Therefore the sent data
+ /// must not contain sensitive information or anything else that shouldn't be known by others.
+ ///
+ /// NOTE: Messages sent via this API function are rate-limited by the server. If the rate-limit is hit, the message
+ /// will be dropped without an error message. The rate-limiting is global (e.g. it doesn't matter which plugin sent
+ /// the respective messages - they all count to the same limit).
+ /// Therefore if you have multiple messages to send, you should consider sending them asynchronously one at a time
+ /// with a little delay in between (~1 second).
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param connection The ID of the server-connection to send the data through (the server the given users are on)
+ /// @param users An array of user IDs to send the data to
+ /// @param userCount The size of the provided user-array
+ /// @param data The data array that shall be sent. This can be an arbitrary sequence of bytes. Note that the size of
+ /// is restricted to <= 1KB.
+ /// @param dataLength The length of the data array
+ /// @param dataID The ID of the sent data. This has to be used by the receiving plugin(s) to figure out what to do with
+ /// the data. This has to be a C-encoded String. It is recommended that the ID starts with a plugin-specific prefix
+ /// in order to avoid name clashes. Note that the size of this string is restricted to <= 100 bytes.
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *sendData)(mumble_plugin_id_t callerID, mumble_connection_t connection, const mumble_userid_t *users,
+ size_t userCount, const uint8_t *data, size_t dataLength, const char *dataID);
+
+ /// Logs the given message (typically to Mumble's console). All passed strings have to be UTF-8 encoded.
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param message The message to log
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *log)(mumble_plugin_id_t callerID, const char *message);
+
+ /// Plays the provided sample. It uses libsndfile as a backend so the respective file format needs to be supported by it
+ /// in order for this to work out (see http://www.mega-nerd.com/libsndfile/).
+ ///
+ /// @param callerID The ID of the plugin calling this function
+ /// @param samplePath The path to the sample that shall be played (UTF-8 encoded)
+ /// @returns The error code. If everything went well, STATUS_OK will be returned.
+ mumble_error_t (PLUGIN_CALLING_CONVENTION *playSample)(mumble_plugin_id_t callerID, const char *samplePath);
+};
+
+#endif
diff --git a/plugins/MumblePlugin_v_1_0_x.h b/plugins/MumblePlugin_v_1_0_x.h
new file mode 100644
index 000000000..f3feb740b
--- /dev/null
+++ b/plugins/MumblePlugin_v_1_0_x.h
@@ -0,0 +1,402 @@
+// Copyright 2021 The Mumble Developers. All rights reserved.
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file at the root of the
+// Mumble source tree or at <https://www.mumble.info/LICENSE>.
+
+/// This header file specifies the Mumble plugin interface
+
+#ifndef EXTERNAL_MUMBLE_PLUGIN_H_
+#define EXTERNAL_MUMBLE_PLUGIN_H_
+
+#include "PluginComponents_v_1_0_x.h"
+#include "MumbleAPI_v_1_0_x.h"
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+
+#if defined(__GNUC__) && !defined(__MINGW32__) // GCC on Unix-like systems
+ #define PLUGIN_EXPORT __attribute__((visibility("default")))
+#elif defined(_MSC_VER)
+ #define PLUGIN_EXPORT __declspec(dllexport)
+#elif defined(__MINGW32__)
+ #define PLUGIN_EXPORT __attribute__((dllexport))
+#else
+ #error No PLUGIN_EXPORT definition available
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ //////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////// MANDATORY FUNCTIONS ///////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////////
+
+ /// Gets called right after loading the plugin in order to let the plugin initialize.
+ ///
+ /// Registers the ID of this plugin.
+ /// @param id The ID for this plugin. This is the ID Mumble will reference this plugin with
+ /// and by which this plugin can identify itself when communicating with Mumble.
+ /// @returns The status of the initialization. If everything went fine, return STATUS_OK
+ PLUGIN_EXPORT mumble_error_t PLUGIN_CALLING_CONVENTION mumble_init(uint32_t id);
+
+ /// Gets called when unloading the plugin in order to allow it to clean up after itself.
+ /// Note that it is still safe to call API functions from within this callback.
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_shutdown();
+
+ /// Gets the name of the plugin.
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @returns A String-wrapper containing the requested name
+ PLUGIN_EXPORT struct MumbleStringWrapper PLUGIN_CALLING_CONVENTION mumble_getName();
+
+ /// Gets the Version of the plugin-API this plugin intends to use.
+ /// Mumble will decide whether this plugin is loadable or not based on the return value of this function.
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @returns The respective API Version
+ PLUGIN_EXPORT mumble_version_t PLUGIN_CALLING_CONVENTION mumble_getAPIVersion();
+
+ /// Provides the MumbleAPI struct to the plugin. This struct contains function pointers that can be used
+ /// to interact with the Mumble client. It is up to the plugin to store this struct somewhere if it wants to make use
+ /// of it at some point.
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @param api A pointer to the MumbleAPI struct. The API struct must be cast to the version corresponding to the
+ /// user API version. If your plugin is e.g. using the 1.0.x API, then you have to cast this pointer to
+ /// MumbleAPI_v_1_0_x. Note also that you **must not store this pointer**. It will become invalid. Therefore
+ /// you have to copy the struct in order to use it later on.
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_registerAPIFunctions(void *apiStruct);
+
+ /// Releases the resource pointed to by the given pointer. If the respective resource has been allocated before,
+ /// this would be the time to free/delete it.
+ /// The resources processed by this functions are only those that have been specifically allocated in order to return
+ /// them in one of the plugin functions to Mumble (e.g. the String returned by mumble_getName) and has nothing to do
+ /// with your plugin's internal resource management.
+ /// In short: Only resources passed from the plugin to Mumble via a return value may be processed by this function.
+ ///
+ /// NOTE1: This function may be called without the plugin being loaded
+ ///
+ /// NOTE2: that the pointer might be pointing to memory that had to be allocated without the plugin being loaded.
+ /// Therefore you should be very sure that there'll be another callback in which you want to free this memory,
+ /// should you decide to not do it here (which is hereby explicitly advised against).
+ ///
+ /// NOTE3: The pointer is const as Mumble won't mess with the memory allocated by the plugin (no modifications).
+ /// Nontheless this function is explicitly responsible for freeing the respective memory parts. If the memory has
+ /// been allocated using malloc(), it needs to be freed using free() which requires a const-cast. If however the
+ /// memory has been created using the new operator you have to cast the pointer back to its original type and then
+ /// use the delete operator on it (no const-cast necessary in this case).
+ /// See https://stackoverflow.com/questions/2819535/unable-to-free-const-pointers-in-c
+ /// and https://stackoverflow.com/questions/941832/is-it-safe-to-delete-a-void-pointer
+ ///
+ /// @param pointer The pointer to the memory that needs free-ing
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_releaseResource(const void *pointer);
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////
+ ///////////////////////////// GENERAL FUNCTIONS //////////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////////
+
+ /// Tells the plugin some basic information about the Mumble client loading it.
+ /// This function will be the first one that is being called on this plugin - even before it is decided whether to load
+ /// the plugin at all.
+ ///
+ /// @param mumbleVersion The Version of the Mumble client
+ /// @param mumbleAPIVersion The Version of the plugin-API the Mumble client runs with
+ /// @param minimumExpectedAPIVersion The minimum Version the Mumble clients expects this plugin to meet in order to load it
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_setMumbleInfo(mumble_version_t mumbleVersion, mumble_version_t mumbleAPIVersion, mumble_version_t minimumExpectedAPIVersion);
+
+ /// Gets the Version of this plugin
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @returns The plugin's version
+ PLUGIN_EXPORT mumble_version_t PLUGIN_CALLING_CONVENTION mumble_getVersion();
+
+ /// Gets the name of the plugin author(s).
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @returns A String-wrapper containing the requested author name(s)
+ PLUGIN_EXPORT struct MumbleStringWrapper PLUGIN_CALLING_CONVENTION mumble_getAuthor();
+
+ /// Gets the description of the plugin.
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @returns A String-wrapper containing the requested description
+ PLUGIN_EXPORT struct MumbleStringWrapper PLUGIN_CALLING_CONVENTION mumble_getDescription();
+
+ /// Gets the feature set of this plugin. The feature set is described by bitwise or'ing the elements of the Mumble_PluginFeature enum
+ /// together.
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @returns The feature set of this plugin
+ PLUGIN_EXPORT uint32_t PLUGIN_CALLING_CONVENTION mumble_getFeatures();
+
+ /// Requests this plugin to deactivate the given (sub)set of provided features.
+ /// If this is not possible, the features that can't be deactivated shall be returned by this function.
+ ///
+ /// Example (check if FEATURE_POSITIONAL shall be deactivated):
+ /// @code
+ /// if (features & FEATURE_POSITIONAL) {
+ /// // positional shall be deactivated
+ /// };
+ /// @endcode
+ ///
+ /// @param features The feature set that shall be deactivated
+ /// @returns The feature set that can't be disabled (bitwise or'ed). If all requested features can be disabled, return
+ /// FEATURE_NONE. If none of the requested features can be disabled return the unmodified features parameter.
+ PLUGIN_EXPORT uint32_t PLUGIN_CALLING_CONVENTION mumble_deactivateFeatures(uint32_t features);
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////
+ //////////////////////////// POSITIONAL DATA /////////////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////////
+ // If this plugin wants to provide positional data, ALL functions of this category
+ // have to be implemented
+
+ /// Indicates that Mumble wants to use this plugin to request positional data. Therefore it should check whether it is currently
+ /// able to do so and allocate memory that is needed for that process.
+ /// As a parameter this function gets an array of names and an array of PIDs. They are of same length and the PID at index i
+ /// belongs to a program whose name is listed at index i in the "name-array".
+ ///
+ /// @param programNames An array of pointers to the program names
+ /// @param programPIDs An array of the corresponding program PIDs
+ /// @param programCount The length of programNames and programPIDs
+ /// @returns The error code. If everything went fine PDEC_OK shall be returned. In that case Mumble will start frequently
+ /// calling fetchPositionalData. If this returns anything but PDEC_OK, Mumble will assume that the plugin is (currently)
+ /// uncapable of providing positional data. In this case this function must not have allocated any memory that needs to be
+ /// cleaned up later on. Depending on the returned error code, Mumble might try to call this function again at some point.
+ PLUGIN_EXPORT uint8_t PLUGIN_CALLING_CONVENTION mumble_initPositionalData(const char *const*programNames, const uint64_t *programPIDs, size_t programCount);
+
+ /// Retrieves the positional data. If no data can be fetched, set all float-vectors to 0 and return false.
+ ///
+ /// @param[out] avatarPos A float-array of size 3 representing the cartesian position of the player/avatar in the ingame world.
+ /// One unit represents one meter of distance.
+ /// @param[out] avatarDir A float-array of size 3 representing the cartesian direction-vector of the player/avatar ingame (where it
+ /// is facing).
+ /// @param[out] avatarAxis A float-array of size 3 representing the vector pointing from the toes of the character to its head. One
+ /// unit represents one meter of distance.
+ /// @param[out] cameraPos A float-array of size 3 representing the cartesian position of the camera in the ingame world.
+ /// One unit represents one meter of distance.
+ /// @param[out] cameraDir A float-array of size 3 representing the cartesian direction-vector of the camera ingame (where it
+ /// is facing).
+ /// @param[out] cameraAxis A float-array of size 3 representing a vector from the bottom of the camera to its top. One unit
+ /// represents one meter of distance.
+ /// @param[out] context A pointer to where the pointer to a C-encoded string storing the context of the provided positional data
+ /// shall be written. This context should include information about the server (and team) the player is on. Only players with identical
+ /// context will be able to hear each other's audio. The returned pointer has to remain valid until the next invokation of this function
+ /// or until shutdownPositionalData is called.
+ /// @param[out] identity A pointer to where the pointer to a C-encoded string storing the identity of the player shall be written. It can
+ /// be polled by external scripts from the server and should uniquely identify the player in the game. The pointer has to remain valid
+ /// until the next invokation of this function or until shutdownPositionalData is called.
+ /// @returns Whether this plugin can continue delivering positional data. If this function returns false, shutdownPositionalData will
+ /// be called.
+ PLUGIN_EXPORT bool PLUGIN_CALLING_CONVENTION mumble_fetchPositionalData(float *avatarPos, float *avatarDir, float *avatarAxis, float *cameraPos, float *cameraDir,
+ float *cameraAxis, const char **context, const char **identity);
+
+ /// Indicates that this plugin will not be asked for positional data any longer. Thus any memory allocated for this purpose should
+ /// be freed at this point.
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_shutdownPositionalData();
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////
+ ////////////////////// EVENTHANDLERS / CALLBACK FUNCTIONS ////////////////////////
+ //////////////////////////////////////////////////////////////////////////////////
+
+ /// Called when connecting to a server.
+ /// Note that in most cases you'll want to use mumble_onServerSynchronized instead.
+ /// Note also that this callback will be called from a DIFFERENT THREAD!
+ ///
+ /// @param connection The ID of the newly established server-connection
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onServerConnected(mumble_connection_t connection);
+
+ /// Called when disconnecting from a server.
+ /// Note that this callback is called from a DIFFERENT THREAD!
+ ///
+ /// @param connection The ID of the server-connection that has been terminated
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onServerDisconnected(mumble_connection_t connection);
+
+ /// Called when the client has finished synchronizing with the server
+ ///
+ /// @param connection The ID of the server-connection that has been terminated
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onServerSynchronized(mumble_connection_t connection);
+
+ /// Called whenever any user on the server enters a channel
+ /// This function will also be called when freshly connecting to a server as each user on that
+ /// server needs to be "added" to the respective channel as far as the local client is concerned.
+ ///
+ /// @param connection The ID of the server-connection this event is connected to
+ /// @param userID The ID of the user this event has been triggered for
+ /// @param previousChannelID The ID of the chanel the user is coming from. Negative IDs indicate that there is no previous channel (e.g. the user
+ /// freshly connected to the server) or the channel isn't available because of any other reason.
+ /// @param newChannelID The ID of the channel the user has entered. If the ID is negative, the new channel could not be retrieved. This means
+ /// that the ID is invalid.
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onChannelEntered(mumble_connection_t connection, mumble_userid_t userID, mumble_channelid_t previousChannelID,
+ mumble_channelid_t newChannelID);
+
+ /// Called whenever a user leaves a channel.
+ /// This includes a client disconnecting from the server as this will also lead to the user not being in that channel anymore.
+ ///
+ /// @param connection The ID of the server-connection this event is connected to
+ /// @param userID The ID of the user that left the channel
+ /// @param channelID The ID of the channel the user left. If the ID is negative, the channel could not be retrieved. This means that the ID is
+ /// invalid.
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onChannelExited(mumble_connection_t connection, mumble_userid_t userID, mumble_channelid_t channelID);
+
+ /// Called when any user changes his/her talking state.
+ ///
+ /// @param connection The ID of the server-connection this event is connected to
+ /// @param userID The ID of the user whose talking state has been changed
+ /// @param talkingState The new TalkingState the user has switched to.
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onUserTalkingStateChanged(mumble_connection_t connection, mumble_userid_t userID, mumble_talking_state_t talkingState);
+
+ /// Called whenever there is audio input.
+ /// Note that this callback will be called from the AUDIO THREAD.
+ /// Note also that blocking this callback will cause Mumble's audio processing to get suspended.
+ ///
+ /// @param inputPCM A pointer to a short-array holding the pulse-code-modulation (PCM) representing the audio input. Its length
+ /// is sampleCount * channelCount. The PCM format for stereo input is [LRLRLR...] where L and R are samples of the left and right
+ /// channel respectively.
+ /// @param sampleCount The amount of sample points per channel
+ /// @param channelCount The amount of channels in the audio
+ /// @param sampleRate The used sample rate in Hz
+ /// @param isSpeech A boolean flag indicating whether Mumble considers the input as part of speech (instead of background noise)
+ /// @returns Whether this callback has modified the audio input-array
+ PLUGIN_EXPORT bool PLUGIN_CALLING_CONVENTION mumble_onAudioInput(short *inputPCM, uint32_t sampleCount, uint16_t channelCount,
+ uint32_t sampleRate, bool isSpeech);
+
+ /// Called whenever Mumble fetches data from an active audio source (could be a voice packet or a playing sample).
+ /// The provided audio buffer is the raw buffer without any processing applied to it yet.
+ /// Note that this callback will be called from the AUDIO THREAD.
+ /// Note also that blocking this callback will cause Mumble's audio processing to get suspended.
+ ///
+ /// @param outputPCM A pointer to a float-array holding the pulse-code-modulation (PCM) representing the audio output. Its length
+ /// is sampleCount * channelCount. The PCM format for stereo output is [LRLRLR...] where L and R are samples of the left and right
+ /// channel respectively.
+ /// @param sampleCount The amount of sample points per channel
+ /// @param channelCount The amount of channels in the audio
+ /// @param sampleRate The used sample rate in Hz
+ /// @param isSpeech Whether this audio belongs to a received voice packet (and will thus (most likely) contain speech)
+ /// @param userID If isSpeech is true, this contains the ID of the user this voice packet belongs to. If isSpeech is false,
+ /// the content of this parameter is unspecified and should not be accessed
+ /// @returns Whether this callback has modified the audio output-array
+ PLUGIN_EXPORT bool PLUGIN_CALLING_CONVENTION mumble_onAudioSourceFetched(float *outputPCM, uint32_t sampleCount, uint16_t channelCount,
+ uint32_t sampleRate, bool isSpeech, mumble_userid_t userID);
+
+ /// Called whenever the fully mixed and processed audio is about to be handed to the audio backend (about to be played).
+ /// Note that this happens immediately before Mumble clips the audio buffer.
+ /// Note that this callback will be called from the AUDIO THREAD.
+ /// Note also that blocking this callback will cause Mumble's audio processing to get suspended.
+ ///
+ /// @param outputPCM A pointer to a float-array holding the pulse-code-modulation (PCM) representing the audio output. Its length
+ /// is sampleCount * channelCount. The PCM format for stereo output is [LRLRLR...] where L and R are samples of the left and right
+ /// channel respectively.
+ /// @param sampleCount The amount of sample points per channel
+ /// @param channelCount The amount of channels in the audio
+ /// @param sampleRate The used sample rate in Hz
+ /// @returns Whether this callback has modified the audio output-array
+ PLUGIN_EXPORT bool PLUGIN_CALLING_CONVENTION mumble_onAudioOutputAboutToPlay(float *outputPCM, uint32_t sampleCount, uint16_t channelCount,
+ uint32_t sampleRate);
+
+ /// Called whenever data has been received that has been sent by a plugin. This data should only be processed by the
+ /// intended plugin. For this reason a dataID is provided that should be used to determine whether the data is intended
+ /// for this plugin or not. As soon as the data has been processed, no further plugins will be notified about it.
+ ///
+ /// @param connection The ID of the server-connection the data is coming from
+ /// @param sender The ID of the user whose client's plugin has sent the data
+ /// @param data The sent data array. This can be an arbitrary sequence of bytes.
+ /// @param dataLength The length of the data array
+ /// @param dataID The ID of this data (C-encoded)
+ /// @return Whether the given data has been processed by this plugin
+ PLUGIN_EXPORT bool PLUGIN_CALLING_CONVENTION mumble_onReceiveData(mumble_connection_t connection, mumble_userid_t sender,
+ const uint8_t *data, size_t dataLength, const char *dataID);
+
+ /// Called when a new user gets added to the user model. This is the case when that new user freshly connects to the server the
+ /// local user is on but also when the local user connects to a server other clients are already connected to (in this case this
+ /// method will be called for every client already on that server).
+ ///
+ /// @param connection An object used to identify the current connection
+ /// @param userID The ID of the user that has been added
+
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onUserAdded(mumble_connection_t connection, mumble_userid_t userID);
+
+ /// Called when a user gets removed from the user model. This is the case when that user disconnects from the server the
+ /// local user is on but also when the local user disconnects from a server other clients are connected to (in this case this
+ /// method will be called for every client on that server).
+ ///
+ /// @param connection An object used to identify the current connection
+ /// @param userID The ID of the user that has been removed
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onUserRemoved(mumble_connection_t connection, mumble_userid_t userID);
+
+ /// Called when a new channel gets added to the user model. This is the case when a new channel is created on the server the local
+ /// user is on but also when the local user connects to a server that contains channels other than the root-channel (in this case
+ /// this method will be called for ever non-root channel on that server).
+ ///
+ /// @param connection An object used to identify the current connection
+ /// @param channelID The ID of the channel that has been added
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onChannelAdded(mumble_connection_t connection, mumble_channelid_t channelID);
+
+ /// Called when a channel gets removed from the user model. This is the case when a channel is removed on the server the local
+ /// user is on but also when the local user disconnects from a server that contains channels other than the root-channel (in this case
+ /// this method will be called for ever non-root channel on that server).
+ ///
+ /// @param connection An object used to identify the current connection
+ /// @param channelID The ID of the channel that has been removed
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onChannelRemoved(mumble_connection_t connection, mumble_channelid_t channelID);
+
+ /// Called when a channel gets renamed. This also applies when a new channel is created (thus assigning it an initial name is also
+ /// considered renaming).
+ ///
+ /// @param connection An object used to identify the current connection
+ /// @param channelID The ID of the channel that has been renamed
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onChannelRenamed(mumble_connection_t connection, mumble_channelid_t channelID);
+
+ /// Called when a key has been pressed or released while Mumble has keyboard focus.
+ /// Note that this callback will only work if the user has explicitly given permission to monitor keyboard
+ /// events for this plugin. Thus if you want to use this callback, make sure your users know that they have to
+ /// enable that.
+ ///
+ /// @param keyCode The key code of the respective key. The character codes are defined
+ /// via the Mumble_KeyCode enum. For printable 7-bit ASCII characters these codes conform
+ /// to the ASCII code-page with the only difference that case is not distinguished. Therefore
+ /// always the upper-case letter code will be used for letters.
+ /// @param wasPres Whether the respective key has been pressed (instead of released)
+ PLUGIN_EXPORT void PLUGIN_CALLING_CONVENTION mumble_onKeyEvent(uint32_t keyCode, bool wasPress);
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////// PLUGIN UPDATES ////////////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////////
+
+ /// This function is used to determine whether the plugin can find an update for itself that is available for download.
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @return Whether the plugin was able to find an update for itself
+ PLUGIN_EXPORT bool PLUGIN_CALLING_CONVENTION mumble_hasUpdate();
+
+ /// This function is used to retrieve the URL for downloading the newer/updated version of this plugin.
+ ///
+ /// NOTE: This function may be called without the plugin being loaded
+ ///
+ /// @returns A String-wrapper containing the requested URL
+ PLUGIN_EXPORT struct MumbleStringWrapper PLUGIN_CALLING_CONVENTION mumble_getUpdateDownloadURL();
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/plugins/PluginComponents_v_1_0_x.h b/plugins/PluginComponents_v_1_0_x.h
new file mode 100644
index 000000000..628283f22
--- /dev/null
+++ b/plugins/PluginComponents_v_1_0_x.h
@@ -0,0 +1,411 @@
+// Copyright 2021 The Mumble Developers. All rights reserved.
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file at the root of the
+// Mumble source tree or at <https://www.mumble.info/LICENSE>.
+
+/// This header file contains definitions of types and other components used in Mumble's plugin system
+
+#ifndef MUMBLE_PLUGINCOMPONENT_H_
+#define MUMBLE_PLUGINCOMPONENT_H_
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+
+#ifdef __cplusplus
+# include <string>
+#endif
+
+#ifdef QT_VERSION
+ #include <QString>
+#endif
+
+// define the calling convention macro based on the compiler being used
+#if defined(_MSC_VER)
+ #define PLUGIN_CALLING_CONVENTION __cdecl
+#elif defined(__MINGW32__)
+ #define PLUGIN_CALLING_CONVENTION __attribute__((cdecl))
+#else
+ #define PLUGIN_CALLING_CONVENTION
+#endif
+
+
+/// A macro holding the exit status of a successful operation
+#define STATUS_OK EC_OK
+/// A macro holding the version object that is considered to correspond to an unknown version
+#define VERSION_UNKNOWN Version({0,0,0})
+
+
+/// This enum's values correspond to special feature sets a plugin may provide.
+/// They are meant to be or'ed together to represent the total feature set of a plugin.
+enum Mumble_PluginFeature {
+ /// None of the below
+ FEATURE_NONE = 0,
+ /// The plugin provides positional data from a game
+ FEATURE_POSITIONAL = 1 << 0,
+ /// The plugin modifies the input/output audio itself
+ FEATURE_AUDIO = 1 << 1
+};
+
+/// This enum's values represent talking states a user can be in when using Mumble.
+enum Mumble_TalkingState {
+ INVALID=-1,
+ PASSIVE=0,
+ TALKING,
+ WHISPERING,
+ SHOUTING,
+ TALKING_MUTED
+};
+
+/// This enum's values represent transmission modes a user might have configured. Transmission mode
+/// in this context is referring to a method that determines when a user is speaking and thus when
+/// to transmit audio packets.
+enum Mumble_TransmissionMode {
+ TM_CONTINOUS,
+ TM_VOICE_ACTIVATION,
+ TM_PUSH_TO_TALK
+};
+
+/// This enum's values represent the error codes that are being used by the MumbleAPI.
+/// You can get a string-representation for each error code via the errorMessage function.
+enum Mumble_ErrorCode {
+ EC_INTERNAL_ERROR = -2,
+ EC_GENERIC_ERROR = -1,
+ EC_OK = 0,
+ EC_POINTER_NOT_FOUND,
+ EC_NO_ACTIVE_CONNECTION,
+ EC_USER_NOT_FOUND,
+ EC_CHANNEL_NOT_FOUND,
+ EC_CONNECTION_NOT_FOUND,
+ EC_UNKNOWN_TRANSMISSION_MODE,
+ EC_AUDIO_NOT_AVAILABLE,
+ EC_INVALID_SAMPLE,
+ EC_INVALID_PLUGIN_ID,
+ EC_INVALID_MUTE_TARGET,
+ EC_CONNECTION_UNSYNCHRONIZED,
+ EC_INVALID_API_VERSION,
+ EC_UNSYNCHRONIZED_BLOB,
+ EC_UNKNOWN_SETTINGS_KEY,
+ EC_WRONG_SETTINGS_TYPE,
+ EC_SETTING_WAS_REMOVED,
+ EC_DATA_TOO_BIG,
+ EC_DATA_ID_TOO_LONG,
+};
+
+/// This enum's values represent error codes specific to the framework of handling positional data
+/// gathering (needed for Mumble's positional audio feature).
+enum Mumble_PositionalDataErrorCode {
+ /// Positional data has been initialized properly
+ PDEC_OK = 0,
+ /// Positional data is temporarily unavailable (e.g. because the corresponding process isn't running) but might be
+ /// at another point in time.
+ PDEC_ERROR_TEMP,
+ /// Positional data is permanently unavailable (e.g. because the respective memory offsets are outdated).
+ PDEC_ERROR_PERM
+};
+
+/// This enum's values represent keys for specific settings inside Mumble.
+enum Mumble_SettingsKey {
+ MSK_INVALID = -1,
+ MSK_AUDIO_INPUT_VOICE_HOLD = 0,
+ MSK_AUDIO_INPUT_VAD_SILENCE_THRESHOLD = 1,
+ MSK_AUDIO_INPUT_VAD_SPEECH_THRESHOLD = 2,
+ MSK_AUDIO_OUTPUT_PA_MINIMUM_DISTANCE = 3,
+ MSK_AUDIO_OUTPUT_PA_MAXIMUM_DISTANCE = 4,
+ MSK_AUDIO_OUTPUT_PA_BLOOM = 5,
+ MSK_AUDIO_OUTPUT_PA_MINIMUM_VOLUME = 6,
+};
+
+/// This enum's values represent the key-codes Mumble's API uses to reference keys on the keyboard.
+enum Mumble_KeyCode {
+ KC_INVALID = -1,
+
+ // Non-printable characters first
+ KC_NULL = 0,
+ KC_END = 1,
+ KC_LEFT = 2,
+ KC_RIGHT = 4,
+ KC_UP = 5,
+ KC_DOWN = 6,
+ KC_DELETE = 7,
+ KC_BACKSPACE = 8,
+ KC_TAB = 9,
+ KC_ENTER = 10, // == '\n'
+ KC_ESCAPE = 27,
+ KC_PAGE_UP = 11,
+ KC_PAGE_DOWN = 12,
+ KC_SHIFT = 13,
+ KC_CONTROL = 14,
+ KC_META = 15,
+ KC_ALT = 16,
+ KC_ALT_GR = 17,
+ KC_CAPSLOCK = 18,
+ KC_NUMLOCK = 19,
+ KC_SUPER = 20, // == windows key
+ KC_HOME = 21, // == Pos1
+ KC_PRINT = 22,
+ KC_SCROLLLOCK = 23,
+
+ // Printable characters are assigned to their ASCII code
+ KC_SPACE = ' ',
+ KC_EXCLAMATION_MARK = '!',
+ KC_DOUBLE_QUOTE = '"',
+ KC_HASHTAG = '#',
+ KC_DOLLAR = '$',
+ KC_PERCENT = '%',
+ KC_AMPERSAND = '&',
+ KC_SINGLE_QUOTE = '\'',
+ KC_OPEN_PARENTHESIS = '(',
+ KC_CLOSE_PARENTHESIS = ')',
+ KC_ASTERISK = '*',
+ KC_PLUS = '+',
+ KC_COMMA = ',',
+ KC_MINUS = '-',
+ KC_PERIOD = '.',
+ KC_SLASH = '/',
+ KC_0 = '0',
+ KC_1 = '1',
+ KC_2 = '2',
+ KC_3 = '3',
+ KC_4 = '4',
+ KC_5 = '5',
+ KC_6 = '6',
+ KC_7 = '7',
+ KC_8 = '8',
+ KC_9 = '9',
+ KC_COLON = ':',
+ KC_SEMICOLON = ';',
+ KC_LESS_THAN = '<',
+ KC_EQUALS = '=',
+ KC_GREATER_THAN = '>',
+ KC_QUESTION_MARK = '?',
+ KC_AT_SYMBOL = '@',
+ KC_A = 'A',
+ KC_B = 'B',
+ KC_C = 'C',
+ KC_D = 'D',
+ KC_E = 'E',
+ KC_F = 'F',
+ KC_G = 'G',
+ KC_H = 'H',
+ KC_I = 'I',
+ KC_J = 'J',
+ KC_K = 'K',
+ KC_L = 'L',
+ KC_M = 'M',
+ KC_N = 'N',
+ KC_O = 'O',
+ KC_P = 'P',
+ KC_Q = 'Q',
+ KC_R = 'R',
+ KC_S = 'S',
+ KC_T = 'T',
+ KC_U = 'U',
+ KC_V = 'V',
+ KC_W = 'W',
+ KC_X = 'X',
+ KC_Y = 'Y',
+ KC_Z = 'Z',
+ // leave out lowercase letters (for now)
+ KC_OPEN_BRACKET = '[',
+ KC_BACKSLASH = '\\',
+ KC_CLOSE_BRACKET = ']',
+ KC_CIRCUMFLEX = '^',
+ KC_UNDERSCORE = '_',
+ KC_GRAVE_AKCENT = '`',
+ KC_OPEN_BRACE = '{',
+ KC_VERTICAL_BAR = '|',
+ KC_CLOSE_BRACE = '}',
+ KC_TILDE = '~',
+
+ // Some characters from the extended ASCII code
+ KC_DEGREE_SIGN = 176,
+
+
+
+ // F-keys
+ // Start at a value of 256 as extended ASCII codes range up to 255
+ KC_F1 = 256,
+ KC_F2 = 257,
+ KC_F3 = 258,
+ KC_F4 = 259,
+ KC_F5 = 260,
+ KC_F6 = 261,
+ KC_F7 = 262,
+ KC_F8 = 263,
+ KC_F9 = 264,
+ KC_F10 = 265,
+ KC_F11 = 266,
+ KC_F12 = 267,
+ KC_F13 = 268,
+ KC_F14 = 269,
+ KC_F15 = 270,
+ KC_F16 = 271,
+ KC_F17 = 272,
+ KC_F18 = 273,
+ KC_F19 = 274,
+};
+
+/// A struct for representing a version of the form major.minor.patch
+struct Version {
+ int32_t major;
+ int32_t minor;
+ int32_t patch;
+#ifdef __cplusplus
+ bool operator<(const Version& other) const {
+ if (this->major != other.major) {
+ return this->major < other.major;
+ }
+ if (this->minor != other.minor) {
+ return this->minor < other.minor;
+ }
+ // Major and Minor are equal
+ return this->patch < other.patch;
+ }
+
+ bool operator>(const Version& other) const {
+ if (this->major != other.major) {
+ return this->major > other.major;
+ }
+ if (this->minor != other.minor) {
+ return this->minor > other.minor;
+ }
+ // Major and Minor are equal
+ return this->patch > other.patch;
+ }
+
+ bool operator>=(const Version& other) const {
+ if (this->major != other.major) {
+ return this->major > other.major;
+ }
+ if (this->minor != other.minor) {
+ return this->minor > other.minor;
+ }
+ // Major and Minor are equal
+ return this->patch >= other.patch;
+ }
+
+ bool operator<=(const Version& other) const {
+ if (this->major != other.major) {
+ return this->major < other.major;
+ }
+ if (this->minor != other.minor) {
+ return this->minor < other.minor;
+ }
+ // Major and Minor are equal
+ return this->patch <= other.patch;
+ }
+
+ bool operator==(const Version& other) const {
+ return this->major == other.major && this->minor == other.minor && this->patch == other.patch;
+ }
+
+ bool operator!=(const Version& other) const {
+ return this->major != other.major || this->minor != other.minor || this->patch != other.patch;
+ }
+
+ operator std::string() const {
+ return std::string("v") + std::to_string(this->major) + std::string(".") + std::to_string(this->minor) + std::string(".") + std::to_string(this->patch);
+ }
+
+#ifdef QT_VERSION
+ operator QString() const {
+ return QString::fromLatin1("v%0.%1.%2").arg(this->major).arg(this->minor).arg(this->patch);
+ }
+#endif
+#endif
+};
+
+/// Obtains a String representation for the given numeric error code.
+/// Note that the exact String representation corresponding to an error code may change and is thus
+/// not part of the plugin API as such. This function acts merely as a convenience helper for printing
+/// errors in a meaningful way.
+///
+/// @param errorCode The error code to get the String representation for
+/// @returns The error message coresponding to the given error code. The message
+/// is encoded as a C-string and is static, meaning that it is safe to use the
+/// returned pointer in your code.
+inline const char* errorMessage(int16_t errorCode) {
+ switch (errorCode) {
+ case EC_GENERIC_ERROR:
+ return "Generic error";
+ case EC_OK:
+ return "Ok - this is not an error";
+ case EC_POINTER_NOT_FOUND:
+ return "Can't find the passed pointer";
+ case EC_NO_ACTIVE_CONNECTION:
+ return "There is currently no active connection to a server";
+ case EC_USER_NOT_FOUND:
+ return "Can't find the requested user";
+ case EC_CHANNEL_NOT_FOUND:
+ return "Can't find the requested channel";
+ case EC_CONNECTION_NOT_FOUND:
+ return "Can't identify the requested connection";
+ case EC_UNKNOWN_TRANSMISSION_MODE:
+ return "Unknown transmission mode encountered";
+ case EC_AUDIO_NOT_AVAILABLE:
+ return "There is currently no audio output available";
+ case EC_INVALID_SAMPLE:
+ return "Attempted to use invalid sample (can't play it)";
+ case EC_INVALID_PLUGIN_ID:
+ return "Used an invalid plugin ID";
+ case EC_INVALID_MUTE_TARGET:
+ return "Used an invalid mute-target";
+ case EC_CONNECTION_UNSYNCHRONIZED:
+ return "The requested server connection has not yet finished synchronizing";
+ case EC_INVALID_API_VERSION:
+ return "The used API version is invalid or not supported";
+ case EC_UNSYNCHRONIZED_BLOB:
+ return "The requested blob (content) has not yet been synchronized between the client and the server";
+ case EC_UNKNOWN_SETTINGS_KEY:
+ return "The used settings-key does not match any key known to Mumble";
+ case EC_WRONG_SETTINGS_TYPE:
+ return "The referenced setting has a different type than requested";
+ case EC_SETTING_WAS_REMOVED:
+ return "The referenced setting got removed from Mumble and is no longer used";
+ case EC_DATA_TOO_BIG:
+ return "The given data is too large (exceeds limit)";
+ case EC_DATA_ID_TOO_LONG:
+ return "The given data ID is too long (exceeds limit)";
+ default:
+ return "Unknown error code";
+ }
+}
+
+
+/// This struct is used to return Strings from a plugin to Mumble. It is needed in order to
+/// work around the limitation of std::string not being part of C (it holds important information
+/// about the String's lifetime management requirements).
+struct MumbleStringWrapper {
+ /// The pointer to the actual String data
+ const char *data;
+ /// The size of the pointed String data
+ size_t size;
+ /// Whether the wrapped String needs to be released
+ /// after its usage. Instances for which this would be
+ /// false: Static Strings, String literals
+ bool needsReleasing;
+};
+
+/// Typedef for the type of a talking state
+typedef enum Mumble_TalkingState mumble_talking_state_t;
+/// Typedef for the type of a transmission mode
+typedef enum Mumble_TransmissionMode mumble_transmission_mode_t;
+/// Typedef for the type of a version
+typedef struct Version mumble_version_t;
+/// Typedef for the type of a connection
+typedef int32_t mumble_connection_t;
+/// Typedef for the type of a user
+typedef uint32_t mumble_userid_t;
+/// Typedef for the type of a channel
+typedef int32_t mumble_channelid_t;
+/// Typedef for the type of an error (code)
+typedef enum Mumble_ErrorCode mumble_error_t;
+/// Typedef for the type of a plugin ID
+typedef uint32_t mumble_plugin_id_t;
+/// Typedef for the type of a key to a setting in Mumble
+typedef enum Mumble_SettingsKey mumble_settings_key_t;
+/// Typedef for the type of a key-code
+typedef enum Mumble_KeyCode mumble_keycode_t;
+
+#endif // MUMBLE_PLUGINCOMPONENT_H_
diff --git a/plugins/Process.cpp b/plugins/Process.cpp
index 8d222a266..6f7042a53 100644
--- a/plugins/Process.cpp
+++ b/plugins/Process.cpp
@@ -5,7 +5,7 @@
#include "Process.h"
-#include "mumble_plugin_utils.h"
+#include "mumble_positional_audio_utils.h"
#include <chrono>
diff --git a/plugins/ProcessWindows.cpp b/plugins/ProcessWindows.cpp
index 234cb6123..3dc3472a9 100644
--- a/plugins/ProcessWindows.cpp
+++ b/plugins/ProcessWindows.cpp
@@ -5,7 +5,7 @@
#include "ProcessWindows.h"
-#include "mumble_plugin_win32_internals.h"
+#include "mumble_positional_audio_win32_internals.h"
ProcessWindows::ProcessWindows(const procid_t id, const std::string &name) : Process(id, name) {
const auto mods = modules();
diff --git a/plugins/amongus/Game.cpp b/plugins/amongus/Game.cpp
index decf24576..aa384d331 100644
--- a/plugins/amongus/Game.cpp
+++ b/plugins/amongus/Game.cpp
@@ -5,7 +5,7 @@
#include "Game.h"
-#include "mumble_plugin_utils.h"
+#include "../mumble_positional_audio_utils.h"
Game::Game(const procid_t id, const std::string name) : m_ok(false), m_proc(id, name) {
if (!m_proc.isOk()) {
diff --git a/plugins/amongus/amongus.cpp b/plugins/amongus/amongus.cpp
index 40d9caa9c..c671e72ea 100644
--- a/plugins/amongus/amongus.cpp
+++ b/plugins/amongus/amongus.cpp
@@ -5,8 +5,10 @@
#include "Game.h"
-#include "mumble_plugin.h"
-#include "mumble_plugin_utils.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_utils.h"
#include <sstream>
diff --git a/plugins/aoc/aoc.cpp b/plugins/aoc/aoc.cpp
index 0d818b1fd..9eb0c11c5 100644
--- a/plugins/aoc/aoc.cpp
+++ b/plugins/aoc/aoc.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/arma2/arma2.cpp b/plugins/arma2/arma2.cpp
index af103973c..b73ad5721 100644
--- a/plugins/arma2/arma2.cpp
+++ b/plugins/arma2/arma2.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
procptr_t posptr, frontptr, topptr;
diff --git a/plugins/bf1/bf1.cpp b/plugins/bf1/bf1.cpp
index 17c1cee9d..766316018 100644
--- a/plugins/bf1/bf1.cpp
+++ b/plugins/bf1/bf1.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &context, std::wstring &identity) {
diff --git a/plugins/bf1942/bf1942.cpp b/plugins/bf1942/bf1942.cpp
index a35a29784..4d2cc00f8 100644
--- a/plugins/bf1942/bf1942.cpp
+++ b/plugins/bf1942/bf1942.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
procptr_t faceptr, topptr;
// BYTE *stateptr;
diff --git a/plugins/bf2/bf2.cpp b/plugins/bf2/bf2.cpp
index 4e744487c..a08442eae 100644
--- a/plugins/bf2/bf2.cpp
+++ b/plugins/bf2/bf2.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/bf2142/bf2142.cpp b/plugins/bf2142/bf2142.cpp
index aa1b2e4ef..7f7bb91d3 100644
--- a/plugins/bf2142/bf2142.cpp
+++ b/plugins/bf2142/bf2142.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header.
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
// Variable to contain module's addresses
procptr_t RendDX9 = 0;
diff --git a/plugins/bf3/bf3.cpp b/plugins/bf3/bf3.cpp
index 812e49134..e19198768 100644
--- a/plugins/bf3/bf3.cpp
+++ b/plugins/bf3/bf3.cpp
@@ -36,7 +36,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
static bool ptr_chain_valid = false;
diff --git a/plugins/bf4/bf4.cpp b/plugins/bf4/bf4.cpp
index f06fb379e..287dd8dc6 100644
--- a/plugins/bf4/bf4.cpp
+++ b/plugins/bf4/bf4.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header.
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &context, std::wstring &identity) {
diff --git a/plugins/bf4_x86/bf4_x86.cpp b/plugins/bf4_x86/bf4_x86.cpp
index c4d49620f..af7400e00 100644
--- a/plugins/bf4_x86/bf4_x86.cpp
+++ b/plugins/bf4_x86/bf4_x86.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header.
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &context, std::wstring &identity) {
diff --git a/plugins/bfbc2/bfbc2.cpp b/plugins/bfbc2/bfbc2.cpp
index 312498e37..cd31f737a 100644
--- a/plugins/bfbc2/bfbc2.cpp
+++ b/plugins/bfbc2/bfbc2.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
bool is_steam = false;
diff --git a/plugins/bfheroes/bfheroes.cpp b/plugins/bfheroes/bfheroes.cpp
index fc7136737..f92ded261 100644
--- a/plugins/bfheroes/bfheroes.cpp
+++ b/plugins/bfheroes/bfheroes.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
procptr_t posptr, faceptr, topptr, stateptr;
diff --git a/plugins/blacklight/blacklight.cpp b/plugins/blacklight/blacklight.cpp
index ffc016f98..e94677761 100644
--- a/plugins/blacklight/blacklight.cpp
+++ b/plugins/blacklight/blacklight.cpp
@@ -34,7 +34,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
/*
Arrays of bytes to find addresses accessed by respective functions so we don't have to blindly search for addresses
diff --git a/plugins/borderlands/borderlands.cpp b/plugins/borderlands/borderlands.cpp
index 46aabf210..bca3f2ac6 100644
--- a/plugins/borderlands/borderlands.cpp
+++ b/plugins/borderlands/borderlands.cpp
@@ -34,7 +34,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
procptr_t posptr, frontptr, topptr, contextptraddress, stateaddress, loginaddress;
diff --git a/plugins/borderlands2/borderlands2.cpp b/plugins/borderlands2/borderlands2.cpp
index 2ef7b0a1f..4e58f0dfc 100644
--- a/plugins/borderlands2/borderlands2.cpp
+++ b/plugins/borderlands2/borderlands2.cpp
@@ -35,7 +35,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
#include <algorithm>
diff --git a/plugins/breach/breach.cpp b/plugins/breach/breach.cpp
index 605b16a94..16185714b 100644
--- a/plugins/breach/breach.cpp
+++ b/plugins/breach/breach.cpp
@@ -34,7 +34,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
procptr_t posptr, frontptr, topptr;
diff --git a/plugins/cod2/cod2.cpp b/plugins/cod2/cod2.cpp
index 1baef190b..05739facb 100644
--- a/plugins/cod2/cod2.cpp
+++ b/plugins/cod2/cod2.cpp
@@ -5,8 +5,10 @@
#include "ProcessWindows.h"
-#include "mumble_plugin.h"
-#include "mumble_plugin_utils.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_utils.h"
std::unique_ptr< ProcessWindows > process;
diff --git a/plugins/cod4/cod4.cpp b/plugins/cod4/cod4.cpp
index 05c504014..9a6155bdd 100644
--- a/plugins/cod4/cod4.cpp
+++ b/plugins/cod4/cod4.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/cod5/cod5.cpp b/plugins/cod5/cod5.cpp
index cf5982383..e27cfa892 100644
--- a/plugins/cod5/cod5.cpp
+++ b/plugins/cod5/cod5.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &, std::wstring &) {
diff --git a/plugins/codmw2/codmw2.cpp b/plugins/codmw2/codmw2.cpp
index 44b4d9527..9daf9a84f 100644
--- a/plugins/codmw2/codmw2.cpp
+++ b/plugins/codmw2/codmw2.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &, std::wstring &) {
diff --git a/plugins/codmw2so/codmw2so.cpp b/plugins/codmw2so/codmw2so.cpp
index cac4484a7..25122bb62 100644
--- a/plugins/codmw2so/codmw2so.cpp
+++ b/plugins/codmw2so/codmw2so.cpp
@@ -35,7 +35,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &, std::wstring &) {
diff --git a/plugins/cs/cs.cpp b/plugins/cs/cs.cpp
index 2d8e8730e..2097dd8fe 100644
--- a/plugins/cs/cs.cpp
+++ b/plugins/cs/cs.cpp
@@ -35,7 +35,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/dys/dys.cpp b/plugins/dys/dys.cpp
index 946731c3d..2fa0a9034 100644
--- a/plugins/dys/dys.cpp
+++ b/plugins/dys/dys.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/etqw/etqw.cpp b/plugins/etqw/etqw.cpp
index 124848d2a..e5f1a2b57 100644
--- a/plugins/etqw/etqw.cpp
+++ b/plugins/etqw/etqw.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/ffxiv/ffxiv.cpp b/plugins/ffxiv/ffxiv.cpp
index c1643a24c..f7742bcdc 100644
--- a/plugins/ffxiv/ffxiv.cpp
+++ b/plugins/ffxiv/ffxiv.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header.
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
#include <cmath>
diff --git a/plugins/gmod/gmod.cpp b/plugins/gmod/gmod.cpp
index fd2bb2153..d13b9ab88 100644
--- a/plugins/gmod/gmod.cpp
+++ b/plugins/gmod/gmod.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/gtaiv/gtaiv.cpp b/plugins/gtaiv/gtaiv.cpp
index b57cb7d84..18db5d817 100644
--- a/plugins/gtaiv/gtaiv.cpp
+++ b/plugins/gtaiv/gtaiv.cpp
@@ -34,7 +34,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
static unsigned int playerid;
static procptr_t base_address;
diff --git a/plugins/gtasa/gtasa.cpp b/plugins/gtasa/gtasa.cpp
index cb166b5d4..293b2d115 100644
--- a/plugins/gtasa/gtasa.cpp
+++ b/plugins/gtasa/gtasa.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
struct Matrix {
float right[4];
diff --git a/plugins/gtav/gtav.cpp b/plugins/gtav/gtav.cpp
index a10e75888..d00237c76 100644
--- a/plugins/gtav/gtav.cpp
+++ b/plugins/gtav/gtav.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header.
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
#include <algorithm> // Include algorithm header for the game version detector
diff --git a/plugins/gw/gw.cpp b/plugins/gw/gw.cpp
index 567a5d14f..b8fbeab57 100644
--- a/plugins/gw/gw.cpp
+++ b/plugins/gw/gw.cpp
@@ -34,7 +34,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
/*
Arrays of bytes to find addresses accessed by respective functions so we don't have to blindly search for addresses
diff --git a/plugins/insurgency/insurgency.cpp b/plugins/insurgency/insurgency.cpp
index 89f4ce811..f7ce9d405 100644
--- a/plugins/insurgency/insurgency.cpp
+++ b/plugins/insurgency/insurgency.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/jc2/jc2.cpp b/plugins/jc2/jc2.cpp
index 5d8c66b58..521da373e 100644
--- a/plugins/jc2/jc2.cpp
+++ b/plugins/jc2/jc2.cpp
@@ -35,7 +35,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
const unsigned int off_character_manager = 0xD8FB24;
const unsigned int off_local_player = 0x3570;
diff --git a/plugins/link/link-posix.cpp b/plugins/link/link-posix.cpp
index 43306e21b..c29e6de4b 100644
--- a/plugins/link/link-posix.cpp
+++ b/plugins/link/link-posix.cpp
@@ -3,7 +3,8 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
#include <stdint.h>
#include <stdio.h>
diff --git a/plugins/link/link.cpp b/plugins/link/link.cpp
index a899affd5..f98bed2e4 100644
--- a/plugins/link/link.cpp
+++ b/plugins/link/link.cpp
@@ -10,7 +10,8 @@
#include <windows.h>
#include <math.h>
-#include "../mumble_plugin.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
static std::wstring wsPluginName;
static std::wstring wsDescription;
diff --git a/plugins/lol/lol.cpp b/plugins/lol/lol.cpp
index 9746cc4a8..4f70ced4f 100644
--- a/plugins/lol/lol.cpp
+++ b/plugins/lol/lol.cpp
@@ -34,7 +34,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
/*
Arrays of bytes to find addresses accessed by respective functions so we don't have to blindly search for addresses
diff --git a/plugins/lotro/lotro.cpp b/plugins/lotro/lotro.cpp
index ec5c79cb1..f3562236f 100644
--- a/plugins/lotro/lotro.cpp
+++ b/plugins/lotro/lotro.cpp
@@ -34,7 +34,10 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &context, std::wstring &) {
diff --git a/plugins/mumble_plugin.h b/plugins/mumble_legacy_plugin.h
index bed4383aa..14c35cf40 100644
--- a/plugins/mumble_plugin.h
+++ b/plugins/mumble_legacy_plugin.h
@@ -1,10 +1,23 @@
-// Copyright 2005-2021 The Mumble Developers. All rights reserved.
+// Copyright 2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#ifndef MUMBLE_MUMBLE_PLUGIN_H_
-#define MUMBLE_MUMBLE_PLUGIN_H_
+// This header describes the deprecated "plugin" API from the times in which "plugins" could only be used
+// alongside the positional audio feature of Mumble.
+// By default translation units including this file will not compile due to a preprocessor error. This is intended
+// behaviour as you shouldn't be using this API any longer. Use the API from MumblePlugin.h instead.
+//
+// If for some reason you absolutely have to include this header file, you have to define the macro MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+// before including this header.
+#ifndef MUMBLE_LEGACY_PLUGIN_H_
+#define MUMBLE_LEGACY_PLUGIN_H_
+
+#ifndef MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+ #error "You are trying to use a deprecated plugin API. Use the new API from MumblePlugin.h instead. If you think you really need this deprecated one, see the instructions at the top of this file."
+#else
+ #undef MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#endif
#include <stdint.h>
diff --git a/plugins/mumble_plugin_linux.h b/plugins/mumble_positional_audio_linux.h
index 15a26f26e..6758e63b8 100644
--- a/plugins/mumble_plugin_linux.h
+++ b/plugins/mumble_positional_audio_linux.h
@@ -1,16 +1,16 @@
-// Copyright 2016-2021 The Mumble Developers. All rights reserved.
+// Copyright 2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#ifndef MUMBLE_PLUGIN_LINUX_H_
-#define MUMBLE_PLUGIN_LINUX_H_
+#ifndef MUMBLE_POSITIONAL_AUDIO_LINUX_H_
+#define MUMBLE_POSITIONAL_AUDIO_LINUX_H_
-#ifndef MUMBLE_PLUGIN_MAIN_H_
-# error "Include mumble_plugin_main.h instead of mumble_plugin_linux.h"
+#ifndef MUMBLE_POSITIONAL_AUDIO_MAIN_H_
+# error "Include mumble_positional_audio_main.h instead of mumble_positional_audio_linux.h"
#endif
-#include "mumble_plugin_utils.h"
+#include "mumble_positional_audio_utils.h"
#include <cstring>
#include <elf.h>
diff --git a/plugins/mumble_plugin_main.h b/plugins/mumble_positional_audio_main.h
index 1024c431b..c8966535f 100644
--- a/plugins/mumble_plugin_main.h
+++ b/plugins/mumble_positional_audio_main.h
@@ -1,4 +1,4 @@
-// Copyright 2019-2021 The Mumble Developers. All rights reserved.
+// Copyright 2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
@@ -11,15 +11,14 @@
// base address of a module (e.g. shared library), the latter reads memory at the
// specified address and stores it in a variable.
-#ifndef MUMBLE_PLUGIN_MAIN_H_
-#define MUMBLE_PLUGIN_MAIN_H_
+#ifndef MUMBLE_POSITIONAL_AUDIO_MAIN_H_
+#define MUMBLE_POSITIONAL_AUDIO_MAIN_H_
#if !defined(OS_WINDOWS) && !defined(OS_LINUX)
# error "Please define either OS_WINDOWS or OS_LINUX"
#endif
-#include "mumble_plugin.h"
-#include "mumble_plugin_win32_internals.h"
+#include "mumble_positional_audio_win32_internals.h"
#include <chrono>
#include <cstring>
@@ -228,10 +227,10 @@ static inline int8_t isWin32Process64Bit(const procptr_t &baseAddress) {
}
}
-#ifdef OS_WINDOWS
-# include "../mumble_plugin_win32.h"
+#ifdef WIN32
+# include "../mumble_positional_audio_win32.h"
#else
-# include "../mumble_plugin_linux.h"
+# include "../mumble_positional_audio_linux.h"
#endif
#endif
diff --git a/plugins/mumble_plugin_utils.h b/plugins/mumble_positional_audio_utils.h
index 355239d2c..ca6b5b4f0 100644
--- a/plugins/mumble_plugin_utils.h
+++ b/plugins/mumble_positional_audio_utils.h
@@ -1,10 +1,10 @@
-// Copyright 2016-2021 The Mumble Developers. All rights reserved.
+// Copyright 2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#ifndef MUMBLE_MUMBLE_PLUGIN_UTILS_H_
-#define MUMBLE_MUMBLE_PLUGIN_UTILS_H_
+#ifndef MUMBLE_POSITIONAL_AUDIO_UTILS_H_
+#define MUMBLE_POSITIONAL_AUDIO_UTILS_H_
#include <cmath>
#include <codecvt>
diff --git a/plugins/mumble_plugin_win32.h b/plugins/mumble_positional_audio_win32.h
index b2d530579..246002d01 100644
--- a/plugins/mumble_plugin_win32.h
+++ b/plugins/mumble_positional_audio_win32.h
@@ -1,13 +1,13 @@
-// Copyright 2010-2021 The Mumble Developers. All rights reserved.
+// Copyright 2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#ifndef MUMBLE_MUMBLE_PLUGIN_WIN32_H_
-#define MUMBLE_MUMBLE_PLUGIN_WIN32_H_
+#ifndef MUMBLE_POSITIONAL_AUDIO_WIN32_H_
+#define MUMBLE_POSITIONAL_AUDIO_WIN32_H_
-#ifndef MUMBLE_PLUGIN_MAIN_H_
-# error "Include mumble_plugin_main.h instead of mumble_plugin_win32.h"
+#ifndef MUMBLE_POSITIONAL_AUDIO_MAIN_H_
+# error "Include mumble_positional_audio_main.h instead of mumble_positional_audio_win32.h"
#endif
#include <stdio.h>
diff --git a/plugins/mumble_plugin_win32_internals.h b/plugins/mumble_positional_audio_win32_internals.h
index 81662589e..671a39dac 100644
--- a/plugins/mumble_plugin_win32_internals.h
+++ b/plugins/mumble_positional_audio_win32_internals.h
@@ -1,10 +1,10 @@
-// Copyright 2019-2021 The Mumble Developers. All rights reserved.
+// Copyright 2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#ifndef MUMBLE_MUMBLE_PLUGIN_WIN32_INTERNALS_H_
-#define MUMBLE_MUMBLE_PLUGIN_WIN32_INTERNALS_H_
+#ifndef MUMBLE_MUMBLE_POSITIONAL_AUDIO_WIN32_INTERNALS_H_
+#define MUMBLE_MUMBLE_POSITIONAL_AUDIO_WIN32_INTERNALS_H_
// These structures represent the header(s) of an NT image.
//
diff --git a/plugins/null_plugin.cpp b/plugins/null_plugin.cpp
index a41f30444..ed9d38cce 100644
--- a/plugins/null_plugin.cpp
+++ b/plugins/null_plugin.cpp
@@ -3,7 +3,8 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "mumble_plugin.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "mumble_legacy_plugin.h"
#ifndef NULL_DESC
# define NULL_DESC L"Retracted plugin"
diff --git a/plugins/ql/ql.cpp b/plugins/ql/ql.cpp
index 0905c2bd0..69c0441a3 100644
--- a/plugins/ql/ql.cpp
+++ b/plugins/ql/ql.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header.
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &context, std::wstring &identity) {
diff --git a/plugins/rl/rl.cpp b/plugins/rl/rl.cpp
index eabe7707c..5d8ee9f0a 100644
--- a/plugins/rl/rl.cpp
+++ b/plugins/rl/rl.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
#ifdef WIN32
// Memory offsets
diff --git a/plugins/se/se.cpp b/plugins/se/se.cpp
index f048ea3ad..15bcd759f 100644
--- a/plugins/se/se.cpp
+++ b/plugins/se/se.cpp
@@ -3,8 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "mumble_plugin.h"
-#include "mumble_plugin_utils.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_utils.h"
#ifdef OS_LINUX
# include "ProcessLinux.h"
diff --git a/plugins/sr/sr.cpp b/plugins/sr/sr.cpp
index 0482179d6..9ec80b8f7 100644
--- a/plugins/sr/sr.cpp
+++ b/plugins/sr/sr.cpp
@@ -35,7 +35,10 @@
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string & /*context*/, std::wstring & /*identity*/) {
diff --git a/plugins/testPlugin/CMakeLists.txt b/plugins/testPlugin/CMakeLists.txt
new file mode 100644
index 000000000..6dea29e32
--- /dev/null
+++ b/plugins/testPlugin/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Copyright 2021 The Mumble Developers. All rights reserved.
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file at the root of the
+# Mumble source tree or at <https://www.mumble.info/LICENSE>.
+
+if(${CMAKE_BUILD_TYPE} MATCHES Debug)
+ message("Including TestPlugin in debug mode")
+ add_library(testPlugin SHARED "testPlugin.cpp")
+endif()
diff --git a/plugins/testPlugin/testPlugin.cpp b/plugins/testPlugin/testPlugin.cpp
new file mode 100644
index 000000000..e18822fed
--- /dev/null
+++ b/plugins/testPlugin/testPlugin.cpp
@@ -0,0 +1,480 @@
+// Copyright 2021 The Mumble Developers. All rights reserved.
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file at the root of the
+// Mumble source tree or at <https://www.mumble.info/LICENSE>.
+
+// Include the definitions of the plugin functions
+// Not that this will also include ../PluginComponents.h
+#include "../MumblePlugin_v_1_0_x.h"
+#include "../MumbleAPI_v_1_0_x.h"
+
+#include <iostream>
+#include <cstring>
+
+// These are just some utility functions facilitating writing logs and the like
+// The actual implementation of the plugin is further down
+std::ostream& pLog() {
+ std::cout << "TestPlugin: ";
+ return std::cout;
+}
+
+template<typename T>
+void pluginLog(T log) {
+ pLog() << log << std::endl;
+}
+
+std::ostream& operator<<(std::ostream& stream, const mumble_version_t version) {
+ stream << "v" << version.major << "." << version.minor << "." << version.patch;
+ return stream;
+}
+
+
+//////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////
+//////////////////// PLUGIN IMPLEMENTATION ///////////////////
+//////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////
+
+MumbleAPI_v_1_0_x mumAPI;
+mumble_connection_t activeConnection;
+mumble_plugin_id_t ownID;
+
+//////////////////////////////////////////////////////////////
+//////////////////// OBLIGATORY FUNCTIONS ////////////////////
+//////////////////////////////////////////////////////////////
+// All of the following function must be implemented in order for Mumble to load the plugin
+
+mumble_error_t mumble_init(uint32_t id) {
+ pluginLog("Initialized plugin");
+
+ ownID = id;
+
+ // Print the connection ID at initialization. If not connected to a server it should be -1.
+ pLog() << "Plugin ID is " << id << std::endl;
+
+ mumAPI.log(ownID, "Intitialized");
+
+ // Little showcase for how to retrieve a setting from Mumble
+ int64_t voiceHold;
+ mumble_error_t error = mumAPI.getMumbleSetting_int(ownID, MSK_AUDIO_INPUT_VOICE_HOLD, &voiceHold);
+ if (error == STATUS_OK) {
+ pLog() << "The voice hold is set to " << voiceHold << std::endl;
+ } else {
+ pluginLog("Failed to retrieve voice hold");
+ pLog() << errorMessage(error) << std::endl;
+ }
+
+ // STATUS_OK is a macro set to the appropriate status flag (ErrorCode)
+ // If you need to return any other status have a look at the ErrorCode enum
+ // inside PluginComponents.h and use one of its values
+ return STATUS_OK;
+}
+
+void mumble_shutdown() {
+ pluginLog("Shutdown plugin");
+
+ mumAPI.log(ownID, "Shutdown");
+}
+
+MumbleStringWrapper mumble_getName() {
+ static const char *name = "TestPlugin";
+
+ MumbleStringWrapper wrapper;
+ wrapper.data = name;
+ wrapper.size = strlen(name);
+ // It's a static String and therefore doesn't need releasing
+ wrapper.needsReleasing = false;
+
+ return wrapper;
+}
+
+mumble_version_t mumble_getAPIVersion() {
+ // MUMBLE_PLUGIN_API_VERSION will always contain the API version of the used header file (the one used to build
+ // this plugin against). Thus you should always return that here in order to no have to worry about it.
+ return MUMBLE_PLUGIN_API_VERSION;
+}
+
+void mumble_registerAPIFunctions(void *api) {
+ // In this function the plugin is presented with a struct of function pointers that can be used
+ // to interact with Mumble. Thus you should store it somewhere safe for later usage.
+
+ // The pointer has to be cast to the respective API struct. You always have to cast to the same API version
+ // as this plugin itself is using. Thus if this plugin is compiled using the API version 1.0.x (where x is an arbitrary version)
+ // the pointer has to be cast to MumbleAPI_v_1_0_x (where x is a literal "x").
+ // Furthermore the struct HAS TO BE COPIED!!! Storing the pointer is not an option as it will become invalid quickly!
+
+ // **If** you are using the same API version that is specified in the included header file (as you should), you
+ // can simply use the MUMBLE_API_CAST to cast the pointer to the correct type and automatically dereferencing it.
+ mumAPI = MUMBLE_API_CAST(api);
+
+ pluginLog("Registered Mumble's API functions");
+}
+
+void mumble_releaseResource(const void *pointer) {
+ std::cerr << "[ERROR]: Unexpected call to mumble_releaseResources" << std::endl;
+ std::terminate();
+ // This plugin doesn't use resources that are explicitly allocated (only static Strings are used). Therefore
+ // we don't have to implement this function.
+ //
+ // If you allocated resources using malloc(), you're implementation for releasing that would be
+ // free(const_cast<void *>(pointer));
+ //
+ // If however you allocated a resource using the new operator (C++ only), you have figure out the pointer's
+ // original type and then invoke
+ // delete static_cast<ActualType *>(pointer);
+
+ // Mark as unused
+ (void) pointer;
+}
+
+
+//////////////////////////////////////////////////////////////
+///////////////////// OPTIONAL FUNCTIONS /////////////////////
+//////////////////////////////////////////////////////////////
+// The implementation of below functions is optional. If you don't need them, don't include them in your
+// plugin
+
+void mumble_setMumbleInfo(mumble_version_t mumbleVersion, mumble_version_t mumbleAPIVersion, mumble_version_t minimumExpectedAPIVersion) {
+ // this function will always be the first one to be called. Even before init()
+ // In here you can get info about the Mumble version this plugin is about to run in.
+ pLog() << "Mumble version: " << mumbleVersion << "; Mumble API-Version: " << mumbleAPIVersion << "; Minimal expected API-Version: "
+ << minimumExpectedAPIVersion << std::endl;
+}
+
+mumble_version_t mumble_getVersion() {
+ // Mumble uses semantic versioning (see https://semver.org/)
+ // { major, minor, patch }
+ return { 1, 0, 0 };
+}
+
+MumbleStringWrapper mumble_getAuthor() {
+ static const char *author = "MumbleDevelopers";
+
+ MumbleStringWrapper wrapper;
+ wrapper.data = author;
+ wrapper.size = strlen(author);
+ // It's a static String and therefore doesn't need releasing
+ wrapper.needsReleasing = false;
+
+ return wrapper;
+}
+
+MumbleStringWrapper mumble_getDescription() {
+ static const char *description =
+ "This plugin is merely a reference implementation without any real functionality. It shouldn't be included in the release build of Mumble.";
+
+ MumbleStringWrapper wrapper;
+ wrapper.data = description;
+ wrapper.size = strlen(description);
+ // It's a static String and therefore doesn't need releasing
+ wrapper.needsReleasing = false;
+
+ return wrapper;
+}
+
+uint32_t mumble_getFeatures() {
+ // Tells Mumble whether this plugin delivers some known common functionality. See the PluginFeature enum in
+ // PluginComponents.h for what is available.
+ // If you want your plugin to deliver positional data, you'll want to return FEATURE_POSITIONAL
+ return FEATURE_NONE;
+}
+
+uint32_t mumble_deactivateFeatures(uint32_t features) {
+ pLog() << "Asked to deactivate feature set " << features << std::endl;
+
+ // All features that can't be deactivated should be returned
+ return features;
+}
+
+uint8_t mumble_initPositionalData(const char *const*programNames, const uint64_t *programPIDs, size_t programCount) {
+ std::ostream& stream = pLog() << "Got " << programCount << " programs to init positional data.";
+
+ if (programCount > 0) {
+ stream << " The first name is " << programNames[0] << " and has PID " << programPIDs[0];
+ }
+
+ stream << std::endl;
+
+ // As this plugin doesn't provide PD, we return PDEC_ERROR_PERM to indicate that even in the future we won't do so
+ // If your plugin is indeed delivering positional data but is only temporarily unable to do so, return PDEC_ERROR_TEMP.
+ // and if you deliver PD and succeeded initializing return PDEC_OK.
+ return PDEC_ERROR_PERM;
+}
+
+#define SET_TO_ZERO(name) name[0] = 0.0f; name[1] = 0.0f; name[2] = 0.0f
+bool mumble_fetchPositionalData(float *avatarPos, float *avatarDir, float *avatarAxis, float *cameraPos, float *cameraDir,
+ float *cameraAxis, const char **context, const char **identity) {
+ pluginLog("Has been asked to deliver positional data");
+
+ // If unable to provide positional data, this function should return false and reset all given values to 0 / empty Strings
+ SET_TO_ZERO(avatarPos);
+ SET_TO_ZERO(avatarDir);
+ SET_TO_ZERO(avatarAxis);
+ SET_TO_ZERO(cameraPos);
+ SET_TO_ZERO(cameraDir);
+ SET_TO_ZERO(cameraAxis);
+ *context = "";
+ *identity = "";
+
+ // This function returns whether it can continue to deliver positional data
+ return false;
+}
+#undef SET_TO_ZERO
+
+void mumble_shutdownPositionalData() {
+ pluginLog("Shutting down positional data");
+}
+
+void mumble_onServerConnected(mumble_connection_t connection) {
+ activeConnection = connection;
+
+ pLog() << "Established server-connection with ID " << connection << std::endl;
+
+ // Use API function that'll block
+ mumAPI.log(ownID, "Connected to a server");
+}
+
+void mumble_onServerDisconnected(mumble_connection_t connection) {
+ activeConnection = -1;
+
+ const char *serverHash;
+ if (mumAPI.getServerHash(ownID, connection, &serverHash) == STATUS_OK) {
+ pLog() << "Disconnected from server-connection with ID " << connection << "(hash: " << serverHash << ")" << std::endl;
+
+ mumAPI.freeMemory(ownID, serverHash);
+ } else {
+ pluginLog("[ERROR]: mumble_onServerDisconnected - Unable to fetch server-hash");
+ }
+}
+
+void mumble_onServerSynchronized(mumble_connection_t connection) {
+ // The client has finished synchronizing with the server. Thus we can now obtain a list of all users on this server
+ const char *serverHash;
+ if (mumAPI.getServerHash(ownID, connection, &serverHash) == STATUS_OK) {
+ pLog() << "Server has finished synchronizing (ServerConnection: " << connection << "; hash: " << serverHash << ")" << std::endl ;
+
+ mumAPI.freeMemory(ownID, serverHash);
+ } else {
+ pluginLog("[ERROR]: mumble_onServerSynchronized - Unable to fetch server-hash");
+ }
+
+ size_t userCount;
+ mumble_userid_t *userIDs;
+
+ if (mumAPI.getAllUsers(ownID, activeConnection, &userIDs, &userCount) != STATUS_OK) {
+ pluginLog("[ERROR]: Can't obtain user list");
+ return;
+ }
+
+ mumble_userid_t localUserID;
+ if (mumAPI.getLocalUserID(ownID, connection, &localUserID) != STATUS_OK) {
+ pluginLog("[ERROR]: Can't obtain ID of local user");
+ return;
+ }
+
+ pLog() << "There are " << userCount << " users on this server. Their names are:" << std::endl;
+
+ for(size_t i=0; i<userCount; i++) {
+ const char *userName;
+ if (mumAPI.getUserName(ownID, connection, userIDs[i], &userName) != STATUS_OK) {
+ pLog() << "<Unable to fetch user name>" << std::endl;
+ continue;
+ }
+
+ const char *userHash;
+ if (mumAPI.getUserHash(ownID, connection, userIDs[i], &userHash) != STATUS_OK) {
+ pluginLog("<Unable to get user-hash>");
+ }
+
+ pLog() << "\t" << userName << " (" << userHash << ")" << std::endl;
+
+ // Mute the user "MuteMe" if this is not the name of the local user (in which case it'd fail)
+ if (userIDs[i] != localUserID && std::strcmp(userName, "MuteMe") == 0) {
+ if (mumAPI.requestLocalMute(ownID, connection, userIDs[i], true) != STATUS_OK) {
+ pluginLog("[ERROR]: Failed at muting user \"MuteMe\"!");
+ }
+ }
+
+ mumAPI.freeMemory(ownID, userName);
+ mumAPI.freeMemory(ownID, userHash);
+ }
+
+ mumAPI.freeMemory(ownID, userIDs);
+
+ size_t channelCount;
+ mumble_channelid_t *channelIDs;
+
+ if (mumAPI.getAllChannels(ownID, activeConnection, &channelIDs, &channelCount) != STATUS_OK) {
+ pluginLog("[ERROR]: Failed to fetch channel list!");
+ return;
+ }
+
+ pLog() << "There are " << channelCount << " channels on this server" << std::endl;
+
+ mumAPI.freeMemory(ownID, channelIDs);
+
+ mumble_userid_t localUser;
+ if (mumAPI.getLocalUserID(ownID, activeConnection, &localUser) != STATUS_OK) {
+ pluginLog("Failed to retrieve local user ID");
+ return;
+ }
+
+ if (mumAPI.sendData(ownID, activeConnection, &localUser, 1, reinterpret_cast<const uint8_t *>("Just a test"), 12, "testMsg") == STATUS_OK) {
+ pluginLog("Successfully sent plugin message");
+
+ // Try break the rate-limiter for plugin messages
+ for (int i = 0; i < 40; i++) {
+ std::string data = "Rate-limit message #" + std::to_string(i);
+
+ mumAPI.sendData(ownID, activeConnection, &localUser, 1, reinterpret_cast<const uint8_t * >(data.c_str()), data.size(), "testMsg");
+ }
+ } else {
+ pluginLog("Failed at sending message");
+ }
+
+ if (mumAPI.requestSetLocalUserComment(ownID, connection, "This user has the TestPlugin enabled - <b>hand over a cookie!</b>") != STATUS_OK) {
+ pluginLog("Failed at setting the local user's comment");
+ }
+}
+
+void mumble_onChannelEntered(mumble_connection_t connection, mumble_userid_t userID, mumble_channelid_t previousChannelID, mumble_channelid_t newChannelID) {
+ std::ostream& stream = pLog() << "User with ID " << userID << " entered channel with ID " << newChannelID << ".";
+
+ // negative ID means that there was no previous channel (e.g. because the user just connected)
+ if (previousChannelID >= 0) {
+ stream << " Came from channel with ID " << previousChannelID << ".";
+ }
+
+ stream << " (ServerConnection: " << connection << ")" << std::endl;
+}
+
+void mumble_onChannelExited(mumble_connection_t connection, mumble_userid_t userID, mumble_channelid_t channelID) {
+ pLog() << "User with ID " << userID << " has left channel with ID " << channelID << ". (ServerConnection: " << connection << ")" << std::endl;
+}
+
+void mumble_onUserTalkingStateChanged(mumble_connection_t connection, mumble_userid_t userID, mumble_talking_state_t talkingState) {
+ std::ostream& stream = pLog() << "User with ID " << userID << " changed his talking state to ";
+
+ // The possible values are contained in the TalkingState enum inside PluginComponent.h
+ switch(talkingState) {
+ case INVALID:
+ stream << "Invalid";
+ break;
+ case PASSIVE:
+ stream << "Passive";
+ break;
+ case TALKING:
+ stream << "Talking";
+ break;
+ case WHISPERING:
+ stream << "Whispering";
+ break;
+ case SHOUTING:
+ stream << "Shouting";
+ break;
+ default:
+ stream << "Unknown (" << talkingState << ")";
+ }
+
+ stream << ". (ServerConnection: " << connection << ")" << std::endl;
+}
+
+bool mumble_onAudioInput(short *inputPCM, uint32_t sampleCount, uint16_t channelCount, uint32_t sampleRate, bool isSpeech) {
+ // pLog() << "Audio input with " << channelCount << " channels and " << sampleCount << " samples per channel encountered. IsSpeech: "
+ // << isSpeech << " Sample rate is " << sampleRate << "Hz" << std::endl;
+
+ // mark variables as unused
+ (void) inputPCM;
+ (void) sampleCount;
+ (void) channelCount;
+ (void) sampleRate;
+ (void) isSpeech;
+
+ // This function returns whether it has modified the audio stream
+ return false;
+}
+
+bool mumble_onAudioSourceFetched(float *outputPCM, uint32_t sampleCount, uint16_t channelCount, uint32_t sampleRate, bool isSpeech, mumble_userid_t userID) {
+ std::ostream& stream = pLog() << "Audio output source with " << channelCount << " channels and " << sampleCount << " samples per channel "
+ << "(" << sampleRate << " Hz) fetched.";
+
+ if (isSpeech) {
+ stream << " The output is speech from user with ID " << userID << ".";
+ }
+
+ stream << std::endl;
+
+ // Mark ouputPCM as unused
+ (void) outputPCM;
+
+ // This function returns whether it has modified the audio stream
+ return false;
+}
+
+bool mumble_onAudioOutputAboutToPlay(float *outputPCM, uint32_t sampleCount, uint16_t channelCount, uint32_t sampleRate) {
+ // pLog() << "The resulting audio output has " << channelCount << " channels with " << sampleCount << " samples per channel ("
+ // sampleRate << " Hz)" << std::endl;
+
+ // mark variables as unused
+ (void) outputPCM;
+ (void) sampleCount;
+ (void) channelCount;
+ (void) sampleRate;
+
+ // This function returns whether it has modified the audio stream
+ return false;
+}
+
+bool mumble_onReceiveData(mumble_connection_t connection, mumble_userid_t sender, const uint8_t *data, size_t dataLength, const char *dataID) {
+ pLog() << "Received data with ID \"" << dataID << "\" from user with ID " << sender << ". Its length is " << dataLength
+ << ". (ServerConnection:" << connection << ")" << std::endl;
+
+ if (std::strcmp(dataID, "testMsg") == 0) {
+ // We know that data is only a normal C-encoded String, so the reinterpret_cast is safe
+ pLog() << "The received data: " << reinterpret_cast<const char *>(data) << std::endl;
+ }
+
+ // This function returns whether it has processed the data (preventing further plugins from seeing it)
+ return false;
+}
+
+void mumble_onUserAdded(mumble_connection_t connection, mumble_userid_t userID) {
+ pLog() << "Added user with ID " << userID << " (ServerConnection: " << connection << ")" << std::endl;
+}
+
+void mumble_onUserRemoved(mumble_connection_t connection, mumble_userid_t userID) {
+ pLog() << "Removed user with ID " << userID << " (ServerConnection: " << connection << ")" << std::endl;
+}
+
+void mumble_onChannelAdded(mumble_connection_t connection, mumble_channelid_t channelID) {
+ pLog() << "Added channel with ID " << channelID << " (ServerConnection: " << connection << ")" << std::endl;
+}
+
+void mumble_onChannelRemoved(mumble_connection_t connection, mumble_channelid_t channelID) {
+ pLog() << "Removed channel with ID " << channelID << " (ServerConnection: " << connection << ")" << std::endl;
+}
+
+void mumble_onChannelRenamed(mumble_connection_t connection, mumble_channelid_t channelID) {
+ pLog() << "Renamed channel with ID " << channelID << " (ServerConnection: " << connection << ")" << std::endl;
+}
+
+void mumble_onKeyEvent(uint32_t keyCode, bool wasPress) {
+ pLog() << "Encountered key " << (wasPress ? "press" : "release") << " of key with code " << keyCode << std::endl;
+}
+
+bool mumble_hasUpdate() {
+ // This plugin never has an update
+ return false;
+}
+
+MumbleStringWrapper mumble_getUpdateDownloadURL() {
+ static const char *url = "https://i.dont.exist/testplugin.zip";
+
+ MumbleStringWrapper wrapper;
+ wrapper.data = url;
+ wrapper.size = strlen(url);
+ // It's a static String and therefore doesn't need releasing
+ wrapper.needsReleasing = false;
+
+ return wrapper;
+}
diff --git a/plugins/ut2004/ut2004.cpp b/plugins/ut2004/ut2004.cpp
index 07a490fe1..1da0776ed 100644
--- a/plugins/ut2004/ut2004.cpp
+++ b/plugins/ut2004/ut2004.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/ut3/ut3.cpp b/plugins/ut3/ut3.cpp
index bcf6d50c2..981ef29a3 100644
--- a/plugins/ut3/ut3.cpp
+++ b/plugins/ut3/ut3.cpp
@@ -3,7 +3,10 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
using namespace std;
diff --git a/plugins/ut99/ut99.cpp b/plugins/ut99/ut99.cpp
index 8831452ba..7ee98151a 100644
--- a/plugins/ut99/ut99.cpp
+++ b/plugins/ut99/ut99.cpp
@@ -34,8 +34,11 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "../mumble_plugin_main.h"
-#include "../mumble_plugin_utils.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
+#include "../mumble_positional_audio_utils.h"
procptr_t posptr;
procptr_t frtptr;
diff --git a/plugins/wolfet/wolfet.cpp b/plugins/wolfet/wolfet.cpp
index a8827ae69..2dda0e743 100644
--- a/plugins/wolfet/wolfet.cpp
+++ b/plugins/wolfet/wolfet.cpp
@@ -47,7 +47,10 @@
Increasing when turning left.
*/
-#include "../mumble_plugin_main.h"
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h"
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &context, std::wstring &) {
diff --git a/plugins/wow/wow.cpp b/plugins/wow/wow.cpp
index 5a4ffed6d..e64fe9b89 100644
--- a/plugins/wow/wow.cpp
+++ b/plugins/wow/wow.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header.
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &context, std::wstring &identity) {
diff --git a/plugins/wow_x64/wow_x64.cpp b/plugins/wow_x64/wow_x64.cpp
index f6ea550ad..50b04f6ad 100644
--- a/plugins/wow_x64/wow_x64.cpp
+++ b/plugins/wow_x64/wow_x64.cpp
@@ -3,8 +3,11 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_main.h" // Include standard plugin header.
-#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
+#define MUMBLE_ALLOW_DEPRECATED_LEGACY_PLUGIN_API
+#include "../mumble_legacy_plugin.h"
+
+#include "../mumble_positional_audio_main.h" // Include standard positional audio header.
+#include "../mumble_positional_audio_utils.h" // Include positional audio header for special functions, like "escape".
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front,
float *camera_top, std::string &context, std::wstring &identity) {