Skip to content

Commit

Permalink
Update Wireplumber API to 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tokyovigilante committed Feb 14, 2024
1 parent 1dce607 commit 25cd5ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 4 additions & 0 deletions include/modules/wireplumber.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#pragma once


#include <fmt/format.h>
#include <wp/wp.h>

#define WP_LOCAL_LOG_TOPIC wp_waybar
WP_LOG_TOPIC_EXTERN (wp_waybar)

Check warning on line 8 in include/modules/wireplumber.hpp

View workflow job for this annotation

GitHub Actions / build

include/modules/wireplumber.hpp:8:22 [readability-identifier-naming]

invalid case style for variable 'wp_waybar'

#include <algorithm>
#include <array>

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ libevdev = dependency('libevdev', required: get_option('libevdev'))
libmpdclient = dependency('libmpdclient', required: get_option('mpd'))
xkbregistry = dependency('xkbregistry')
libjack = dependency('jack', required: get_option('jack'))
libwireplumber = dependency('wireplumber-0.4', required: get_option('wireplumber'))
libwireplumber = dependency('wireplumber-0.5', required: get_option('wireplumber'))

libsndio = compiler.find_library('sndio', required: get_option('sndio'))
if libsndio.found()
Expand Down
14 changes: 5 additions & 9 deletions src/modules/wireplumber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ waybar::modules::Wireplumber::Wireplumber(const std::string& id, const Json::Val
volume_(0.0),
min_step_(0.0),
node_id_(0) {
wp_init(WP_INIT_PIPEWIRE);
wp_init(WP_INIT_ALL);
wp_core_ = wp_core_new(NULL, NULL);
apis_ = g_ptr_array_new_with_free_func(g_object_unref);
om_ = wp_object_manager_new();
Expand Down Expand Up @@ -255,15 +255,11 @@ void waybar::modules::Wireplumber::loadRequiredApiModules() {
spdlog::debug("[{}]: loading required modules", name_);
g_autoptr(GError) error = NULL;

if (!wp_core_load_component(wp_core_, "libwireplumber-module-default-nodes-api", "module", NULL,
&error)) {
throw std::runtime_error(error->message);
}
wp_core_load_component(wp_core_, "libwireplumber-module-default-nodes-api", "module", NULL,
NULL, NULL, NULL, nullptr);

if (!wp_core_load_component(wp_core_, "libwireplumber-module-mixer-api", "module", NULL,
&error)) {
throw std::runtime_error(error->message);
}
wp_core_load_component(wp_core_, "libwireplumber-module-mixer-api", "module", NULL,
NULL, NULL, NULL, nullptr);

g_ptr_array_add(apis_, wp_plugin_find(wp_core_, "default-nodes-api"));
g_ptr_array_add(apis_, ({
Expand Down

0 comments on commit 25cd5ea

Please sign in to comment.