diff --git a/applet/metadata.desktop b/applet/metadata.desktop index d304ab3..896813f 100644 --- a/applet/metadata.desktop +++ b/applet/metadata.desktop @@ -1,55 +1,56 @@ [Desktop Entry] Name=Audio Volume Name[ar]=مستوى الصّوت Name[ast]=Volume d'audiu Name[ca]=Volum de l'àudio Name[ca@valencia]=Volum de l'àudio Name[cs]=Hlasitost zvuku Name[da]=Lydstyrke Name[de]=Lautstärke Name[el]=Ένταση ήχου Name[en_GB]=Audio Volume Name[es]=Volumen del sonido Name[et]=Helitugevus Name[fi]=Äänenvoimakkuus Name[gl]=Volume do son Name[it]=Volume audio Name[ko]=오디오 음량 Name[lt]=Garsumas Name[nl]=Geluidsvolume Name[nn]=Lydstyrke Name[pa]=ਆਡੀਓ ਵਾਲੀਅਮ Name[pl]=Głośność dźwięku Name[pt]=Volume do Áudio Name[pt_BR]=Volume do áudio Name[ru]=Громкость Name[sk]=Hlasitosť zvuku Name[sl]=Glasnost zvoka Name[sr]=Јачина звука Name[sr@ijekavian]=Јачина звука Name[sr@ijekavianlatin]=Jačina zvuka Name[sr@latin]=Jačina zvuka Name[sv]=Ljudvolym Name[uk]=Гучність Name[x-test]=xxAudio Volumexx Name[zh_CN]=音频音量 +Name[zh_TW]=音效音量 Comment= Icon=org.kde.plasma.volume Type=Service X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml X-Plasma-NotificationArea=true X-Plasma-ConfigPlugins=kcm_pulseaudio X-KDE-PluginInfo-Name=org.kde.plasma.volume X-KDE-PluginInfo-Category=Multimedia X-KDE-PluginInfo-Author=Harald Sitter X-KDE-PluginInfo-Email=sitter@kde.org X-KDE-PluginInfo-Version=1.0.0 X-KDE-PluginInfo-Website= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true diff --git a/src/kcm/kcm_pulseaudio.desktop b/src/kcm/kcm_pulseaudio.desktop index be716fe..93b77fc 100644 --- a/src/kcm/kcm_pulseaudio.desktop +++ b/src/kcm/kcm_pulseaudio.desktop @@ -1,113 +1,116 @@ [Desktop Entry] Type=Service Icon=kmix Exec=kcmshell5 kcm_pulseaudio X-KDE-Library=kcm_pulseaudio X-KDE-ServiceTypes=KCModule X-KDE-System-Settings-Parent-Category=audio-and-video X-KDE-ParentApp=kcontrol X-KDE-PluginKeyword=kcm_pulseaudio X-DocPath=kcontrol/plasma-pa/index.html Name=Audio Volume Name[ar]=مستوى الصّوت Name[ast]=Volume d'audiu Name[ca]=Volum de l'àudio Name[ca@valencia]=Volum de l'àudio Name[cs]=Hlasitost zvuku Name[da]=Lydstyrke Name[de]=Lautstärke Name[el]=Ένταση ήχου Name[en_GB]=Audio Volume Name[es]=Volumen del sonido Name[et]=Helitugevus Name[fi]=Äänenvoimakkuus Name[gl]=Volume do son Name[it]=Volume audio Name[ko]=오디오 음량 Name[lt]=Garsumas Name[nl]=Geluidsvolume Name[nn]=Lydstyrke Name[pa]=ਆਡੀਓ ਵਾਲੀਅਮ Name[pl]=Głośność dźwięku Name[pt]=Volume do Áudio Name[pt_BR]=Volume do áudio Name[ru]=Громкость Name[sk]=Hlasitosť zvuku Name[sl]=Glasnost zvoka Name[sr]=Јачина звука Name[sr@ijekavian]=Јачина звука Name[sr@ijekavianlatin]=Jačina zvuka Name[sr@latin]=Jačina zvuka Name[sv]=Ljudvolym Name[uk]=Гучність Name[x-test]=xxAudio Volumexx Name[zh_CN]=音频音量 +Name[zh_TW]=音效音量 Comment=Configure the Audio Volume Comment[ar]=اضبط مستوى الصّوت Comment[ast]=Configura'l volume d'audiu Comment[ca]=Configura el volum de l'àudio Comment[ca@valencia]=Configura el volum de l'àudio Comment[cs]=Nastavit hlasitost zvuku Comment[da]=Indstil lydstyrken Comment[de]=Einstellung der Lautstärke Comment[el]=Διαμόρφωση έντασης ήχου Comment[en_GB]=Configure the Audio Volume Comment[es]=Configurar el volumen del sonido Comment[et]=Helitugevuse seadistamine Comment[fi]=Äänenvoimakkuuden asetukset Comment[gl]=Configurar o volume do son Comment[it]=Configura il volume audio Comment[ko]=오디오 음량 설정 Comment[lt]=Konfigūruoti garsumą Comment[nl]=Het geluidsvolume configureren Comment[nn]=Set opp lystyrken Comment[pa]=ਆਡੀਓ ਵਾਲੀਅਮ ਦੀ ਸੰਰਚਨਾ Comment[pl]=Ustawienia głośności dźwięku Comment[pt]=Configurar o Volume do Áudio Comment[pt_BR]=Configurar o volume do áudio Comment[ru]=Настройка громкости звука Comment[sk]=Nastaviť halsitosť zvuku Comment[sl]=Nastavi glasnost zvoka Comment[sr]=Подешавање јачине звука Comment[sr@ijekavian]=Подешавање јачине звука Comment[sr@ijekavianlatin]=Podešavanje jačine zvuka Comment[sr@latin]=Podešavanje jačine zvuka Comment[sv]=Anpassa ljudvolym Comment[uk]=Налаштовування гучності Comment[x-test]=xxConfigure the Audio Volumexx Comment[zh_CN]=配置音频音量 +Comment[zh_TW]=設定音量 X-KDE-Keywords=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse X-KDE-Keywords[ar]=صوت,مستوى,خرج,موسيقى,Pulse,PulseAudio X-KDE-Keywords[ast]=Soníu,Volume,Salida,Audiu,Música,PulseAusio,Pulse X-KDE-Keywords[ca]=So,Volum,Sortida,Àudio,Música,PulseAudio,Pulse X-KDE-Keywords[ca@valencia]=So,Volum,Eixida,Àudio,Música,PulseAudio,Pulse X-KDE-Keywords[cs]=Zvuk,Hlasitost,Výstup,Audio,Hudba,PulseAudio,Pulse X-KDE-Keywords[da]=lyd,lydstyrke,output,audio,musik,PulseAudio,Pulse X-KDE-Keywords[de]=Sound,Lautstärke,Ausgabe,Audio,Musik,PulseAudio,Pulse X-KDE-Keywords[el]=Ήχος,Ένταση,Έξοδος,Audio,Μουσική,PulseAudio,Pulse X-KDE-Keywords[en_GB]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse X-KDE-Keywords[es]=Sonido,Volumen,Salida,Audio,Música,PulseAudio,Pulse X-KDE-Keywords[et]=Heli,Helitugevus,Väljund,Audio,Muusika,PulseAudio X-KDE-Keywords[fi]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse,Ääni,Voimakkuus,Äänenvoimakkuus,Ulostulo,Lähtö,Musiikki X-KDE-Keywords[gl]=Son,Audio,Volume,Saída,Música,PulseAudio,Pulse X-KDE-Keywords[it]=Suono,volume,uscita,audio,musica,PulseAudio,Pulse X-KDE-Keywords[ko]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse,소리,음악,음량,출력,오디오 X-KDE-Keywords[lt]=Garsas,Garsumas,Išvestis,Audio,Muzika,PulseAudio,Pulse X-KDE-Keywords[nl]=Geluid,Volume,Uitvoer,Audio,Muziek,PulseAudio,Pulse X-KDE-Keywords[nn]=lyd,lydstyrke,volum,støy,musikk,PulseAudio,Pulse X-KDE-Keywords[pl]=Dźwięk,Głośność,Wyjście,Audio,Muzyka,PulseAudio,Pulse X-KDE-Keywords[pt]=Som,Volume,Saída,Áudio,Música,PulseAudio,Pulse X-KDE-Keywords[pt_BR]=Som,Volume,Saída,Áudio,Música,PulseAudio,Pulse X-KDE-Keywords[ru]=звук,громкость,выход,аудио,музыка,PulseAudio,Pulse,Sound,Volume,Output,Audio,Music X-KDE-Keywords[sk]=Zvuk,Hlasitosť,Výstup,Audio,Hudba,PulseAudio,Pulse X-KDE-Keywords[sl]=zvok,glasnost,izhod,glasba,PulseAudio,Pulse X-KDE-Keywords[sr]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse,звук,јачина,излаз,аудио,музика,Пулс‑аудио X-KDE-Keywords[sr@ijekavian]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse,звук,јачина,излаз,аудио,музика,Пулс‑аудио X-KDE-Keywords[sr@ijekavianlatin]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse,zvuk,jačina,izlaz,audio,muzika,PulseAudio X-KDE-Keywords[sr@latin]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse,zvuk,jačina,izlaz,audio,muzika,PulseAudio X-KDE-Keywords[sv]=Ljud,Volym,Utgång,Audio,Musik,PulseAudio,Pulse X-KDE-Keywords[uk]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse,звук,гучність,вихід,аудіо,музика,пульс,пульсаудіо X-KDE-Keywords[x-test]=xxSoundxx,xxVolumexx,xxOutputxx,xxAudioxx,xxMusicxx,xxPulseAudioxx,xxPulsexx X-KDE-Keywords[zh_CN]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse,声音,音量,输出,音频,音乐,脉冲 +X-KDE-Keywords[zh_TW]=Sound,Volume,Output,Audio,Music,PulseAudio,Pulse diff --git a/src/kcm/package/metadata.desktop b/src/kcm/package/metadata.desktop index 9586638..a2d7bd1 100644 --- a/src/kcm/package/metadata.desktop +++ b/src/kcm/package/metadata.desktop @@ -1,80 +1,82 @@ [Desktop Entry] Name=Sound Name[ar]=الصّوت Name[ast]=Soníu Name[ca]=So Name[ca@valencia]=So Name[cs]=Zvuk Name[da]=Lyd Name[de]=Klänge Name[el]=Ήχος Name[en_GB]=Sound Name[es]=Sonido Name[et]=Heli Name[fi]=Ääni Name[gl]=Son Name[it]=Suono Name[ko]=소리 Name[lt]=Garsas Name[nl]=Geluid Name[nn]=Lyd Name[pa]=ਆਵਾਜ਼ Name[pl]=Dźwięk Name[pt]=Som Name[pt_BR]=Som Name[ru]=Звук Name[sk]=Zvuk Name[sl]=Zvok Name[sr]=Звук Name[sr@ijekavian]=Звук Name[sr@ijekavianlatin]=Zvuk Name[sr@latin]=Zvuk Name[sv]=Ljud Name[uk]=Звук Name[x-test]=xxSoundxx Name[zh_CN]=声音 +Name[zh_TW]=音效 Comment=Configure Sound Comment[ar]=اضبط الصّوت Comment[ast]=Configura'l soníu Comment[ca]=Configura el so Comment[ca@valencia]=Configura el so Comment[cs]=Nastavit zvuk Comment[da]=Indstil lyd Comment[de]=Klänge einrichten Comment[el]=Διαμόρφωση ήχου Comment[en_GB]=Configure Sound Comment[es]=Configurar el sonido Comment[et]=Heli seadistamine Comment[fi]=Äänen asetukset Comment[gl]=Configurar o son Comment[it]=Configura suono Comment[ko]=소리 설정 Comment[lt]=Konfigūruoti garsą Comment[nl]=Geluid instellen Comment[nn]=Set opp lyd Comment[pa]=ਆਵਾਜ਼ ਦੀ ਸੰਰਚਨਾ Comment[pl]=Ustawienia dźwięku Comment[pt]=Configurar o Som Comment[pt_BR]=Configurar o som Comment[ru]=Настройка звука Comment[sk]=Nastaviť zvuk Comment[sl]=Nastavi zvok Comment[sr]=Подешавање звука Comment[sr@ijekavian]=Подешавање звука Comment[sr@ijekavianlatin]=Podešavanje zvuka Comment[sr@latin]=Podešavanje zvuka Comment[sv]=Anpassa ljud Comment[uk]=Налаштовування звуку Comment[x-test]=xxConfigure Soundxx Comment[zh_CN]=配置声音 +Comment[zh_TW]=設定音效 Icon=kmix Type=Service X-KDE-PluginInfo-Author=Harald Sitter X-KDE-PluginInfo-Email=sitter@kde.org X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-Name=kcm_pulseaudio X-KDE-ServiceTypes=Plasma/Generic X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml X-Plasma-RemoteLocation= diff --git a/src/maps.h b/src/maps.h index 780ae86..af72710 100644 --- a/src/maps.h +++ b/src/maps.h @@ -1,170 +1,166 @@ /* Copyright 2014-2015 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef MAPS_H #define MAPS_H #include "debug.h" #include #include #include namespace QPulseAudio { // Used for typedefs. class Card; class Client; class Sink; class SinkInput; class Source; class SourceOutput; /** * @see MapBase * This class is nothing more than the QObject base since moc cannot handle * templates. */ class Q_DECL_EXPORT MapBaseQObject : public QObject { Q_OBJECT signals: void added(quint32 index); void updated(quint32 index); void removed(quint32 index); }; /** * Maps a specific index to a specific object pointer. * This is used to give the unique arbitrary PulseAudio index of a PulseObject a * serialized list index. Namely it enables us to translate a discrete list * index to a pulse index to an object, and any permutation thereof. */ template class Q_DECL_EXPORT MapBase : public MapBaseQObject { public: virtual ~MapBase() {} const QMap &data() const { return m_data; } int modelIndexForQObject(QObject *qobject) const { Type *t = qobject_cast(qobject); if (!t) return -1; int key = m_data.key(t, -1); if (key == -1) return -1; return m_data.keys().indexOf(key); } /** * @param dataIndex index in the data model * @return -1 on invalid index, otherwise PA index */ qint64 dataIndexToPaIndex(int dataIndex) const { auto list = m_data.values(); qCDebug(PLASMAPA) << Q_FUNC_INFO << list.length() << dataIndex; if (list.length() <= dataIndex) { return -1; } qCDebug(PLASMAPA) << " " << list.at(dataIndex)->index(); qCDebug(PLASMAPA) << " " << list.at(dataIndex)->name(); return list.at(dataIndex)->index(); } int paIndexToDataIndex(quint32 index) const { qCDebug(PLASMAPA) << m_data.keys() << index; return m_data.keys().indexOf(index); } void reset() { while (!m_data.isEmpty()) { - auto key = m_data.lastKey(); - auto *obj = m_data.take(key); - emit removed(obj->index()); - delete obj; + removeEntry(m_data.lastKey()); } - m_data.clear(); m_pendingRemovals.clear(); } // Context is passed in as parent because context needs to include the maps // so we'd cause a circular dep if we were to try to use the instance here. // Plus that's weird separation anyway. void updateEntry(const PAInfo *info, QObject *parent) { Q_ASSERT(info); if (m_pendingRemovals.remove(info->index)) { // Was already removed again. return; } const bool isNew = !m_data.contains(info->index); auto *obj = m_data.value(info->index, nullptr); if (!obj) { obj = new Type(parent); } obj->update(info); m_data.insert(info->index, obj); const int modelIndex = m_data.keys().indexOf(info->index); Q_ASSERT(modelIndex >= 0); if (isNew) { emit added(modelIndex); } else { emit updated(modelIndex); } } void removeEntry(quint32 index) { if (!m_data.contains(index)) { m_pendingRemovals.insert(index); } else { const int modelIndex = m_data.keys().indexOf(index); m_data.take(index)->deleteLater(); emit removed(modelIndex); } } protected: QMap m_data; QSet m_pendingRemovals; }; typedef MapBase SinkMap; typedef MapBase SinkInputMap; typedef MapBase SourceMap; typedef MapBase SourceOutputMap; typedef MapBase ClientMap; typedef MapBase CardMap; } // QPulseAudio #endif // MAPS_H