mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
acp: get i18n interface from support and use it
Save the i18n interface in a global variable. Make acp use the support interface when translating strings.
This commit is contained in:
parent
0b5741e725
commit
3babedec9c
3 changed files with 16 additions and 2 deletions
|
|
@ -30,6 +30,8 @@ int _acp_log_level = 1;
|
||||||
acp_log_func _acp_log_func;
|
acp_log_func _acp_log_func;
|
||||||
void *_acp_log_data;
|
void *_acp_log_data;
|
||||||
|
|
||||||
|
struct spa_i18n *acp_i18n;
|
||||||
|
|
||||||
#define VOLUME_ACCURACY (PA_VOLUME_NORM/100) /* don't require volume adjustments to be perfectly correct. don't necessarily extend granularity in software unless the differences get greater than this level */
|
#define VOLUME_ACCURACY (PA_VOLUME_NORM/100) /* don't require volume adjustments to be perfectly correct. don't necessarily extend granularity in software unless the differences get greater than this level */
|
||||||
|
|
||||||
static const uint32_t channel_table[PA_CHANNEL_POSITION_MAX] = {
|
static const uint32_t channel_table[PA_CHANNEL_POSITION_MAX] = {
|
||||||
|
|
|
||||||
|
|
@ -586,8 +586,16 @@ static inline char *pa_readlink(const char *p) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#define _(...) (__VA_ARGS__)
|
#include <spa/support/i18n.h>
|
||||||
#define N_(...) (__VA_ARGS__)
|
|
||||||
|
extern struct spa_i18n *acp_i18n;
|
||||||
|
|
||||||
|
#define _(String) spa_i18n_gettext(acp_i18n, String)
|
||||||
|
#ifdef gettext_noop
|
||||||
|
#define N_(String) gettext_noop(String)
|
||||||
|
#else
|
||||||
|
#define N_(String) (String)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "channelmap.h"
|
#include "channelmap.h"
|
||||||
#include "volume.h"
|
#include "volume.h"
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
#include <spa/utils/names.h>
|
#include <spa/utils/names.h>
|
||||||
#include <spa/support/loop.h>
|
#include <spa/support/loop.h>
|
||||||
#include <spa/support/plugin.h>
|
#include <spa/support/plugin.h>
|
||||||
|
#include <spa/support/i18n.h>
|
||||||
#include <spa/monitor/device.h>
|
#include <spa/monitor/device.h>
|
||||||
#include <spa/monitor/utils.h>
|
#include <spa/monitor/utils.h>
|
||||||
#include <spa/monitor/event.h>
|
#include <spa/monitor/event.h>
|
||||||
|
|
@ -48,6 +49,8 @@
|
||||||
|
|
||||||
#include "acp/acp.h"
|
#include "acp/acp.h"
|
||||||
|
|
||||||
|
extern struct spa_i18n *acp_i18n;
|
||||||
|
|
||||||
#define NAME "alsa-device"
|
#define NAME "alsa-device"
|
||||||
|
|
||||||
#define MAX_POLL 16
|
#define MAX_POLL 16
|
||||||
|
|
@ -927,6 +930,7 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
|
|
||||||
this->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
|
this->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
|
||||||
this->loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Loop);
|
this->loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Loop);
|
||||||
|
acp_i18n = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_I18N);
|
||||||
if (this->loop == NULL) {
|
if (this->loop == NULL) {
|
||||||
spa_log_error(this->log, "a Loop interface is needed");
|
spa_log_error(this->log, "a Loop interface is needed");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue