Skip to content

Commit

Permalink
FEAT(client): Plugin framework
Browse files Browse the repository at this point in the history
This commit introduces a new plugin framework into the codebase of the
Mumble client. Note that "plugin" here really refers to a (more or less)
general purpose plugin and is therefore not to be confused with the
previously available positional data plugins (only responsible for
fetching positional data from a running game and passing that to
Mumble).

The plugin interface is written in C, removing the compiler-dependence
the old "plugins" had. Instead plugins can now be written in an
arbitrary language as long as that language is capable of being compiled
into a shared library and also being capable of being C-compatible.

As already indicated a plugin is essentially a shared library that
provides certain functions that allow Mumble to interface with it.

Inside Mumble the so-called PluginManager is responsible for managing
the plugins and relaying events to the respective callbacks. Plugins
themselves can also interact with Mumble on their own initiative by
using the provided API functions.

Fixes #2455
Fixes #2148
Fixes #1594
Fixes #2051
Fixes #3742
Fixes #4575
Fixes #4751
  • Loading branch information
Krzmbrzl committed Apr 15, 2021
1 parent c10d636 commit a831091
Show file tree
Hide file tree
Showing 130 changed files with 9,942 additions and 1,145 deletions.
3 changes: 2 additions & 1 deletion .ci/azure-pipelines/install-environment_linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ sudo apt-get -y install build-essential g++-multilib ninja-build pkg-config \
libasound2-dev libasound2-plugins libasound2-plugins-extra\
libogg-dev libsndfile1-dev libspeechd-dev \
libavahi-compat-libdnssd-dev libzeroc-ice-dev \
zsync appstream libgrpc++-dev protobuf-compiler-grpc
zsync appstream libgrpc++-dev protobuf-compiler-grpc \
libpoco-dev
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ freebsd_instance:
freebsd_task:
pkg_script:
- pkg update && pkg upgrade -y
- pkg install -y git ninja pkgconf cmake qt5-buildtools qt5-qmake qt5-linguisttools qt5-concurrent qt5-network qt5-xml qt5-sql qt5-svg qt5-testlib boost-libs libsndfile protobuf ice avahi-libdns grpc
- pkg install -y git ninja pkgconf cmake qt5-buildtools qt5-qmake qt5-linguisttools qt5-concurrent qt5-network qt5-xml qt5-sql qt5-svg qt5-testlib boost-libs libsndfile protobuf ice avahi-libdns grpc poco
fetch_submodules_script: git submodule --quiet update --init --recursive
build_script:
- mkdir build && cd build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ sudo apt -y install \
zsync \
appstream \
libgrpc++-dev \
protobuf-compiler-grpc
protobuf-compiler-grpc \
libpoco-dev
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ project(Mumble
)

set(3RDPARTY_DIR "${CMAKE_SOURCE_DIR}/3rdparty")
set(PLUGINS_DIR "${CMAKE_SOURCE_DIR}/plugins")

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
Expand Down
10 changes: 10 additions & 0 deletions docs/dev/build-instructions/cmake_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ Build 32 bit overlay library, necessary for the overlay to work with 32 bit proc
Build package.
(Default: OFF)

### plugin-callback-debug

Build Mumble with debug output for plugin callbacks inside of Mumble.
(Default: OFF)

### plugin-debug

Build Mumble with debug output for plugin developers.
(Default: OFF)

### plugins

Build plugins.
Expand Down
5 changes: 5 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion plugins/HostLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "HostLinux.h"

#include "mumble_plugin_utils.h"
#include "mumble_positional_audio_utils.h"

#include <cstring>
#include <sstream>
Expand Down
2 changes: 1 addition & 1 deletion plugins/HostWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "HostWindows.h"

#include "mumble_plugin_utils.h"
#include "mumble_positional_audio_utils.h"

#include <windows.h>
#include <tlhelp32.h>
Expand Down
492 changes: 492 additions & 0 deletions plugins/MumbleAPI_v_1_0_x.h

Large diffs are not rendered by default.

402 changes: 402 additions & 0 deletions plugins/MumblePlugin_v_1_0_x.h

Large diffs are not rendered by default.

Loading

0 comments on commit a831091

Please sign in to comment.