ukui-media/ 0000775 0001750 0001750 00000000000 15170054730 011534 5 ustar feng feng ukui-media/Makefile.am 0000664 0001750 0001750 00000001552 15170052044 013567 0 ustar feng feng NULL =
SUBDIRS = data po man
DISTCHECK_CONFIGURE_FLAGS = \
--enable-more-warnings \
--enable-compile-warnings=maximum \
--enable-deprecated
DIST_SUBDIRS = \
data \
po \
man \
$(NULL)
EXTRA_DIST = \
.version \
autogen.sh \
configure \
ChangeLog \
COPYING \
COPYING-DOCS \
build-aux/git-version-gen \
$(INTLTOOL_BUILT:=.in) \
$(NULL)
DISTCLEANFILES = \
po/.intltool-merge-cache \
$(NULL)
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
# see build-aux/git-version-get for details
BUILT_SOURCES = $(top_srcdir)/.version
$(top_srcdir)/.version:
echo $(VERSION) > $@-t && mv $@-t $@
# Build ChangeLog from GIT history
ChangeLog:
$(AM_V_GEN) if test -d $(top_srcdir)/.git; then \
GIT_DIR="$(top_srcdir)/.git" git log --stat > $@; \
fi
dist: ChangeLog
.PHONY: ChangeLog
-include $(top_srcdir)/git.mk
ukui-media/sound-theme-player/ 0000775 0001750 0001750 00000000000 15170054730 015256 5 ustar feng feng ukui-media/sound-theme-player/sound-theme-player.pro 0000664 0001750 0001750 00000002447 15170054730 021531 0 ustar feng feng #-------------------------------------------------
#
# Project created by QtCreator 2021-01-03T20:04:12
#
#-------------------------------------------------
QT += core gui dbus xml
#greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = sound-theme-player
TEMPLATE = app
include(dbus-adaptor/dbus-adaptor.pri)
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
LIBS += -lukui-log4qt
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
target.path = /usr/bin
CONFIG += \
c++11 \
no_keywords link_pkgconfig debug\
PKGCONFIG += \
glib-2.0 \
gio-2.0 \
dconf \
gsettings-qt6 \
libxml-2.0 \
libcanberra \
libpulse
SOURCES += \
main.cpp \
sound_theme_player.cpp
HEADERS += \
sound_theme_player.h
INSTALLS += \
target
ukui-media/sound-theme-player/dbus-adaptor/ 0000775 0001750 0001750 00000000000 15170054730 017643 5 ustar feng feng ukui-media/sound-theme-player/dbus-adaptor/org.ukui.soundthemeplayer.xml 0000664 0001750 0001750 00000000554 15170054730 025523 0 ustar feng feng
ukui-media/sound-theme-player/dbus-adaptor/dbus-adaptor.pri 0000664 0001750 0001750 00000000151 15170054730 022741 0 ustar feng feng INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/dbus-adaptor.h \
SOURCES += \
$$PWD/dbus-adaptor.cpp \
ukui-media/sound-theme-player/dbus-adaptor/dbus-adaptor.h 0000664 0001750 0001750 00000002515 15170054730 022404 0 ustar feng feng /*
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp org.ukui.soundthemeplayer.xml -i sound_theme_player.h -a dbus-adaptor
*
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
* before re-generating it.
*/
#ifndef DBUS_ADAPTOR_H
#define DBUS_ADAPTOR_H
#include
#include
#include "sound_theme_player.h"
QT_BEGIN_NAMESPACE
class QByteArray;
template class QList;
template class QMap;
class QString;
class QVariant;
QT_END_NAMESPACE
/*
* Adaptor class for interface org.ukui.sound.theme.player
*/
class PlayerAdaptor: public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.ukui.sound.theme.player")
Q_CLASSINFO("D-Bus Introspection", ""
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
"")
public:
PlayerAdaptor(QObject *parent);
virtual ~PlayerAdaptor();
public: // PROPERTIES
public Q_SLOTS: // METHODS
bool playAlertSound(const QString &soundEvent);
Q_SIGNALS: // SIGNALS
};
#endif
ukui-media/sound-theme-player/dbus-adaptor/dbus-adaptor.cpp 0000664 0001750 0001750 00000002047 15170054730 022737 0 ustar feng feng /*
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp org.ukui.soundthemeplayer.xml -i sound_theme_player.h -a dbus-adaptor
*
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
*/
#include "dbus-adaptor.h"
#include
#include
#include
#include
#include
#include
#include
/*
* Implementation of adaptor class PlayerAdaptor
*/
PlayerAdaptor::PlayerAdaptor(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
// constructor
setAutoRelaySignals(true);
}
PlayerAdaptor::~PlayerAdaptor()
{
// destructor
}
bool PlayerAdaptor::playAlertSound(const QString &soundEvent)
{
// handle method call org.ukui.sound.theme.player.playAlertSound
bool out0;
QMetaObject::invokeMethod(parent(), "playAlertSound", Q_RETURN_ARG(bool, out0), Q_ARG(QString, soundEvent));
return out0;
}
ukui-media/sound-theme-player/main.cpp 0000664 0001750 0001750 00000002245 15170054730 016711 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "sound_theme_player.h"
#include
#include
#include
#include "dbus-adaptor.h"
#include
int main(int argc, char *argv[])
{
initUkuiLog4qt("ukui-media");
QCoreApplication a(argc, argv);
SoundThemePlayer player;
return a.exec();
}
ukui-media/sound-theme-player/sound_theme_player.cpp 0000664 0001750 0001750 00000020664 15170054730 021660 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "sound_theme_player.h"
#include
#include
SoundThemePlayer::SoundThemePlayer()
{
createCaContext();//注册
UkmediaPlayerDbusRegister();
initGSettings();
addSoundFileList();
}
/**
* @brief create for the libcanberra context
* @return create successfully or not
*/
bool SoundThemePlayer::createCaContext()
{
if (nullptr != m_caContext)
{
ca_context_cancel(m_caContext, 0);
ca_context_destroy(m_caContext);
}
return (ca_context_create(&m_caContext) == 0) ? true : false;
}
/**
* @brief Register for the dbus service
*/
void SoundThemePlayer::UkmediaPlayerDbusRegister()
{
QDBusConnection con = QDBusConnection::sessionBus();
if (!con.registerService("org.ukui.sound.theme.player"))
qDebug() << "registerService failed" << con.lastError().message();
if (!con.registerObject("/org/ukui/sound/theme/player", this, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals))
qDebug() << "registerObject failed" << con.lastError().message();
}
/**
* @brief Play the corresponding sound effects
*
* @param soundEvent Application sound type
* @return Play successfully or not
*/
bool SoundThemePlayer::playAlertSound(QString soundEvent)
{
bool soundSwitch;
if (m_pSoundSettings->keys().contains("eventSounds"))
soundSwitch = m_pSoundSettings->get(EVENT_SOUNDS_KEY).toBool();
if (!soundSwitch)
return false;
gint retval;
QByteArray ba;
const gchar *eventId;
const gchar *desc = "Sound Theme Player";
if (m_pSoundFileList.contains(soundEvent))
ba = soundEvent.toLatin1();
else {
QString theme = m_pSoundSettings->get(SOUND_THEME_KEY).toString();
if (isFileExist(theme, soundEvent))
ba = soundEvent.toLatin1();
else
ba = NOTIFICATION_GENERAL;
}
eventId = ba.data();
if (ba == AUDIO_VOLUME_CHANGE && m_pSoundSettings->get(SOUND_CUSTOM_THEME_KEY).toBool()) {
QString soundPath = m_pSoundSettings->get(AUDIO_VOLUME_CHANGE).toString();
retval = playCustomAlertSound(soundPath);
return retval;
}
else if (ba == NOTIFICATION_GENERAL && m_pSoundSettings->get(SOUND_CUSTOM_THEME_KEY).toBool()) {
QString soundPath = m_pSoundSettings->get(NOTIFICATION_GENERAL).toString();
retval = playCustomAlertSound(soundPath);
return retval;
}
if (createCaContext()) {
retval = ca_context_play(m_caContext, 0,
CA_PROP_EVENT_ID, eventId,
CA_PROP_EVENT_DESCRIPTION, desc,
CA_PROP_CANBERRA_VOLUME, m_dBValue,
NULL);
}
qDebug() << __func__ << soundEvent << eventId << retval;
return (retval == 0 ? 1 : 0);
}
/**
* @brief Find the sound file according to the sound type
*
* @param action Application sound type
* @return Sound file
*/
QString SoundThemePlayer::readJson(QString action)
{
QFile file("/usr/share/ukui-media/sounds/audio.json");
if (!file.open(QFile::ReadOnly | QFile::Text)) {
qDebug() << "can't open error!";
return "";
}
// 读�文件的全部内容
QTextStream stream(&file);
stream.setEncoding(QStringConverter::Utf8); // 设置读å�–ç¼–ç �是UTF8
QString str = stream.readAll();
file.close();
// QJsonParseError类用于在JSON解�期间报告错误。
QJsonParseError jsonError;
// å°†jsonè§£æž�为UTF-8ç¼–ç �çš„json文档,并从ä¸åˆ›å»ºä¸€ä¸ªQJsonDocument。
// 如果解��功,返回QJsonDocument对象,�则返回null
QJsonDocument doc = QJsonDocument::fromJson(str.toUtf8(), &jsonError);
// åˆ¤æ–æ˜¯å�¦è§£æž�失败
if (jsonError.error != QJsonParseError::NoError && !doc.isNull()) {
qDebug() << "Jsonæ ¼å¼�错误ï¼�" << jsonError.error;
return "";
}
QJsonObject rootObj = doc.object();
//获�键值对
QJsonValue card = rootObj.value(action);
if (card.toString().isEmpty())
return NOTIFICATION_GENERAL;
return card.toString();
}
bool SoundThemePlayer::playCustomAlertSound(QString soundPath)
{
int retval = 1;
if (createCaContext()) {
retval = ca_context_play(m_caContext, 0,
CA_PROP_APPLICATION_NAME, "Sound Theme Player",
CA_PROP_MEDIA_FILENAME, soundPath.toLatin1().data(),
CA_PROP_EVENT_DESCRIPTION, "Testing event sound",
CA_PROP_CANBERRA_CACHE_CONTROL, "never",
CA_PROP_APPLICATION_ID, "org.ukui.VolumeControl",
CA_PROP_CANBERRA_VOLUME, m_dBValue,
#ifdef CA_PROP_CANBERRA_ENABLE
CA_PROP_CANBERRA_ENABLE, "1",
#endif
NULL);
qDebug() << __func__ << soundPath << retval;
}
return (retval == 0 ? 1 : 0);
}
bool SoundThemePlayer::isFileExist(QString theme, QString soundTye)
{
QString path = SOUND_FILE_PATH;
path.replace("xxxTheme", theme);
path.replace("xxxFile", soundTye);
QFileInfo fileInfo(path);
path.replace("ogg", "oga");
QFileInfo fileInfoOga(path);
if (fileInfo.isFile())
return true;
else if (fileInfoOga.isFile())
return true;
else
return false;
}
void SoundThemePlayer::addSoundFileList()
{
m_pSoundFileList << "audio-volume-change"
<< "battery-low"
<< "complete"
<< "device-added-failed"
<< "device-added"
<< "device-removed"
<< "dialog-error"
<< "dialog-warning"
<< "notification-general"
<< "notification-special"
<< "operation-file"
<< "operation-unsupported"
<< "power-plug"
<< "screen-capture"
<< "screen-record"
<< "start-up"
<< "trash-empty" ;
}
void SoundThemePlayer::initGSettings()
{
if (QGSettings::isSchemaInstalled(KEY_SOUNDS_SCHEMA)) {
m_pSoundSettings = new QGSettings(KEY_SOUNDS_SCHEMA);
}
if (nullptr == m_pSoundSettings) {
qDebug() << "m_pSoundSettings create fail";
return;
}
if (m_pSoundSettings->keys().contains("alertVolume")) {
int n_AlertVolume = m_pSoundSettings->get(ALERT_VOLUME).toInt();
m_dBValue = alertVolumeTodB(n_AlertVolume);
}
connect(m_pSoundSettings, &QGSettings::changed, this, &SoundThemePlayer::onSettingChanged);
}
void SoundThemePlayer::onSettingChanged(const QString &key)
{
if (key == "alertVolume") {
int n_AlertVolume = m_pSoundSettings->get(ALERT_VOLUME).toInt();
m_dBValue = alertVolumeTodB(n_AlertVolume);
qDebug() << "The alert volume is changed, now is" << n_AlertVolume << m_dBValue;
}
}
char *SoundThemePlayer::alertVolumeTodB(int value)
{
if (value < 0 || value > 100)
value = 100;
pa_volume_t volume = value / 100.0 * 65536.0;
double dBValue = pa_sw_volume_to_dB(volume);
QByteArray byteArray = QByteArray::number(dBValue, 'f', 2);
if (m_dBValue) {
delete[] m_dBValue;
m_dBValue = nullptr;
}
m_dBValue = new char[byteArray.size() + 1];
snprintf(m_dBValue, byteArray.size() + 1, "%s", byteArray.constData());
return m_dBValue;
}
SoundThemePlayer::~SoundThemePlayer()
{
}
ukui-media/sound-theme-player/sound_theme_player.h 0000664 0001750 0001750 00000004726 15170054730 021326 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef SOUND_THEME_PLAYER_H
#define SOUND_THEME_PLAYER_H
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
extern "C" {
#include
#include
}
#define KEY_SOUNDS_SCHEMA "org.ukui.sound"
#define EVENT_SOUNDS_KEY "event-sounds"
#define SOUND_THEME_KEY "theme-name"
#define SOUND_CUSTOM_THEME_KEY "custom-theme"
#define AUDIO_VOLUME_CHANGE "audio-volume-change"
#define NOTIFICATION_GENERAL "notification-general"
#define ALERT_VOLUME "alert-volume"
#define SOUND_FILE_PATH "/usr/share/sounds/xxxTheme/stereo/xxxFile.ogg"
class SoundThemePlayer : public QObject
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface","org.ukui.sound.theme.player")
public:
SoundThemePlayer();
~SoundThemePlayer();
bool createCaContext();
void UkmediaPlayerDbusRegister();
QString readJson(QString action);
void addSoundFileList();
bool playCustomAlertSound(QString soundPath);
bool isFileExist(QString theme, QString soundTye);
void initGSettings();
void onSettingChanged(const QString &key);
char *alertVolumeTodB(int value);
public Q_SLOTS: //METHODS
bool playAlertSound(QString soundEvent);
private:
ca_context *m_caContext = nullptr;
QGSettings *m_pSoundSettings = nullptr;
QStringList m_pSoundFileList;
char *m_dBValue = nullptr;
};
#endif // SOUND_THEME_PLAYER_H
ukui-media/ukui-login-sound/ 0000775 0001750 0001750 00000000000 15170054730 014745 5 ustar feng feng ukui-media/ukui-login-sound/main.cpp 0000664 0001750 0001750 00000013053 15170054730 016377 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include
#include
#include
#include
#include
#include "ukui_login_sound_user_config.h"
#include "ukui_login_sound.h"
/* define hw sound card dirvers */
#define HI3XXX_HI6405 "hi3xxx_hi6405"
#define HI3XXX_DA_COMBINE_V5 "hi3xxx_DA_combine_v5"
#define DA_COMBINE_V5_MACHINE "da_combine_v5_machine"
#define HW_AUDIO_SERVICE "/usr/share/hw-audio/hwaudioservice"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
if (QFile(SOUND_EFFECT_JSON).exists())
{
syslog(LOG_INFO, "this is not first time longin to the system, so the stratup sound effect will not play.");
return 0;
}
std::shared_ptr info = std::make_shared();
QString autoLoginUser = std::dynamic_pointer_cast(info)->getAutoLoginUser();
QString lastLoginUser = std::dynamic_pointer_cast(info)->getLastLoginUser();
syslog(LOG_DEBUG, "autoLoginUser:%s, lastLoginUser:%s", autoLoginUser.toLatin1().data(), lastLoginUser.toLatin1().data());
// 1. æ£å¸¸è£…机或者OEMè£…æœºæ—¶ç¬¬ä¸€æ¬¡ç™»å½•ï¼Œä½¿ç”¨é»˜è®¤è®¾å¤‡æ’æ”¾å¼€æœºéŸ³æ•ˆ
if ("oem" == autoLoginUser || ("" == autoLoginUser && "" == lastLoginUser))
{
if (QFile::exists(HW_AUDIO_SERVICE)) {
system("/usr/share/hw-audio/hwaudioservice -o");
}
syslog(LOG_INFO, "when you first enter the system, use the default output device to play startup sound effect.");
QString defaultOutputDev = DEFAULT_AUDIO_CARD_VALUE;
defaultOutputDev = UkuiLoginSound::getInstance().checkPcm(defaultOutputDev.toLatin1().data());
UkuiLoginSound::getInstance().aplayMain(PLAY_STARTUP_WAV, defaultOutputDev.toLatin1().data());
}
else
{
// 2.当系统设置自动登录时,使用自动登录用户记录的设备信æ�¯è¿›è¡Œæ’放,没有设置自动登录用户时,使用上一次登录用户记录的设备信æ�¯è¿›è¡Œæ’放
bool status = info->getValueFromJson(info->getJsonByType(std::dynamic_pointer_cast(info)->getJsonMap(),
JsonType::JSON_TYPE_USERINFO), AUDIO_STRATUP_SOUNDEFFECT_KEY).toBool();
bool mute = info->getValueFromJson(info->getJsonByType(std::dynamic_pointer_cast(info)->getJsonMap(),
JsonType::JSON_TYPE_USERINFO), AUDIO_MUTE_KEY).toBool();
int volume = info->getValueFromJson(info->getJsonByType(std::dynamic_pointer_cast(info)->getJsonMap(),
JsonType::JSON_TYPE_USERINFO), AUDIO_VOLUME_KEY).toInt();
/* Do not play the boot sound effect when the user is closed when the boot sound effect,
* the mute state, and the volume value are 0 */
if (!status || mute || !volume) {
syslog(LOG_DEBUG, "%s user has turned off the system boot sound or it is in mute mode, status: %d, muted: %d, volume: %d.",
autoLoginUser == "" ? lastLoginUser.toLatin1().data() : autoLoginUser.toLatin1().data(), status, mute, volume);
return 0;
}
int cardId = info->getValueFromJson(info->getJsonByType(std::dynamic_pointer_cast(info)->getJsonMap(),
JsonType::JSON_TYPE_USERINFO), AUDIO_CARDID_KEY).toInt();
QString audioDEV = info->getValueFromJson(info->getJsonByType(std::dynamic_pointer_cast(info)->getJsonMap(),
JsonType::JSON_TYPE_USERINFO), AUDIO_CARD_KEY).toString();
/* Check whether the PCM device is valid before playing the boot sound */
audioDEV = UkuiLoginSound::getInstance().checkPcm(audioDEV.toLatin1().data());
bool support = UkuiLoginSound::getInstance().isSupportHardwareVolumeControl(QString("hw:%1").arg(cardId).toLatin1().data());
syslog(LOG_INFO, "play system sound effects on the device:%s at volume:%d.", audioDEV.toLatin1().data(), volume);
if (!mute && QFile::exists(HW_AUDIO_SERVICE)) {
system("/usr/share/hw-audio/hwaudioservice -o");
}
/* When the driver does not support hardware volume control, modify the volume of
* the audio file of the boot sound effect through FFMPEG */
if (!support && !UkuiLoginSound::getInstance().wav_convert(volume)) {
UkuiLoginSound::getInstance().aplayMain(TMP_STARTUP_WAV_PATH, audioDEV.toLatin1().data());
}
else {
UkuiLoginSound::getInstance().aplayMain(PLAY_STARTUP_WAV, audioDEV.toLatin1().data());
}
}
return 0;
}
ukui-media/ukui-login-sound/ukui-login-sound.pro 0000664 0001750 0001750 00000002646 15170054730 020710 0 ustar feng feng QT += core gui
#greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TEMPLATE = app
TARGET = ukui-login-sound
target.path = /usr/bin
CONFIG += \
c++17 \
no_keywords link_pkgconfig debug\
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
../common/user_config.cpp \
main.cpp \
ukui_login_sound.cpp \
../common/sound_effect_json.cpp \
../common/user_info_json.cpp \
ukui_login_sound_user_config.cpp
HEADERS += \
formats.h \
ukui_login_sound.h \
../common/json.h \
../common/sound_effect_json.h \
../common/user_info_json.h \
../common/user_config.h \
ukui_login_sound_user_config.h
PKGCONFIG += alsa
# Default rules for deployment.
#qnx: target.path = /tmp/$${TARGET}/bin
#else: unix:!android: target.path = /opt/$${TARGET}/bin
#!isEmpty(target.path): INSTALLS += target
INSTALLS += target \
ukui-media/ukui-login-sound/ukui_login_sound.h 0000664 0001750 0001750 00000015715 15170054730 020504 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef APLAYPLAY_H
#define APLAYPLAY_H
//#include "aconfig.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "formats.h"
#include
#include
#include
#include
#define BUFFER_LEN 1024
//开机音ä¹�æ’æ”¾è·¯å¾„
#define PLAY_STARTUP_WAV "/usr/share/ukui/ukui-session-manager/startup.wav"
#define TMP_STARTUP_WAV_PATH "/tmp/startup.wav"
#define NORMAL_VOLUME 100.0
#define MIN_VOLUME 0.0
#define ABS(a) (a) < 0 ? -(a) : (a)
#ifdef SND_CHMAP_API_VERSION
#define CONFIG_SUPPORT_CHMAP 1
#endif
#ifndef LLONG_MAX
#define LLONG_MAX 9223372036854775807LL
#endif
#ifndef le16toh
#include
#define le16toh(x) __le16_to_cpu(x)
#define be16toh(x) __be16_to_cpu(x)
#define le32toh(x) __le32_to_cpu(x)
#define be32toh(x) __be32_to_cpu(x)
#endif
#define DEFAULT_FORMAT SND_PCM_FORMAT_U8
#define DEFAULT_SPEED 8000
#define FORMAT_DEFAULT -1
#define FORMAT_RAW 0
#define FORMAT_VOC 1
#define FORMAT_WAVE 2
#define FORMAT_AU 3
/* global data */
static snd_pcm_sframes_t (*readi_func)(snd_pcm_t *handle, void *buffer, snd_pcm_uframes_t size);
static snd_pcm_sframes_t (*writei_func)(snd_pcm_t *handle, const void *buffer, snd_pcm_uframes_t size);
static snd_pcm_sframes_t (*readn_func)(snd_pcm_t *handle, void **bufs, snd_pcm_uframes_t size);
static snd_pcm_sframes_t (*writen_func)(snd_pcm_t *handle, void **bufs, snd_pcm_uframes_t size);
enum {
VUMETER_NONE,
VUMETER_MONO,
VUMETER_STEREO
};
static snd_pcm_t *handle;
static struct {
snd_pcm_format_t format;
unsigned int channels;
unsigned int rate;
} hwparams, rhwparams;
static int timelimit = 0;
static int sampleslimit = 0;
static int quiet_mode = 0;
static int file_type = FORMAT_DEFAULT;
static int open_mode = 0;
static snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;
static int mmap_flag = 0;
static int interleaved = 1;
static int nonblock = 0;
static volatile sig_atomic_t in_aborting = 0;
static u_char *audiobuf = NULL;
static snd_pcm_uframes_t chunk_size = 0;
static unsigned period_time = 0;
static unsigned buffer_time = 0;
static snd_pcm_uframes_t period_frames = 0;
static snd_pcm_uframes_t buffer_frames = 0;
static int avail_min = -1;
static int start_delay = 0;
static int stop_delay = 0;
static int monotonic = 0;
static int interactive = 0;
static int can_pause = 0;
static int fatal_errors = 0;
static int verbose = 0;
static int vumeter = VUMETER_NONE;
static int buffer_pos = 0;
static size_t significant_bits_per_sample, bits_per_sample, bits_per_frame;
static size_t chunk_bytes;
static int test_position = 0;
static int test_coef = 8;
static int test_nowait = 0;
static snd_output_t *snd_log;
static long long max_file_size = 0;
static int max_file_time = 0;
static int use_strftime = 0;
volatile static int recycle_capture_file = 0;
static long term_c_lflag = -1;
static int dump_hw_params = 0;
static int fd = -1;
static off64_t pbrec_count = LLONG_MAX, fdcount;
static int vocmajor, vocminor;
static char *pidfile_name = NULL;
//FILE *pidf = NULL;
static int pidfile_written = 0;
#ifdef CONFIG_SUPPORT_CHMAP
static snd_pcm_chmap_t *channel_map = NULL; /* chmap to override */
static unsigned int *hw_map = NULL; /* chmap to follow */
#endif
//extern "C"{
/* needed prototypes */
class UkuiLoginSound
{
public:
static UkuiLoginSound& getInstance();
int aplayMain(char *filename,char *playdev);
char* checkPcm(char *name);
bool isSupportHardwareVolumeControl(char *name);
int wav_convert(int volume);
private:
UkuiLoginSound();
UkuiLoginSound(const UkuiLoginSound&) = delete;
UkuiLoginSound(UkuiLoginSound&&) = delete;
UkuiLoginSound operator=(const UkuiLoginSound&) = delete;
UkuiLoginSound operator=(UkuiLoginSound&&) = delete;
~UkuiLoginSound() = default;
static void check_wavefile_space(u_char *buffer,u_int len, size_t blimit);
static void device_list();
static void pcm_list(void);
static void prg_exit(int code);
static void signal_handler(int sig);
static void signal_handler_recycle (int sig);
static ssize_t safe_read(int fd, void *buf, size_t count);
static size_t test_wavefile_read(int fd, u_char *buffer, size_t *size, size_t reqsize, int line);
static ssize_t test_wavefile(int fd, u_char *_buffer, size_t size);
static void show_available_sample_formats(snd_pcm_hw_params_t* params);
static int setup_chmap(void);
static void set_params(void);
static void init_stdin(void);
static void done_stdin(void);
static void do_pause(void);
static void check_stdin(void);
static void xrun(void);
static void suspend(void);
static void print_vu_meter_mono(int perc, int maxperc);
static void print_vu_meter_stereo(int *perc, int *maxperc);
static void print_vu_meter(signed int *perc, signed int *maxperc);
static void compute_max_peak(u_char *data, size_t count);
static void do_test_position(void);
static u_char *remap_data(u_char *data, size_t count);
static u_char **remap_datav(u_char **data, size_t count);
static ssize_t pcm_write(u_char *data, size_t count);
static ssize_t pcm_writev(u_char **data, unsigned int channels, size_t count);
static ssize_t pcm_read(u_char *data, size_t rcount);
static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount);
static ssize_t voc_pcm_write(u_char *data, size_t count);
static void init_raw_data(void);
static off64_t calc_count(void);
static void header(int rtype, char *name);
static void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *name);
static int read_header(int *loaded, int header_size);
static int playback_wave(char *name, int *loaded);
static int playback_raw(char *name, int *loaded);
static void playback(char *name);
};
#endif // APLAYPLAY_H
ukui-media/ukui-login-sound/ukui_login_sound_user_config.cpp 0000664 0001750 0001750 00000005560 15170054730 023417 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "ukui_login_sound_user_config.h"
UkuiLoginSoundUserConfig::UkuiLoginSoundUserConfig()
{
initSettings();
initJsonMap();
}
void UkuiLoginSoundUserConfig::initSettings()
{
m_pAutoLoginSetting = std::make_unique(LIGHTDM_CONF_FILE, QSettings::IniFormat);
m_pLastLoginSetting = std::make_unique(UKUI_GREETER_CONF_FILE, QSettings::IniFormat);
}
void UkuiLoginSoundUserConfig::initJsonMap()
{
for (const auto& [k, v] : m_keys) {
std::shared_ptr json = nullptr;
switch (k) {
case JsonType::JSON_TYPE_SOUNDEFFECT: {
json = std::make_shared(v());
json->init();
break;
}
case JsonType::JSON_TYPE_USERINFO: {
json = std::make_shared(v());
break;
}
default:
break;
}
if (json) {
m_jsonMap.emplace(k, json);
}
}
}
const QString UkuiLoginSoundUserConfig::getAutoLoginUser() const
{
return m_pAutoLoginSetting->value(LIGHTDM_CONF_KEY).toString();
}
const QString UkuiLoginSoundUserConfig::getLastLoginUser() const
{
return m_pLastLoginSetting->value(UKUI_GREETER_CONF_KEY).toString();
}
std::unordered_map> UkuiLoginSoundUserConfig::getJsonMap() const
{
return m_jsonMap;
}
QString UkuiLoginSoundUserConfig::getSoundEffectFullPath()
{
return SOUND_EFFECT_JSON;
}
QString UkuiLoginSoundUserConfig::getUserInfoFullPath()
{
QString path = DEFAULT_PATH;
QString autoLoginUser = getAutoLoginUser();
QString lastLoginUser = getLastLoginUser();
if ("" == autoLoginUser && "" == lastLoginUser) {
path = INVAILD_PATH;
}
else {
autoLoginUser == "" ? path.append(lastLoginUser) : path.append(autoLoginUser);
}
path == INVAILD_PATH ? path : path.append(AUDIO_JSON);
syslog(LOG_DEBUG, "usr info file path: %s.", path.toLatin1().data());
return path;
}
UkuiLoginSoundUserConfig::~UkuiLoginSoundUserConfig()
{
}
ukui-media/ukui-login-sound/formats.h 0000664 0001750 0001750 00000010761 15170054730 016576 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef FORMATS_H
#define FORMATS_H 1
#include
#include
/* Definitions for .VOC files */
#define VOC_MAGIC_STRING "Creative Voice File\x1A"
#define VOC_ACTUAL_VERSION 0x010A
#define VOC_SAMPLESIZE 8
#define VOC_MODE_MONO 0
#define VOC_MODE_STEREO 1
#define VOC_DATALEN(bp) ((u_long)(bp->datalen) | \
((u_long)(bp->datalen_m) << 8) | \
((u_long)(bp->datalen_h) << 16) )
typedef struct voc_header {
u_char magic[20]; /* must be MAGIC_STRING */
u_short headerlen; /* Headerlength, should be 0x1A */
u_short version; /* VOC-file version */
u_short coded_ver; /* 0x1233-version */
} VocHeader;
typedef struct voc_blocktype {
u_char type;
u_char datalen; /* low-byte */
u_char datalen_m; /* medium-byte */
u_char datalen_h; /* high-byte */
} VocBlockType;
typedef struct voc_voice_data {
u_char tc;
u_char pack;
} VocVoiceData;
typedef struct voc_ext_block {
u_short tc;
u_char pack;
u_char mode;
} VocExtBlock;
/* Definitions for Microsoft WAVE format */
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define COMPOSE_ID(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))
#define LE_SHORT(v) (v)
#define LE_INT(v) (v)
#define BE_SHORT(v) bswap_16(v)
#define BE_INT(v) bswap_32(v)
#elif __BYTE_ORDER == __BIG_ENDIAN
#define COMPOSE_ID(a,b,c,d) ((d) | ((c)<<8) | ((b)<<16) | ((a)<<24))
#define LE_SHORT(v) bswap_16(v)
#define LE_INT(v) bswap_32(v)
#define BE_SHORT(v) (v)
#define BE_INT(v) (v)
#else
#error "Wrong endian"
#endif
/* Note: the following macros evaluate the parameter v twice */
#define TO_CPU_SHORT(v, be) \
((be) ? BE_SHORT(v) : LE_SHORT(v))
#define TO_CPU_INT(v, be) \
((be) ? BE_INT(v) : LE_INT(v))
#define WAV_RIFF COMPOSE_ID('R','I','F','F')
#define WAV_RIFX COMPOSE_ID('R','I','F','X')
#define WAV_WAVE COMPOSE_ID('W','A','V','E')
#define WAV_FMT COMPOSE_ID('f','m','t',' ')
#define WAV_DATA COMPOSE_ID('d','a','t','a')
/* WAVE fmt block constants from Microsoft mmreg.h header */
#define WAV_FMT_PCM 0x0001
#define WAV_FMT_IEEE_FLOAT 0x0003
#define WAV_FMT_DOLBY_AC3_SPDIF 0x0092
#define WAV_FMT_EXTENSIBLE 0xfffe
/* Used with WAV_FMT_EXTENSIBLE format */
#define WAV_GUID_TAG "\x00\x00\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71"
/* it's in chunks like .voc and AMIGA iff, but my source say there
are in only in this combination, so I combined them in one header;
it works on all WAVE-file I have
*/
typedef struct {
u_int magic; /* 'RIFF' */
u_int length; /* filelen */
u_int type; /* 'WAVE' */
} WaveHeader;
typedef struct {
u_short format; /* see WAV_FMT_* */
u_short channels;
u_int sample_fq; /* frequence of sample */
u_int byte_p_sec;
u_short byte_p_spl; /* samplesize; 1 or 2 bytes */
u_short bit_p_spl; /* 8, 12 or 16 bit */
} WaveFmtBody;
typedef struct {
WaveFmtBody format;
u_short ext_size;
u_short bit_p_spl;
u_int channel_mask;
u_short guid_format; /* WAV_FMT_* */
u_char guid_tag[14]; /* WAV_GUID_TAG */
} WaveFmtExtensibleBody;
typedef struct {
u_int type; /* 'data' */
u_int length; /* samplecount */
} WaveChunkHeader;
/* Definitions for Sparc .au header */
#define AU_MAGIC COMPOSE_ID('.','s','n','d')
#define AU_FMT_ULAW 1
#define AU_FMT_LIN8 2
#define AU_FMT_LIN16 3
typedef struct au_header {
u_int magic; /* '.snd' */
u_int hdr_size; /* size of header (min 24) */
u_int data_size; /* size of data */
u_int encoding; /* see to AU_FMT_XXXX */
u_int sample_rate; /* sample rate */
u_int channels; /* number of channels (voices) */
} AuHeader;
#endif /* FORMATS */
ukui-media/ukui-login-sound/ukui_login_sound.cpp 0000664 0001750 0001750 00000154554 15170054730 021044 0 ustar feng feng /*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see = 0) {
char name[32];
// sprintf(name, "hw:%d", card);
snprintf(name, sizeof(name), "hw:%d", card);
if ((err = snd_ctl_open(&handle, name, 0)) < 0) {
printf("control open (%i): %s", card, snd_strerror(err));
goto next_card;
}
if ((err = snd_ctl_card_info(handle, info)) < 0) {
printf("control hardware info (%i): %s", card, snd_strerror(err));
snd_ctl_close(handle);
goto next_card;
}
dev = -1;
while (1) {
unsigned int count;
if (snd_ctl_pcm_next_device(handle, &dev)<0)
printf("snd_ctl_pcm_next_device");
if (dev < 0)
break;
snd_pcm_info_set_device(pcminfo, dev);
snd_pcm_info_set_subdevice(pcminfo, 0);
snd_pcm_info_set_stream(pcminfo, stream);
if ((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) {
if (err != -ENOENT)
printf("control digital audio info (%i): %s", card, snd_strerror(err));
continue;
}
printf(("card %i: %s [%s], device %i: %s [%s]\n"),
card, snd_ctl_card_info_get_id(info), snd_ctl_card_info_get_name(info),
dev,
snd_pcm_info_get_id(pcminfo),
snd_pcm_info_get_name(pcminfo));
count = snd_pcm_info_get_subdevices_count(pcminfo);
printf((" Subdevices: %i/%i\n"),
snd_pcm_info_get_subdevices_avail(pcminfo), count);
for (idx = 0; idx < (int)count; idx++) {
snd_pcm_info_set_subdevice(pcminfo, idx);
if ((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) {
printf("control digital audio playback info (%i): %s", card, snd_strerror(err));
} else {
printf((" Subdevice #%i: %s\n"),
idx, snd_pcm_info_get_subdevice_name(pcminfo));
}
}
}
snd_ctl_close(handle);
next_card:
if (snd_card_next(&card) < 0) {
printf("snd_card_next");
break;
}
}
}
void UkuiLoginSound::pcm_list(void)
{
void **hints, **n;
char *name, *descr, *descr1, *io;
const char *filter;
if (snd_device_name_hint(-1, "pcm", &hints) < 0)
return;
n = hints;
filter = stream == SND_PCM_STREAM_CAPTURE ? "Input" : "Output";
while (*n != NULL) {
name = snd_device_name_get_hint(*n, "NAME");
descr = snd_device_name_get_hint(*n, "DESC");
io = snd_device_name_get_hint(*n, "IOID");
if (io != NULL && strcmp(io, filter) != 0)
goto __end;
printf("%s\n", name);
if ((descr1 = descr) != NULL) {
printf(" ");
while (*descr1) {
if (*descr1 == '\n')
printf("\n ");
else
putchar(*descr1);
descr1++;
}
putchar('\n');
}
__end:
if (name != NULL)
free(name);
if (descr != NULL)
free(descr);
if (io != NULL)
free(io);
n++;
}
snd_device_name_free_hint(hints);
}
/*
* Subroutine to clean up before exit.
*/
void UkuiLoginSound::prg_exit(int code)
{
done_stdin();
if (handle)
snd_pcm_close(handle);
if (pidfile_written)
remove (pidfile_name);
exit(code);
}
void UkuiLoginSound::signal_handler(int sig)
{
if (in_aborting)
return;
in_aborting = 1;
if (verbose==2)
putchar('\n');
if (!quiet_mode)
{
syslog (LOG_INFO,"sig: %d quiet_mode: %d.", sig, quiet_mode);
fprintf(stderr, ("Aborted by signal %s...\n"), strsignal(sig));
}
if (handle)
snd_pcm_abort(handle);
if (sig == SIGABRT) {
/* do not call snd_pcm_close() and abort immediately */
handle = NULL;
prg_exit(EXIT_FAILURE);
}
signal(sig, SIG_DFL);
}
/* call on SIGUSR1 signal. */
void UkuiLoginSound::signal_handler_recycle ([[maybe_unused]] int sig)
{
/* flag the capture loop to start a new output file */
recycle_capture_file = 1;
}
int UkuiLoginSound::aplayMain(char *filename, char *playdev)
{
// int duration_or_sample = 0;
// int option_index;
// static const char short_options[] = "hnlLD:qt:c:f:r:d:s:MNF:A:R:T:B:vV:IPCi"
#ifdef CONFIG_SUPPORT_CHMAP
"m:"
#endif
;
char *pcm_name = playdev;
int err;
int do_device_list = 0, do_pcm_list = 0;
snd_pcm_info_t *info;
#ifdef ENABLE_NLS
setlocale(LC_ALL, "");
textdomain(PACKAGE);
#endif
snd_pcm_info_alloca(&info);
err = snd_output_stdio_attach(&snd_log, stderr, 0);
assert(err >= 0);
file_type = FORMAT_DEFAULT;
stream = SND_PCM_STREAM_PLAYBACK;
chunk_size = -1;
rhwparams.format = DEFAULT_FORMAT;
rhwparams.rate = DEFAULT_SPEED;
rhwparams.channels = 1;
if (do_device_list) {
if (do_pcm_list)
pcm_list();
device_list();
goto __end;
} else if (do_pcm_list) {
pcm_list();
goto __end;
}
err = snd_pcm_open(&handle, playdev, stream, open_mode);
syslog (LOG_INFO, "start open %s device...", pcm_name);
if (err < 0) {
printf(("audio open error: %s"), snd_strerror(err));
return 1;
}
if ((err = snd_pcm_info(handle, info)) < 0) {
printf(("info error: %s"), snd_strerror(err));
return 1;
}
if (nonblock) {
err = snd_pcm_nonblock(handle, 1);
if (err < 0) {
printf(("nonblock setting error: %s"), snd_strerror(err));
return 1;
}
}
chunk_size = 1024;
hwparams = rhwparams;
audiobuf = (u_char *)malloc(1024);
if (audiobuf == NULL) {
printf(("not enough memory"));
return 1;
}
if (mmap_flag) {
writei_func = snd_pcm_mmap_writei;
readi_func = snd_pcm_mmap_readi;
writen_func = snd_pcm_mmap_writen;
readn_func = snd_pcm_mmap_readn;
} else {
writei_func = snd_pcm_writei;
readi_func = snd_pcm_readi;
writen_func = snd_pcm_writen;
readn_func = snd_pcm_readn;
}
if (pidfile_name) {
errno = 0;
pidf = fopen (pidfile_name, "w");
if (pidf) {
(void)fprintf (pidf, "%d\n", getpid());
fclose(pidf);
pidfile_written = 1;
} else {
printf(("Cannot create process ID file %s: %s"),
pidfile_name, strerror (errno));
return 1;
}
}
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
signal(SIGABRT, signal_handler);
signal(SIGUSR1, signal_handler_recycle);
if (interleaved) {
if (stream == SND_PCM_STREAM_PLAYBACK)
{
playback(filename);
}
}
if (verbose==2)
putchar('\n');
snd_pcm_close(handle);
handle = NULL;
free(audiobuf);
__end:
snd_output_close(snd_log);
snd_config_update_free_global();
prg_exit(EXIT_SUCCESS);
/* avoid warning */
return EXIT_SUCCESS;
}
/*
* Safe read (for pipes)
*/
ssize_t UkuiLoginSound::safe_read(int fd, void *buf, size_t count)
{
ssize_t result = 0, res;
while (count > 0 && !in_aborting) {
if ((res = read(fd, buf, count)) == 0)
break;
if (res < 0)
return result > 0 ? result : res;
count -= res;
result += res;
buf = (char *)buf + res;
}
return result;
}
/*
* helper for test_wavefile
*/
size_t UkuiLoginSound::test_wavefile_read(int fd, u_char *buffer, size_t *size, size_t reqsize, int line)
{
if (*size >= reqsize)
return *size;
if ((size_t)safe_read(fd, buffer + *size, reqsize - *size) != reqsize - *size) {
printf(("read error (called from line %i)"), line);
prg_exit(EXIT_FAILURE);
}
return *size = reqsize;
}
#define check_wavefile_space(buffer, len, blimit) \
if (len > blimit) { \
blimit = len; \
if ((buffer = (u_char *)realloc(buffer, blimit)) == NULL) { \
printf(("not enough memory")); \
prg_exit(EXIT_FAILURE); \
} \
}
/*
* test, if it's a .WAV file, > 0 if ok (and set the speed, stereo etc.)
* == 0 if not
* Value returned is bytes to be discarded.
*/
ssize_t UkuiLoginSound::test_wavefile(int fd, u_char *_buffer, size_t size)
{
WaveHeader *h = (WaveHeader *)_buffer;
u_char *buffer = NULL;
size_t blimit = 0;
WaveFmtBody *f;
WaveChunkHeader *c;
u_int type, len;
unsigned short format, channels;
int big_endian, native_format;
if (size < sizeof(WaveHeader))
return -1;
if (h->magic == WAV_RIFF)
big_endian = 0;
else if (h->magic == WAV_RIFX)
big_endian = 1;
else
return -1;
if (h->type != WAV_WAVE)
return -1;
if (size > sizeof(WaveHeader)) {
check_wavefile_space(buffer, size - sizeof(WaveHeader), blimit);
memcpy(buffer, (_buffer + (sizeof(WaveHeader))), size - sizeof(WaveHeader));
}
size -= sizeof(WaveHeader);
while (1) {
check_wavefile_space(buffer, sizeof(WaveChunkHeader), blimit);
test_wavefile_read(fd, buffer, &size, sizeof(WaveChunkHeader), __LINE__);
c = (WaveChunkHeader*)buffer;
type = c->type;
len = TO_CPU_INT(c->length, big_endian);
len += len % 2;
if (size > sizeof(WaveChunkHeader))
memmove(buffer, buffer + sizeof(WaveChunkHeader), size - sizeof(WaveChunkHeader));
size -= sizeof(WaveChunkHeader);
if (type == WAV_FMT)
break;
check_wavefile_space(buffer, len, blimit);
test_wavefile_read(fd, buffer, &size, len, __LINE__);
if (size > len)
memmove(buffer, buffer + len, size - len);
size -= len;
}
if (len < sizeof(WaveFmtBody)) {
printf(("unknown length of 'fmt ' chunk (read %u, should be %u at least)"),
len, (u_int)sizeof(WaveFmtBody));
prg_exit(EXIT_FAILURE);
}
check_wavefile_space(buffer, len, blimit);
test_wavefile_read(fd, buffer, &size, len, __LINE__);
f = (WaveFmtBody*) buffer;
format = TO_CPU_SHORT(f->format, big_endian);
if (format == WAV_FMT_EXTENSIBLE) {
WaveFmtExtensibleBody *fe = (WaveFmtExtensibleBody*)buffer;
if (len < sizeof(WaveFmtExtensibleBody)) {
printf(("unknown length of extensible 'fmt ' chunk (read %u, should be %u at least)"),
len, (u_int)sizeof(WaveFmtExtensibleBody));
prg_exit(EXIT_FAILURE);
}
if (memcmp(fe->guid_tag, WAV_GUID_TAG, 14) != 0) {
printf(("wrong format tag in extensible 'fmt ' chunk"));
prg_exit(EXIT_FAILURE);
}
format = TO_CPU_SHORT(fe->guid_format, big_endian);
}
if (format != WAV_FMT_PCM &&
format != WAV_FMT_IEEE_FLOAT) {
printf(("can't play WAVE-file format 0x%04x which is not PCM or FLOAT encoded"), format);
prg_exit(EXIT_FAILURE);
}
channels = TO_CPU_SHORT(f->channels, big_endian);
if (channels < 1) {
printf(("can't play WAVE-files with %d tracks"), channels);
prg_exit(EXIT_FAILURE);
}
hwparams.channels = channels;
switch (TO_CPU_SHORT(f->bit_p_spl, big_endian)) {
case 8:
if (hwparams.format != DEFAULT_FORMAT &&
hwparams.format != SND_PCM_FORMAT_U8)
fprintf(stderr, ("Warning: format is changed to U8\n"));
hwparams.format = SND_PCM_FORMAT_U8;
break;
case 16:
if (big_endian)
native_format = SND_PCM_FORMAT_S16_BE;
else
native_format = SND_PCM_FORMAT_S16_LE;
if (hwparams.format != DEFAULT_FORMAT &&
hwparams.format != native_format)
fprintf(stderr, ("Warning: format is changed to %s\n"),
snd_pcm_format_name((snd_pcm_format_t)native_format));
hwparams.format = (snd_pcm_format_t)native_format;
break;
case 24:
switch (TO_CPU_SHORT(f->byte_p_spl, big_endian) / hwparams.channels) {
case 3:
if (big_endian)
native_format = SND_PCM_FORMAT_S24_3BE;
else
native_format = SND_PCM_FORMAT_S24_3LE;
if (hwparams.format != DEFAULT_FORMAT &&
hwparams.format != native_format)
fprintf(stderr, ("Warning: format is changed to %s\n"),
snd_pcm_format_name((snd_pcm_format_t)native_format));
hwparams.format = (snd_pcm_format_t)native_format;
break;
case 4:
if (big_endian)
native_format = SND_PCM_FORMAT_S24_BE;
else
native_format = SND_PCM_FORMAT_S24_LE;
if (hwparams.format != DEFAULT_FORMAT &&
hwparams.format != native_format)
fprintf(stderr, ("Warning: format is changed to %s\n"),
snd_pcm_format_name((snd_pcm_format_t)native_format));
hwparams.format = (snd_pcm_format_t)native_format;
break;
default:
printf((" can't play WAVE-files with sample %d bits in %d bytes wide (%d channels)"),
TO_CPU_SHORT(f->bit_p_spl, big_endian),
TO_CPU_SHORT(f->byte_p_spl, big_endian),
hwparams.channels);
prg_exit(EXIT_FAILURE);
}
break;
case 32:
if (format == WAV_FMT_PCM) {
if (big_endian)
native_format = SND_PCM_FORMAT_S32_BE;
else
native_format = SND_PCM_FORMAT_S32_LE;
hwparams.format = (snd_pcm_format_t)native_format;
} else if (format == WAV_FMT_IEEE_FLOAT) {
if (big_endian)
native_format = SND_PCM_FORMAT_FLOAT_BE;
else
native_format = SND_PCM_FORMAT_FLOAT_LE;
hwparams.format = (snd_pcm_format_t)native_format;
}
break;
default:
printf((" can't play WAVE-files with sample %d bits wide"),
TO_CPU_SHORT(f->bit_p_spl, big_endian));
prg_exit(EXIT_FAILURE);
}
hwparams.rate = TO_CPU_INT(f->sample_fq, big_endian);
if (size > len)
memmove(buffer, buffer + len, size - len);
size -= len;
while (1) {
u_int type, len;
check_wavefile_space(buffer, sizeof(WaveChunkHeader), blimit);
test_wavefile_read(fd, buffer, &size, sizeof(WaveChunkHeader), __LINE__);
c = (WaveChunkHeader*)buffer;
type = c->type;
len = TO_CPU_INT(c->length, big_endian);
if (size > sizeof(WaveChunkHeader))
memmove(buffer, buffer + sizeof(WaveChunkHeader), size - sizeof(WaveChunkHeader));
size -= sizeof(WaveChunkHeader);
if (type == WAV_DATA) {
if (len < pbrec_count && len < 0x7ffffffe)
pbrec_count = len;
if (size > 0)
memcpy(_buffer, buffer, size);
free(buffer);
return size;
}
len += len % 2;
check_wavefile_space(buffer, len, blimit);
test_wavefile_read(fd, buffer, &size, len, __LINE__);
if (size > len)
memmove(buffer, buffer + len, size - len);
size -= len;
}
/* shouldn't be reached */
return -1;
}
void UkuiLoginSound::show_available_sample_formats(snd_pcm_hw_params_t* params)
{
// snd_pcm_format_t format;
int format;
fprintf(stderr, "Available formats:\n");
for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
if (snd_pcm_hw_params_test_format(handle, params, (snd_pcm_format_t)format) == 0)
fprintf(stderr, "- %s\n", snd_pcm_format_name((snd_pcm_format_t)format));
}
}
#ifdef CONFIG_SUPPORT_CHMAP
int UkuiLoginSound::setup_chmap(void)
{
snd_pcm_chmap_t *chmap = channel_map;
char mapped[hwparams.channels];
snd_pcm_chmap_t *hw_chmap;
unsigned int ch, i;
int err;
if (!chmap)
return 0;
if (chmap->channels != hwparams.channels) {
printf(("Channel numbers don't match between hw_params and channel map"));
return -1;
}
err = snd_pcm_set_chmap(handle, chmap);
if (!err)
return 0;
hw_chmap = snd_pcm_get_chmap(handle);
if (!hw_chmap) {
fprintf(stderr, ("Warning: unable to get channel map\n"));
return 0;
}
if (hw_chmap->channels == chmap->channels &&
!memcmp(hw_chmap, chmap, 4 * (chmap->channels + 1))) {
/* maps are identical, so no need to convert */
free(hw_chmap);
return 0;
}
hw_map = (unsigned int *)calloc(hwparams.channels, sizeof(int));
if (!hw_map) {
printf(("not enough memory"));
free(hw_chmap);
return -1;
}
memset(mapped, 0, sizeof(mapped));
for (ch = 0; ch < hw_chmap->channels; ch++) {
if (chmap->pos[ch] == hw_chmap->pos[ch]) {
mapped[ch] = 1;
hw_map[ch] = ch;
continue;
}
for (i = 0; i < hw_chmap->channels; i++) {
if (!mapped[i] && chmap->pos[ch] == hw_chmap->pos[i]) {
mapped[i] = 1;
hw_map[ch] = i;
break;
}
}
if (i >= hw_chmap->channels) {
char buf[256];
printf(("Channel %d doesn't match with hw_parmas"), ch);
snd_pcm_chmap_print(hw_chmap, sizeof(buf), buf);
fprintf(stderr, "hardware chmap = %s\n", buf);
free(hw_chmap);
return -1;
}
}
free(hw_chmap);
return 0;
}
#else
#define setup_chmap() 0
#endif
void UkuiLoginSound::set_params(void)
{
snd_pcm_hw_params_t *params;
snd_pcm_sw_params_t *swparams;
snd_pcm_uframes_t buffer_size;
int err;
size_t n;
unsigned int rate;
snd_pcm_uframes_t start_threshold, stop_threshold;
snd_pcm_hw_params_alloca(¶ms);
snd_pcm_sw_params_alloca(&swparams);
err = snd_pcm_hw_params_any(handle, params);
if (err < 0) {
printf(("Broken configuration for this PCM: no configurations available"));
prg_exit(EXIT_FAILURE);
}
if (dump_hw_params) {
fprintf(stderr, ("HW Params of device \"%s\":\n"),
snd_pcm_name(handle));
fprintf(stderr, "--------------------\n");
snd_pcm_hw_params_dump(params, snd_log);
fprintf(stderr, "--------------------\n");
}
if (mmap_flag) {
snd_pcm_access_mask_t *mask = (snd_pcm_access_mask_t *)alloca(snd_pcm_access_mask_sizeof());
snd_pcm_access_mask_none(mask);
snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_INTERLEAVED);
snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_NONINTERLEAVED);
snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_COMPLEX);
err = snd_pcm_hw_params_set_access_mask(handle, params, mask);
} else if (interleaved)
err = snd_pcm_hw_params_set_access(handle, params,
SND_PCM_ACCESS_RW_INTERLEAVED);
else
err = snd_pcm_hw_params_set_access(handle, params,
SND_PCM_ACCESS_RW_NONINTERLEAVED);
if (err < 0) {
printf(("Access type not available"));
prg_exit(EXIT_FAILURE);
}
err = snd_pcm_hw_params_set_format(handle, params, hwparams.format);
if (err < 0) {
printf(("Sample format non available"));
show_available_sample_formats(params);
prg_exit(EXIT_FAILURE);
}
err = snd_pcm_hw_params_set_channels(handle, params, hwparams.channels);
if (err < 0) {
printf(("Channels count non available"));
prg_exit(EXIT_FAILURE);
}
#if 0
err = snd_pcm_hw_params_set_periods_min(handle, params, 2);
assert(err >= 0);
#endif
rate = hwparams.rate;
err = snd_pcm_hw_params_set_rate_near(handle, params, &hwparams.rate, 0);
assert(err >= 0);
if ((float)rate * 1.05 < hwparams.rate || (float)rate * 0.95 > hwparams.rate) {
if (!quiet_mode) {
char plugex[64];
const char *pcmname = snd_pcm_name(handle);
fprintf(stderr, ("Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"), rate, hwparams.rate);
if (! pcmname || strchr(snd_pcm_name(handle), ':'))
*plugex = 0;
else
snprintf(plugex, sizeof(plugex), "(-Dplug:%s)",
snd_pcm_name(handle));
fprintf(stderr, (" please, try the plug plugin %s\n"),
plugex);
}
}
rate = hwparams.rate;
if (buffer_time == 0 && buffer_frames == 0) {
err = snd_pcm_hw_params_get_buffer_time_max(params,
&buffer_time, 0);
assert(err >= 0);
if (buffer_time > 500000)
buffer_time = 500000;
}
if (period_time == 0 && period_frames == 0) {
if (buffer_time > 0)
period_time = buffer_time / 4;
else
period_frames = buffer_frames / 4;
}
if (period_time > 0)
err = snd_pcm_hw_params_set_period_time_near(handle, params,
&period_time, 0);
else
err = snd_pcm_hw_params_set_period_size_near(handle, params,
&period_frames, 0);
assert(err >= 0);
if (buffer_time > 0) {
err = snd_pcm_hw_params_set_buffer_time_near(handle, params,
&buffer_time, 0);
} else {
err = snd_pcm_hw_params_set_buffer_size_near(handle, params,
&buffer_frames);
}
assert(err >= 0);
monotonic = snd_pcm_hw_params_is_monotonic(params);
can_pause = snd_pcm_hw_params_can_pause(params);
err = snd_pcm_hw_params(handle, params);
if (err < 0) {
printf(("Unable to install hw params:"));
snd_pcm_hw_params_dump(params, snd_log);
prg_exit(EXIT_FAILURE);
}
snd_pcm_hw_params_get_period_size(params, &chunk_size, 0);
snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
if (chunk_size == buffer_size) {
printf(("Can't use period equal to buffer size (%lu == %lu)"),
chunk_size, buffer_size);
prg_exit(EXIT_FAILURE);
}
err = snd_pcm_sw_params_current(handle, swparams);
if (err < 0) {
printf(("Unable to get current sw params."));
prg_exit(EXIT_FAILURE);
}
if (avail_min < 0)
n = chunk_size;
else
n = (double) rate * avail_min / 1000000;
err = snd_pcm_sw_params_set_avail_min(handle, swparams, n);
/* round up to closest transfer boundary */
n = buffer_size;
if (start_delay <= 0) {
start_threshold = n + (double) rate * start_delay / 1000000;
} else
start_threshold = (double) rate * start_delay / 1000000;
if (start_threshold < 1)
start_threshold = 1;
if (start_threshold > n)
start_threshold = n;
err = snd_pcm_sw_params_set_start_threshold(handle, swparams, start_threshold);
assert(err >= 0);
if (stop_delay <= 0)
stop_threshold = buffer_size + (double) rate * stop_delay / 1000000;
else
stop_threshold = (double) rate * stop_delay / 1000000;
err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold);
assert(err >= 0);
if (snd_pcm_sw_params(handle, swparams) < 0) {
printf(("unable to install sw params:"));
snd_pcm_sw_params_dump(swparams, snd_log);
prg_exit(EXIT_FAILURE);
}
if (setup_chmap())
prg_exit(EXIT_FAILURE);
if (verbose)
snd_pcm_dump(handle, snd_log);
bits_per_sample = snd_pcm_format_physical_width(hwparams.format);
significant_bits_per_sample = snd_pcm_format_width(hwparams.format);
bits_per_frame = bits_per_sample * hwparams.channels;
chunk_bytes = chunk_size * bits_per_frame / 8;
audiobuf = (u_char *)realloc(audiobuf, chunk_bytes);
if (audiobuf == NULL) {
printf(("not enough memory"));
prg_exit(EXIT_FAILURE);
}
// fprintf(stderr, "real chunk_size = %i, frags = %i, total = %i\n", chunk_size, setup.buf.block.frags, setup.buf.block.frags * chunk_size);
/* stereo VU-meter isn't always available... */
if (vumeter == VUMETER_STEREO) {
if (hwparams.channels != 2 || !interleaved || verbose > 2)
vumeter = VUMETER_MONO;
}
/* show mmap buffer arragment */
if (mmap_flag && verbose) {
const snd_pcm_channel_area_t *areas;
snd_pcm_uframes_t offset, size = chunk_size;
int i;
err = snd_pcm_mmap_begin(handle, &areas, &offset, &size);
if (err < 0) {
printf(("snd_pcm_mmap_begin problem: %s"), snd_strerror(err));
prg_exit(EXIT_FAILURE);
}
for (i = 0; i < hwparams.channels; i++)
fprintf(stderr, "mmap_area[%i] = %p,%u,%u (%u)\n", i, areas[i].addr, areas[i].first, areas[i].step, snd_pcm_format_physical_width(hwparams.format));
/* not required, but for sure */
snd_pcm_mmap_commit(handle, offset, 0);
}
buffer_frames = buffer_size; /* for position test */
}
void UkuiLoginSound::init_stdin(void)
{
struct termios term;
long flags;
if (!interactive)
return;
if (!isatty(fileno(stdin))) {
interactive = 0;
return;
}
tcgetattr(fileno(stdin), &term);
term_c_lflag = term.c_lflag;
if (fd == fileno(stdin))
return;
flags = fcntl(fileno(stdin), F_GETFL);
if (flags < 0 || fcntl(fileno(stdin), F_SETFL, flags|O_NONBLOCK) < 0)
fprintf(stderr, ("stdin O_NONBLOCK flag setup failed\n"));
term.c_lflag &= ~ICANON;
tcsetattr(fileno(stdin), TCSANOW, &term);
}
void UkuiLoginSound::done_stdin(void)
{
struct termios term;
if (!interactive)
return;
if (fd == fileno(stdin) || term_c_lflag == -1)
return;
tcgetattr(fileno(stdin), &term);
term.c_lflag = term_c_lflag;
tcsetattr(fileno(stdin), TCSANOW, &term);
}
void UkuiLoginSound::do_pause(void)
{
int err;
unsigned char b;
if (!can_pause) {
fprintf(stderr, ("\rPAUSE command ignored (no hw support)\n"));
return;
}
if (snd_pcm_state(handle) == SND_PCM_STATE_SUSPENDED)
suspend();
err = snd_pcm_pause(handle, 1);
if (err < 0) {
printf(("pause push error: %s"), snd_strerror(err));
return;
}
while (1) {
while (read(fileno(stdin), &b, 1) != 1);
if (b == ' ' || b == '\r') {
while (read(fileno(stdin), &b, 1) == 1);
if (snd_pcm_state(handle) == SND_PCM_STATE_SUSPENDED)
suspend();
err = snd_pcm_pause(handle, 0);
if (err < 0)
printf(("pause release error: %s"), snd_strerror(err));
return;
}
}
}
void UkuiLoginSound::check_stdin(void)
{
unsigned char b;
if (!interactive)
return;
if (fd != fileno(stdin)) {
while (read(fileno(stdin), &b, 1) == 1) {
if (b == ' ' || b == '\r') {
while (read(fileno(stdin), &b, 1) == 1);
fprintf(stderr, ("\r=== PAUSE === "));
fflush(stderr);
do_pause();
fprintf(stderr, " \r");
fflush(stderr);
}
}
}
}
#ifndef timersub
#define timersub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
if ((result)->tv_usec < 0) { \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
} \
} while (0)
#endif
#ifndef timermsub
#define timermsub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_nsec = (a)->tv_nsec - (b)->tv_nsec; \
if ((result)->tv_nsec < 0) { \
--(result)->tv_sec; \
(result)->tv_nsec += 1000000000L; \
} \
} while (0)
#endif
/* I/O error handler */
void UkuiLoginSound::xrun(void)
{
snd_pcm_status_t *status;
int res;
snd_pcm_status_alloca(&status);
if ((res = snd_pcm_status(handle, status))<0) {
printf(("status error: %s"), snd_strerror(res));
prg_exit(EXIT_FAILURE);
}
if (snd_pcm_status_get_state(status) == SND_PCM_STATE_XRUN) {
if (fatal_errors) {
printf(("fatal %s: %s"),
stream == SND_PCM_STREAM_PLAYBACK ? ("underrun") : ("overrun"),
snd_strerror(res));
prg_exit(EXIT_FAILURE);
}
if (monotonic) {
#ifdef HAVE_CLOCK_GETTIME
struct timespec now, diff, tstamp;
clock_gettime(CLOCK_MONOTONIC, &now);
snd_pcm_status_get_trigger_htstamp(status, &tstamp);
timermsub(&now, &tstamp, &diff);
fprintf(stderr, _("%s!!! (at least %.3f ms long)\n"),
stream == SND_PCM_STREAM_PLAYBACK ? _("underrun") : _("overrun"),
diff.tv_sec * 1000 + diff.tv_nsec / 1000000.0);
#else
fprintf(stderr, "%s !!!\n", ("underrun"));
#endif
} else {
struct timeval now, diff, tstamp;
gettimeofday(&now, 0);
snd_pcm_status_get_trigger_tstamp(status, &tstamp);
timersub(&now, &tstamp, &diff);
fprintf(stderr, ("%s!!! (at least %.3f ms long)\n"),
stream == SND_PCM_STREAM_PLAYBACK ? ("underrun") : ("overrun"),
diff.tv_sec * 1000 + diff.tv_usec / 1000.0);
}
if (verbose) {
fprintf(stderr, ("Status:\n"));
snd_pcm_status_dump(status, snd_log);
}
if ((res = snd_pcm_prepare(handle))<0) {
printf(("xrun: prepare error: %s"), snd_strerror(res));
prg_exit(EXIT_FAILURE);
}
return; /* ok, data should be accepted again */
} if (snd_pcm_status_get_state(status) == SND_PCM_STATE_DRAINING) {
if (verbose) {
fprintf(stderr, ("Status(DRAINING):\n"));
snd_pcm_status_dump(status, snd_log);
}
if (stream == SND_PCM_STREAM_CAPTURE) {
fprintf(stderr, ("capture stream format change? attempting recover...\n"));
if ((res = snd_pcm_prepare(handle))<0) {
printf(("xrun(DRAINING): prepare error: %s"), snd_strerror(res));
prg_exit(EXIT_FAILURE);
}
return;
}
}
if (verbose) {
fprintf(stderr, ("Status(R/W):\n"));
snd_pcm_status_dump(status, snd_log);
}
printf(("read/write error, state = %s"), snd_pcm_state_name(snd_pcm_status_get_state(status)));
prg_exit(EXIT_FAILURE);
}
/* I/O suspend handler */
void UkuiLoginSound::suspend(void)
{
int res;
if (!quiet_mode) {
fprintf(stderr, ("Suspended. Trying resume. ")); fflush(stderr);
}
while ((res = snd_pcm_resume(handle)) == -EAGAIN)
sleep(1); /* wait until suspend flag is released */
if (res < 0) {
if (!quiet_mode) {
fprintf(stderr, ("Failed. Restarting stream. ")); fflush(stderr);
}
if ((res = snd_pcm_prepare(handle)) < 0) {
printf(("suspend: prepare error: %s"), snd_strerror(res));
prg_exit(EXIT_FAILURE);
}
}
if (!quiet_mode)
fprintf(stderr, ("Done.\n"));
}
void UkuiLoginSound::print_vu_meter_mono(int perc, int maxperc)
{
const int bar_length = 50;
char line[80];
int val;
for (val = 0; val <= perc * bar_length / 100 && val < bar_length; val++)
line[val] = '#';
for (; val <= maxperc * bar_length / 100 && val < bar_length; val++)
line[val] = ' ';
line[val] = '+';
for (++val; val <= bar_length; val++)
line[val] = ' ';
// if (maxperc > 99)
// sprintf(line + val, "| MAX");
// else
// sprintf(line + val, "| %02i%%", maxperc);
if (maxperc > 99)
snprintf(line + val, sizeof(line) - val, "| MAX");
else
snprintf(line + val, sizeof(line) - val, "| %02i%%", maxperc);
fputs(line, stderr);
if (perc > 100)
fprintf(stderr, (" !clip "));
}
void UkuiLoginSound::print_vu_meter_stereo(int *perc, int *maxperc)
{
const int bar_length = 35;
char line[80];
int c;
memset(line, ' ', sizeof(line) - 1);
line[bar_length + 3] = '|';
for (c = 0; c < 2; c++) {
int p = perc[c] * bar_length / 100;
char tmp[4];
if (p > bar_length)
p = bar_length;
if (c)
memset(line + bar_length + 6 + 1, '#', p);
else
memset(line + bar_length - p - 1, '#', p);
p = maxperc[c] * bar_length / 100;
if (p > bar_length)
p = bar_length;
if (c)
line[bar_length + 6 + 1 + p] = '+';
else
line[bar_length - p - 1] = '+';
// if (ABS(maxperc[c]) > 99)
// sprintf(tmp, "MAX");
// else
// sprintf(tmp, "%02d%%", maxperc[c]);
if (ABS(maxperc[c]) > 99)
snprintf(tmp, sizeof(tmp), "MAX");
else
snprintf(tmp, sizeof(tmp), "%02d%%", maxperc[c]);
if (c)
memcpy(line + bar_length + 3 + 1, tmp, 3);
else
memcpy(line + bar_length, tmp, 3);
}
line[bar_length * 2 + 6 + 2] = 0;
fputs(line, stderr);
}
void UkuiLoginSound::print_vu_meter(signed int *perc, signed int *maxperc)
{
if (vumeter == VUMETER_STEREO)
print_vu_meter_stereo(perc, maxperc);
else
print_vu_meter_mono(*perc, *maxperc);
}
/* peak handler */
void UkuiLoginSound::compute_max_peak(u_char *data, size_t count)
{
signed int val, max, perc[2], max_peak[2];
static int run = 0;
size_t ocount = count;
int format_little_endian = snd_pcm_format_little_endian(hwparams.format);
int ichans, c;
if (vumeter == VUMETER_STEREO)
ichans = 2;
else
ichans = 1;
memset(max_peak, 0, sizeof(max_peak));
switch (bits_per_sample) {
case 8: {
signed char *valp = (signed char *)data;
signed char mask = snd_pcm_format_silence(hwparams.format);
c = 0;
while (count-- > 0) {
val = *valp++ ^ mask;
val = abs(val);
if (max_peak[c] < val)
max_peak[c] = val;
if (vumeter == VUMETER_STEREO)
c = !c;
}
break;
}
case 16: {
signed short *valp = (signed short *)data;
signed short mask = snd_pcm_format_silence_16(hwparams.format);
signed short sval;
count /= 2;
c = 0;
while (count-- > 0) {
if (format_little_endian)
sval = le16toh(*valp);
else
sval = be16toh(*valp);
sval = abs(sval) ^ mask;
if (max_peak[c] < sval)
max_peak[c] = sval;
valp++;
if (vumeter == VUMETER_STEREO)
c = !c;
}
break;
}
case 24: {
unsigned char *valp = data;
signed int mask = snd_pcm_format_silence_32(hwparams.format);
count /= 3;
c = 0;
while (count-- > 0) {
if (format_little_endian) {
val = valp[0] | (valp[1]<<8) | (valp[2]<<16);
} else {
val = (valp[0]<<16) | (valp[1]<<8) | valp[2];
}
/* Correct signed bit in 32-bit value */
if (val & (1<<(bits_per_sample-1))) {
val |= 0xff<<24; /* Negate upper bits too */
}
val = abs(val) ^ mask;
if (max_peak[c] < val)
max_peak[c] = val;
valp += 3;
if (vumeter == VUMETER_STEREO)
c = !c;
}
break;
}
case 32: {
signed int *valp = (signed int *)data;
signed int mask = snd_pcm_format_silence_32(hwparams.format);
count /= 4;
c = 0;
while (count-- > 0) {
if (format_little_endian)
val = le32toh(*valp);
else
val = be32toh(*valp);
val = abs(val) ^ mask;
if (max_peak[c] < val)
max_peak[c] = val;
valp++;
if (vumeter == VUMETER_STEREO)
c = !c;
}
break;
}
default:
if (run == 0) {
fprintf(stderr, ("Unsupported bit size %d.\n"), (int)bits_per_sample);
run = 1;
}
return;
}
max = 1 << (significant_bits_per_sample-1);
if (max <= 0)
max = 0x7fffffff;
for (c = 0; c < ichans; c++) {
if (bits_per_sample > 16)
perc[c] = max_peak[c] / (max / 100);
else
perc[c] = max_peak[c] * 100 / max;
}
if (interleaved && verbose <= 2) {
static int maxperc[2];
static time_t t=0;
const time_t tt=time(NULL);
if(tt>t) {
t=tt;
maxperc[0] = 0;
maxperc[1] = 0;
}
for (c = 0; c < ichans; c++)
if (perc[c] > maxperc[c])
maxperc[c] = perc[c];
putc('\r', stderr);
print_vu_meter(perc, maxperc);
fflush(stderr);
}
else if(verbose==3) {
fprintf(stderr, ("Max peak (%li samples): 0x%08x "), (long)ocount, max_peak[0]);
for (val = 0; val < 20; val++)
if (val <= perc[0] / 5)
putc('#', stderr);
else
putc(' ', stderr);
fprintf(stderr, " %i%%\n", perc[0]);
fflush(stderr);
}
}
void UkuiLoginSound::do_test_position(void)
{
static long counter = 0;
static time_t tmr = -1;
time_t now;
static float availsum, delaysum, samples;
static snd_pcm_sframes_t maxavail, maxdelay;
static snd_pcm_sframes_t minavail, mindelay;
static snd_pcm_sframes_t badavail = 0, baddelay = 0;
snd_pcm_sframes_t outofrange;
snd_pcm_sframes_t avail, delay;
int err;
err = snd_pcm_avail_delay(handle, &avail, &delay);
if (err < 0)
return;
outofrange = (test_coef * (snd_pcm_sframes_t)buffer_frames) / 2;
if (avail > outofrange || avail < -outofrange ||
delay > outofrange || delay < -outofrange) {
badavail = avail; baddelay = delay;
availsum = delaysum = samples = 0;
maxavail = maxdelay = 0;
minavail = mindelay = buffer_frames * 16;
fprintf(stderr, ("Suspicious buffer position (%li total): "
"avail = %li, delay = %li, buffer = %li\n"),
++counter, (long)avail, (long)delay, (long)buffer_frames);
} else if (verbose) {
time(&now);
if (tmr == (time_t) -1) {
tmr = now;
availsum = delaysum = samples = 0;
maxavail = maxdelay = 0;
minavail = mindelay = buffer_frames * 16;
}
if (avail > maxavail)
maxavail = avail;
if (delay > maxdelay)
maxdelay = delay;
if (avail < minavail)
minavail = avail;
if (delay < mindelay)
mindelay = delay;
availsum += avail;
delaysum += delay;
samples++;
if (avail != 0 && now != tmr) {
fprintf(stderr, "BUFPOS: avg%li/%li "
"min%li/%li max%li/%li (%li) (%li:%li/%li)\n",
(long)(availsum / samples),
(long)(delaysum / samples),
(long)minavail, (long)mindelay,
(long)maxavail, (long)maxdelay,
(long)buffer_frames,
counter, badavail, baddelay);
tmr = now;
}
}
}
/*
*/
#ifdef CONFIG_SUPPORT_CHMAP
u_char * UkuiLoginSound::remap_data(u_char *data, size_t count)
{
static u_char *tmp, *src, *dst;
static size_t tmp_size;
size_t sample_bytes = bits_per_sample / 8;
size_t step = bits_per_frame / 8;
size_t chunk_bytes;
unsigned int ch, i;
if (!hw_map)
return data;
chunk_bytes = count * bits_per_frame / 8;
if (tmp_size < chunk_bytes) {
free(tmp);
tmp = (u_char *)malloc(chunk_bytes);
if (!tmp) {
printf(("not enough memory"));
exit(1);
}
tmp_size = count;
}
src = data;
dst = tmp;
for (i = 0; i < count; i++) {
for (ch = 0; ch < hwparams.channels; ch++) {
memcpy(dst, src + sample_bytes * hw_map[ch],
sample_bytes);
dst += sample_bytes;
}
src += step;
}
return tmp;
}
u_char ** UkuiLoginSound::remap_datav(u_char **data, [[maybe_unused]] size_t count)
{
static u_char **tmp;
unsigned int ch;
if (!hw_map)
return data;
if (!tmp) {
tmp = (u_char **)malloc(sizeof(*tmp) * hwparams.channels);
if (!tmp) {
printf(("not enough memory"));
exit(1);
}
for (ch = 0; ch < hwparams.channels; ch++)
tmp[ch] = data[hw_map[ch]];
}
return tmp;
}
#else
#define remap_data(data, count) (data)
#define remap_datav(data, count) (data)
#endif
/*
* write function
*/
ssize_t UkuiLoginSound::pcm_write(u_char *data, size_t count)
{
ssize_t r;
ssize_t result = 0;
if (count < chunk_size) {
snd_pcm_format_set_silence(hwparams.format, data + count * bits_per_frame / 8, (chunk_size - count) * hwparams.channels);
count = chunk_size;
}
data = remap_data(data, count);
while (count > 0 && !in_aborting) {
if (test_position)
do_test_position();
check_stdin();
r = writei_func(handle, data, count);
if (test_position)
do_test_position();
if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
if (!test_nowait)
snd_pcm_wait(handle, 100);
} else if (r == -EPIPE) {
xrun();
} else if (r == -ESTRPIPE) {
suspend();
} else if (r < 0) {
printf(("write error: %s"), snd_strerror(r));
prg_exit(EXIT_FAILURE);
}
if (r > 0) {
if (vumeter)
compute_max_peak(data, r * hwparams.channels);
result += r;
count -= r;
data += r * bits_per_frame / 8;
}
}
return result;
}
ssize_t UkuiLoginSound::pcm_writev(u_char **data, unsigned int channels, size_t count)
{
ssize_t r;
size_t result = 0;
if (count != chunk_size) {
unsigned int channel;
size_t offset = count;
size_t remaining = chunk_size - count;
for (channel = 0; channel < channels; channel++)
snd_pcm_format_set_silence(hwparams.format, data[channel] + offset * bits_per_sample / 8, remaining);
count = chunk_size;
}
data = remap_datav(data, count);
while (count > 0 && !in_aborting) {
unsigned int channel;
void *bufs[channels];
size_t offset = result;
for (channel = 0; channel < channels; channel++)
bufs[channel] = data[channel] + offset * bits_per_sample / 8;
if (test_position)
do_test_position();
check_stdin();
r = writen_func(handle, bufs, count);
if (test_position)
do_test_position();
if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
if (!test_nowait)
snd_pcm_wait(handle, 100);
} else if (r == -EPIPE) {
xrun();
} else if (r == -ESTRPIPE) {
suspend();
} else if (r < 0) {
printf(("writev error: %s"), snd_strerror(r));
prg_exit(EXIT_FAILURE);
}
if (r > 0) {
if (vumeter) {
for (channel = 0; channel < channels; channel++)
compute_max_peak(data[channel], r);
}
result += r;
count -= r;
}
}
return result;
}
/*
* read function
*/
ssize_t UkuiLoginSound::pcm_read(u_char *data, size_t rcount)
{
ssize_t r;
size_t result = 0;
size_t count = rcount;
if (count != chunk_size) {
count = chunk_size;
}
while (count > 0 && !in_aborting) {
if (test_position)
do_test_position();
check_stdin();
r = readi_func(handle, data, count);
if (test_position)
do_test_position();
if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
if (!test_nowait)
snd_pcm_wait(handle, 100);
} else if (r == -EPIPE) {
xrun();
} else if (r == -ESTRPIPE) {
suspend();
} else if (r < 0) {
printf(("read error: %s"), snd_strerror(r));
prg_exit(EXIT_FAILURE);
}
if (r > 0) {
if (vumeter)
compute_max_peak(data, r * hwparams.channels);
result += r;
count -= r;
data += r * bits_per_frame / 8;
}
}
return rcount;
}
ssize_t UkuiLoginSound::pcm_readv(u_char **data, unsigned int channels, size_t rcount)
{
ssize_t r;
size_t result = 0;
size_t count = rcount;
if (count != chunk_size) {
count = chunk_size;
}
while (count > 0 && !in_aborting) {
unsigned int channel;
void *bufs[channels];
size_t offset = result;
for (channel = 0; channel < channels; channel++)
bufs[channel] = data[channel] + offset * bits_per_sample / 8;
if (test_position)
do_test_position();
check_stdin();
r = readn_func(handle, bufs, count);
if (test_position)
do_test_position();
if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
if (!test_nowait)
snd_pcm_wait(handle, 100);
} else if (r == -EPIPE) {
xrun();
} else if (r == -ESTRPIPE) {
suspend();
} else if (r < 0) {
printf(("readv error: %s"), snd_strerror(r));
prg_exit(EXIT_FAILURE);
}
if (r > 0) {
if (vumeter) {
for (channel = 0; channel < channels; channel++)
compute_max_peak(data[channel], r);
}
result += r;
count -= r;
}
}
return rcount;
}
/* setting the globals for playing raw data */
void UkuiLoginSound::init_raw_data(void)
{
hwparams = rhwparams;
}
/* calculate the data count to read from/to dsp */
off64_t UkuiLoginSound::calc_count(void)
{
off64_t count;
if (timelimit == 0)
if (sampleslimit == 0)
count = pbrec_count;
else
count = snd_pcm_format_size(hwparams.format, sampleslimit * hwparams.channels);
else {
count = snd_pcm_format_size(hwparams.format, hwparams.rate * hwparams.channels);
count *= (off64_t)timelimit;
}
return count < pbrec_count ? count : pbrec_count;
}
void UkuiLoginSound::header(int rtype, char *name)
{
if (!quiet_mode) {
if (! name)
name = (char *)((stream == SND_PCM_STREAM_PLAYBACK) ? "stdout" : "stdin");
fprintf(stderr, "%s, ", snd_pcm_format_description(hwparams.format));
fprintf(stderr, ("Rate %d Hz, "), hwparams.rate);
if (hwparams.channels == 1)
fprintf(stderr, ("Mono"));
else if (hwparams.channels == 2)
fprintf(stderr, ("Stereo"));
else
fprintf(stderr, ("Channels %i"), hwparams.channels);
fprintf(stderr, "\n");
}
}
/* playing raw data */
void UkuiLoginSound::playback_go(int fd, size_t loaded, off64_t count, int rtype, char *name)
{
int l, r;
off64_t written = 0;
off64_t c;
header(rtype, name);
set_params();
while (loaded > chunk_bytes && written < count && !in_aborting) {
if (pcm_write(audiobuf + written, chunk_size) <= 0)
return;
written += chunk_bytes;
loaded -= chunk_bytes;
}
if (written > 0 && loaded > 0)
memmove(audiobuf, audiobuf + written, loaded);
l = loaded;
while (written < count && !in_aborting) {
do {
c = count - written;
if (c > chunk_bytes)
c = chunk_bytes;
/* c < l, there is more data loaded
* then we actually need to write
*/
if (c < l)
l = c;
c -= l;
if (c == 0)
break;
r = safe_read(fd, audiobuf + l, c);
if (r < 0) {
perror(name);
prg_exit(EXIT_FAILURE);
}
fdcount += r;
if (r == 0)
break;
l += r;
} while ((size_t)l < chunk_bytes);
l = l * 8 / bits_per_frame;
r = pcm_write(audiobuf, l);
if (r != l)
break;
r = r * bits_per_frame / 8;
written += r;
l = 0;
}
snd_pcm_nonblock(handle, 0);
snd_pcm_drain(handle);
snd_pcm_nonblock(handle, nonblock);
}
int UkuiLoginSound::read_header(int *loaded, int header_size)
{
int ret;
struct stat buf;
ret = fstat(fd, &buf);
if (ret < 0) {
perror("fstat");
prg_exit(EXIT_FAILURE);
}
/* don't be adventurous, get out if file size is smaller than
* requested header size */
if ((buf.st_mode & S_IFMT) == S_IFREG &&
buf.st_size < header_size)
return -1;
if (*loaded < header_size) {
header_size -= *loaded;
ret = safe_read(fd, audiobuf + *loaded, header_size);
if (ret != header_size) {
printf(("read error"));
prg_exit(EXIT_FAILURE);
}
*loaded += header_size;
}
return 0;
}
int UkuiLoginSound::playback_wave(char *name, int *loaded)
{
ssize_t dtawave;
syslog (LOG_INFO, "start play %s file...", name);
if (read_header(loaded, sizeof(WaveHeader)) < 0)
return -1;
if ((dtawave = test_wavefile(fd, audiobuf, *loaded)) < 0)
return -1;
pbrec_count = calc_count();
playback_go(fd, dtawave, pbrec_count, FORMAT_WAVE, name);
return 0;
}
int UkuiLoginSound::playback_raw(char *name, int *loaded)
{
syslog (LOG_INFO, "start play %s file...", name);
init_raw_data();
pbrec_count = calc_count();
playback_go(fd, *loaded, pbrec_count, FORMAT_RAW, name);
return 0;
}
/*
* let's play or capture it (capture_type says VOC/WAVE/raw)
*/
void UkuiLoginSound::playback(char *name)
{
int loaded = 0;
pbrec_count = LLONG_MAX;
fdcount = 0;
if (!name || !strcmp(name, "-")) {
fd = fileno(stdin);
name = "stdin";
} else {
init_stdin();
if ((fd = open(name, O_RDONLY, 0)) == -1) {
perror(name);
prg_exit(EXIT_FAILURE);
}
}
/* parse the file header */
if (playback_wave(name, &loaded) < 0)
playback_raw(name, &loaded); /* should be raw data */
if (fd != fileno(stdin))
close(fd);
}
UkuiLoginSound::UkuiLoginSound()
{
}
int UkuiLoginSound::wav_convert(int volume)
{
if (volume > NORMAL_VOLUME) {
volume = NORMAL_VOLUME;
}
float volume_factor = volume/NORMAL_VOLUME;
QString cmd = "ffmpeg -i ";
cmd += PLAY_STARTUP_WAV;
cmd += " ";
cmd += QString("-filter:a volume=%1 ").arg(volume_factor);
cmd += TMP_STARTUP_WAV_PATH;
int err = system(cmd.toLatin1().data());
if(err)
{
syslog(LOG_ERR, "file convert error, err:%d.", err);
return -1;
}
return 0;
}
char* UkuiLoginSound::checkPcm(char *pcmName)
{
void **hints, **n;
char *name, *defaultPcmName;
defaultPcmName = "default";
if (snd_device_name_hint(-1, "pcm", &hints) < 0)
return "default";
n = hints;
/* If the configuration file does not specify or does not exist,
* the PCM device list is traversed to find the last PCM device
* as the output device to play the system sound effect. */
while (*n != NULL) {
name = snd_device_name_get_hint(*n, "NAME");
if (strcmp(pcmName, name) == 0) {
return pcmName;
}
else if (strstr(name, "sysdefault")) {
defaultPcmName = name;
}
n++;
}
snd_device_name_free_hint(hints);
if (name != NULL)
free(name);
syslog(LOG_INFO, "system does not have %s device, so the device from %s changed to %s device", pcmName, pcmName, defaultPcmName);
return defaultPcmName;
}
bool UkuiLoginSound::isSupportHardwareVolumeControl(char *card)
{
int err;
snd_hctl_t* handle;
snd_hctl_elem_t* elem;
snd_ctl_elem_info_t* info;
snd_ctl_elem_id_t* id;
snd_ctl_elem_info_alloca(&info);
snd_ctl_elem_id_alloca(&id);
bool ret = false;
if ((err = snd_hctl_open(&handle, card, 0)) < 0) {
syslog(LOG_ERR, "control %s open error: %s", card, snd_strerror(err));
return ret;
}
if ((err = snd_hctl_load(handle)) < 0) {
syslog(LOG_ERR, "control %s local error: %s", card, snd_strerror(err));
return ret;
}
for (elem = snd_hctl_first_elem(handle); elem; elem = snd_hctl_elem_next(elem)) {
if ((err = snd_hctl_elem_info(elem, info)) < 0) {
syslog(LOG_ERR, "Control %s snd_hctl_elem_info error: %s", card, snd_strerror(err));
return ret;
}
snd_hctl_elem_get_id(elem, id);
char* str = snd_ctl_ascii_elem_id_get(id);
if (strstr(str, "Volume")) {
ret = true;
break;
}
}
syslog(LOG_INFO, "card %s %s hardware volume control.", card, ret ? "support" : "unsupport");
return ret;
}
ukui-media/ukui-login-sound/ukui_login_sound_user_config.h 0000664 0001750 0001750 00000004001 15170054730 023051 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef UKUILOGINSOUNDUSERCONFIG_H
#define UKUILOGINSOUNDUSERCONFIG_H
#include
#include
#include
#include
#include
#include
#include
#include "../common/user_config.h"
#include "../common/user_info_json.h"
#include "../common/sound_effect_json.h"
class UkuiLoginSoundUserConfig : public UserConfig
{
public:
UkuiLoginSoundUserConfig();
~UkuiLoginSoundUserConfig();
public:
const QString getAutoLoginUser() const;
const QString getLastLoginUser() const;
std::unordered_map> getJsonMap() const;
virtual void initJsonMap() override;
private:
void initSettings();
QString getSoundEffectFullPath();
QString getUserInfoFullPath();
private:
std::unordered_map> m_keys {
{JsonType::JSON_TYPE_SOUNDEFFECT, [this](){ return getSoundEffectFullPath();}},
{JsonType::JSON_TYPE_USERINFO, [this](){ return getUserInfoFullPath(); }},
};
std::unique_ptr m_pLastLoginSetting;
std::unique_ptr m_pAutoLoginSetting;
};
#endif // UKUILOGINSOUNDUSERCONFIG_H
ukui-media/AUTHORS 0000664 0001750 0001750 00000001332 15170052044 012577 0 ustar feng feng UKUI:
Hao Lee
MATE:
Perberos
Steve Zesch
Stefano Karapetsas
Michal Ratajsky
GNOME Maintainers:
Marc-Andre Lureau
Bastien Nocera
GNOME Authors:
Andreas Hyden (grecord)
Seth Nickell (gst-mixer)
Ronald Bultje (gst-mixer)
Thomas Vander Stichele (profiles)
William Jon McCann (mate-volume-control)
ukui-media/ukui-media-control-led/ 0000775 0001750 0001750 00000000000 15170054730 016006 5 ustar feng feng ukui-media/ukui-media-control-led/ukui_media_control_led.h 0000664 0001750 0001750 00000002370 15170054730 022661 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef MATE_MEDIA_CONTROL_LED_H
#define MATE_MEDIA_CONTROL_LED_H
#include
#include
#include
class UkuiMediaControlLed : public QObject
{
Q_OBJECT
public:
UkuiMediaControlLed();
~UkuiMediaControlLed();
private slots:
void outputMuteChanged(QString str);
void inputMuteChanged(QString str);
private:
};
#endif // MATE_MEDIA_CONTROL_LED_H
ukui-media/ukui-media-control-led/ukui_media_control_led.cpp 0000664 0001750 0001750 00000005010 15170054730 023206 0 ustar feng feng /*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see
#include
#include
#include
#include
#include
#include
#include
UkuiMediaControlLed::UkuiMediaControlLed()
{
QDBusConnection::systemBus().connect(QString(),"/","org.ukui.media","systemOutputVolumeIsMute",this,SLOT(outputMuteChanged(QString)));
QDBusConnection::systemBus().connect(QString(),"/","org.ukui.media","systemInputVolumeIsMute",this,SLOT(inputMuteChanged(QString)));
}
void UkuiMediaControlLed::outputMuteChanged(QString str)
{
QFile file("/sys/class/leds/platform::mute/brightness");
if(!file.exists()){
qDebug() << " THE DIRECTORY OR FILE IS NOT EXIST ";
return;
}
qDebug() << "sink muted" << str;
if (strstr(str.toLatin1().data(),"mute")) {
qDebug() << "输出音��音";
system("echo 1 > /sys/class/leds/platform::mute/brightness");
}
else if (strstr(str.toLatin1().data(),"no")) {
qDebug() << "输出音��消�音";
system("echo 0 > /sys/class/leds/platform::mute/brightness");
}
}
void UkuiMediaControlLed::inputMuteChanged(QString str)
{
QFile file("/sys/class/leds/platform::micmute/brightness");
if(!file.exists()){
qDebug() << " THE DIRECTORY OR FILE IS NOT EXIST ";
return;
}
qDebug() << "source muted" << str;
if (strstr(str.toLatin1().data(),"mute")) {
qDebug() << "输入音��音";
system("echo 1 > /sys/class/leds/platform::micmute/brightness");
}
else if (strstr(str.toLatin1().data(),"no")) {
qDebug() << "输入音��消�音";
system("echo 0 > /sys/class/leds/platform::micmute/brightness");
}
}
UkuiMediaControlLed::~UkuiMediaControlLed()
{
}
ukui-media/ukui-media-control-led/main.cpp 0000664 0001750 0001750 00000002103 15170054730 017432 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "ukui_media_control_led.h"
//#include
#include
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
UkuiMediaControlLed control;
return a.exec();
}
ukui-media/ukui-media-control-led/ukui-media-control-led.pro 0000664 0001750 0001750 00000002065 15170052044 023001 0 ustar feng feng #-------------------------------------------------
#
# Project created by QtCreator 2021-01-03T20:04:12
#
#-------------------------------------------------
QT += core gui dbus
#greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = ukui-media-control-led
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
target.path = /usr/bin
SOURCES += \
main.cpp \
ukui_media_control_led.cpp
HEADERS += \
ukui_media_control_led.h
INSTALLS += \
target
ukui-media/man/ 0000775 0001750 0001750 00000000000 15170054730 012307 5 ustar feng feng ukui-media/man/Makefile.am 0000664 0001750 0001750 00000000170 15170052044 014335 0 ustar feng feng man_MANS = ukui-volume-control.1 ukui-volume-control-applet.1 ukui-volume-control-applet-qt.1
EXTRA_DIST = $(man_MANS)
ukui-media/man/ukui-media-control-led.1 0000664 0001750 0001750 00000002061 15170052044 016636 0 ustar feng feng .\" Man Page for ukui-volume-control-applet-qt
.TH UKUI-MEDIA-CONTROL-LED 1 "20 February 2019" "UKUI Desktop Environment"
.\" Please adjust this date when revising the manpage.
.\"
.SH "NAME"
\fBukui-media-control-led\fR \- The UKUI Volume Control Applet(Qt)
.SH "SYNOPSIS"
.B ukui-media-control-led [OPTIONS]
.SH "DESCRIPTION"
The UKUI Volume Control Applet is used for adjusting audio levels from the notification area.
.SH "OPTIONS"
.TP
\fB\-v, \-\-version\fR
Output version information and exit.
.TP
\fB\-d, \-\-debug\fR
Enable debugging code.
.TP
\fB\-\-display=DISPLAY\fR
X display to use.
.TP
\fB\-?, \-h, \-\-help\fR
Print standard command line options.
.TP
\fB\-\-help\-all\fR
Print all command line options.
.SH "BUGS"
.SS Should you encounter any bugs, they may be reported at:
http://github.com/ukui/ukui-media/issues
.SH "AUTHORS"
.SS This Manual Page has been written for the UKUI Desktop Environment by:
Adam Erdman (2014)
.SH "SEE ALSO"
.SS Further information may also be available at: http://ukui.org
.BR ukui-media-control-led (1)
ukui-media/man/sound-theme-player.1 0000664 0001750 0001750 00000000661 15170054730 016116 0 ustar feng feng .TH sound-theme-player 1 "UKUI Media"
.SH NAME
sound-theme-player \- æ’æ”¾ UKUI 声音主题的命令行工具
.SH SYNOPSIS
.B sound-theme-player
[
.I options
]
.SH DESCRIPTION
.B sound-theme-player
ç”¨äºŽæ ¹æ�® UKUI 声音主题é…�ç½®æ’æ”¾å�¯åЍã€�å…³æœºç‰æ��示音。
.SH OPTIONS
æ— ç‰¹å®šå‘½ä»¤è¡Œå�‚数。è¿�行å�ŽæŒ‰é»˜è®¤ä¸»é¢˜æ’放指定声音。
.SH SEE ALSO
.BR ukui-login-sound (1)
.SH AUTHOR
Kylin Software Co., Ltd.
ukui-media/man/ukui-login-sound.1 0000664 0001750 0001750 00000000604 15170054730 015602 0 ustar feng feng .TH ukui-login-sound 1 "UKUI Media"
.SH NAME
ukui-login-sound \- 在登录会è¯�æ—¶æ’æ”¾æ��示音
.SH SYNOPSIS
.B ukui-login-sound
[
.I options
]
.SH DESCRIPTION
.B ukui-login-sound
在用户登录桌é�¢ä¼šè¯�æ—¶æ’æ”¾ç™»å½•æ��示音,用于桌é�¢çŽ¯å¢ƒå�¯åЍå��馈。
.SH OPTIONS
æ— ç‰¹å®šå‘½ä»¤è¡Œå�‚数。
.SH SEE ALSO
.BR sound-theme-player (1)
.SH AUTHOR
Kylin Software Co., Ltd.
ukui-media/man/ukui-volume-control-applet-qt.1 0000664 0001750 0001750 00000002074 15170052044 020235 0 ustar feng feng .\" Man Page for ukui-volume-control-applet-qt
.TH UKUI-VOLUME-CONTROL-APPLET-QT 1 "20 February 2019" "UKUI Desktop Environment"
.\" Please adjust this date when revising the manpage.
.\"
.SH "NAME"
\fBukui-volume-control-applet-qt\fR \- The UKUI Volume Control Applet(Qt)
.SH "SYNOPSIS"
.B ukui-volume-control-qt [OPTIONS]
.SH "DESCRIPTION"
The UKUI Volume Control Applet is used for adjusting audio levels from the notification area.
.SH "OPTIONS"
.TP
\fB\-v, \-\-version\fR
Output version information and exit.
.TP
\fB\-d, \-\-debug\fR
Enable debugging code.
.TP
\fB\-\-display=DISPLAY\fR
X display to use.
.TP
\fB\-?, \-h, \-\-help\fR
Print standard command line options.
.TP
\fB\-\-help\-all\fR
Print all command line options.
.SH "BUGS"
.SS Should you encounter any bugs, they may be reported at:
http://github.com/ukui/ukui-media/issues
.SH "AUTHORS"
.SS This Manual Page has been written for the UKUI Desktop Environment by:
Adam Erdman (2014)
.SH "SEE ALSO"
.SS Further information may also be available at: http://ukui.org
.BR ukui-volume-control (1)
ukui-media/COPYING 0000664 0001750 0001750 00000043254 15170052044 012573 0 ustar feng feng GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
ukui-media/audio/ 0000775 0001750 0001750 00000000000 15170054730 012635 5 ustar feng feng ukui-media/audio/ukmedia_settings_widget.cpp 0000664 0001750 0001750 00000012104 15170054730 020241 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "ukmedia_settings_widget.h"
#include
UkmediaSettingsWidget::UkmediaSettingsWidget(QWidget *parent) : QWidget(parent)
{
m_pAdvancedSettingsWidget = new QFrame(this);
m_pEquipmentControlWidget = new QFrame(m_pAdvancedSettingsWidget);
m_pAppSoundCtrlWidget = new QFrame(m_pAdvancedSettingsWidget);
m_pAdvancedSettingsWidget->setFrameShape(QFrame::Shape::Box);
m_pEquipmentControlWidget->setFrameShape(QFrame::Shape::Box);
m_pAppSoundCtrlWidget->setFrameShape(QFrame::Shape::Box);
//é«˜çº§è®¾ç½®æ ‡ç¾
//~ contents_path /Audio/Advanced Settings
m_pAdvancedSettingsLabel = new TitleLabel(this);
m_pAdvancedSettingsLabel->setText(tr("Advanced Settings"));
m_pAdvancedSettingsLabel->setContentsMargins(16,0,16,0);
m_pAdvancedSettingsLabel->setStyleSheet("QLabel{color: palette(windowText);}");
//声音设备管ç�†æ ‡ç¾
//~ contents_path /Audio/Sound Equipment Control
m_pEquipmentControlLabel = new QLabel(tr("Sound Equipment Control"), m_pEquipmentControlWidget);
m_pDevControlDetailsBtn = new QPushButton(m_pEquipmentControlWidget);
m_pDevControlDetailsBtn->setText(tr("Details"));
m_pDevControlDetailsBtn->setProperty("useButtonPalette",true);
//åº”ç”¨å£°éŸ³æ ‡ç¾
//~ contents_path /Audio/App Sound Control
m_pAppSoundLabel = new QLabel(tr("App Sound Control"), m_pAppSoundCtrlWidget);
m_pAppSoundDetailsBtn = new QPushButton(m_pAppSoundCtrlWidget);
m_pAppSoundDetailsBtn->setText(tr("Details"));
m_pAppSoundDetailsBtn->setProperty("useButtonPalette", true);
//设置大�
m_pAdvancedSettingsWidget->setMinimumSize(550,0);
m_pAdvancedSettingsWidget->setMaximumSize(16777215,240);
m_pEquipmentControlWidget->setMinimumSize(550,60);
m_pEquipmentControlWidget->setMaximumSize(16777215,60);
m_pAppSoundCtrlWidget->setMinimumSize(550,60);
m_pAppSoundCtrlWidget->setMaximumSize(16777215,60);
//声音设备管控
QHBoxLayout *EquipmentControlLayout = new QHBoxLayout(m_pEquipmentControlWidget);
EquipmentControlLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
EquipmentControlLayout->addWidget(m_pEquipmentControlLabel);
EquipmentControlLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Expanding));
EquipmentControlLayout->addWidget(m_pDevControlDetailsBtn);
EquipmentControlLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
EquipmentControlLayout->setSpacing(0);
m_pEquipmentControlWidget->setLayout(EquipmentControlLayout);
m_pEquipmentControlWidget->layout()->setContentsMargins(0,0,0,0);
//应用声音
QHBoxLayout *AppSoundLayout = new QHBoxLayout(m_pAppSoundCtrlWidget);
AppSoundLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
AppSoundLayout->addWidget(m_pAppSoundLabel);
AppSoundLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Expanding));
AppSoundLayout->addWidget(m_pAppSoundDetailsBtn);
AppSoundLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
AppSoundLayout->setSpacing(0);
m_pAppSoundCtrlWidget->setLayout(AppSoundLayout);
m_pAppSoundCtrlWidget->layout()->setContentsMargins(0,0,0,0);
//è®¾å¤‡ç®¡æŽ§å’Œåº”ç”¨å£°éŸ³æ·»åŠ å¸ƒå±€
QVBoxLayout *m_pVlayout1 = new QVBoxLayout(m_pAdvancedSettingsWidget);
m_pVlayout1->setContentsMargins(0,0,0,0);
m_pVlayout1->addWidget(m_pEquipmentControlWidget);
m_pVlayout1->addWidget(myLine());
m_pVlayout1->addWidget(m_pAppSoundCtrlWidget);
m_pVlayout1->setSpacing(0);
m_pAdvancedSettingsWidget->setLayout(m_pVlayout1);
m_pAdvancedSettingsWidget->layout()->setContentsMargins(0,0,0,0);
//整体布局
QVBoxLayout *vLayout1 = new QVBoxLayout(this);
vLayout1->addWidget(m_pAdvancedSettingsLabel);
vLayout1->addItem(new QSpacerItem(16,4,QSizePolicy::Fixed));
vLayout1->addWidget(m_pAdvancedSettingsWidget);
this->setLayout(vLayout1);
this->layout()->setContentsMargins(0,0,0,0);
}
QFrame* UkmediaSettingsWidget::myLine()
{
QFrame *line = new QFrame(this);
line->setMinimumSize(QSize(0, 1));
line->setMaximumSize(QSize(16777215, 1));
line->setLineWidth(0);
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
return line;
}
UkmediaSettingsWidget::~UkmediaSettingsWidget()
{
}
ukui-media/audio/ukmedia_output_widget.h 0000664 0001750 0001750 00000005355 15170054730 017420 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef UKMEDIAOUTPUTWIDGET_H
#define UKMEDIAOUTPUTWIDGET_H
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "ukui_custom_style.h"
#include "ukui_list_widget_item.h"
#include "customstyle.h"
#include
#include
#include "kswitchbutton.h"
#include
using namespace kdk;
class UkmediaOutputWidget : public QWidget
{
Q_OBJECT
public:
explicit UkmediaOutputWidget(QWidget *parent = nullptr);
~UkmediaOutputWidget();
void setVolumeSliderRange(bool status);
friend class UkmediaMainWidget;
Q_SIGNALS:
public Q_SLOTS:
void onPaletteChanged();
private:
void setLabelAlignment(Qt::Alignment alignment);
QFrame* myLine();
private:
QFrame *m_pOutputWidget;
QFrame *m_pMasterVolumeWidget;
QFrame *m_pVolumeIncreaseWidget;
QWidget *VolumeIncreaseTipsWidget;
QFrame *m_pAudioBlanceWidget; //monoAudio
QFrame *m_pMonoAudioWidget;
QFrame *m_pChannelBalanceWidget;
QFrame *m_pMonoLine;
QWidget *MonoAudioTipsWidget;
FixLabel *m_pMonoAudioLabel;
FixLabel *MonoAudioTipsLabel;
KSwitchButton *m_pMonoAudioButton;
TitleLabel *m_pOutputLabel;
FixLabel *m_pOutputDeviceLabel;
FixLabel *m_pOpVolumeLabel;
QLabel *m_pOpVolumePercentLabel;
FixLabel *m_pOpBalanceLabel;
FixLabel *VolumeIncreaseTipsLabel;
FixLabel *m_pLeftBalanceLabel;
FixLabel *m_pRightBalanceLabel;
FixLabel *m_pVolumeIncreaseLabel;
QComboBox *m_pDeviceSelectBox;
QFrame *m_pOutputSlectWidget;
UkuiButtonDrawSvg *m_pOutputIconBtn;
AudioSlider *m_pOpVolumeSlider;
UkmediaVolumeSlider *m_pOpBalanceSlider;
KSwitchButton *m_pVolumeIncreaseButton;
QVBoxLayout *m_pVlayout;
QString sliderQss;
};
#endif // UKMEDIAOUTPUTWIDGET_H
ukui-media/audio/audio.cpp 0000664 0001750 0001750 00000004631 15170052044 014442 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "audio.h"
#include "ui_audio.h"
#include
#include
#include
Audio::Audio() : mFirstLoad(true)
{
#ifndef QT_NO_TRANSLATION
QString translatorFileName = QLatin1String("qt_");
translatorFileName += QLocale::system().name();
QTranslator *pTranslator = new QTranslator();
if (pTranslator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
QApplication::installTranslator(pTranslator);
#endif
QTranslator *translator = new QTranslator(this);
translator->load("/usr/share/ukui-media/translations/audio/" + QLocale::system().name());
QApplication::installTranslator(translator);
pluginName = tr("Audio");
pluginType = SYSTEM;
}
Audio::~Audio()
{
}
QString Audio::plugini18nName()
{
return pluginName;
}
int Audio::pluginTypes()
{
return pluginType;
}
QWidget *Audio::pluginUi()
{
if (mFirstLoad) {
mFirstLoad = false;
widget = new UkmediaMainWidget;
}
return widget;
}
bool Audio::isEnable() const
{
return true;
}
const QString Audio::name() const
{
return QStringLiteral("Audio");
}
bool Audio::isShowOnHomePage() const
{
return true;
}
QIcon Audio::icon() const
{
return QIcon::fromTheme("audio-volume-high-symbolic");
}
QString Audio::translationPath() const
{
return "/usr/share/ukui-media/translations/audio/%1.ts";
}
void Audio::initSearchText()
{
//~ contents_path /UkccPlugin/UkccPlugin
tr("UkccPlugin");
//~ contents_path /UkccPlugin/ukccplugin test
tr("ukccplugin test");
}
ukui-media/audio/customstyle.cpp 0000664 0001750 0001750 00000036375 15170054730 015752 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "customstyle.h"
#include
#include
#include
#include
CustomStyle::CustomStyle(const QString &proxyStyleName, QObject *parent) : QProxyStyle (proxyStyleName)
{
Q_UNUSED(parent);
m_helpTip = new SliderTipLabelHelper(this);
}
CustomStyle::~CustomStyle()
{
}
void CustomStyle::drawComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
{
if(control == CC_ToolButton)
{
/// 我们需�获�ToolButton的详细信�,通过qstyleoption_cast�以得到
/// 对应的option,通过拷è´�æž„é€ å‡½æ•°å¾—åˆ°ä¸€ä»½å¤‡ä»½ç”¨äºŽç»˜åˆ¶å�控件
/// 我们一般�用在�option是怎么得到的,大部分的Qt控件都能够�供了option的init方法
}
return QProxyStyle::drawComplexControl(control, option, painter, widget);
}
void CustomStyle::drawControl(QStyle::ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
{
switch (element) {
case CE_ProgressBar:
{
if (const QStyleOptionProgressBar *pb = qstyleoption_cast(option)) {
QStyleOptionProgressBar subopt = *pb;
subopt.rect = subElementRect(SE_ProgressBarGroove, pb, widget);
proxy()->drawControl(CE_ProgressBarGroove, &subopt, painter, widget);
subopt.rect = subElementRect(SE_ProgressBarContents, pb, widget);
proxy()->drawControl(CE_ProgressBarContents, &subopt, painter, widget);
//这是这个控件的当å‰�进度的文å—ï¼Œä½ é‚£è¾¹çœ‹æƒ…å†µæ˜¯å�¦éœ€è¦�绘制
// if (pb->textVisible) {
// subopt.rect = subElementRect(SE_ProgressBarLabel, pb, widget);
// proxy()->drawControl(CE_ProgressBarLabel, &subopt, painter, widget);
// }
return;
}
break;
}
case CE_ProgressBarGroove:
{
//è¿™æ˜¯è¿™ä¸ªæŽ§ä»¶çš„èƒŒæ™¯ï¼Œä½ é‚£è¾¹çœ‹æƒ…å†µæ˜¯å�¦ç»˜åˆ¶
return;
if (const QStyleOptionProgressBar *pbg = qstyleoption_cast(option)) {
const bool enable = pbg->state &State_Enabled;
painter->save();
painter->setRenderHint(QPainter::Antialiasing, true);
painter->setPen(Qt::NoPen);
painter->setBrush(pbg->palette.brush(enable ? QPalette::Active : QPalette::Disabled, QPalette::Window));
painter->drawRect(pbg->rect);
painter->restore();
return;
}
break;
}
case CE_ProgressBarContents:
{
if (const QStyleOptionProgressBar *bar = qstyleoption_cast(option)) {
if (bar->progress == bar->maximum)
return;
const bool enable = bar->state & QStyle::State_Enabled;
bool vertical = false;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (widget) {
const QProgressBar *progressBar = qobject_cast(widget);
if (progressBar) {
vertical = (progressBar->orientation() == Qt::Vertical);
}
}
#else
vertical = (bar->orientation == Qt::Vertical);
#endif
const bool inverted = bar->invertedAppearance;
qint64 minimum = qint64(bar->minimum);
qint64 maximum = qint64(bar->maximum);
qint64 progress = qint64(bar->progress);
qint64 totalSteps = qMax(Q_INT64_C(1), maximum - minimum);
qint64 progressSteps = progress - bar->minimum;
qint64 progressBarWidth = progressSteps * (vertical ? bar->rect.height() : bar->rect.width()) / totalSteps;
int ProgressBarItem_Width = 4;
int ProgressBarItem_Distance = 16;
int distance = ProgressBarItem_Distance + ProgressBarItem_Width;
int num = progressBarWidth / distance;
int totalnum = (vertical ? bar->rect.height() : bar->rect.width()) / distance;
bool reverse = (!vertical && (bar->direction == Qt::RightToLeft)) || vertical;
if (inverted)
reverse = !reverse;
int ProgressBarItem_Hight = 16;
QRect drawRect(bar->rect);
if (vertical) {
drawRect.setWidth(ProgressBarItem_Hight);
} else {
drawRect.setHeight(ProgressBarItem_Hight);
}
drawRect.moveCenter(bar->rect.center());
QRect itemRect(drawRect);
painter->save();
painter->setPen(Qt::NoPen);
painter->setRenderHints(QPainter::Antialiasing, true);
for (int var = 0; var < totalnum; ++var) {
if (var < num) {
if (enable)
painter->setBrush(bar->palette.brush(QPalette::Active, QPalette::Highlight));
else {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
painter->setBrush(bar->palette.color(QPalette::Active, QPalette::Highlight).lighter(150));
#else
painter->setBrush(bar->palette.color(QPalette::Active, QPalette::Highlight).light(150));
#endif
}
} else {
painter->setBrush(bar->palette.brush(enable ? QPalette::Active : QPalette::Disabled, QPalette::Button));
}
if (vertical)
itemRect.setRect(drawRect.left(), !reverse ? drawRect.top() + var * distance : drawRect.bottom() - ProgressBarItem_Width - var * distance,
drawRect.width(), ProgressBarItem_Width);
else
itemRect.setRect(reverse ? drawRect.right() - ProgressBarItem_Width - var * distance : drawRect.left() + var * distance, drawRect.top(),
ProgressBarItem_Width, drawRect.height());
painter->drawRoundedRect(itemRect, ProgressBarItem_Width/2, ProgressBarItem_Width/2);
}
painter->restore();;
return;
}
break;
}
default:
break;
}
return QProxyStyle::drawControl(element, option, painter, widget);
}
void CustomStyle::drawItemPixmap(QPainter *painter, const QRect &rectangle, int alignment, const QPixmap &pixmap) const
{
return QProxyStyle::drawItemPixmap(painter, rectangle, alignment, pixmap);
}
void CustomStyle::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const
{
return QProxyStyle::drawItemText(painter, rectangle, alignment, palette, enabled, text, textRole);
}
//绘制简å�•的颜色圆角ç‰
void CustomStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
{
switch (element) {
//绘制 ToolButton
case PE_PanelButtonTool:{
painter->save();
painter->setRenderHint(QPainter::Antialiasing,true);
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xff,0xff,0xff,0x00));
painter->drawRoundedRect(option->rect,4,4);
if (option->state & State_MouseOver) {
if (option->state & State_Sunken) {
painter->setRenderHint(QPainter::Antialiasing,true);
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xff,0xff,0xff,0x14));
painter->drawRoundedRect(option->rect,4,4);
qDebug() << " 点击按钮";
} else {
painter->setRenderHint(QPainter::Antialiasing,true);
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xff,0xff,0xff,0x1f));
painter->drawRoundedRect(option->rect,4,4);
qDebug() << "悬�按钮";
}
}
painter->restore();
return;
}
case PE_PanelTipLabel:{
painter->save();
painter->setRenderHint(QPainter::Antialiasing,true);
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xff,0xff,0x00,0xff));
painter->drawRoundedRect(option->rect,4,4);
painter->restore();
return;
}break;
case PE_PanelButtonCommand:{
painter->save();
painter->setRenderHint(QPainter::TextAntialiasing,true);
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xff,0xff,0xff,0x00));
if (option->state & State_MouseOver) {
if (option->state & State_Sunken) {
painter->setRenderHint(QPainter::Antialiasing,true);
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0x3d,0x6b,0xe5,0xff));
painter->drawRoundedRect(option->rect,4,4);
} else {
painter->setRenderHint(QPainter::Antialiasing,true);
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xff,0xff,0xff,0x1f));
painter->drawRoundedRect(option->rect.adjusted(2,2,-2,-2),4,4);
}
}
painter->restore();
return;
}break;
}
return QProxyStyle::drawPrimitive(element, option, painter, widget);
}
QPixmap CustomStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const
{
return QProxyStyle::generatedIconPixmap(iconMode, pixmap, option);
}
QStyle::SubControl CustomStyle::hitTestComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, const QPoint &position, const QWidget *widget) const
{
return QProxyStyle::hitTestComplexControl(control, option, position, widget);
}
QRect CustomStyle::itemPixmapRect(const QRect &rectangle, int alignment, const QPixmap &pixmap) const
{
return QProxyStyle::itemPixmapRect(rectangle, alignment, pixmap);
}
QRect CustomStyle::itemTextRect(const QFontMetrics &metrics, const QRect &rectangle, int alignment, bool enabled, const QString &text) const
{
return QProxyStyle::itemTextRect(metrics, rectangle, alignment, enabled, text);
}
//
int CustomStyle::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
{
switch (metric){
case PM_ProgressBarChunkWidth:
{
int ProgressBarItem_Width = 4;
int ProgressBarItem_Distance = 16;
return ProgressBarItem_Width + ProgressBarItem_Distance;
}
case PM_ToolBarIconSize:{
return (int)48*qApp->devicePixelRatio();
}
default:
break;
}
return QProxyStyle::pixelMetric(metric, option, widget);
}
//
void CustomStyle::polish(QWidget *widget)
{
if (widget) {
if (widget->inherits("QTipLabel")) {
widget->setAttribute(Qt::WA_TranslucentBackground);
QPainterPath path;
auto rect = widget->rect();
rect.adjust(0,0,0,0);
path.addRoundedRect(rect,6,6);
widget->setProperty("blurRegion",QRegion(path.toFillPolygon().toPolygon()));
}
}
if (widget) {
if (widget->inherits("QLable")) {
const_cast (widget)->setAttribute(Qt::WA_TranslucentBackground);
widget->setAttribute(Qt::WA_TranslucentBackground);
QPainterPath path;
auto rect = widget->rect();
rect.adjust(0,0,0,0);
path.addRoundedRect(rect,6,6);
widget->setProperty("blurRegion",QRegion(path.toFillPolygon().toPolygon()));
}
}
if (widget){
widget->setAttribute(Qt::WA_Hover);
widget->inherits("QSlider");
m_helpTip->registerWidget(widget);
widget->installEventFilter(this);
}
return QProxyStyle::polish(widget);
}
void CustomStyle::polish(QApplication *application)
{
return QProxyStyle::polish(application);
}
//
void CustomStyle::polish(QPalette &palette)
{
// return QProxyStyle::polish(palette);
// QProxyStyle::polish(palette);
// palette.setBrush(QPalette::Foreground, Qt::black);
QColor lightBlue(200, 0, 0);
palette.setBrush(QPalette::Highlight, lightBlue);
}
void CustomStyle::unpolish(QWidget *widget)
{
return QProxyStyle::unpolish(widget);
}
void CustomStyle::unpolish(QApplication *application)
{
return QProxyStyle::unpolish(application);
}
QSize CustomStyle::sizeFromContents(QStyle::ContentsType type, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget) const
{
QSize newSize = contentsSize;
switch (type) {
case CT_ProgressBar:
{
qDebug()<pixelMetric(QStyle::PM_ProgressBarChunkWidth, option, widget);
newSize.setWidth(cw * ProgressBarItem_Num);
return newSize;
}
default:
break;
}
return QProxyStyle::sizeFromContents(type, option, contentsSize, widget);
}
QIcon CustomStyle::standardIcon(QStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
{
return QProxyStyle::standardIcon(standardIcon, option, widget);
}
QPalette CustomStyle::standardPalette() const
{
return QProxyStyle::standardPalette();
}
//如果需�背景�明也许需�用到这个函数
int CustomStyle::styleHint(QStyle::StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const
{
switch (hint) {
/// 让ScrollView viewport的绘制区域包�scrollbar和corner widget
/// 这个例å�䏿²¡æœ‰ä»€ä¹ˆä½œç”¨ï¼Œå¦‚果我们需è¦�绘制一个背景é€�明的滚动æ�¡
/// 这个style hint对我们的æ„�ä¹‰åº”è¯¥å¾ˆå¤§ï¼Œå› ä¸ºæˆ‘ä»¬å¸Œæœ›è§†å›¾èƒ½å¤Ÿå¸®åŠ©
/// 我们填充滚动�的背景区域,�则当背景�明时底下会出现明显的分割
case SH_ScrollView_FrameOnlyAroundContents: {
return false;
}
default:
break;
}
return QProxyStyle::styleHint(hint, option, widget, returnData);
}
QRect CustomStyle::subControlRect(QStyle::ComplexControl control, const QStyleOptionComplex *option, QStyle::SubControl subControl, const QWidget *widget) const
{
return QProxyStyle::subControlRect(control, option, subControl, widget);
}
QRect CustomStyle::subElementRect(QStyle::SubElement element, const QStyleOption *option, const QWidget *widget) const
{
switch (element) {
case SE_ProgressBarGroove:
case SE_ProgressBarContents:
return option->rect;
default:
break;
}
return QProxyStyle::subElementRect(element, option, widget);
}
ukui-media/audio/translations/ 0000775 0001750 0001750 00000000000 15170054730 015356 5 ustar feng feng ukui-media/audio/translations/ky.ts 0000664 0001750 0001750 00000073546 15170054730 016370 0 ustar feng feng
Audio
Audio
دووش
UkccPlugin
ukccplugin سىنىعى
/UkccPlugin/UkccPlugin
ukccplugin test
ukccplugin سىنىعى
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
كىرگىزۉۉ جابدۇۇلار.
Confirm
البەتتە.
OutputDevWidget
Output Devices
ۅندۉرۉش جابدۇۇلار.
Confirm
البەتتە.
QObject
pa_context_get_server_info() failed
pa_context_get_server_info() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
Card callback failure
كارتوچكا قايتارۇۇ جەÚىلۉۉ بولدۇ
Sink callback failure
قايتما ۅندۉرۉش جەÚىلۉۉ بولۇش
Source callback failure
قايتما كىرگىزۉۉ جەÚىلۉۉ بولدۇ
Sink input callback failure
Ú†Û…Ú¯Û‰Ù¾ باراتات. قايتما كىرگىزۉۉ جەÚىلۉۉ بولدۇ
Source output callback failure
ÙƒÛ•Ù„Û‰Û‰ جەر جانى ۅندۉرۉش قايتما ØªÛ•ÚØ´Û…Û… جەÚىلۉۉ بولدۇ
Client callback failure
تىرمىنال قايتما ØªÛ•ÚØ´Û•Ú¯Ù‰ جەÚىلۉۉ بولدۇ
Server info callback failure
مۇلازىمەتىر قايتما ØªÛ•ÚØ´Û•Ú¯Ù‰ جەÚىلۉۉ بولدۇ
Failed to initialize stream_restore extension: %s
stream_restore نى Ú†Û•Ú†Û‰Û‰ جەÚىلۉۉ بولدۇ : Ùªs
pa_ext_stream_restore_read() failed
pa_ext_stream_restore_read() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
Failed to initialize device manager extension: %s
شايمان باشقارعىچتى ÙƒÛ•Úەيتۉۉنۉ العاچىنا كەتىرىش جەÚىلۉۉ بولدۇ : Ùªs
pa_ext_device_manager_read() failed
pa_ext_device_manager_read() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_sink_info_by_index() failed
pa_context_get_sink_info_by_index() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_source_info_by_index() failed
pa_context_get_source_info_by_index() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_sink_input_info() failed
pa_context_get_sink_input_info() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_client_info() failed
pa_context_get_client_info() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_card_info_by_index() failed
pa_context_get_card_info_by_index() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_subscribe() failed
pa_context_subscribe() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_client_info_list() failed
pa_context_client_info_list() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_card_info_list() failed
pa_context_get_card_info_list() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_sink_info_list() failed
pa_context_get_sink_info_list() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_source_info_list() failed
pa_context_get_source_info_list() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_sink_input_info_list() failed
pa_context_get_sink_input_info_list() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_get_source_output_info_list() failed
pa_context_get_source_output_info_list() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
Ukui Media Volume Control
Ukui Media دووش كونتىرول جاسوو ،اتقارۇۇ
UkmediaAppCtrlWidget
App Sound Control
تىركەمە دووش تىزگىندۅۅ جاسوو ،اتقارۇۇ پىروگىرامماسى
None
جوق
System Volume
ساامالىق وبونۇ
UkmediaAppItemWidget
Application
پراگرامما
Output Volume
ۅندۉرۉش ۅلچۅمۉ
Input Device
كىيىرگىچ
This case does not support setting the input device
بۇل تۉر مۇرۇن .جاعداي كىرگىزگىچتى ØªÛ•ÚØ´Û•شتى قولدوبويت
Output Device
ۅندۉرۉش جابدۇۇسۇن تانداش
This case does not support setting the output device
بۇل تۉر مۇرۇن .جاعداي ۅندۉرۉش جابدۇۇسۇن ØªÛ•ÚØ´Û•شتى قولدوبويت
Confirm
البەتتە.
UkmediaDevControlWidget
audio device control
声音设备管�
output device
输出设备
input device
输入设备
Sound Equipment Control
دووش جابدۇۇلار. تىزگىندۅۅ جاسوو ،اتقارۇۇ
Output Devices
ۅندۉرۉش جابدۇۇلار.
Input Devices
كىرگىزۉۉ جابدۇۇلار.
UkmediaInputWidget
Input
كىرگىز
/Audio/Input
Input Device
كىيىرگىچ
/Audio/Input Device
Volume
ÙƒÛ…Ù„Û…Ù…Û‰
/Audio/Volume
Input Level
كىرگىزۉۉ ئنكاسى
/Audio/Input Level
Noise Reduction
ىزى-چۇۇ اپتوماتتىك تۅمۅندۅتۉۉ
/Audio/Noise Reduction
Voice Monitor
دووش كۉزۅتكۉچ
/audio/Voice Monitor
(None Device)
(شايمان جوق)
You can hear your voice in the output device of your choice
سىز ۅزۉÚۉز تاندالعان ۅندۉرۉش اسپابىنان ابازىÚىزدى ۇعا الاسىز
UkmediaMainWidget
Light-Seeking
寻光
HeYin
和�
Custom
ۅزۉ بەكىتۉۉ
None
جوق
UkmediaOutputWidget
Output
چىعۇۇ
/Audio/Output
Output Device
ۅندۉرۉش جابدۇۇسۇن تانداش
/Audio/Output Device
Master Volume
دووش
/Audio/Master Volume
Balance
جارىقتىق تەÚÙ¾Û‡Úلۇقىنى ØªÛ•ÚØ´Û…Û…
/Audio/Balance
Left
سولعو
Right
ÙˆÚ ØªØ§Ø±Ø§Ù¾
Volume Increase
دووشتۇ جوعورۇلاتۇۇ
Volume above 100% can cause sound distortion and damage your speakers.
وبونۇ ٪100 تىن جوعورۇ دووش بۇرۇلۇش كەلىترىپ چىعارات، قانايعا زىيان جەتگۉزۉلەت.
Mono Audio
مونو دوبۇش
It merges the left and right channels into one channel.
ال ÙˆÚ-سول قانالدار بىر لەشتىرىپ بىر قانالعا الماشتىرات .
UkmediaSettingsWidget
Advanced Settings
جوعورۇ ØªÛ•ÚØ´Û•كتەر
Sound Equipment Control
دووش جابدۇۇلار. تىزگىندۅۅ جاسوو ،اتقارۇۇ
/Audio/Sound Equipment Control
Details
ىچكەلەي ، قۇنت قويۇپ ماتىرىيال
App Sound Control
تىركەمە دووش تىزگىندۅۅ جاسوو ،اتقارۇۇ پىروگىرامماسى
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
ساامالىق دووش ۅنۉمۉ
Sound Theme
دووش تەماسى
/Audio/Sound Theme
Beep Switch
ەسكەرتۉۉ وبونۇ
/Audio/Beep Switch
Poweroff Music
بەكىتىش
/Audio/Poweroff Music
Startup Music
اچۇۇ
/Audio/Startup Music
Wakeup Music
ويعونۇۇ.
/Audio/Wakeup Music
Notification Sound
ۇقتۇرۇۇ وبونۇ
/Audio/Notification Sound
Volume Control Sound
دووشتۇ تىزگىندۅۅ جاسوو ،اتقارۇۇ وبونۇ
/Audio/Volume Control Sound
Logout Music
تىزىمدىكىتىن ۅچۉرۉۉ
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_volume_by_index() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_sink_mute_by_index() failed
pa_context_set_sink_mute_by_index() جەÚىلۉۉ بولدۇ
pa_context_set_source_mute_by_index() failed
pa_context_set_source_mute_by_index() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_source_volume_by_index() failed
pa_context_set_source_volume_by_index() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_source_output_volume() failed
pa_context_set_source_output_volume() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_source_output_mute() failed
pa_context_set_source_output_mute() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_card_profile_by_index() failed
pa_context_set_card_profile_by_index() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_default_sink() failed
pa_context_set_default_sink() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_default_source() failed
pa_context_set_default_source() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_sink_port_by_name() failed
pa_context_set_sink_port_by_name() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
pa_context_set_source_port_by_name() failed
pa_context_set_source_port_by_name() اتقارماق جاسوو ،اتقارۇۇ جەÚىلۉۉ بولدۇ
(plugged in)
( قاتىشقان)
(unavailable)
(ىشتەتكەلى بولبويت )
(unplugged)
ۇلانبادى
Failed to read data from stream
اعىمدان ساندۇۇ باياندامالاردى وقۇۇ جەÚىلۉۉ بولدۇ
Peak detect
چوقۇ نارق تەكشەرىش
Failed to create monitoring stream
كۉزۅتۉۉ اعىمى قۇرۇۇ جەÚىلۉۉ بولدۇ
Failed to connect monitoring stream
كۉزۅتۉۉ اعىمدى ۇلوو جەÚىلۉۉ بولدۇ
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
Ú†Û…Ú¯Û‰Ù¾ باراتات. نارق كىرگىزۉۉ نازاردان ساق اتقارىلدى ØŒ انتكەنى ال بىر وقۇيالۇۇ دەپ بەكىتىلدى، وشوعو ÙˆÙ‚Û‡ÙŠØ§Ù„Û‡Û‡Ù†Ù‰Ú ÙƒÙ‰Ú†Ù‰Ùƒ بۅلۅگۉ ووردۇندا بىر تەرەپ اتقارىلدى
pa_context_kill_source_output() failed
pa_context_kill_source_output() جەÚىلۉۉ بولدۇ
Establishing connection to PulseAudio. Please wait...
PulseAudio Ù†Ù‰Ú Û‡Ù„Ø§Ù†Û‡Û‡Ø³Û‡ قۇرۇلۇپ جاتات، سەل ساقتاپ تۇرۇÚ
ukui-media/audio/translations/zh_CN.ts 0000664 0001750 0001750 00000062363 15170054730 016741 0 ustar feng feng
Audio
Audio
声音
UkccPlugin
/UkccPlugin/UkccPlugin
ukccplugin test
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
输入设备
Confirm
确认
OutputDevWidget
Output Devices
输出设备
Confirm
确认
QObject
pa_context_get_server_info() failed
Card callback failure
Sink callback failure
Source callback failure
Sink input callback failure
Source output callback failure
Client callback failure
Server info callback failure
Failed to initialize stream_restore extension: %s
pa_ext_stream_restore_read() failed
Failed to initialize device manager extension: %s
pa_ext_device_manager_read() failed
pa_context_get_sink_info_by_index() failed
pa_context_get_source_info_by_index() failed
pa_context_get_sink_input_info() failed
pa_context_get_client_info() failed
pa_context_get_card_info_by_index() failed
pa_context_subscribe() failed
pa_context_client_info_list() failed
pa_context_get_card_info_list() failed
pa_context_get_sink_info_list() failed
pa_context_get_source_info_list() failed
pa_context_get_sink_input_info_list() failed
pa_context_get_source_output_info_list() failed
Ukui Media Volume Control
UkmediaAppCtrlWidget
App Sound Control
应用声音
None
æ—
System Volume
系统
UkmediaAppItemWidget
Application
应用
Output Volume
输出音�
Input Device
输入设备
This case does not support setting the input device
该情况�支�设置输入设备
Output Device
输出设备
This case does not support setting the output device
该情况�支�设置输出设备
Confirm
确认
UkmediaDevControlWidget
audio device control
声音设备管�
output device
输出设备
input device
输入设备
Sound Equipment Control
声音设备管�
Output Devices
输出设备
Input Devices
输入设备
UkmediaInputWidget
Input
输入
/Audio/Input
Input Device
选择输入设备
/Audio/Input Device
Volume
音�
/Audio/Volume
Input Level
音��馈
/Audio/Input Level
Noise Reduction
智能�噪
/Audio/Noise Reduction
Voice Monitor
侦å�¬æ¤è®¾å¤‡
/audio/Voice Monitor
(None Device)
(æ— è®¾å¤‡)
You can hear your voice in the output device of your choice
å�¯åœ¨æ‰€é€‰è¾“出设备ä¸å�¬åˆ°è‡ªå·±çš„声音
UkmediaMainWidget
Light-Seeking
寻光
HeYin
和�
Custom
自定义
None
æ—
UkmediaOutputWidget
Output
输出
/Audio/Output
Output Device
选择输出设备
/Audio/Output Device
Master Volume
音�
/Audio/Master Volume
Balance
声�平衡
/Audio/Balance
Left
å·¦
Right
�
Volume Increase
音�增强
Volume above 100% can cause sound distortion and damage your speakers.
音é‡�超过100%æ—¶å�¯èƒ½ä¼šå¯¼è‡´éŸ³æ•ˆå¤±çœŸå¹¶æ�Ÿå®³ä½ 的扬声器。
Mono Audio
�声�音频
It merges the left and right channels into one channel.
会将左声�和�声��并�一个声�
UkmediaSettingsWidget
Advanced Settings
高级设置
Sound Equipment Control
声音设备管�
/Audio/Sound Equipment Control
Details
详情
App Sound Control
应用声音
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
系统音效
Sound Theme
音效主题
/Audio/Sound Theme
Beep Switch
�示音
/Audio/Beep Switch
Poweroff Music
关机
/Audio/Poweroff Music
Startup Music
开机
/Audio/Startup Music
Wakeup Music
唤醒
/Audio/Wakeup Music
Notification Sound
接收通知
/Audio/Notification Sound
Volume Control Sound
音�调节
/Audio/Volume Control Sound
Logout Music
注销
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_mute_by_index() failed
pa_context_set_source_mute_by_index() failed
pa_context_set_source_volume_by_index() failed
pa_context_set_source_output_volume() failed
pa_context_set_source_output_mute() failed
pa_context_set_card_profile_by_index() failed
pa_context_set_default_sink() failed
pa_context_set_default_source() failed
pa_context_set_sink_port_by_name() failed
pa_context_set_source_port_by_name() failed
(plugged in)
(unavailable)
(unplugged)
Failed to read data from stream
Peak detect
Failed to create monitoring stream
Failed to connect monitoring stream
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
pa_context_kill_source_output() failed
Establishing connection to PulseAudio. Please wait...
ukui-media/audio/translations/kk.ts 0000664 0001750 0001750 00000071623 15170054730 016344 0 ustar feng feng
Audio
Audio
Û‡Ù†
UkccPlugin
مىندەتتى ستونى
/UkccPlugin/UkccPlugin
ukccplugin test
ukccplugin سىنىعى
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
كىرگىزۋ اسباپتارى
Confirm
تۇراقتاندىرۋ
OutputDevWidget
Output Devices
جاريالاۋ اسباپتارى
Confirm
تۇراقتاندىرۋ
QObject
pa_context_get_server_info() failed
pa_context_get_server_info() اتقار ەتۋ جەÚىلىپ قالدى
Card callback failure
قاريتا قايتارىپ ەتۋ جەÚىلىپ قالدى
Sink callback failure
قايتتما جاريالاۋ جەÚىلىپ بولۋ
Source callback failure
قايتتما كىرگىزۋ جەÚىلىپ قالدى
Sink input callback failure
چۆكمە قايتتما كىرگىزۋ جەÚىلىپ قالدى
Source output callback failure
قاينار جاريالاۋ قايتتما ØªÛ•ÚØ´Û•Û‹ جەÚىلىپ قالدى
Client callback failure
Ø³ÙˆÚØ¹Ù¸ ۇشٸ قايتتما تەÚگەرگٸش جەÚىلىپ قالدى
Server info callback failure
قىزىمەت وتەۋ اسبابى قايتتما تەÚگەرگٸش جەÚىلىس قالدى
Failed to initialize stream_restore extension: %s
stream_restore نى جايۋ جەÚىلىس قالدى: Ùªs
pa_ext_stream_restore_read() failed
pa_ext_stream_restore_read() اتقار ەتۋ جەÚىلىپ قالدى
Failed to initialize device manager extension: %s
اسباب باسقارۋشنى ÙƒÛ•Úەيتۋدى قالپىنا قايتارۋ جەÚىلىپ قالدى: Ùªs
pa_ext_device_manager_read() failed
pa_ext_device_manager_read() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_sink_info_by_index() failed
pa_context_get_sink_info_by_index() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_source_info_by_index() failed
pa_context_get_source_info_by_index() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_sink_input_info() failed
pa_context_get_sink_input_info() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_client_info() failed
pa_context_get_client_info() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_card_info_by_index() failed
pa_context_get_card_info_by_index() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_subscribe() failed
pa_context_subscribe() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_client_info_list() failed
pa_context_client_info_list() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_card_info_list() failed
pa_context_get_card_info_list() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_sink_info_list() failed
pa_context_get_sink_info_list() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_source_info_list() failed
pa_context_get_source_info_list() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_sink_input_info_list() failed
pa_context_get_sink_input_info_list() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_get_source_output_info_list() failed
pa_context_get_source_output_info_list() اتقار ەتۋ جەÚىلىپ قالدى
Ukui Media Volume Control
Ukui Media اۋا كونتىرول ەتۋ
UkmediaAppCtrlWidget
App Sound Control
جيۋ اۋا Ù…Û•Úگەرۋ ەتۋ پٸروگٸرامماسٸ
None
جوق
System Volume
سەستيما داۋىسى
UkmediaAppItemWidget
Application
قولدانعىش
Output Volume
جاريالاۋ كولەمى
Input Device
كىرگىزۋ اسپابٸ
This case does not support setting the input device
Ù†Û‡ ٴتۇر Ø§ØØ§Û‹Ù„ كىرگىزۋ اسپابىن ØªÛ•ÚØ´Û•ۋدٸ قولدامايدى
Output Device
جاريالاۋ اسبابٸن تالداۋ
This case does not support setting the output device
Ù†Û‡ ٴتۇر Ø§ØØ§Û‹Ù„ جاريالاۋ اسبابٸن ØªÛ•ÚØ´Û•ۋدٸ قولدامايدى
Confirm
تۇراقتاندىرۋ
UkmediaDevControlWidget
audio device control
声音设备管�
output device
输出设备
input device
输入设备
Sound Equipment Control
اۋا جابدىقتارىن Ù…Û•Úگەرۋ ەتۋ
Output Devices
جاريالاۋ اسباپتارى
Input Devices
كىرگىزۋ اسباپتارى
UkmediaInputWidget
Input
كىرگىزۋ
/Audio/Input
Input Device
كىرگىزۋ اسپابٸ
/Audio/Input Device
Volume
كولەمى
/Audio/Volume
Input Level
كىرگىزۋ جاۋاب قايتارۋٸ
/Audio/Input Level
Noise Reduction
شۋىل اۆتوماتتى تومەندەتۋ
/Audio/Noise Reduction
Voice Monitor
اۋا كۇزەتۋشى
/audio/Voice Monitor
(None Device)
(اسباب جوق)
You can hear your voice in the output device of your choice
ٴسىز ٶزٸÚٸز تالداعان جاريالاۋ اسپابىنان داۋسىÚىزدى ئاÚلىيالايٴسىز
UkmediaMainWidget
Light-Seeking
寻光
HeYin
和�
Custom
ٶزى بەلگٸلەۋ
None
جوق
UkmediaOutputWidget
Output
جاريالاۋ
/Audio/Output
Output Device
جاريالاۋ اسبابٸن تالداۋ
/Audio/Output Device
Master Volume
اۋا
/Audio/Master Volume
Balance
جارىقتىق تەپە-ØªÛ•ÚØ¯Ù‰Ùƒ ØªÛ•ÚØ´Û•Û‹
/Audio/Balance
Left
سول
Right
ÙˆÚ Ø¬Ø§Ù‚
Volume Increase
دٸبٸستٸ جوعارتىلۋ
Volume above 100% can cause sound distortion and damage your speakers.
داۋىسى ٪100 تىن جوعارعى اۋا بۇرىلۋ كەتىرىپ شٸعارادٸ، كانايگا زيان جەتكىزەدى.
Mono Audio
مونو ۇن
It merges the left and right channels into one channel.
ول ÙˆÚ-سول كانالداردى بٸرلەستٸرٸپ بٸر كانالعا ايلاندٸرادٸ.
UkmediaSettingsWidget
Advanced Settings
جوعارى ØªÛ•ÚØ´Û•ۋلەر
Sound Equipment Control
اۋا جابدىقتارىن Ù…Û•Úگەرۋ ەتۋ
/Audio/Sound Equipment Control
Details
ناقتى مازمۇنى
App Sound Control
جيۋ اۋا Ù…Û•Úگەرۋ ەتۋ پٸروگٸرامماسٸ
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
سەستيما اۋا ٶنىمى
Sound Theme
اۋا تەمەسى
/Audio/Sound Theme
Beep Switch
ەسكەرتپەۋ داۋىسى
/Audio/Beep Switch
Poweroff Music
تاقاۋ
/Audio/Poweroff Music
Startup Music
ٸشٸۋ
/Audio/Startup Music
Wakeup Music
ويانۋ
/Audio/Wakeup Music
Notification Sound
ۇقتٸرۋ داۋىسى
/Audio/Notification Sound
Volume Control Sound
دٸبٸستٸ Ù…Û•Úگەرۋ ەتۋ داۋىسى
/Audio/Volume Control Sound
Logout Music
تٸزٸمدەن ٴوشىرۋ
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_volume_by_index() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_sink_mute_by_index() failed
pa_context_set_sink_mute_by_index() جەÚىلىپ قالدى
pa_context_set_source_mute_by_index() failed
pa_context_set_source_mute_by_index() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_source_volume_by_index() failed
pa_context_set_source_volume_by_index() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_source_output_volume() failed
pa_context_set_source_output_volume() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_source_output_mute() failed
pa_context_set_source_output_mute() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_card_profile_by_index() failed
pa_context_set_card_profile_by_index() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_default_sink() failed
pa_context_set_default_sink() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_default_source() failed
pa_context_set_default_source() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_sink_port_by_name() failed
pa_context_set_sink_port_by_name() اتقار ەتۋ جەÚىلىپ قالدى
pa_context_set_source_port_by_name() failed
pa_context_set_source_port_by_name() اتقار ەتۋ جەÚىلىپ قالدى
(plugged in)
(شارپىلدى)
(unavailable)
(ٸستەتكەلٸ بولمايدى)
(unplugged)
جالعاۋنبادٸ
Failed to read data from stream
اعىمنان ساندىق مالىمەتتەردى وقۋ جەÚىلىپ قالدى
Peak detect
شوقى ٴمان تەكسەرۋ
Failed to create monitoring stream
كۇزەتۋگە اعٸمٸ قۇرۋ جەÚىلىپ قالدى
Failed to connect monitoring stream
كۇزەتۋگە مەنى اۋلاۋ جەÚىلىپ قالدى
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
چۆكمە ٴمان كىرگىزۋ نازاردان ساقتانۋ قىلىندى، ۇيتكەنٸ ول بٸر ۋاقىيعالىقتى دوپ بەكٸتٸلدٸ، سوندىقتان Û‹Ø§Ù‚Ù‰ÙŠØ¹Ø§Ù„Ù‰Ù‚ØªÙ‰Ù†Ù‰Ú ÙƒØ´ÙƒÛ•Ù†Û• بولەك ورٸندا بٸرتەرەپ قىلىندى
pa_context_kill_source_output() failed
pa_context_kill_source_output() جەÚىلىپ قالدى
Establishing connection to PulseAudio. Please wait...
PulseAudio Ù†Ù‰Ú ÙˆØ±Ù†Ø§Ù„Ø§Ø³Ù¸Û‹Ù¸ جاسالىپ جاتىر، سەل ساقتاپ تۇر
ukui-media/audio/translations/ms.ts 0000664 0001750 0001750 00000062724 15170054730 016360 0 ustar feng feng
Audio
Audio
UkccPlugin
/UkccPlugin/UkccPlugin
ukccplugin test
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
Confirm
OutputDevWidget
Output Devices
Confirm
QObject
pa_context_get_server_info() failed
Card callback failure
Sink callback failure
Source callback failure
Sink input callback failure
Source output callback failure
Client callback failure
Server info callback failure
Failed to initialize stream_restore extension: %s
pa_ext_stream_restore_read() failed
Failed to initialize device manager extension: %s
pa_ext_device_manager_read() failed
pa_context_get_sink_info_by_index() failed
pa_context_get_source_info_by_index() failed
pa_context_get_sink_input_info() failed
pa_context_get_client_info() failed
pa_context_get_card_info_by_index() failed
pa_context_subscribe() failed
pa_context_client_info_list() failed
pa_context_get_card_info_list() failed
pa_context_get_sink_info_list() failed
pa_context_get_source_info_list() failed
pa_context_get_sink_input_info_list() failed
pa_context_get_source_output_info_list() failed
Ukui Media Volume Control
UkmediaAppCtrlWidget
App Sound Control
None
System Volume
UkmediaAppItemWidget
Application
Output Volume
Input Device
This case does not support setting the input device
Output Device
This case does not support setting the output device
Confirm
UkmediaDevControlWidget
audio device control
声音设备管�
output device
输出设备
input device
输入设备
Sound Equipment Control
Output Devices
Input Devices
UkmediaInputWidget
Input
/Audio/Input
Input Device
/Audio/Input Device
Volume
/Audio/Volume
Input Level
/Audio/Input Level
Noise Reduction
/Audio/Noise Reduction
Voice Monitor
/audio/Voice Monitor
(None Device)
You can hear your voice in the output device of your choice
UkmediaMainWidget
Light-Seeking
寻光
HeYin
和�
Custom
None
UkmediaOutputWidget
Output
/Audio/Output
Output Device
/Audio/Output Device
Master Volume
/Audio/Master Volume
Balance
/Audio/Balance
Left
Right
Volume Increase
Volume above 100% can cause sound distortion and damage your speakers.
Mono Audio
It merges the left and right channels into one channel.
UkmediaSettingsWidget
Advanced Settings
Sound Equipment Control
/Audio/Sound Equipment Control
Details
App Sound Control
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
Sound Theme
/Audio/Sound Theme
Beep Switch
/Audio/Beep Switch
Poweroff Music
/Audio/Poweroff Music
Startup Music
/Audio/Startup Music
Wakeup Music
/Audio/Wakeup Music
Notification Sound
/Audio/Notification Sound
Volume Control Sound
/Audio/Volume Control Sound
Logout Music
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_mute_by_index() failed
pa_context_set_source_mute_by_index() failed
pa_context_set_source_volume_by_index() failed
pa_context_set_source_output_volume() failed
pa_context_set_source_output_mute() failed
pa_context_set_card_profile_by_index() failed
pa_context_set_default_sink() failed
pa_context_set_default_source() failed
pa_context_set_sink_port_by_name() failed
pa_context_set_source_port_by_name() failed
(plugged in)
(unavailable)
(unplugged)
Failed to read data from stream
Peak detect
Failed to create monitoring stream
Failed to connect monitoring stream
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
pa_context_kill_source_output() failed
Establishing connection to PulseAudio. Please wait...
ukui-media/audio/translations/tr.ts 0000664 0001750 0001750 00000060553 15170054730 016364 0 ustar feng feng
Audio
Audio
UkccPlugin
/UkccPlugin/UkccPlugin
ukccplugin test
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
confirm
OutputDevWidget
Output Devices
Confirm
QObject
pa_context_get_server_info() failed
Card callback failure
Sink callback failure
Source callback failure
Sink input callback failure
Source output callback failure
Client callback failure
Server info callback failure
Failed to initialize stream_restore extension: %s
pa_ext_stream_restore_read() failed
Failed to initialize device manager extension: %s
pa_ext_device_manager_read() failed
pa_context_get_sink_info_by_index() failed
pa_context_get_source_info_by_index() failed
pa_context_get_sink_input_info() failed
pa_context_get_client_info() failed
pa_context_get_card_info_by_index() failed
pa_context_subscribe() failed
pa_context_client_info_list() failed
pa_context_get_card_info_list() failed
pa_context_get_sink_info_list() failed
pa_context_get_source_info_list() failed
pa_context_get_sink_input_info_list() failed
pa_context_get_source_output_info_list() failed
Connection failed, attempting reconnect
Ukui Media Volume Control
UkmediaAppCtrlWidget
App Sound Control
None
System Volume
UkmediaAppItemWidget
Application
Output Volume
Input Device
Output Device
Confirm
UkmediaDevControlWidget
Sound Equipment Control
Output Devices
Input Devices
UkmediaInputWidget
Input
/Audio/Input
Input Device
/Audio/Input Device
Volume
/Audio/Volume
Input Level
/Audio/Input Level
Noise Reduction
/audio/Noise
Voice Monitor
/audio/Voice Monitor
(None Device)
You can hear your voice in the output device of your choice
UkmediaMainWidget
Custom
None
UkmediaOutputWidget
Output
/Audio/Output
Output Device
/Audio/Output Device
Master Volume
/Audio/Master Volume
Balance
/Audio/Balance
Left
Right
Volume Increase
Volume above 100% can cause sound distortion and damage your speakers.
Mono Audio
It merges the left and right channels into one channel.
UkmediaSettingsWidget
Advanced Settings
Sound Equipment Control
Details
App Sound Control
UkmediaSoundEffectsWidget
System Sound
Sound Theme
/Audio/Sound Theme
Beep Switch
/Audio/Beep Switch
Poweroff Music
/Audio/Poweroff Music
Startup Music
/Audio/Startup Music
Wakeup Music
/Audio/Wakeup Music
Logout Music
/Audio/Logout Music
Notification Sound
/Audio/Notification Sound
Volume Control Sound
/Audio/Volume Control Sound
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_source_mute_by_index() failed
pa_context_set_source_volume_by_index() failed
pa_context_set_source_output_volume() failed
pa_context_set_source_output_mute() failed
pa_context_set_card_profile_by_index() failed
pa_context_set_default_sink() failed
pa_context_set_default_source() failed
pa_context_set_sink_port_by_name() failed
pa_context_set_source_port_by_name() failed
(plugged in)
(unavailable)
(unplugged)
Failed to read data from stream
Peak detect
Failed to create monitoring stream
Failed to connect monitoring stream
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
pa_context_kill_source_output() failed
Establishing connection to PulseAudio. Please wait...
ukui-media/audio/translations/ug.ts 0000664 0001750 0001750 00000071534 15170054730 016353 0 ustar feng feng
Audio
Audio
ئۈن ـ سىن
UkccPlugin
ukccplugin سىنىقى
/UkccPlugin/UkccPlugin
ukccplugin test
ukccplugin سىنىقى
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
ئۈسكۈنە كىرگۈزۈش
Confirm
جەزىملەشتۈرۈش
OutputDevWidget
Output Devices
چىقىرىش ئۈسكۈنىلىرى
Confirm
جەزىملەشتۈرۈش
QObject
pa_context_get_server_info() failed
pa_context_get_server_info() ئىجرا قىلىش مەغلۇپ بولدى
Card callback failure
كارتا قايتۇرۇۋ�تىش مەغلۇپ بولدى
Sink callback failure
قايتما چىقىرىش مەغلۇپ بولۇش
Source callback failure
قايتما كىرگۈزۈش مەغلۇپ بولدى
Sink input callback failure
چۆكمە قايتما كىرگۈزۈش مەغلۇپ بولدى
Source output callback failure
مەنبە چىقىرىش قايتما ØªÛ•ÚØ´Û•Ø´ مەغلۇپ بولدى
Client callback failure
تÛ�رمىنال قايتما ØªÛ•ÚØ´Ù‰ÙƒÙ‰ مەغلۇپ بولدى
Server info callback failure
مۇلازىمىتÛ�ر قايتما ØªÛ•ÚØ´Ù‰ÙƒÙ‰ مەغلۇب بولدى
Failed to initialize stream_restore extension: %s
stream_restore ئۇزارتىشنى باشلىمىدى: s%
pa_ext_stream_restore_read() failed
pa_ext_stream_restore_read() ئىجرا قىلىش مەغلۇپ بولدى
Failed to initialize device manager extension: %s
ئۈسكۈنە باشقۇرغۇچنى ئۇزارتىشنى قوزغىتىش مەغلۇپ بولدى: s%
pa_ext_device_manager_read() failed
pa_ext_device_manager_read() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_sink_info_by_index() failed
pa_context_get_sink_info_by_index() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_source_info_by_index() failed
pa_context_get_source_info_by_index() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_sink_input_info() failed
pa_context_get_sink_input_info() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_client_info() failed
pa_context_get_client_info() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_card_info_by_index() failed
pa_context_get_card_info_by_index() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_subscribe() failed
pa_context_subscribe() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_client_info_list() failed
pa_context_client_info_list() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_card_info_list() failed
pa_context_get_card_info_list() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_sink_info_list() failed
pa_context_get_sink_info_list() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_source_info_list() failed
pa_context_get_source_info_list() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_sink_input_info_list() failed
pa_context_get_sink_input_info_list() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_get_source_output_info_list() failed
pa_context_get_source_output_info_list() ئىجرا قىلىش مەغلۇپ بولدى
Ukui Media Volume Control
Ukui Media ئاۋاز كونتىرول قىلىش
UkmediaAppCtrlWidget
App Sound Control
ئەپ ئاۋاز كونتىرول قىلىش
None
يوق
System Volume
سىست�ما ئاۋازى
UkmediaAppItemWidget
Application
ئەپ
Output Volume
چىقىرىش ھەجىمى
Input Device
كىرگۈزۈش ئۈسكۈنىسى
This case does not support setting the input device
بۇ دÛ�لو كىرگۈزۈش ئۈسكۈنىسىنى ØªÛ•ÚØ´Û•شنى قوللىمايدۇ
Output Device
چىقىرىش ئۈسكۈنىسىنى تاللاش
This case does not support setting the output device
بۇ دÛ�لودا چىقىرىش ئۈسكۈنىسىنى ØªÛ•ÚØ´Û•Ø´ قوللىمايدۇ
Confirm
جەزىملەشتۈرۈش
UkmediaDevControlWidget
audio device control
声音设备管�
output device
输出设备
input device
输入设备
Sound Equipment Control
ئاۋاز ئۈسكۈنىلىرىنى كونتىرول قىلىش
Output Devices
چىقىرىش ئۈسكۈنىلىرى
Input Devices
ئۈسكۈنە كىرگۈزۈش
UkmediaInputWidget
Input
كىرگۈزۈش
/Audio/Input
Input Device
كىرگۈزۈش ئۈسكۈنىسى
/Audio/Input Device
Volume
ئاۋاز
/Audio/Volume
Input Level
كىرگۈزۈش ئىنكاسى
/Audio/Input Level
Noise Reduction
شاۋقۇننى ئاپتوماتىك تۆۋەنلىتىش
/Audio/Noise Reduction
Voice Monitor
ئاۋاز كۆزەتكۈچ
/audio/Voice Monitor
(None Device)
(ھ�چنىمە ئۈسكۈنىسى)
You can hear your voice in the output device of your choice
ئاۋازىÚىزنى ئۆزىÚىز تاللىغان چىقىرىش ئۈسكۈنىسىدىن ئاÚلىيالايسىز
UkmediaMainWidget
Light-Seeking
寻光
HeYin
和�
Custom
ئۆرپ-ئادەت
None
يوق
UkmediaOutputWidget
Output
چىقىرىش
/Audio/Output
Output Device
چىقىرىش ئۈسكۈنىسىنى تاللاش
/Audio/Output Device
Master Volume
ئاۋاز
/Audio/Master Volume
Balance
ئاۋاز يولى تەÚÙ¾Û‡Úلۇقى
/Audio/Balance
Left
سول
Right
ئوÚ
Volume Increase
ئاۋازنى يۇقىرىلىتىش
Volume above 100% can cause sound distortion and damage your speakers.
100% تىن يۇقىرى ھەجىملىك Ø¦Ø§Û‹Ø§Ø²Ù†Ù‰Ú Ø¨Û‡Ø±Ù…Ù‰Ù„Ù‰Ù†Ù‰Ø´Ù‰Ù†Ù‰ كەلتۈرۈپ چىقىرىدۇ Û‹Û• كانايىÚىزنى زەخىملەندۈرىدۇ.
Mono Audio
Mono Audio
It merges the left and right channels into one channel.
ئۇ سول Û‹Û• Ø¦ÙˆÚ ÙŠÙˆÙ„Ù„Ø§Ø±Ù†Ù‰ بىر قانالغا بىرلەشتۈرىدۇ.
UkmediaSettingsWidget
Advanced Settings
ئىلغار ØªÛ•ÚØ´Û•كلەر
Sound Equipment Control
ئاۋاز ئۈسكۈنىلىرىنى كونتىرول قىلىش
/Audio/Sound Equipment Control
Details
تەپسىلىي ئۇچۇرى:
App Sound Control
ئەپ ئاۋاز كونتىرول قىلىش
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
سىست�ما ئاۋاز ئۈنىمى
Sound Theme
ئاۋاز ت�مىسى
/Audio/Sound Theme
Beep Switch
ئەسكەرتىش ئاۋازى
/Audio/Beep Switch
Poweroff Music
تاقاش
/Audio/Poweroff Music
Startup Music
ئ�چىش
/Audio/Startup Music
Wakeup Music
ئويغىنىش
/Audio/Wakeup Music
Notification Sound
ئۇقتۇرۇش ئاۋازى
/Audio/Notification Sound
Volume Control Sound
ئاۋاز مىقدارىنى كونترول قىلىش ئاۋازى
/Audio/Volume Control Sound
Logout Music
تىزىمدىن ئۆچۈرۈش
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_volume_by_index() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_sink_mute_by_index() failed
pa_context_set_source_mute_by_index() failed
pa_context_set_source_mute_by_index() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_source_volume_by_index() failed
pa_context_set_source_volume_by_index() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_source_output_volume() failed
pa_context_set_source_output_volume() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_source_output_mute() failed
pa_context_set_source_output_mute() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_card_profile_by_index() failed
pa_context_set_card_profile_by_index() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_default_sink() failed
pa_context_set_default_sink() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_default_source() failed
pa_context_set_default_source() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_sink_port_by_name() failed
pa_context_set_sink_port_by_name() ئىجرا قىلىش مەغلۇپ بولدى
pa_context_set_source_port_by_name() failed
pa_context_set_source_port_by_name() ئىجرا قىلىش مەغلۇپ بولدى
(plugged in)
(چ�تىلدى)
(unavailable)
(ئىشلەتكىلى بولمايدۇ)
(unplugged)
ئۇلانمىدى
Failed to read data from stream
ئ�قىمدىن سانلىق مەلۇماتلارنى ئوقۇش مەغلۇپ بولدى
Peak detect
چوققا قىممەت تەكشۈرۈش
Failed to create monitoring stream
كۆزىتىش ئ�قىمى قۇرۇش مەغلۇپ بولدى
Failed to connect monitoring stream
كۆزىتىش ئ�قىمىنى ئۇلاش مەغلۇپ بولدى
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
چۆكمە قىممەت كىرگۈزۈش نەزەردىن ساقىت قىلىندى، چۈنكى ئۇ بىر ۋەقەلىك دەپ بÛ�كىتىلدى، Ø´Û‡ÚØ§ Û‹Û•Ù‚Û•Ù„Ù‰ÙƒÙ†Ù‰Ú ÙƒÙ‰Ú†Ù‰Ùƒ قىسمى ئورنىدا بىرتەرەپ قىلىندى
pa_context_kill_source_output() failed
Establishing connection to PulseAudio. Please wait...
PulseAudio Ù†Ù‰Ú Ø¦Û‡Ù„Ù‰Ù†Ù‰Ø´Ù‰ قۇرۇلىۋاتىدۇ، سەل ساقلاپ تۇرۇÚ
ukui-media/audio/translations/bo_CN.ts 0000664 0001750 0001750 00000076543 15170054730 016725 0 ustar feng feng
Audio
Audio
སྒྲ་ཕབ�
UkccPlugin
ཚོད་ལྟའི་ལྷུ་ལག�
/UkccPlugin/UkccPlugin
ukccplugin test
ལྷུ་ལག་ཡིག་སྒྱུར་ཚོད་ལྟ�
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
ནང་འཇུག་སྒྲིག་ཆས�
Confirm
�ག་ཆོད�
OutputDevWidget
Output Devices
ཕྱིར་ག�ོང་སྒྲིག་ཆས�
Confirm
�ག་ཆོད�
QObject
pa_context_get_server_info() failed
pa_context_get_server_info()ཕམ་ཉེས་བྱུང་བ�
Card callback failure
བྱང་བུ་ཕྱིར་སློག་བྱེད་མ་�ུབ་པ�
Sink callback failure
ཕྱིར་ལྡོག་བྱེད་པར་ཕམ་ཉེས་བྱུང་བ�
Source callback failure
འབྱུང་�ུངས་ཕྱིར་ལྡོག་བྱེད་མ་�ུབ་པ�
Sink input callback failure
མ་དངུལ་འཇོག་པའི་ཕྱིར་ལྡོག་ལ་ཕམ་ཉེས་བྱུང
Source output callback failure
འབྱུང་�ུངས་ཕྱིར་ལྡོག་བྱེད་པར་ཕམ་ཉེས་བྱུང་བ�
Client callback failure
མངགས་བཅོལ་བྱེད་མ�ན་གྱིས་ཕྱིར་སློག་
Server info callback failure
ཞབས་ཞུའི་ཡོ་བྱད་ཀྱི་ཆ་འཕྲིན་ཕྱིར་ལྡོག་བྱེད་མ་�ུབ
Failed to initialize stream_restore extension: %s
stream_restore་རིང་དུ་ག�ོང་བའི་�ོག་མའི་དུས་ཚོད་ལ་སླེབས་མ་�ུབ་པ� %s
pa_ext_stream_restore_read() failed
pa_ext_stream_restore_read()ཕམ་�་བྱུང་བ་རེད�
Failed to initialize device manager extension: %s
སྒྲིག་ཆས་དོ་དམ་གྱི་དུས་འགྱངས་ལ་�ོག་མའི་དུས་འགྱངས་བྱེད་མ་�ུབ་པ� %s
pa_ext_device_manager_read() failed
pa_ext_device_manager_read()ཕམ་ཉེས་བྱུང་བ�
pa_context_get_sink_info_by_index() failed
pa_context_get_sink_info_by_index()ཕམ་�་བྱུང་བ་རེད�
pa_context_get_source_info_by_index() failed
pa_context_get_source_info_by_index()ཕམ་�་བྱུང་བ་རེད�
pa_context_get_sink_input_info() failed
pa_context_get_sink_input_info()ཕམ་�་བྱུང་བ་རེད�
pa_context_get_client_info() failed
pa_context_get_client_info()ཕམ་ཉེས་བྱུང་བ�
pa_context_get_card_info_by_index() failed
pa_context_get_card_info_by_index()ཕམ་ཉེས་བྱུང་བ�
pa_context_subscribe() failed
pa_context_subscribe()ཕམ་�་བྱུང་བ་རེད�
pa_context_client_info_list() failed
pa_context_client_info_list()ཕམ་ཉེས་བྱུང་བ�
pa_context_get_card_info_list() failed
pa_context_get_card_info_list()ཕམ་ཉེས་བྱུང་བ�
pa_context_get_sink_info_list() failed
pa_context_get_sink_info_list()ཕམ་ཉེས་བྱུང་བ�
pa_context_get_source_info_list() failed
pa_context_get_source_info_list()ཕམ་�་བྱུང་བ་རེད�
pa_context_get_sink_input_info_list() failed
pa_context_get_sink_input_info_list()ཕམ་ཉེས་བྱུང་བ�
pa_context_get_source_output_info_list() failed
pa_context_get_source_output_info_list()ཕམ་�་བྱུང་བ་རེད�
Connection failed, attempting reconnect
འབྲེལ་མ�ུད་བྱེད་མ་�ུབ་པར་ཡང་བས�ྱར་འབྲེལ་མ�ུད་བྱེད་རྩིས་བྱས�
Ukui Media Volume Control
�ུའུ་�ི་ལན་གྱི་སྨྱན་སྦྱོར་གྱི་བོངས་
UkmediaAppCtrlWidget
App Sound Control
ཉེར་སྤྱོད་སྒྲ�
None
གཅིག་ཀྱང་མེད�
System Volume
མ་ལག
UkmediaAppItemWidget
Application
ཉེར་སྤྱོད་བྱ་རིམ�
Output Volume
ཕྱིར་ག�ོང་གི་སྒྲ་ཚད�
Input Device
ནང་འཇུག་སྒྲིག་ཆས�
This case does not support setting the input device
གནས་ཚུལ་འདིར་ནང་འཇུག་སྒྲིག་ཆས་ལ་རྒྱབ་ས�ྱོར་བྱེད་མི་�ུབ�
Output Device
ཕྱིར་ག�ོང་སྒྲིག་ཆས�
This case does not support setting the output device
གནས་ཚུལ་འདིར་ཕྱིར་ག�ོང་སྒྲིག་ཆས་ལ་རྒྱབ་ས�ྱོར་མི་བྱེད་པ་�
Confirm
�ག་ཆོད�
UkmediaDevControlWidget
Sound Equipment Control
སྒྲའི་སྒྲིག་ཆས་དོ་དམ�
Output Devices
ཕྱིར་ག�ོང་སྒྲིག་ཆས�
Input Devices
ནང་འཇུག་སྒྲིག་ཆས�
UkmediaInputWidget
Input
མ་དངུལ་འཇོག་པ�
/Audio/Input
Input Device
ནང་འཇུག་སྒྲིག་ཆས�
/Audio/Input Device
Volume
ས�ད་སྒྲ�
/Audio/Volume
Input Level
སྒྲ་ཚད་ཕྱིར་ལན�
/Audio/Input Level
Noise Reduction
རིག་ནུས་ཀྱི་འཛེར་སྒྲ་གཅོག་པ�
/Audio/Noise Reduction
Voice Monitor
སྒྲིག་ཆས་འདི་ལ་ཉན་ཞིབ་�
/audio/Voice Monitor
You can hear your voice in the output device of your choice
འོན་ཀྱང་བདམས་པའི་ཕྱིར་འདོན་སྒྲིག་ཆས་ནང་ནས་རང་ཉིད་ཀྱི་ས�ད་�ོས་�
(None Device)
(སྒྲིག་ཆས་མེད་པ་)
UkmediaMainWidget
Custom
མཚན་ཉིད་རང་འཇོག�
None
གཅིག་ཀྱང་མེད�
UkmediaOutputWidget
Output
�ོན་ཚད�
/Audio/Output
Output Device
ཕྱིར་ག�ོང་སྒྲིག་ཆས�
/Audio/Output Device
Master Volume
སྒྲ་ཚད�
/Audio/Master Volume
Balance
དོ་མཉམ�
/Audio/Balance
Left
གཡོན་ཕྱོགས�
Right
གཡས་གཡོན�
Volume Increase
སྒྲ་ཚད་ཇེ་དྲག་�ུ�
Volume above 100% can cause sound distortion and damage your speakers.
སྒྲ་ཚད་བརྒྱ་ཆ་༡༠༠ལས་བརྒལ་ན་སྒྲ་ནུས་དངོས་མིན་དང་�ྱོད་ཀྱི་སྒྲ་ས�ྱེད་ཆས་ལ་གནོད་པ་�ེབས་སྲིད�
Mono Audio
སྒྲ་ལམ་ར�ྱང་པའི་སྒྲ་ཟློས�
It merges the left and right channels into one channel.
སྒྲ་ལམ་གཡོན་དང་སྒྲ་ལམ་གཡས་ཟླ་སྒྲིལ་བྱས་ནས་སྒྲ་ལམ་གཅིག་�ུ་གྱུར�
UkmediaSettingsWidget
Advanced Settings
མ�ོ་རིམ་སྒྲིག་འགོད�
Sound Equipment Control
སྒྲའི་སྒྲིག་ཆས་དོ་དམ�
/Audio/Sound Equipment Control
Details
གནས་ཚུལ་ཞིབ་ཕྲ�
App Sound Control
ཉེར་སྤྱོད་སྒྲ�
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
མ་ལག་སྒྲ་ནུས�
Sound Theme
སྒྲ་ནུས་ཀྱི་བརྗོད་བྱ�
/Audio/Sound Theme
Alert Sound
ཉེན་བརྡའི་སྒྲ་
/Audio/Alert Sound
Beep Switch
སྣེ་སྟོན་པའི་སྒྲ�
/Audio/Beep Switch
Poweroff Music
གླུ་དབྱངས་སྒོ་བརྒྱབ་པ�
/Audio/Poweroff Music
Startup Music
རོལ་དབྱངས་�་ཕྱེ་བ�
/Audio/Startup Music
Wakeup Music
འབོད་སློང་�
/Audio/Wakeup Music
Notification Sound
བསྡུ་ལེན་བརྡ་�ོ�
/Audio/Notification Sound
Volume Control Sound
སྒྲ་ཚད་སྙོམ་སྒྲིག
/Audio/Volume Control Sound
Volume Change
སྒྲ་གདངས་འགྱུར་ལྡོག
/Audio/Volume Change
Logout Music
རོལ་དབྱངས་མེད་པར་བཟོ་བ�
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_volume_by_index()ཕམ་�་བྱུང་བ་རེད�
pa_context_set_sink_mute_by_index() failed
t_sink_mute_by_index() failed
pa_context_set_source_mute_by_index() failed
pa_context_set_source_mute_by_index()ཕམ་�་བྱུང་བ་རེད�
pa_context_set_source_volume_by_index() failed
pa_context_set_source_volume_by_index()ཕམ་�་བྱུང་བ་རེད�
pa_context_set_source_output_volume() failed
pa_context_set_source_output_volume()ཕམ་�་བྱུང་བ་རེད�
pa_context_set_source_output_mute() failed
pa_context_set_source_output_mute()ཕམ་�་བྱུང་བ་རེད�
pa_context_set_card_profile_by_index() failed
pa_context_set_card_profile_by_index()ཕམ་ཉེས་བྱུང་བ�
pa_context_set_default_sink() failed
pa_context_set_default_sink()ཕམ་�་བྱུང་བ་རེད�
pa_context_set_default_source() failed
pa_context_set_default_source()ཕམ་ཉེས་བྱུང་བ�
pa_context_set_sink_port_by_name() failed
pa_context_set_sink_port_by_name()ཕམ་�་བྱུང་བ་རེད�
pa_context_set_source_port_by_name() failed
pa_context_set_source_port_by_name()ཕམ་ཉེས་བྱུང་བ�
(plugged in)
(ནང་དུ་བཅུག་པ་)�
(unavailable)
(སྤྱོད་གོ་མི་ཆོད་པ)�
(unplugged)
(�་�ོར་ཡ་བྲལ་དུ་སོང་བ་)�
Failed to read data from stream
ཆུ་ཕྲན་ནས་གཞི་གྲངས་ཀློག་མ་�ུབ་པ�
Peak detect
ཡང་རྩེར་ཞིབ་དཔྱད་ཚད་ལེན
Failed to create monitoring stream
ལྟ་ཞིབ་ཚད་ལེན་གྱི་ཆུ་ཕྲན་གསར་ས�ྲུན་བྱེད་མ་�ུབ་པ
Failed to connect monitoring stream
ལྟ་ཞིབ་ཚད་ལེན་གྱི་ཆུ་ཕྲན་སྦྲེལ་མ�ུད་བྱེད་མ་�ུབ་པ
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
དོན་ར�ྱེན་ཞིག་�ུ་བརྩིས་ནས་དོན་ར�ྱེན་ཆུང་ཆུང་ཞིག་�ུ་བརྩིས་ནས་�ག་གཅོད་བྱས་པའི་ར�ྱེན་གྱིས་ཆུ་ནང་དུ་འཛུལ་བར་སྣང་མེད་བྱས་པ་རེད�
pa_context_kill_source_output() failed
_output() failed
Establishing connection to PulseAudio. Please wait...
ཕུའུ་ལུའུ་ཧྲི་ཨོ་�ོ་དང་འབྲེལ་བ་བཙུགས་པ་རེད� ས�ུ་མ�ྱེན་སྒུག་རོགས�...
ukui-media/audio/translations/vi.ts 0000664 0001750 0001750 00000067162 15170054730 016360 0 ustar feng feng
Audio
Audio
Thiết bị âm thanh
UkccPlugin
Plugin Ukcc
/UkccPlugin/UkccPlugin
ukccplugin test
Kiểm tra ukccplugin
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
Thiết bị đầu và o
Confirm
Lưu sá»a đổi
OutputDevWidget
Output Devices
Thiết bị đầu ra
Confirm
Lưu sá»a đổi
QObject
pa_context_get_server_info() failed
Pa_context_get_server_info() thất bại
Card callback failure
Lỗi g�i lại thẻ
Sink callback failure
Lỗi g�i lại Sink thất bại
Source callback failure
Lỗi g�i lại Nguồn thất bại
Sink input callback failure
Lỗi callback đầu và o sink
Source output callback failure
Lỗi phản hồi đầu ra nguồn
Client callback failure
Lỗi g�i lại từ khách hà ng
Server info callback failure
Lỗi callback thông tin máy chủ
Failed to initialize stream_restore extension: %s
Khởi tạo phần mở rộng stream_restore thất bại: %s
pa_ext_stream_restore_read() failed
��c pa_ext_stream_restore thất bại
Failed to initialize device manager extension: %s
Khởi tạo phần mở rộng quản lý thiết bị thất bại: %s
pa_ext_device_manager_read() failed
��c pa_ext_device_manager thất bại
pa_context_get_sink_info_by_index() failed
Lấy thông tin thiết bị xuất âm bằng chỉ mục trong ngữ cảnh PulseAudio thất bại
pa_context_get_source_info_by_index() failed
Lấy thông tin v� source (đầu và o âm thanh) bằng chỉ mục thất bại
pa_context_get_sink_input_info() failed
Pa_context_get_sink_input_info() thất bại
pa_context_get_client_info() failed
Pa context lấy thông tin khách hà ng() thất bại
pa_context_get_card_info_by_index() failed
Lấy thông tin v� card âm thanh theo chỉ số thất bại
pa_context_subscribe() failed
�ăng ký ngữ cảnh PA không thà nh công
pa_context_client_info_list() failed
Hà m pa_context_client_info_list() thực thi thất bại
pa_context_get_card_info_list() failed
Lỗi khi lấy danh sách thông tin card âm thanh của ngữ cảnh PulseAudio
pa_context_get_sink_info_list() failed
Lỗi khi lấy danh sách thông tin đầu ra âm thanh (sink) từ ngữ cảnh PulseAudio
pa_context_get_source_info_list() failed
Lỗi khi lấy danh sách thông tin nguồn âm thanh từ ngữ cảnh PulseAudio
pa_context_get_sink_input_info_list() failed
Hà m pa_context_get_sink_input_info_list() thực thi thất bại
pa_context_get_source_output_info_list() failed
Hà m pa_context_get_source_output_info_list() thực thi thất bại
Ukui Media Volume Control
Bộ đi�u khiển âm lượng đa phương tiện Ukui
UkmediaAppCtrlWidget
App Sound Control
Âm thanh ứng dụng
None
SỠdùng settings hiện tại của máy in
System Volume
Âm lượng hệ thống
UkmediaAppItemWidget
Application
Ứng dụng
Output Volume
Âm lượng đầu ra
Input Device
Thiết bị đầu và o
This case does not support setting the input device
Tình huống nà y không hỗ trợ cà i đặt thiết bị đầu và o
Output Device
Ch�n thiết bị đầu ra
This case does not support setting the output device
Tình huống nà y không hỗ trợ cà i đặt thiết bị đầu ra
Confirm
Lưu sá»a đổi
UkmediaDevControlWidget
audio device control
声音设备管�
output device
输出设备
input device
输入设备
Sound Equipment Control
Quảy lý thiết bị âm thanh
Output Devices
Thiết bị đầu ra
Input Devices
Thiết bị đầu và o
UkmediaInputWidget
Input
�ầu và o
/Audio/Input
Input Device
Thiết bị đầu và o
/Audio/Input Device
Volume
Âm thanh
/Audio/Volume
Input Level
Phản hồi âm lượng
/Audio/Input Level
Noise Reduction
Giảm ồn thông minh
/Audio/Noise Reduction
Voice Monitor
Lắng nghe thiết bị nà y
/audio/Voice Monitor
(None Device)
(Không có thiết bị)
You can hear your voice in the output device of your choice
Có thể nghe lại gi�ng nói của mình qua thiết bị đầu ra đã ch�n
UkmediaMainWidget
Light-Seeking
寻光
HeYin
和�
Custom
�ịnh dạng khác
None
SỠdùng settings hiện tại của máy in
UkmediaOutputWidget
Output
�ầu ra
/Audio/Output
Output Device
Ch�n thiết bị đầu ra
/Audio/Output Device
Master Volume
Âm lượng
/Audio/Master Volume
Balance
Cân bằng
/Audio/Balance
Left
Có sẵn
Right
PhÃa phải
Volume Increase
Tăng cư�ng âm lượng
Volume above 100% can cause sound distortion and damage your speakers.
Khi âm lượng vượt quá 100%, có thể gây méo âm và là m h�ng loa của bạn.
Mono Audio
Âm thanh đơn kênh âm thanh
It merges the left and right channels into one channel.
Gộp kênh âm thanh trái và phải thà nh một kênh âm thanh đơn.
UkmediaSettingsWidget
Advanced Settings
Cà i đặt cao cấp
Sound Equipment Control
Quảy lý thiết bị âm thanh
/Audio/Sound Equipment Control
Details
Mô tả chi tiết
App Sound Control
Âm thanh ứng dụng
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
Hiệu ứng âm thanh hệ thống
Sound Theme
Chủ đ� hiệu ứng âm thanh
/Audio/Sound Theme
Beep Switch
Âm thanh thông báo
/Audio/Beep Switch
Poweroff Music
Tắt máy
/Audio/Poweroff Music
Startup Music
Khởi động
/Audio/Startup Music
Wakeup Music
�ánh thức
/Audio/Wakeup Music
Notification Sound
Nháºn thông báo
/Audio/Notification Sound
Volume Control Sound
�i�u chỉnh âm lượng
/Audio/Volume Control Sound
Logout Music
�ăng xuất
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
Hà m pa_context_set_sink_volume_by_index() thực thi thất bại
pa_context_set_sink_mute_by_index() failed
Hà m pa_context_set_sink_mute_by_index() thực thi thất bại
pa_context_set_source_mute_by_index() failed
Hà m pa_context_set_source_mute_by_index() thực thi thất bại
pa_context_set_source_volume_by_index() failed
Hà m pa_context_set_source_volume_by_index() thực thi thất bại
pa_context_set_source_output_volume() failed
Hà m pa_context_set_source_output_volume() thực thi thất bại
pa_context_set_source_output_mute() failed
Hà m pa_context_set_source_output_mute() thực thi thất bại
pa_context_set_card_profile_by_index() failed
Hà m pa_context_set_card_profile_by_index() thực thi thất bại
pa_context_set_default_sink() failed
Hà m pa_context_set_default_sink() thực thi thất bại
pa_context_set_default_source() failed
Hà m pa_context_set_default_source() thực thi thất bại
pa_context_set_sink_port_by_name() failed
Hà m pa_context_set_sink_port_by_name() thực thi thất bại
pa_context_set_source_port_by_name() failed
Hà m pa_context_set_source_port_by_name() thực thi thất bại
(plugged in)
(đã cắm)
(unavailable)
(không khả dụng)
(unplugged)
(đã ngắt kết nối)
Failed to read data from stream
Không thể đ�c dữ liệu từ luồng
Peak detect
Phát hiện đỉnh
Failed to create monitoring stream
Không thể tạo luồng giám sát
Failed to connect monitoring stream
Không thể kết nối luồng giám sát
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
B� qua sink-input do được chỉ định là sự kiện (event) và sẽ được xỠlý bởi widget Sự kiện
pa_context_kill_source_output() failed
pa_context_kill_source_output() không thà nh công
Establishing connection to PulseAudio. Please wait...
Ä�ang thiết láºp kết nối tá»›i PulseAudio. Vui lòng chá»�...
ukui-media/audio/translations/ab.ts 0000664 0001750 0001750 00000061164 15170054730 016320 0 ustar feng feng
Audio
Audio
UkccPlugin
/UkccPlugin/UkccPlugin
ukccplugin test
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
Confirm
OutputDevWidget
Output Devices
Confirm
QObject
pa_context_get_server_info() failed
Card callback failure
Sink callback failure
Source callback failure
Sink input callback failure
Source output callback failure
Client callback failure
Server info callback failure
Failed to initialize stream_restore extension: %s
pa_ext_stream_restore_read() failed
Failed to initialize device manager extension: %s
pa_ext_device_manager_read() failed
pa_context_get_sink_info_by_index() failed
pa_context_get_source_info_by_index() failed
pa_context_get_sink_input_info() failed
pa_context_get_client_info() failed
pa_context_get_card_info_by_index() failed
pa_context_subscribe() failed
pa_context_client_info_list() failed
pa_context_get_card_info_list() failed
pa_context_get_sink_info_list() failed
pa_context_get_source_info_list() failed
pa_context_get_sink_input_info_list() failed
pa_context_get_source_output_info_list() failed
Ukui Media Volume Control
UkmediaAppCtrlWidget
App Sound Control
None
System Volume
UkmediaAppItemWidget
Application
Output Volume
Input Device
This case does not support setting the input device
Output Device
This case does not support setting the output device
Confirm
UkmediaDevControlWidget
audio device control
声音设备管�
output device
输出设备
input device
输入设备
Sound Equipment Control
Output Devices
Input Devices
UkmediaInputWidget
Input
/Audio/Input
Input Device
/Audio/Input Device
Volume
/Audio/Volume
Input Level
/Audio/Input Level
Noise Reduction
/Audio/Noise Reduction
Voice Monitor
/audio/Voice Monitor
(None Device)
You can hear your voice in the output device of your choice
UkmediaMainWidget
Light-Seeking
寻光
HeYin
和�
Custom
None
UkmediaOutputWidget
Output
/Audio/Output
Output Device
/Audio/Output Device
Master Volume
/Audio/Master Volume
Balance
/Audio/Balance
Left
Right
Volume Increase
Volume above 100% can cause sound distortion and damage your speakers.
Mono Audio
It merges the left and right channels into one channel.
UkmediaSettingsWidget
Advanced Settings
Sound Equipment Control
/Audio/Sound Equipment Control
Details
App Sound Control
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
Sound Theme
/Audio/Sound Theme
Beep Switch
/Audio/Beep Switch
Poweroff Music
/Audio/Poweroff Music
Startup Music
/Audio/Startup Music
Wakeup Music
/Audio/Wakeup Music
Notification Sound
/Audio/Notification Sound
Volume Control Sound
/Audio/Volume Control Sound
Logout Music
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_mute_by_index() failed
pa_context_set_source_mute_by_index() failed
pa_context_set_source_volume_by_index() failed
pa_context_set_source_output_volume() failed
pa_context_set_source_output_mute() failed
pa_context_set_card_profile_by_index() failed
pa_context_set_default_sink() failed
pa_context_set_default_source() failed
pa_context_set_sink_port_by_name() failed
pa_context_set_source_port_by_name() failed
(plugged in)
(unavailable)
(unplugged)
Failed to read data from stream
Peak detect
Failed to create monitoring stream
Failed to connect monitoring stream
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
pa_context_kill_source_output() failed
Establishing connection to PulseAudio. Please wait...
ukui-media/audio/translations/mn_MN.ts 0000664 0001750 0001750 00000101250 15170054730 016731 0 ustar feng feng
Audio
Audio
á á ¦á ‹á ³á ¢á ¤á ‹
UkccPlugin
Ukccc á µá á ¯á á á °á ¤
/UkccPlugin/UkccPlugin
ukccplugin test
á ¤á á ¯á á á ¤á ·á á Žá á ²á £á ¨á £á á Žá ¤á ‹á ¨ á °á £á ·á ¢á ¯á ²á
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
á £á ·á £á á ¤á ¯á ¬á ¤ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢
Confirm
á ²á £á á ²á á á á ¬á ¤
OutputDevWidget
Output Devices
á á á ·á á á ¬á ¤ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢
Confirm
á ²á £á á ²á á á á ¬á ¤
QObject
pa_context_get_server_info() failed
pa_context_get_server_info() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Card callback failure
á ºá á ·á ² á ¢á ‹ á ¡á ¬á ¡á ¬á ¦á ¯á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¦á ¬á ¡á ¢
Sink callback failure
á ¡á ¬á ¡á ¬á ¦á ¯á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Source callback failure
á ¡á ¬á ¦á °á ¬á ¡á á ´á ¢ á µá ¢ á ¡á ¬á ¡á ¬á ¦á ¯á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Sink input callback failure
Sink input á ¢á ‹\ á µá ¢ á ¡á ¬á ¡á ¬á ¦á ¯á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Source output callback failure
á ¡á ¬á ¦á °á ¬á ¡á á ´á ¢ á µá ¢á ¨ á á á ·á á á ¯á ³á á µá ¢ á ¡á ¬á ¡á ¬á ¦á ¯á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Client callback failure
á ¬á ¡á ·á ¡á á ¯á ¡á á ´á ¢ á µá ¢á ¨ á ¦á µá ¦á ¬á ¦á · á ¢á ‹ á ¡á ¬á ¡á ¬á ¦á ¯á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Server info callback failure
á ¦á ¢á ¯á ¡á ´á ¢á ¯á ¡á ¬á ¦á · á ¢á ‹ á ¡á ¬á ¡á ¬á ¦á ¯á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Failed to initialize stream_restore extension: %s
stream_restore á µá ¢/ á ¢á ‹ á á ¨á á ¬á á µá ¢á á ¤á ¯á µá ¤ á ¦á ·á ¬á ¡á ³á ¬á ¡á ¬á ¦ á ¢á ¯á á á ³á á ªá á „%s
pa_ext_stream_restore_read() failed
pa_ext_stream_restore_read() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Failed to initialize device manager extension: %s
á ³á ¦á ¬á ¦á ¬á ¡á ·á ¦á ®á µá ¢ á µá ¢á ¨ á ¬á á ®á ¢á ¶á á ·á ¤á ¯á ³á á µá ¢á ¨ á ªá á á á µá ¢ á µá ¢ á á ¨á á ¬á á µá ¢á á ¤á ¯á µá ¤ á ¦á ·á ¬á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢á „%s
pa_ext_device_manager_read() failed
pa_ext_device_manager_read() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_sink_info_by_index() failed
pa_context_get_sink_info_by_index() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_source_info_by_index() failed
pa_context_get_source_info_by_index() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_sink_input_info() failed
pa_context_get_sink_input_info() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_client_info() failed
pa_context_get_client_info() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_card_info_by_index() failed
pa_context_get_card_info_by_index() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_subscribe() failed
pa_context_subscribe() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_client_info_list() failed
pa_context_client_info_list() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_card_info_list() failed
pa_context_get_card_info_list() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_sink_info_list() failed
pa_context_get_sink_info_list() á µá ¢/ á ¢á ‹á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_source_info_list() failed
pa_context_get_source_info_list() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_sink_input_info_list() failed
pa_context_get_sink_input_info_list() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_get_source_output_info_list() failed
pa_context_get_source_output_info_list() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
Connection failed, attempting reconnect
á ´á ¦á ·á ¬á ¡á ¯á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¦á ¬á ¡á ¢á ‚ á °á ¢á ¨á Žá ¡ á ªá ¡á · á ´á ¦á ·á ¬á ¡á ¯á ¡á ¬á ¦ á µá ¢ á ³á ¤á ·á °á ¢á µá ¤ á ªá á ¢á ¨á Žá
Ukui Media Volume Control
Ukui á ®á ¸á ³á ¢á ¶á Žá á µá ¢á ¨ á ³á á á ¤ á µá ¢ á ¡á µá ¡á ®á ³á ¡á ¬á ¦
UkmediaAppCtrlWidget
App Sound Control
á ¬á ¡á ·á ¡á á ¯á ¡á á ¡á ¨á Žá ¦á Œ á ³á á á ¤
None
á ¦á ¬á ¡á ¢
System Volume
á °á ¢á °á ²á ¸á ®
UkmediaAppItemWidget
Application
á ¬á ¡á ·á ¡á á ¯á ¡á á ¡
Output Volume
á á á ·á á á ¬á ¤ á ³á á á ¤
Input Device
á ¶á á ·á ¢á ¶á á ¨á Žá ³á ‹á ¤á Œ á ¬á ¡á ·á ¡á á ¯á ¡á ¬á ¦ á ªá ¤á ¶á ¤ á °á ¢á ©á á ¡á á ¡á µá ¦ á ¦á ¢á ¯á ¡á ³á ¬á ¦ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢á Žá ¶á ‹á ¢ á °á £á ©á á £á ¬á ¤
This case does not support setting the input device
á ²á ¤á ° á ªá á ¢á ³á á ¯ á ¨á ¢ á £á ·á £á á ¤á ¯á ¬á ¤ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢ á ªá á ¢á á ¤á ¯á ¬á ¤á Žá ¶á ‹á ¢ á ³á ¡á ®á µá ¢á ¬á ¦ á ¦á á ¡á ¢
Output Device
á ³á á á ¤ á ¨á ¡á ªá ²á ¡á ·á ¡á á ¦á ¯á ¬á ¦ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢á Žá ¶á ‹á ¢ á °á £á ©á á £á ¬á ¤
This case does not support setting the output device
á ²á ¤á ° á ªá á ¢á ³á á ¯ á ¨á ¢ á á á ·á á á ¬á ¤ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢ á ²á £á ¬á ¢á ·á á á ¤á ¯á ¬á ¤á Žá ¶á ‹á ¢ á ³á ¡á ®á µá ¢á ¬á ¦ á ¦á á ¡á ¢
Confirm
á ²á £á á ²á á á á ¬á ¤
UkmediaDevControlWidget
Sound Equipment Control
á ³á á á ¤á ¨á Žá ¤á ‹ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢á Žá ¶á ‹á ¢á ¨ á ¬á á ®á ¢á ¶á á ·á ¤á ¯á ²á
Output Devices
á á á ·á á á ¬á ¤ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢
Input Devices
á £á ·á £á á ¤á ¯á ¬á ¤ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢
UkmediaInputWidget
Input
á £á ·á £á á ¤á ¯á ¬á ¤
/Audio/Input
Input Device
á ¶á á ·á ¢á ¶á á ¨á Žá ³á ‹á ¤á Œ á ¬á ¡á ·á ¡á á ¯á ¡á ¬á ¦ á ªá ¤á ¶á ¤ á °á ¢á ©á á ¡á á ¡á µá ¦ á ¦á ¢á ¯á ¡á ³á ¬á ¦ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢á Žá ¶á ‹á ¢ á °á £á ©á á £á ¬á ¤
/Audio/Input Device
Volume
á ¡á ªá ¬á ¡á ®á ¡á ¯
/Audio/Volume
Input Level
á ³á á á ¤á ¨á Žá ¤á ‹ á ¬á ¡á ®á µá ¢á ¶á Žá ¡á Žá ¶á ‹á ¢á ¨ á ªá ¤á ´á á ¯á ²á
/Audio/Input Level
Noise Reduction
á £á ¶á ¤á ¨á ²á ¤ á Žá ªá ¡á · á ±á ¤á ¤á á ¢á ¶á á ¨ á ªá á á ¤á ·á á á ¤á ¯á ¬á ¤
/Audio/Noise Reduction
Voice Monitor
á ²á ¤á ° á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢á Žá ¶á ‹á ¢ á ²á á ©á ¨á á ¨ á °á £á ¨á £á °á ¬á ¤
/audio/Voice Monitor
(None Device)
(á Žá ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢ á ¦á á ¡á ¢ )
You can hear your voice in the output device of your choice
á °á £á ©á á £á µá ¤ á á á ·á á á á °á á ¨ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢ á ³á £á ²á £á ·á Žá á ¥á ªá ¡á ·á Žá ¦á ‹á ¨ á ³á á á ¤á Žá ¶á ‹á ¢ á £á ¯á µá ¤ á °á £á ¨á £á °á ¤á ¨á Žá
UkmediaMainWidget
Custom
á ¦á ªá ¡á ·á ³á ¡á ¬á ¡á ¨ á ³á ¤á á ³á á á á ¬á ¤
None
á ¦á ¬á ¡á ¢
UkmediaOutputWidget
Output
á á á ·á á á ¯á ²á
/Audio/Output
Output Device
á ³á á á ¤ á ¨á ¡á ªá ²á ¡á ·á ¡á á ¦á ¯á ¬á ¦ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢á Žá ¶á ‹á ¢ á °á £á ©á á £á ¬á ¤
/Audio/Output Device
Master Volume
á ³á á á ¤
/Audio/Master Volume
Balance
á á ¡á ·á ¡á ¯á ²á ¦á ´á ¡á Žá ¶á ‹á ¢á ¨ á ²á ¡á ©á ´á ¡á á ¦á ·á ¢á Žá ¶á ‹á ¢á ¨ á ²á £á ¬á ¢á ·á á á ¤á ¯á á Žá
/Audio/Balance
Left
á µá ¡á ¬á ¦á ¨
Right
á ªá á ·á á á ¤á ¨
Volume Increase
á ³á á á ¤á ¨á Žá ¤á ‹ á ¬á ¡á ®á µá ¢á ¶á Žá ¡ á ´á ¢á ©á á á ·á á ¬á ¤
Volume above 100% can cause sound distortion and damage your speakers.
á ³á á á ¤á ¨á Žá ¤á ‹ á ¬á ¡á ®á µá ¢á ¶á Žá ¡ 100% á ¶á ‹á ¢ á ³á á ªá á ¬á ¤ á ¦á ¶á ¡á ° á ³á á á ¤á ¨á Žá ¤á ‹ á ¬á ¦á ´á ¦á ¨ á °á £á ¯á ¢á á ³á á µá ¤ á ‚ á ³á á á ¤á ¨á Žá ¤á ‹ á °á ¦á · á ®á á ¨á ³á ¤á á ¤á ¯á ¤á á ´á ¢ á ªá á ·á ¤á á ¬á £á ¬á ¢á ·á á ¯ á á á ·á ¤á ¨á Žá .
Mono Audio
á ³á á © á ³á á á ¤á ¨ á µá á ®á Žá ¤á ‹á ¨ á ³á á á ¤á ¨ á ³á á ªá ²á á ®á µá ¢
It merges the left and right channels into one channel.
á µá ¡á á ¦á ¨ á ³á á á ¤á ¨ á ªá á ªá á ·á á á ¤á ¨ á ³á á á ¤á ¨ á µá á ®á Žá ¢á ‹ á ¨á ¢á á ¡ á ³á á á ¤á ¨ á µá á ® á ªá £á ¯á á á ¨ á ¨á ¡á ¢á ¯á ¡á á ¦á ¯á ¦á ¨á Žá ¡.
UkmediaSettingsWidget
Advanced Settings
á ³á ¡á á ¡á ³á ¦ á µá ¡á ·á á ¡á Žá ¶á ‹á ¢á ¨ á ²á £á ¬á ¢á ·á á á ¤á ¯á ¤á ¯
Sound Equipment Control
á ³á á á ¤á ¨á Žá ¤á ‹ á ²á ¥á ¬á ¥á á ¡á ·á ¦á ®á µá ¢á Žá ¶á ‹á ¢á ¨ á ¬á á ®á ¢á ¶á á ·á ¤á ¯á ²á
/Audio/Sound Equipment Control
Details
á ¨á á ·á ¢á ¨ á µá á ©á á ¢
App Sound Control
á ¬á ¡á ·á ¡á á ¯á ¡á á ¡á ¨á Žá ¦á Œ á ³á á á ¤
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
á °á ¢á °á ²á ‹á §á ®á Žá ¦á ‹á ¨ á ³á á á ¤á ¨ á ¦á ¢á ¯á ¡á ³á ¦á ¯
Sound Theme
á ³á á á ¤á ¨á Žá ¤á ‹ á á £á £á ¯ á °á ¡á ³á ¦á ª
/Audio/Sound Theme
Alert Sound
á ®á ¡á ³á ¡á á ³á ¡á ¯
/Audio/Alert Sound
Beep Switch
á °á á ¨á á á ¤á ¯á ¤á ®á µá ¢
/Audio/Beep Switch
Poweroff Music
á ¬á á á á ¬á ¤
/Audio/Poweroff Music
Startup Music
á ¨á ¡á ¬á ¡á ¬á ¦
/Audio/Startup Music
Wakeup Music
á ³á á á ¤á ³á á ¨ á °á ¡á ·á á ¦á á ¡á ¬á ¦
/Audio/Wakeup Music
Notification Sound
á ®á ¡á ³á ¡á á ³á ¡á ¯ á ¬á ¦á ¯á ¢á ¶á ¡á ¨ á á ªá ¬á ¤
/Audio/Notification Sound
Volume Control Sound
á ³á á á ¤ á ²á £á ¬á ¢á ·á á á ¤á ¯á ¬á ¤
/Audio/Volume Control Sound
Volume Change
á ³á á á ¤á ¨ á ¤á ‹ á ¬á ¡á ®á µá ¢á ¶á Žá ¡ á µá ¢ á ³á ¤á ¬á ¢á ·á á á ¤á ¯á ¬á ¤
/Audio/Volume Change
Logout Music
á ³á á ©á °á á Žá á ‹á ´á á ¬á á °á ¤á ¬á ¤
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_volume_by_index() á µá ¢/ á ¢á ‹ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_sink_mute_by_index() failed
pa_context_set_sink_mute_by_index (á Ž)á Žá ¢á ¯á á á ³á á µá á ¢
pa_context_set_source_mute_by_index() failed
pa_context_set_source_mute_by_index () á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_source_volume_by_index() failed
pa_context_set_source_volume_by_index () á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_source_output_volume() failed
pa_context_set_source_output_volume() á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_source_output_mute() failed
pa_context_set_source_output_mute() á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_card_profile_by_index() failed
pa_context_set_card_profile_by_index() á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_default_sink() failed
pa_context_set_default_sink() á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_default_source() failed
pa_context_set_default_source() á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_sink_port_by_name() failed
pa_context_set_sink_port_by_name() á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
pa_context_set_source_port_by_name() failed
pa_context_set_source_port_by_name() á ¢á ‹\ á µá ¢ á ¬á ¦á ¢á ´á ¡á ³á ¬á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¥á ¬á ¡á ¢
(plugged in)
( á ´á ¡á ¨á ¡á ¯á ¡á á °á ¡á ¨ á ªá á ¢á ¨á Žá )
(unavailable)
( á ¬á ¡á ·á ¡á á ¯á ¡á µá ¦ á ªá ¤á ¯á ¬á ¤ á ¦á ¬á ¡á ¢)
(unplugged)
( á ´á ¡á ¨á ¡á á ¯á ¡á á °á ¡á ¨ á ¥á ¬á ¡á ¢)
Failed to read data from stream
á ³á ‹á á ¢á ²á ‹á á µá ¢ á ¤á ©á °á ¢á ¬á ¤ á µá ¢á ¨ á á ·á á Žá á ¥á ¬á ¡á ¢
Peak detect
á £á ·á á ¢á ¯ á ¬á ¡á ®á µá ¢á á ³á ¡á ¯ á ¦á ‹á ¨ á ªá á ¢á ´á á á á ¯á ²á
Failed to create monitoring stream
á ¬á ¢á ¨á á ¨ á ¬á ¡á ®á µá ¢á ¬á ¦ á ¤á ·á ¤á °á ¬á á ¯ á ¢á ‹ á ªá á ¢á á ¤á ¯á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¦á ¬á ¡á ¢
Failed to connect monitoring stream
á ¬á ¢á ¨á á ¨ á ¬á ¡á ®á µá ¢á ¬á ¦ á ¤á ·á ¤á °á ¬á á ¯ á ¢á ‹ á ´á ¦á ·á ¬á ¡á ¯á ¡á µá ¤ á ´á ¢á ³á á á °á á ¨ á ¦á ¬á ¡á ¢
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
sink-input á ¢á ‹\ á µá ¢ á ¤á ®á ³á ¤á á á ¢á ¯á á ¨á Žá á ‚ á ¤á ´á ¢á · á ¨á ¢ á ³á ¡á ¬á ¦á ¨ á ¢á ‹ á ¶á á ªá ¤á ³á á ¯ á µá ¢á ¨á · á ³á ¤á á ³á á á á á °á á ¨á ‚ á ¡á ¢á ®á ¤ á ¡á ´á ¡ Event widget á µá ¢á ¡á ·\ á ªá ¡á · á °á ¢á ¢á ³á ªá ¦á ·á ¢á ¯á ¡á ¬á ¦ á ¬á ¡á ·á ¡á á ³á ¡á ¢
pa_context_kill_source_output() failed
pa_context_kill_source_output (á Ž) á ¢á ¯á á á ³á á ¬á ¤
Establishing connection to PulseAudio. Please wait...
PulseAudio á ³á ‹á ¤á Œ/ á ²á ¤á Œ á ´á ¦á ·á ¬á ¡á ¯á ¡á µá ¦ á ªá á ¢á ¨á Žá á ‚ á ³á ¦á · á ¬á ¦á ¯á ¢á ¶á ¡á ¬á ¡á ·á ¡á ¢Â·Â·Â·
ukui-media/audio/translations/en_US.ts 0000664 0001750 0001750 00000061472 15170054730 016751 0 ustar feng feng
Audio
Audio
UkccPlugin
/UkccPlugin/UkccPlugin
ukccplugin test
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
Confirm
OutputDevWidget
Output Devices
Confirm
QObject
pa_context_get_server_info() failed
Card callback failure
Sink callback failure
Source callback failure
Sink input callback failure
Source output callback failure
Client callback failure
Server info callback failure
Failed to initialize stream_restore extension: %s
pa_ext_stream_restore_read() failed
Failed to initialize device manager extension: %s
pa_ext_device_manager_read() failed
pa_context_get_sink_info_by_index() failed
pa_context_get_source_info_by_index() failed
pa_context_get_sink_input_info() failed
pa_context_get_client_info() failed
pa_context_get_card_info_by_index() failed
pa_context_subscribe() failed
pa_context_client_info_list() failed
pa_context_get_card_info_list() failed
pa_context_get_sink_info_list() failed
pa_context_get_source_info_list() failed
pa_context_get_sink_input_info_list() failed
pa_context_get_source_output_info_list() failed
Ukui Media Volume Control
UkmediaAppCtrlWidget
App Sound Control
None
System Volume
UkmediaAppItemWidget
Application
Output Volume
Input Device
This case does not support setting the input device
Output Device
This case does not support setting the output device
Confirm
UkmediaDevControlWidget
Sound Equipment Control
Output Devices
Input Devices
UkmediaInputWidget
Input
/Audio/Input
Input Device
/Audio/Input Device
Volume
/Audio/Volume
Input Level
/Audio/Input Level
Noise Reduction
/Audio/Noise Reduction
Voice Monitor
/audio/Voice Monitor
(None Device)
You can hear your voice in the output device of your choice
UkmediaMainWidget
Custom
None
UkmediaOutputWidget
Output
/Audio/Output
Output Device
/Audio/Output Device
Master Volume
/Audio/Master Volume
Balance
/Audio/Balance
Left
Right
Volume Increase
Volume above 100% can cause sound distortion and damage your speakers.
Mono Audio
It merges the left and right channels into one channel.
UkmediaSettingsWidget
Advanced Settings
Sound Equipment Control
/Audio/Sound Equipment Control
Details
App Sound Control
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
Sound Theme
/Audio/Sound Theme
Beep Switch
/Audio/Beep Switch
Poweroff Music
/Audio/Poweroff Music
Startup Music
/Audio/Startup Music
Wakeup Music
/Audio/Wakeup Music
Logout Music
/Audio/Logout Music
Notification Sound
/Audio/Notification Sound
Volume Control Sound
/Audio/Volume Control Sound
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_mute_by_index() failed
pa_context_set_source_mute_by_index() failed
pa_context_set_source_volume_by_index() failed
pa_context_set_source_output_volume() failed
pa_context_set_source_output_mute() failed
pa_context_set_card_profile_by_index() failed
pa_context_set_default_sink() failed
pa_context_set_default_source() failed
pa_context_set_sink_port_by_name() failed
pa_context_set_source_port_by_name() failed
(plugged in)
(unavailable)
(unplugged)
Failed to read data from stream
Peak detect
Failed to create monitoring stream
Failed to connect monitoring stream
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
pa_context_kill_source_output() failed
Establishing connection to PulseAudio. Please wait...
ukui-media/audio/translations/zh_HK.ts 0000664 0001750 0001750 00000064332 15170054730 016741 0 ustar feng feng
Audio
Audio
�音
UkccPlugin
Ukcc外掛程�
/UkccPlugin/UkccPlugin
ukccplugin test
ukcc外掛程� 測試
/UkccPlugin/ukccplugin test
InputDevWidget
Input Devices
輸入�置
Confirm
確�
OutputDevWidget
Output Devices
輸出�置
Confirm
確�
QObject
pa_context_get_server_info() failed
pa_context_get_server_info() 執行失敗
Card callback failure
�片回調失敗
Sink callback failure
輸出回調失敗
Source callback failure
輸入回調失敗
Sink input callback failure
水槽輸入回調失敗
Source output callback failure
source-ouput回調失敗
Client callback failure
用戶端回調失敗
Server info callback failure
�務端回調錯誤
Failed to initialize stream_restore extension: %s
�始化stream_restore擴展失敗:%s
pa_ext_stream_restore_read() failed
pa_ext_stream_restore_read() 執行失敗
Failed to initialize device manager extension: %s
åˆ�始化è¨å‚™ç®¡ç�†å™¨æ“´å±•失敗:%s
pa_ext_device_manager_read() failed
pa_ext_device_manager_read() 執行失敗
pa_context_get_sink_info_by_index() failed
pa_context_get_sink_info_by_index() 執行失敗
pa_context_get_source_info_by_index() failed
pa_context_get_source_info_by_index() 執行失敗
pa_context_get_sink_input_info() failed
pa_context_get_sink_input_info() 執行失敗
pa_context_get_client_info() failed
pa_context_get_client_info() 執行失敗
pa_context_get_card_info_by_index() failed
pa_context_get_card_info_by_index() 執行失敗
pa_context_subscribe() failed
pa_context_subscribe() 執行失敗
pa_context_client_info_list() failed
pa_context_client_info_list() 執行失敗
pa_context_get_card_info_list() failed
pa_context_get_card_info_list() 執行失敗
pa_context_get_sink_info_list() failed
pa_context_get_sink_info_list() 執行失敗
pa_context_get_source_info_list() failed
pa_context_get_source_info_list() 執行失敗
pa_context_get_sink_input_info_list() failed
pa_context_get_sink_input_info_list() 執行失敗
pa_context_get_source_output_info_list() failed
pa_context_get_source_output_info_list() 執行失敗
Connection failed, attempting reconnect
連接失敗,嘗試é‡�新連接ä¸
Ukui Media Volume Control
UKUI 媒體音�控制
UkmediaAppCtrlWidget
App Sound Control
應用程��音控制
None
空
System Volume
系統音�
UkmediaAppItemWidget
Application
應用
Output Volume
輸出音�
Input Device
é�¸æ“‡è¼¸å…¥è¨å‚™
This case does not support setting the input device
本案例ä¸�支æ�´è¨å®šè¼¸å…¥è¨å‚™
Output Device
é�¸æ“‡è¼¸å‡ºè¨å‚™
This case does not support setting the output device
本案例ä¸�支æ�´è¨å®šè¼¸å‡ºè¨å‚™
Confirm
確�
UkmediaDevControlWidget
Sound Equipment Control
音響è¨å‚™æŽ§åˆ¶
Output Devices
輸出�置
Input Devices
輸入�置
UkmediaInputWidget
Input
輸入
/Audio/Input
Input Device
é�¸æ“‡è¼¸å…¥è¨å‚™
/Audio/Input Device
Volume
音�
/Audio/Volume
Input Level
輸入�饋
/Audio/Input Level
Noise Reduction
智慧�噪
/Audio/Noise Reduction
Voice Monitor
語音監�
/audio/Voice Monitor
(None Device)
(無�置)
You can hear your voice in the output device of your choice
您å�¯ä»¥åœ¨æ‚¨é�¸æ“‡çš„輸出è£�ç½®ä¸è�½åˆ°æ‚¨çš„è�²éŸ³
UkmediaMainWidget
Custom
自定義
None
空
UkmediaOutputWidget
Output
輸出
/Audio/Output
Output Device
é�¸æ“‡è¼¸å‡ºè¨å‚™
/Audio/Output Device
Master Volume
音�
/Audio/Master Volume
Balance
��平衡
/Audio/Balance
Left
å·¦
Right
�
Volume Increase
音�增強
Volume above 100% can cause sound distortion and damage your speakers.
音�超� 100% �能會導致�音失真並�壞��器。
Mono Audio
單��音訊
It merges the left and right channels into one channel.
它將左�通��併為一個通�。
UkmediaSettingsWidget
Advanced Settings
進階è¨å®š
Sound Equipment Control
音響è¨å‚™æŽ§åˆ¶
/Audio/Sound Equipment Control
Details
細節
App Sound Control
應用程��音控制
/Audio/App Sound Control
UkmediaSoundEffectsWidget
System Sound
系統音效
Sound Theme
音效主題
/Audio/Sound Theme
Alert Sound
通知
/Audio/Alert Sound
Beep Switch
�示音
/Audio/Beep Switch
Poweroff Music
關機
/Audio/Poweroff Music
Startup Music
開機
/Audio/Startup Music
Wakeup Music
喚醒
/Audio/Wakeup Music
Notification Sound
通知音效
/Audio/Notification Sound
Volume Control Sound
音�調整音效
/Audio/Volume Control Sound
Volume Change
音�調節
/Audio/Volume Change
Logout Music
註銷
/Audio/Logout Music
UkmediaVolumeControl
pa_context_set_sink_volume_by_index() failed
pa_context_set_sink_volume_by_index() 執行失敗
pa_context_set_sink_mute_by_index() failed
pa_context_set_source_mute_by_index() failed
pa_context_set_source_mute_by_index() 執行失敗
pa_context_set_source_volume_by_index() failed
pa_context_set_source_volume_by_index() 執行失敗
pa_context_set_source_output_volume() failed
pa_context_set_source_output_volume() 執行失敗
pa_context_set_source_output_mute() failed
pa_context_set_source_output_mute() 執行失敗
pa_context_set_card_profile_by_index() failed
pa_context_set_card_profile_by_index() 執行失敗
pa_context_set_default_sink() failed
pa_context_set_default_sink() 執行失敗
pa_context_set_default_source() failed
pa_context_set_default_source() 執行失敗
pa_context_set_sink_port_by_name() failed
pa_context_set_sink_port_by_name() 執行失敗
pa_context_set_source_port_by_name() failed
pa_context_set_source_port_by_name() 執行失敗
(plugged in)
(�上了)
(unavailable)
( ��用 )
(unplugged)
沒有連接
Failed to read data from stream
從æµ�ä¸è®€å�–數據失敗
Peak detect
峰值檢測
Failed to create monitoring stream
創建監控�失敗
Failed to connect monitoring stream
連接監控�失敗
Ignoring sink-input due to it being designated as an event and thus handled by the Event widget
忽略沉é™�è¼¸å…¥ï¼Œå› ç‚ºå®ƒè¢«æŒ‡å®šç‚ºäº‹ä»¶ï¼Œå› æ¤ç”±äº‹ä»¶å°�部件處ç�†
pa_context_kill_source_output() failed
Establishing connection to PulseAudio. Please wait...
æ£åœ¨å»ºç«‹èˆ‡PulseAudio的連接。 è«‹ç‰å¾…...
ukui-media/audio/app-device-control/ 0000775 0001750 0001750 00000000000 15170054730 016330 5 ustar feng feng ukui-media/audio/app-device-control/ukmedia_app_item_widget.h 0000664 0001750 0001750 00000005335 15170054730 023347 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef UKMEDIA_ITEM_WIDGET_H
#define UKMEDIA_ITEM_WIDGET_H
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "kslider.h"
#include "../../audio/ukui_custom_style.h"
#include "../../common/ukmedia_common.h"
using namespace kdk;
class UkmediaAppItemWidget : public QWidget
{
Q_OBJECT
public:
UkmediaAppItemWidget(QWidget *parent = nullptr);
~UkmediaAppItemWidget();
friend class UkmediaAppCtrlWidget;
void initUI();
void addInputCombobox(QString port);
void addOutputCombobox(QString port);
void setSliderValue(int value);
void outputVolumeDarkThemeImage(int value, bool status);
void setTitleName(QString name); //è®¾ç½®åº”ç”¨æ ‡é¢˜å��
void setChildObjectName(QString name); //设置控件object name
void setInputHintWidgetShow(bool status);
void setOutputHintWidgetShow(bool status);
private:
QFrame* myLine();
// QFrame *line1;
// QFrame *line2;
QFrame *m_pAppWidget;
QFrame *m_pInputWidget;
QFrame *m_pOutputWidget;
QFrame *m_pVolumeWidget;
QFrame *m_pCheckWidget;
FixLabel *m_pAppLabel;
FixLabel *m_pVolumeLabel;
FixLabel *m_pInputDevLabel;
FixLabel *m_pOutputDevLabel;
FixLabel *m_pVolumeNumLabel;
QLabel *m_pInputHintIcon;
QLabel *m_pOutputHintIcon;
QFrame *m_pInputHintWidget;
QFrame *m_pOutputHintWidget;
FixLabel *m_pInputHintLabel;
FixLabel *m_pOutputHintLabel;
KSlider *m_pVolumeSlider;
QComboBox *m_pInputCombobox;
QComboBox *m_pOutputCombobox;
QPushButton *m_pConfirmBtn;
UkuiButtonDrawSvg *m_pVolumeBtn;
QString mThemeName;
void onPaletteChanged();
};
#endif //UKMEDIA_ITEM_WIDGET_H
ukui-media/audio/app-device-control/ukmedia_app_device_ctrl.h 0000664 0001750 0001750 00000006630 15170054730 023330 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef UKMEDIA_APP_DEVICE_CTRL_H
#define UKMEDIA_APP_DEVICE_CTRL_H
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "kwidget.h"
#include "knavigationbar.h"
#include "ukmedia_app_item_widget.h"
#include "../../common/ukmedia_common.h"
using namespace kdk;
class UkmediaAppCtrlWidget : public KWidget
{
Q_OBJECT
public:
explicit UkmediaAppCtrlWidget(QWidget *parent = nullptr);
~UkmediaAppCtrlWidget();
void initUI();
void initData();
void dealSlot();
void addItem(QString appName);
int getSystemVolume();
bool getSystemMuteState();
int getAppVolume(QString app);
bool getAppMuteState(QString app);
void getAppList();
void getAllPortInfo();
void getRecordAppInfo();
void getPlaybackAppInfo();
QStringList getAllInputPort();
QStringList getAllOutputPort();
QString getSystemInputDevice();
QString getSystemOutputDevice();
QString getAppInputDevice(QString app);
QString getAppOutputDevice(QString app);
private:
KNavigationBar* m_pAppSoundCtrlBar;
QStackedWidget* stackWidget;
QStringList appList; //获å�–当å‰�å˜åœ¨çš„应用å��å�•
QStringList sinkPortList;
QStringList sourcePortList;
QList recordAppInfoList;
QList playbackAppInfoList;
QMap portInfoMap;
QDBusInterface* interface;
bool setSystemVolume(int value);
bool setSystemInputDevice(QString portLabel);
bool setSystemOutputDevice(QString portLabel);
int findAppDirection(QString appName);
#ifdef PA_PROP_APPLICATION_MOVE
bool checkAppMoveStatus(int appType, QString appName);
#endif
int indexOfItemCombobox(QString port, QComboBox *box);
QString getAppName(QString appName);
QString getAppIcon(QString appName);
QString AppDesktopFileAdaption(QString appName);
private Q_SLOTS:
void updatePort();
void updateAppItem(QString appName);
void removeAppItem(QString appName);
void updateSystemVolume(int value);
void updateSystemMuteState(bool state);
void updateAppMuteState(QString app, bool state);
// void appVolumeChangedSlot(QString app, QString appId, int volume);
bool setAppMuteState();
bool setAppVolume(int value);
bool setAppInputDevice(QString portLabel);
bool setAppOutputDevice(QString portLabel);
};
#endif // UKMEDIA_APP_DEVICE_CTRL_H
ukui-media/audio/app-device-control/app-device-control.pri 0000664 0001750 0001750 00000000317 15170054730 022540 0 ustar feng feng INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/ukmedia_app_item_widget.h \
$$PWD/ukmedia_app_device_ctrl.h \
SOURCES += \
$$PWD/ukmedia_app_item_widget.cpp \
$$PWD/ukmedia_app_device_ctrl.cpp \
ukui-media/audio/app-device-control/ukmedia_app_device_ctrl.cpp 0000664 0001750 0001750 00000105270 15170054730 023663 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "ukmedia_app_device_ctrl.h"
#include
UkmediaAppCtrlWidget::UkmediaAppCtrlWidget(QWidget *parent)
: KWidget(parent)
{
initData();
initUI();
dealSlot();
}
void UkmediaAppCtrlWidget::initData()
{
interface = new QDBusInterface(UKUI_MEDIA_SERVICE,
UKUI_MEDIA_PATH,
UKUI_MEDIA_INTERFACE,
QDBusConnection::sessionBus());
if (!interface->isValid())
return;
//1.获�app列表
getAppList();
//2.获�所有�用端�信�
getAllPortInfo();
//3.获��用输出端�
getAllOutputPort();
//4.获��用输入端�
getAllInputPort();
}
void UkmediaAppCtrlWidget::initUI()
{
setWidgetName(tr("App Sound Control"));
setIcon(QIcon::fromTheme("ukui-control-center"));
setWindowFlags(Qt::Dialog);
stackWidget = new QStackedWidget(this);
stackWidget->setFixedSize(560, 520);
m_pAppSoundCtrlBar = new KNavigationBar(this);
m_pAppSoundCtrlBar->setFixedSize(188,520);
QBoxLayout *vLayout = new QVBoxLayout();
vLayout->addWidget(m_pAppSoundCtrlBar);
sideBar()->setLayout(vLayout);
vLayout = new QVBoxLayout;
vLayout->addWidget(stackWidget);
baseBar()->setLayout(vLayout);
this->setLayoutType(HorizontalType);
// æ·»åŠ åº”ç”¨åˆ°å¯¼èˆªæ �
for (QString appName : appList)
addItem(appName);
// åˆ�始化UI 默认选ä¸ç¬¬ä¸€é¡¹
QStandardItemModel* m_mode = m_pAppSoundCtrlBar->model(); //获�mode
if (m_mode->item(0,0))
m_pAppSoundCtrlBar->listview()->setCurrentIndex(m_mode->item(0,0)->index());
}
void UkmediaAppCtrlWidget::addItem(QString appName)
{
// 获�应用 name
QString iconName = getAppIcon(appName);
QString pAppName = getAppName(appName);
// 1.左边导航æ �å¢žåŠ æ ‡é¢˜
QStandardItem *item = new QStandardItem(QIcon::fromTheme(iconName), pAppName);
m_pAppSoundCtrlBar->addItem(item);
// 2.å�³è¾¹æ·»åŠ çª—å�£
UkmediaAppItemWidget* widget = new UkmediaAppItemWidget();
widget->setTitleName(pAppName);
widget->setChildObjectName(appName);
widget->setAttribute(Qt::WA_DeleteOnClose);
stackWidget->addWidget(widget);
// 3.设置app对应音�滑动�值
widget->setSliderValue(getAppVolume(appName));
widget->outputVolumeDarkThemeImage(getAppVolume(appName), getAppMuteState(appName));
// 4.设置app对应输出输入设备
for (QString sinkPortLabel : sinkPortList)
widget->addOutputCombobox(sinkPortLabel);
for (QString sourcePortLabel : sourcePortList)
widget->addInputCombobox(sourcePortLabel);
QString defaultInPort = getAppInputDevice(appName);
QString defaultOutPort = getAppOutputDevice(appName);
widget->m_pOutputCombobox->setCurrentText(defaultOutPort);
widget->m_pInputCombobox->setCurrentText(defaultInPort);
// 5.slots
connect(widget->m_pVolumeSlider, &KSlider::valueChanged, this, &UkmediaAppCtrlWidget::setAppVolume);
connect(widget->m_pVolumeBtn, &UkuiButtonDrawSvg::clicked, this, &UkmediaAppCtrlWidget::setAppMuteState);
connect(widget->m_pInputCombobox, QOverload::of(&QComboBox::currentIndexChanged), this, [this](int index) {
QComboBox *comboBox = qobject_cast(sender());
if (comboBox) {
QString text = comboBox->itemText(index);
setAppInputDevice(text);
}
});
connect(widget->m_pOutputCombobox, QOverload::of(&QComboBox::currentIndexChanged), this, [this](int index) {
QComboBox *comboBox = qobject_cast(sender());
if (comboBox) {
QString text = comboBox->itemText(index);
setAppOutputDevice(text);
}
});
connect(widget->m_pConfirmBtn, &QPushButton::clicked, this, [=](){
this->close();
});
//需求31268待2501��入
#if 1
if (appName.compare(QString(SYSTEM_VOLUME_CTRL)) == 0) {
if (!sinkPortList.isEmpty()) {
if (QString(sinkPortList.at(0)).compare(QString(tr("None"))) == 0) {
widget->m_pVolumeSlider->setEnabled(false);
widget->m_pVolumeBtn->setEnabled(false);
} else {
widget->m_pVolumeSlider->setEnabled(true);
widget->m_pVolumeBtn->setEnabled(true);
}
}
}
#endif
// 6.区分App类型
int appType = findAppDirection(appName);
switch (appType) {
case PA_STREAM_PLAYBACK:
item->setData(PA_STREAM_PLAYBACK);
widget->m_pInputCombobox->setDisabled(true);
break;
case PA_STREAM_RECORD:
item->setData(PA_STREAM_RECORD);
widget->m_pVolumeWidget->hide();
widget->m_pOutputCombobox->setDisabled(true);
break;
default:
item->setData(PA_STREAM_NODIRECTION);
break;
}
#ifdef PA_PROP_APPLICATION_MOVE
widget->setInputHintWidgetShow(checkAppMoveStatus(PA_STREAM_RECORD, appName));
widget->setOutputHintWidgetShow(checkAppMoveStatus(PA_STREAM_PLAYBACK, appName));
#endif
qDebug() << __func__ << "Application:" << appName << "Type:" << item->data().toInt();
}
void UkmediaAppCtrlWidget::removeAppItem(QString appName)
{
int index = -1;
for (int i = 0; i < appList.count(); i++) {
if (appList.at(i) == appName) {
index = i;
appList.removeAt(i);
break;
}
}
if (index == -1)
return;
QWidget* w = stackWidget->widget(index);
stackWidget->removeWidget(w);
w->close();
delete w;
m_pAppSoundCtrlBar->model()->removeRow(index);
stackWidget->setCurrentIndex(m_pAppSoundCtrlBar->listview()->currentIndex().row());
qDebug() << __func__ << appName << "stackWidget:" << stackWidget->children();
}
void UkmediaAppCtrlWidget::dealSlot()
{
// 导航æ �点击应用切æ�¢å¯¹åº”窗å�£slot
connect(m_pAppSoundCtrlBar->listview(), &QListView::clicked, this, [=](const QModelIndex modelIndex) {
int index = m_pAppSoundCtrlBar->listview()->currentIndex().row();
stackWidget->setCurrentIndex(index);
});;
QDBusConnection::sessionBus().connect(QString(),
UKUI_MEDIA_CONTROL_PATH,
UKUI_MEDIA_SERVICE,
"updatePortSignal",
this,
SLOT(updatePort()));
QDBusConnection::sessionBus().connect(QString(),
UKUI_MEDIA_CONTROL_PATH,
UKUI_MEDIA_SERVICE,
"updateMute",
this,
SLOT(updateSystemMuteState(bool)));
QDBusConnection::sessionBus().connect(QString(),
UKUI_MEDIA_CONTROL_PATH,
UKUI_MEDIA_SERVICE,
"updateVolume",
this,
SLOT(updateSystemVolume(int)));
QDBusConnection::sessionBus().connect(QString(),
UKUI_MEDIA_CONTROL_PATH,
UKUI_MEDIA_SERVICE,
"updateApp",
this,
SLOT(updateAppItem(QString)));
QDBusConnection::sessionBus().connect(QString(),
UKUI_MEDIA_CONTROL_PATH,
UKUI_MEDIA_SERVICE,
"removeSinkInputSignal",
this,
SLOT(removeAppItem(QString)));
// QDBusConnection::sessionBus().connect(QString(),
// UKUI_MEDIA_CONTROL_PATH,
// UKUI_MEDIA_SERVICE,
// "sinkInputVolumeChangedSignal",
// this,
// SLOT(appVolumeChangedSlot(QString, QString, int)));
}
// 获��行应用��
void UkmediaAppCtrlWidget::getAppList()
{
// é¦–å…ˆæ·»åŠ ç³»ç»ŸéŸ³é‡�
appList << SYSTEM_VOLUME_CTRL;
QDBusReply reply = interface->call("getAppList");
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return;
}
appList << reply.value();
getPlaybackAppInfo();
getRecordAppInfo();
}
void UkmediaAppCtrlWidget::getPlaybackAppInfo()
{
qRegisterMetaType("appInfo");
qDBusRegisterMetaType();
QDBusReply> reply = interface->call("getPlaybackAppInfo");
QList list = reply.value();
for (int i = 0; i < list.count(); i++) {
const QDBusArgument &dbusArgs = list.at(i).value();
while (!dbusArgs.atEnd()) {
appInfo info;
dbusArgs.beginStructure();
dbusArgs >> info.index;
dbusArgs >> info.volume;
dbusArgs >> info.channel;
dbusArgs >> info.mute;
dbusArgs >> info.direction;
#ifdef PA_PROP_APPLICATION_MOVE
dbusArgs >> info.move;
#endif
dbusArgs >> info.name;
dbusArgs >> info.masterIndex;
dbusArgs >> info.masterDevice;
playbackAppInfoList.push_back(info);
dbusArgs.endStructure();
qDebug() << __func__ << info.index << info.name << info.volume << info.masterDevice;
}
}
}
void UkmediaAppCtrlWidget::getRecordAppInfo()
{
qRegisterMetaType("appInfo");
qDBusRegisterMetaType();
QDBusReply> reply = interface->call("getRecordAppInfo");
QList list = reply.value();
for (int i = 0; i < list.count(); i++) {
const QDBusArgument &dbusArgs = list.at(i).value();
while (!dbusArgs.atEnd()) {
appInfo info;
dbusArgs.beginStructure();
dbusArgs >> info.index;
dbusArgs >> info.volume;
dbusArgs >> info.channel;
dbusArgs >> info.mute;
dbusArgs >> info.direction;
#ifdef PA_PROP_APPLICATION_MOVE
dbusArgs >> info.move;
#endif
dbusArgs >> info.name;
dbusArgs >> info.masterIndex;
dbusArgs >> info.masterDevice;
recordAppInfoList.push_back(info);
dbusArgs.endStructure();
qDebug() << __func__ << info.index << info.name << info.volume << info.masterDevice << info.direction;
}
}
}
void UkmediaAppCtrlWidget::getAllPortInfo()
{
// 注册自定义结构体类型
qRegisterMetaType("pa_device_port_info");
qDBusRegisterMetaType();
QDBusConnection bus = QDBusConnection::sessionBus();
if (!bus.isConnected()) {
qDebug() << "Cannot connect to D-Bus.";
return ;
}
QDBusMessage message = QDBusMessage::createMethodCall(PULSEAUDIO_DEVICECONTROL_SERVICE,
PULSEAUDIO_DEVICECONTROL_PATH,
PULSEAUDIO_DEVICECONTROL_INTERFACE,
"GetAllDeviceInfo");
QDBusMessage reply = bus.call(message);
const QDBusArgument &dbusArgs = reply.arguments().at(0).value().variant().value();
QList devsInfo;
dbusArgs.beginArray();
while (!dbusArgs.atEnd()) {
pa_device_port_info info;
dbusArgs.beginStructure();
dbusArgs >> info.card;
dbusArgs >> info.direction;
dbusArgs >> info.available;
dbusArgs >> info.plugged_stauts;
dbusArgs >> info.name;
dbusArgs >> info.description;
dbusArgs >> info.device_description;
dbusArgs >> info.device_product_name;
devsInfo.push_back(info);
dbusArgs.endStructure();
}
dbusArgs.endArray();
// æ·»åŠ ç«¯å�£è‡³portInfoMap
int count = 0;
for (pa_device_port_info &info : devsInfo) {
if (info.available == PA_PORT_AVAILABLE_YES || info.available == PA_PORT_AVAILABLE_UNKNOWN) {
QString portLabel = info.description + "(" + info.device_description + ")";
info.description = portLabel;
portInfoMap.insert(count, info);
count++;
}
}
}
// 获�所有�用输出端�
QStringList UkmediaAppCtrlWidget::getAllOutputPort()
{
QMap::iterator it;
for (it = portInfoMap.begin(); it != portInfoMap.end(); it++) {
if (it.value().direction == PA_DIRECTION_OUTPUT) {
sinkPortList << it.value().description;
// Usb声å�¡å’Œè“�牙声å�¡å˜åœ¨å¤šç§�é…�置文件,ä¿�留声å�¡å½“å‰�选择的é…�置文件端å�£
QDBusReply reply = interface->call("isPortHidingNeeded", SoundType::SINK, it.value().card, it.value().description);
if (reply.value())
sinkPortList.removeAll(it.value().description);
}
}
if (sinkPortList.isEmpty())
sinkPortList.append(tr("None"));
return sinkPortList;
}
// 获�所有�用输入端�
QStringList UkmediaAppCtrlWidget::getAllInputPort()
{
QMap::iterator it;
for (it = portInfoMap.begin(); it != portInfoMap.end(); it++) {
if (it.value().direction == PA_DIRECTION_INPUT) {
sourcePortList << it.value().description;
QDBusReply reply = interface->call("isPortHidingNeeded", SoundType::SOURCE, it.value().card, it.value().description);
if (reply.value())
sourcePortList.removeAll(it.value().description);
}
}
if (sourcePortList.isEmpty())
sourcePortList.append(tr("None"));
return sourcePortList;
}
// 获�系统音�
int UkmediaAppCtrlWidget::getSystemVolume()
{
QDBusReply reply = interface->call("getDefaultOutputVolume");
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return 0;
}
return reply.value();
}
// 获�应用音�
int UkmediaAppCtrlWidget::getAppVolume(QString app)
{
if (app == SYSTEM_VOLUME_CTRL)
return getSystemVolume();
QDBusReply reply = interface->call("getAppVolume", app);
if(!reply.isValid()) {
qWarning() << __func__ << "failed";
return 0;
}
return reply.value();
}
bool UkmediaAppCtrlWidget::getSystemMuteState()
{
QDBusReply reply = interface->call("getDefaultOutputMuteState");
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return false;
}
return reply.value();
}
// 获�应用�音状�
bool UkmediaAppCtrlWidget::getAppMuteState(QString app)
{
if (app == SYSTEM_VOLUME_CTRL)
return getSystemMuteState();
QDBusReply reply = interface->call("getAppMuteState", app);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return false;
}
return reply.value();
}
// 获�系统默认输出设备
QString UkmediaAppCtrlWidget::getSystemOutputDevice()
{
QDBusReply reply = interface->call("getSystemOutputDevice");
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return "";
}
return reply.value();
}
// 获�系统默认输入设备
QString UkmediaAppCtrlWidget::getSystemInputDevice()
{
QDBusReply reply = interface->call("getSystemInputDevice");
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return "";
}
return reply.value();
}
// 获�应用默认输出设备
QString UkmediaAppCtrlWidget::getAppOutputDevice(QString app)
{
if (app == SYSTEM_VOLUME_CTRL)
return getSystemOutputDevice();
QDBusReply reply = interface->call("getAppOutputDevice", app);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return "";
}
return reply.value();
}
// 获�应用默认输入设备
QString UkmediaAppCtrlWidget::getAppInputDevice(QString app)
{
if (app == SYSTEM_VOLUME_CTRL)
return getSystemInputDevice();
QDBusReply reply = interface->call("getAppInputDevice", app);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return "";
}
return reply.value();
}
// 设置系统音�
bool UkmediaAppCtrlWidget::setSystemVolume(int value)
{
QDBusReply reply = interface->call("setDefaultOutputVolume", value);
if (!reply.isValid())
return false;
return reply.value();
}
// 设置应用音�
bool UkmediaAppCtrlWidget::setAppVolume(int value)
{
QSlider *slider = qobject_cast(sender());
if (slider == nullptr)
return false;
QString app = slider->objectName();
UkmediaAppItemWidget *w = stackWidget->findChild(app);
w->outputVolumeDarkThemeImage(value, getAppMuteState(app));
if (app == SYSTEM_VOLUME_CTRL)
return setSystemVolume(value);
QDBusReply reply = interface->call("setAppVolume", app, value);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return false;
}
return reply.value();
}
// 设置应用�音
bool UkmediaAppCtrlWidget::setAppMuteState()
{
UkuiButtonDrawSvg *btn = qobject_cast(sender());
if (btn == nullptr)
return false;
QString app = btn->objectName();
// 1.系统�音设置
if (app == SYSTEM_VOLUME_CTRL) {
QDBusReply reply1 = interface->call("getDefaultOutputMuteState");
if (!reply1.isValid())
return false;
bool state = reply1.value();
QDBusReply reply2 = interface->call("setDefaultOutputMuteState", !state);
if (!reply2.isValid())
return false;
btn->outputVolumeDarkThemeImage(getAppVolume(app), !state);
return reply2.value();
}
// 2.应用�音设置
QDBusReply reply1 = interface->call("getAppMuteState", app);
if (!reply1.isValid())
return false;
bool state = reply1.value();
QDBusReply reply = interface->call("setAppMuteState", app, !state);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return false;
}
btn->outputVolumeDarkThemeImage(getAppVolume(app), !state);
return reply.value();
}
// 设置系统输入设备
bool UkmediaAppCtrlWidget::setSystemInputDevice(QString portLabel)
{
QDBusReply reply = interface->call("setSystemInputDevice", portLabel);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return false;
}
return reply.value();
}
// 设置系统输出设备
bool UkmediaAppCtrlWidget::setSystemOutputDevice(QString portLabel)
{
QDBusReply reply = interface->call("setSystemOutputDevice", portLabel);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return false;
}
return reply.value();
}
// 设置应用输出设备
bool UkmediaAppCtrlWidget::setAppOutputDevice(QString portLabel)
{
QComboBox *combobox = qobject_cast(sender());
if (combobox == nullptr)
return false;
QString app = combobox->objectName().split("-output").at(0);
if (app == SYSTEM_VOLUME_CTRL)
return setSystemOutputDevice(portLabel);
int cardIndex = -1;
QString sinkPortName;
QMap::iterator it;
for (it = portInfoMap.begin(); it != portInfoMap.end(); it++) {
pa_device_port_info info = it.value();
if (portLabel == info.description && info.direction == 1) {
cardIndex = info.card;
sinkPortName = info.name;
}
}
QDBusReply reply = interface->call("setAppOutputDevice", app, cardIndex, sinkPortName);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return false;
}
if (!reply.value()) {
combobox->blockSignals(true);
combobox->setCurrentText(getAppOutputDevice(app));
combobox->blockSignals(false);
qDebug() << __func__ << "failed";
return false;
}
return reply.value();
}
// 设置应用输入设备
bool UkmediaAppCtrlWidget::setAppInputDevice(QString portLabel)
{
QComboBox *combobox = qobject_cast(sender());
if (combobox == nullptr)
return false;
QString app = combobox->objectName().split("-input").at(0);
if (app == SYSTEM_VOLUME_CTRL)
return setSystemInputDevice(portLabel);
int cardIndex = -1;
QString sourcePortName;
QMap::iterator it;
for (it = portInfoMap.begin(); it != portInfoMap.end(); it++) {
pa_device_port_info info = it.value();
if (portLabel == info.description && info.direction == 2) {
cardIndex = info.card;
sourcePortName = info.name;
}
}
QDBusReply reply = interface->call("setAppInputDevice", app, cardIndex, sourcePortName);
if (!reply.isValid()) {
qWarning() << __func__ << "failed";
return false;
}
if (!reply.value()) {
combobox->blockSignals(true);
combobox->setCurrentText(getAppInputDevice(app));
combobox->blockSignals(false);
qDebug() << __func__ << "failed";
return false;
}
return reply.value();
}
void UkmediaAppCtrlWidget::updateAppItem(QString appName)
{
playbackAppInfoList.clear();
recordAppInfoList.clear();
getPlaybackAppInfo();
getRecordAppInfo();
if (!appList.contains(appName)) {
appList << appName;
addItem(appName);
return;
}
else {
UkmediaAppItemWidget *w = stackWidget->findChild(appName);
w->setSliderValue(getAppVolume(appName));
w->outputVolumeDarkThemeImage(getAppVolume(appName), getAppMuteState(appName));
int appType = findAppDirection(appName);
switch (appType) {
case PA_STREAM_PLAYBACK:
w->m_pVolumeWidget->show();
w->m_pInputCombobox->setDisabled(true);
w->m_pOutputCombobox->setDisabled(false);
qDebug() << __func__ << appName << "PA_STREAM_PLAYBACK";
break;
case PA_STREAM_RECORD:
w->m_pVolumeWidget->hide();
w->m_pInputCombobox->setDisabled(false);
w->m_pOutputCombobox->setDisabled(true);
qDebug() << __func__ << appName << "PA_STREAM_RECORD";
break;
default:
w->m_pVolumeWidget->show();
w->m_pInputCombobox->setDisabled(false);
w->m_pOutputCombobox->setDisabled(false);
qDebug() << __func__ << appName << "PA_STREAM_NODIRECTION";
break;
}
#ifdef PA_PROP_APPLICATION_MOVE
w->setInputHintWidgetShow(checkAppMoveStatus(PA_STREAM_RECORD, appName));
w->setOutputHintWidgetShow(checkAppMoveStatus(PA_STREAM_PLAYBACK, appName));
#endif
}
}
// å�Œæ¥ç³»ç»ŸéŸ³é‡�
void UkmediaAppCtrlWidget::updateSystemVolume(int value)
{
UkmediaAppItemWidget *w = stackWidget->findChild(SYSTEM_VOLUME_CTRL);
int mediaVolume = UkmediaCommon::getInstance().paVolumeToMediaVolume(value);
w->setSliderValue(mediaVolume);
w->outputVolumeDarkThemeImage(mediaVolume, getSystemMuteState());
for (int i = 0; i < appList.count(); i++) {
QString appName = appList.at(i);
UkmediaAppItemWidget *w = stackWidget->findChild(appName);
w->m_pOutputCombobox->blockSignals(true);
w->m_pOutputCombobox->setCurrentText(getAppOutputDevice(appName));
w->m_pOutputCombobox->blockSignals(false);
w->m_pInputCombobox->blockSignals(true);
w->m_pInputCombobox->setCurrentText(getAppInputDevice(appName));
w->m_pInputCombobox->blockSignals(false);
}
}
// å�Œæ¥åº”用音é‡�
//void UkmediaAppCtrlWidget::appVolumeChangedSlot(QString app, QString appId, int volume)
//{
// QSlider *slider = stackWidget->findChild(app);
// QLabel *sliderLabel = stackWidget->findChild(app+"-label");
// if (slider == nullptr || sliderLabel == nullptr)
// return;
// int mediaVolume = UkmediaCommon::getInstance().paVolumeToMediaVolume(volume);
// slider->blockSignals(true);
// slider->setValue(mediaVolume);
// slider->blockSignals(false);
// QString percent = QString::number(mediaVolume);
// sliderLabel->setText(percent+"%");
// for (QString appName : appList) {
// QComboBox *outputBox = stackWidget->findChild(appName + "-output");
// QComboBox *inputBox = stackWidget->findChild(appName + "-output");
// inputBox->blockSignals(true);
// outputBox->blockSignals(true);
// QString defaultOutPort = getAppOutputDevice(appName);
// QString defaultInPort = getAppInputDevice(appName);
// inputBox->setCurrentText(defaultInPort);
// outputBox->setCurrentText(defaultOutPort);
// outputBox->blockSignals(false);
// inputBox->blockSignals(false);
// }
// qDebug() << __func__ << app << volume << stackWidget->children();
//}
// å�Œæ¥ç³»ç»Ÿé�™éŸ³çжæ€�
void UkmediaAppCtrlWidget::updateSystemMuteState(bool state)
{
UkuiButtonDrawSvg *btn = stackWidget->findChild(SYSTEM_VOLUME_CTRL);
btn->outputVolumeDarkThemeImage(getSystemVolume(), state);
}
// å�Œæ¥åº”用é�™éŸ³çжæ€�
void UkmediaAppCtrlWidget::updateAppMuteState(QString app, bool state)
{
UkuiButtonDrawSvg *btn = stackWidget->findChild(app);
btn->outputVolumeDarkThemeImage(getAppVolume(app), state);
}
void UkmediaAppCtrlWidget::updatePort()
{
qDebug() << __func__ << sinkPortList;
QStringList currentSinkPortList = sinkPortList;
QStringList currentSourcePortList = sourcePortList;
portInfoMap.clear();
sinkPortList.clear();
sourcePortList.clear();
getAllPortInfo();
getAllInputPort();
getAllOutputPort();
// 1. åˆ é™¤ä¸�å�¯ç”¨è¾“出端å�£
for (int i = 0; i < currentSinkPortList.count(); i++) {
QString port = currentSinkPortList.at(i);
if (!sinkPortList.contains(port)) {
for (int a = 0; a < appList.count(); a++) {
QString appName = appList.at(a);
UkmediaAppItemWidget *w = stackWidget->findChild(appName);
int index = indexOfItemCombobox(port, w->m_pOutputCombobox);
w->m_pOutputCombobox->blockSignals(true);
w->m_pOutputCombobox->removeItem(index);
w->m_pOutputCombobox->blockSignals(false);
}
}
}
// 2. åˆ é™¤ä¸�å�¯ç”¨è¾“入端å�£
for (int i = 0; i < currentSourcePortList.count(); i++) {
QString port = currentSourcePortList.at(i);
if (!sourcePortList.contains(port)) {
for (int a = 0; a < appList.count(); a++) {
QString appName = appList.at(a);
UkmediaAppItemWidget *w = stackWidget->findChild(appName);
int index = indexOfItemCombobox(port, w->m_pInputCombobox);
w->m_pInputCombobox->blockSignals(true);
w->m_pInputCombobox->removeItem(index);
w->m_pInputCombobox->blockSignals(false);
}
}
}
// 3. å¢žåŠ å�¯ç”¨è¾“出端å�£
for (int i = 0; i < sinkPortList.count(); i++) {
QString port = sinkPortList.at(i);
if (!currentSinkPortList.contains(port)) {
for (int a = 0; a < appList.count(); a++) {
QString appName = appList.at(a);
UkmediaAppItemWidget *w = stackWidget->findChild(appName);
w->m_pOutputCombobox->blockSignals(true);
w->m_pOutputCombobox->addItem(port);
w->m_pOutputCombobox->blockSignals(false);
}
}
}
// 4. å¢žåŠ å�¯ç”¨è¾“入端å�£
for (int i = 0; i < sourcePortList.count(); i++) {
QString port = sourcePortList.at(i);
if (!currentSourcePortList.contains(port)) {
for (int a = 0; a < appList.count(); a++) {
QString appName = appList.at(a);
UkmediaAppItemWidget *w = stackWidget->findChild(appName);
w->m_pInputCombobox->blockSignals(true);
w->m_pInputCombobox->addItem(port);
w->m_pInputCombobox->blockSignals(false);
}
}
}
// 5. 选择默认输出设备
for (int i = 0; i < appList.count(); i++) {
QString appName = appList.at(i);
UkmediaAppItemWidget *w = stackWidget->findChild(appName);
w->m_pOutputCombobox->blockSignals(true);
w->m_pOutputCombobox->setCurrentText(getAppOutputDevice(appName));
w->m_pOutputCombobox->blockSignals(false);
w->m_pInputCombobox->blockSignals(true);
w->m_pInputCombobox->setCurrentText(getAppInputDevice(appName));
w->m_pInputCombobox->blockSignals(false);
//需求31268待2501��入
#if 1
if (appName.compare(QString(SYSTEM_VOLUME_CTRL)) == 0) {
if (!sinkPortList.isEmpty()) {
if (QString(sinkPortList.at(0)).compare(QString(tr("None"))) == 0) {
w->m_pVolumeSlider->setEnabled(false);
w->m_pVolumeBtn->setEnabled(false);
} else {
w->m_pVolumeSlider->setEnabled(true);
w->m_pVolumeBtn->setEnabled(true);
}
}
}
#endif
}
}
int UkmediaAppCtrlWidget::indexOfItemCombobox(QString port, QComboBox *box)
{
for (int index = 0; index < box->count(); ++index)
{
QString textport = box->itemText(index);
if (textport == port) {
return index;
}
}
return -1;
}
QString UkmediaAppCtrlWidget::getAppName(QString appName)
{
GError* error = nullptr;
GKeyFileFlags flag = G_KEY_FILE_NONE;
GKeyFile* keyfile = g_key_file_new();
appName = AppDesktopFileAdaption(appName);
QString path = "/usr/share/applications/";
path.append(appName);
path.append(".desktop");
/* Some applications desktop file exist in /etc/xdg/autostart/ path */
QFileInfo file(path);
if (!file.exists()) {
path = "/etc/xdg/autostart/";
path.append(appName);
path.append(".desktop");
}
QByteArray fpbyte = path.toLocal8Bit();
char* filepath = fpbyte.data();
if (!g_key_file_load_from_file(keyfile, filepath, flag, &error))
qDebug() << "g_key_file_load_from_file() failed" << error->message;
char* name= g_key_file_get_locale_string(keyfile, "Desktop Entry", "Name", nullptr, nullptr);
QString namestr=QString::fromLocal8Bit(name);
g_key_file_free(keyfile);
if (appName == SYSTEM_VOLUME_CTRL)
namestr = tr("System Volume");
namestr = (namestr != "") ? namestr : appName;
return namestr;
}
QString UkmediaAppCtrlWidget::getAppIcon(QString appName)
{
GError** error=nullptr;
GKeyFileFlags flags=G_KEY_FILE_NONE;
GKeyFile* keyfile=g_key_file_new ();
appName = AppDesktopFileAdaption(appName);
QString path = "/usr/share/applications/";
path.append(appName);
path.append(".desktop");
/* Some applications desktop file exist in /etc/xdg/autostart/ path */
QFileInfo file(path);
if (!file.exists()) {
path = "/etc/xdg/autostart/";
path.append(appName);
path.append(".desktop");
}
QByteArray fpbyte=path.toLocal8Bit();
char* filepath=fpbyte.data();
g_key_file_load_from_file(keyfile,filepath,flags,error);
char* name=g_key_file_get_locale_string(keyfile,"Desktop Entry","Icon", nullptr, nullptr);
QString namestr=QString::fromLocal8Bit(name);
g_key_file_free(keyfile);
if (appName == SYSTEM_VOLUME_CTRL)
namestr = SYSTEM_VOLUME_CTRL;
/* If we can't find the app icon
* we need to set a default icon for it */
namestr = (namestr != "") ? namestr : "application-x-desktop";
return namestr;
}
int UkmediaAppCtrlWidget::findAppDirection(QString appName)
{
int stream = PA_STREAM_NODIRECTION;
for (appInfo info : playbackAppInfoList) {
if (info.name == appName) {
stream = PA_STREAM_PLAYBACK;
break;
}
}
for (appInfo info : recordAppInfoList) {
if (info.name == appName) {
if (stream == PA_STREAM_PLAYBACK)
stream = PA_STREAM_NODIRECTION;
else
stream = PA_STREAM_RECORD;
break;
}
}
return stream;
}
#ifdef PA_PROP_APPLICATION_MOVE
bool UkmediaAppCtrlWidget::checkAppMoveStatus(int appType, QString appName)
{
bool moveStatus = false;
if (appName == SYSTEM_VOLUME_CTRL)
return true;
if (appType == PA_STREAM_PLAYBACK) {
//start #227383
if ((appName == "kylin-recorder") && (findAppDirection(appName) == PA_STREAM_NODIRECTION)) {
return false;
}
//end
for (appInfo info : playbackAppInfoList) {
if (info.name == appName) {
moveStatus = (info.move == "yes") ? true : false;
break;
}
}
}
else {
for (appInfo info : recordAppInfoList) {
// #214516 Circumvention deals with kylin-recorder
if (appName == "kylin-recorder")
return false;
if (info.name == appName) {
moveStatus = (info.move == "yes") ? true : false;
break;
}
}
}
return moveStatus;
}
#endif
QString UkmediaAppCtrlWidget::AppDesktopFileAdaption(QString appName)
{
//�些第三方应用获�到appName与它的desktop文件��一致,需手动适�
if (appName.contains("qaxbrowser"))
appName = "qaxbrowser-safe";
return appName;
}
UkmediaAppCtrlWidget::~UkmediaAppCtrlWidget()
{
}
ukui-media/audio/app-device-control/ukmedia_app_item_widget.cpp 0000664 0001750 0001750 00000030630 15170054730 023676 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "ukmedia_app_item_widget.h"
UkmediaAppItemWidget::UkmediaAppItemWidget(QWidget *parent)
: QWidget(parent)
{
if (QGSettings::isSchemaInstalled("org.ukui.style")) {
QGSettings *nThemeSetting = new QGSettings("org.ukui.style");
if (nThemeSetting->keys().contains("styleName")) {
mThemeName = nThemeSetting->get("style-name").toString();
}
}
initUI();
onPaletteChanged();
}
void UkmediaAppItemWidget::initUI()
{
this->setFixedSize(560,477);
m_pAppLabel = new FixLabel(tr("Application"), this);
m_pAppLabel->setContentsMargins(17,0,0,0);
m_pAppWidget = new QFrame(this);
m_pInputWidget = new QFrame(m_pAppWidget);
m_pOutputWidget = new QFrame(m_pAppWidget);
m_pVolumeWidget = new QFrame(m_pAppWidget);
m_pCheckWidget = new QFrame(m_pAppWidget);
m_pAppWidget->setFrameShape(QFrame::Shape::Box);
m_pInputWidget->setFrameShape(QFrame::Shape::Box);
m_pOutputWidget->setFrameShape(QFrame::Shape::Box);
m_pVolumeWidget->setFrameShape(QFrame::Shape::Box);
m_pCheckWidget->setFrameShape(QFrame::Shape::Box);
m_pInputWidget->setObjectName("InputWidget");
m_pOutputWidget->setObjectName("OutputWidget");
m_pVolumeWidget->setObjectName("VolumeWidget");
m_pAppWidget->setFixedSize(512, 415);
m_pInputWidget->setFixedSize(512, 90);
m_pOutputWidget->setFixedSize(512, 90);
m_pVolumeWidget->setFixedSize(512, 60);
m_pCheckWidget->setFixedSize(512, 36);
//应用音�布局
m_pVolumeLabel = new FixLabel(tr("Output Volume"), m_pVolumeWidget);
m_pVolumeBtn = new UkuiButtonDrawSvg(m_pVolumeWidget);
m_pVolumeSlider = new KSlider(m_pVolumeWidget);
m_pVolumeSlider->setRange(0,100);
m_pVolumeSlider->setSliderType(SmoothSlider);
m_pVolumeSlider->setNodeVisible(false);
m_pVolumeNumLabel = new FixLabel("0%", m_pVolumeWidget);
m_pVolumeBtn->setFixedSize(24,24);
m_pVolumeSlider->setFixedSize(260,55);
m_pVolumeLabel->setFixedSize(120,20);
m_pVolumeNumLabel->setFixedSize(55,20);
m_pVolumeSlider->setOrientation(Qt::Horizontal);
m_pVolumeNumLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
QHBoxLayout *volumeLayout = new QHBoxLayout(m_pVolumeWidget);
volumeLayout->addItem(new QSpacerItem(17,20,QSizePolicy::Fixed));
volumeLayout->addWidget(m_pVolumeLabel);
volumeLayout->addItem(new QSpacerItem(12,20,QSizePolicy::Expanding));
volumeLayout->addWidget(m_pVolumeBtn);
volumeLayout->addItem(new QSpacerItem(10,20,QSizePolicy::Fixed));
volumeLayout->addWidget(m_pVolumeSlider);
// volumeLayout->addItem(new QSpacerItem(14,20,QSizePolicy::Fixed));
volumeLayout->addWidget(m_pVolumeNumLabel);
volumeLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
volumeLayout->setSpacing(0);
m_pVolumeWidget->setLayout(volumeLayout);
m_pVolumeWidget->layout()->setContentsMargins(0,0,0,0);
//输入设备布局
m_pInputDevLabel = new FixLabel(tr("Input Device"), m_pInputWidget);
m_pInputCombobox = new QComboBox(m_pInputWidget);
m_pInputDevLabel->setFixedSize(120, 36);
m_pInputCombobox->setFixedSize(347, 36);
m_pInputHintIcon = new QLabel(m_pInputWidget);
m_pInputHintIcon->setFixedSize(16, 16);
m_pInputHintIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(QSize(16, 16)));
m_pInputHintLabel = new FixLabel(tr("This case does not support setting the input device"), m_pInputWidget);
m_pInputHintWidget = new QFrame(m_pInputWidget);
QHBoxLayout *lay = new QHBoxLayout(m_pInputHintWidget);
lay->addWidget(m_pInputHintIcon);
lay->addWidget(m_pInputHintLabel);
lay->setSpacing(3);
m_pInputHintWidget->setLayout(lay);
m_pInputHintWidget->layout()->setContentsMargins(0, 0, 0, 0);
QGridLayout *gridLayout = new QGridLayout(m_pInputWidget);
gridLayout->addWidget(m_pInputDevLabel, 0, 0);
gridLayout->addWidget(m_pInputCombobox, 0, 1);
gridLayout->addItem(new QSpacerItem(132, 20, QSizePolicy::Fixed), 1, 0);
gridLayout->addWidget(m_pInputHintWidget);
gridLayout->setSpacing(0);
m_pInputWidget->setLayout(gridLayout);
m_pInputWidget->layout()->setContentsMargins(17, 11, 16, 0);
//输出设备布局
m_pOutputDevLabel = new FixLabel(tr("Output Device"), m_pOutputWidget);
m_pOutputCombobox = new QComboBox(m_pOutputWidget);
m_pOutputDevLabel->setFixedSize(120, 36);
m_pOutputCombobox->setFixedSize(347, 36);
m_pOutputHintIcon = new QLabel(m_pOutputWidget);
m_pOutputHintIcon->setFixedSize(16, 16);
m_pOutputHintIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(QSize(16, 16)));
m_pOutputHintLabel = new FixLabel(tr("This case does not support setting the output device"), m_pOutputWidget);
m_pOutputHintWidget = new QFrame(m_pOutputWidget);
QHBoxLayout *outputLay = new QHBoxLayout(m_pOutputHintWidget);
outputLay->addWidget(m_pOutputHintIcon);
outputLay->addWidget(m_pOutputHintLabel);
outputLay->setSpacing(3);
m_pOutputHintWidget->setLayout(outputLay);
m_pOutputHintWidget->layout()->setContentsMargins(0, 0, 0, 0);
QGridLayout *outputGridLayout = new QGridLayout(m_pOutputWidget);
outputGridLayout->addWidget(m_pOutputDevLabel, 0, 0);
outputGridLayout->addWidget(m_pOutputCombobox, 0, 1);
outputGridLayout->addItem(new QSpacerItem(132, 20, QSizePolicy::Fixed), 1, 0);
outputGridLayout->addWidget(m_pOutputHintWidget);
outputGridLayout->setSpacing(0);
m_pOutputWidget->setLayout(outputGridLayout);
m_pOutputWidget->layout()->setContentsMargins(17, 11, 16, 0);
// check Btn
m_pConfirmBtn = new QPushButton(tr("Confirm"), m_pCheckWidget);
m_pConfirmBtn->setFixedSize(96, 36);
m_pConfirmBtn->setProperty("isImportant", true);
QHBoxLayout *checkLayout = new QHBoxLayout(m_pCheckWidget);
checkLayout->addStretch();
checkLayout->addWidget(m_pConfirmBtn);
checkLayout->setSpacing(0);
m_pCheckWidget->setLayout(checkLayout);
m_pCheckWidget->layout()->setContentsMargins(0,0,0,0);
// line1 = myLine();
// line2 = myLine();
QVBoxLayout *vlayout = new QVBoxLayout(m_pAppWidget);
vlayout->addWidget(m_pVolumeWidget);
vlayout->addSpacing(1);
vlayout->addWidget(m_pOutputWidget);
vlayout->addSpacing(1);
vlayout->addWidget(m_pInputWidget);
vlayout->addItem(new QSpacerItem(16,197,QSizePolicy::Fixed));
vlayout->addStretch();
vlayout->addWidget(m_pCheckWidget);
vlayout->setSpacing(0);
vlayout->setContentsMargins(0,0,0,0);
//整体布局
QVBoxLayout *appLayout = new QVBoxLayout(this);
appLayout->addItem(new QSpacerItem(16,8,QSizePolicy::Fixed));
appLayout->addWidget(m_pAppLabel);
appLayout->addItem(new QSpacerItem(16,8,QSizePolicy::Fixed));
appLayout->addWidget(m_pAppWidget);
appLayout->addItem(new QSpacerItem(16,24,QSizePolicy::Fixed));
appLayout->addStretch();
appLayout->setSpacing(0);
this->setLayout(appLayout);
this->layout()->setContentsMargins(25,0,23,0);
}
void UkmediaAppItemWidget::setInputHintWidgetShow(bool status)
{
if (status) {
m_pInputHintWidget->hide();
m_pInputWidget->setFixedSize(512, 60);
m_pInputCombobox->setDisabled(false);
} else {
m_pInputHintWidget->show();
m_pInputWidget->setFixedSize(512, 90);
m_pInputCombobox->setDisabled(true);
}
}
void UkmediaAppItemWidget::setOutputHintWidgetShow(bool status)
{
if (status) {
m_pOutputHintWidget->hide();
m_pOutputWidget->setFixedSize(512, 60);
m_pOutputCombobox->setDisabled(false);
} else {
m_pOutputHintWidget->show();
m_pOutputWidget->setFixedSize(512, 90);
m_pOutputCombobox->setDisabled(true);
}
}
// 设置窗å�£åº”ç”¨æ ‡é¢˜
void UkmediaAppItemWidget::setTitleName(QString name)
{
m_pAppLabel->setText(name);
}
void UkmediaAppItemWidget::setChildObjectName(QString name)
{
m_pVolumeNumLabel->setObjectName(name+"-label");
m_pVolumeBtn->setObjectName(name);
m_pVolumeSlider->setObjectName(name);
m_pInputCombobox->setObjectName(name+"-input");
m_pOutputCombobox->setObjectName(name+"-output");
this->setObjectName(name);
}
void UkmediaAppItemWidget::setSliderValue(int value)
{
if (m_pVolumeSlider->objectName() == "kylin-settings-system") {
if (QGSettings::isSchemaInstalled("org.ukui.sound")) {
QGSettings *nThemeSetting = new QGSettings("org.ukui.sound");
if (nThemeSetting->keys().contains("volumeIncrease")) {
if (nThemeSetting->get("volumeIncrease").toBool())
m_pVolumeSlider->setRange(0, 125);
}
}
}
m_pVolumeSlider->blockSignals(true);
m_pVolumeSlider->setValue(value);
m_pVolumeSlider->blockSignals(false);
QString percent = QString::number(value);
m_pVolumeNumLabel->setText(percent+"%");
}
void UkmediaAppItemWidget::addInputCombobox(QString port)
{
m_pInputCombobox->blockSignals(true);
m_pInputCombobox->addItem(port);
m_pInputCombobox->blockSignals(false);
}
void UkmediaAppItemWidget::addOutputCombobox(QString port)
{
m_pOutputCombobox->blockSignals(true);
m_pOutputCombobox->addItem(port);
m_pOutputCombobox->blockSignals(false);
}
void UkmediaAppItemWidget::onPaletteChanged()
{
QPalette palette = m_pInputHintLabel->palette();
QColor color = palette.color(QPalette::PlaceholderText);
palette.setColor(QPalette::Text, color);
m_pInputHintLabel->setPalette(palette);
palette = m_pOutputHintLabel->palette();
color = palette.color(QPalette::PlaceholderText);
palette.setColor(QPalette::Text, color);
m_pOutputHintLabel->setPalette(palette);
if (mThemeName == UKUI_THEME_LIGHT || mThemeName == UKUI_THEME_DEFAULT) {
m_pInputWidget->setStyleSheet("#InputWidget{border-radius: 6px; background-color: #F5F5F5;}");
m_pOutputWidget->setStyleSheet("#OutputWidget{border-radius: 6px; background-color: #F5F5F5;}");
m_pVolumeWidget->setStyleSheet("#VolumeWidget{border-radius: 6px; background-color: #F5F5F5;}");
}
else if (mThemeName == UKUI_THEME_DARK) {
m_pInputWidget->setStyleSheet("#InputWidget{border-radius: 6px; background-color: #333333;}");
m_pOutputWidget->setStyleSheet("#OutputWidget{border-radius: 6px; background-color: #333333;}");
m_pVolumeWidget->setStyleSheet("#VolumeWidget{border-radius: 6px; background-color: #333333;}");
}
}
// 更新音é‡�å›¾æ ‡
void UkmediaAppItemWidget::outputVolumeDarkThemeImage(int value, bool status)
{
QImage image;
QColor color = QColor(0,0,0,216);
if (mThemeName == UKUI_THEME_LIGHT || mThemeName == UKUI_THEME_DEFAULT)
color = QColor(0,0,0,216);
else if (mThemeName == UKUI_THEME_DARK)
color = QColor(255,255,255,216);
if (status) {
image = QIcon::fromTheme("audio-volume-muted-symbolic").pixmap(24,24).toImage();
}
else if (value <= 0) {
image = QIcon::fromTheme("audio-volume-muted-symbolic").pixmap(24,24).toImage();
}
else if (value > 0 && value <= 33) {
image = QIcon::fromTheme("audio-volume-low-symbolic").pixmap(24,24).toImage();
}
else if (value >33 && value <= 66) {
image = QIcon::fromTheme("audio-volume-medium-symbolic").pixmap(24,24).toImage();
}
else {
image = QIcon::fromTheme("audio-volume-high-symbolic").pixmap(24,24).toImage();
}
m_pVolumeBtn->refreshIcon(image, color);
}
QFrame* UkmediaAppItemWidget::myLine()
{
QFrame *line = new QFrame(this);
line->setFixedSize(512, 1);
line->setLineWidth(0);
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
return line;
}
UkmediaAppItemWidget::~UkmediaAppItemWidget()
{
}
ukui-media/audio/titlelabel.cpp 0000664 0001750 0001750 00000003034 15170052044 015456 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "titlelabel.h"
#include
#include
#include
#include
TitleLabel::TitleLabel(QWidget *parent):
QLabel(parent)
{
/*åˆ�始化å—体*/
// QFont font;
// QGSettings *m_fontSetting = new QGSettings("org.ukui.style");
// font.setFamily(m_fontSetting->get("systemFont").toString());
// font.setPixelSize(m_fontSetting->get("systemFontSize").toInt() * 18 / 11); //设置的是pt,按照公å¼�计算为px,æ ‡é¢˜é»˜è®¤å—为18px
// font.setWeight(QFont::Medium);
// this->setFont(font);
this ->setContentsMargins(16,0,0,0);
// delete m_fontSetting;
// m_fontSetting = nullptr;
}
TitleLabel::~TitleLabel()
{
}
ukui-media/audio/ukui_list_widget_item.h 0000664 0001750 0001750 00000004054 15170054730 017402 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef UKUILISTWIDGETITEM_H
#define UKUILISTWIDGETITEM_H
#include
#include
#include
#include
#include
#include
#include
#include
class UkuiListWidget : public QListWidget
{
Q_OBJECT
public:
UkuiListWidget(QWidget *parent = nullptr);
~UkuiListWidget();
protected:
void paintEvent(QPaintEvent*event) {
int i;
for (i = 0 ;i < this->count();i++) {
QListWidgetItem *item = this->item(i);
// item->setTextColor(QColor(0,0,0,0));
delete item;
}
QListWidget::paintEvent(event);
}
};
class UkuiListWidgetItem : public QWidget
{
Q_OBJECT
public:
UkuiListWidgetItem(QWidget *parent = 0);
~UkuiListWidgetItem();
public:
void setLabelText(QString portText,QString deviceLabel);
// void setLabelTextIsWhite(bool selected);
void setSelected(bool selected);
// QString text();
QString portName;
QLabel * portLabel;
QLabel * deviceLabel;
protected:
// void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent *ev);
private:
QWidget * widget;
};
#endif // UKUILISTWIDGETITEM_H
ukui-media/audio/ukmedia_input_widget.h 0000664 0001750 0001750 00000004612 15170054730 017212 0 ustar feng feng /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef UKMEDIAINPUTWIDGET_H
#define UKMEDIAINPUTWIDGET_H
#include