同步主线代码
This commit is contained in:
parent
872424237c
commit
40ca46a2f2
|
@ -26,138 +26,138 @@
|
|||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="217"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1640"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1719"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1649"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1728"/>
|
||||
<source>pa_context_get_server_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1228"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1236"/>
|
||||
<source>Card callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1246"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1333"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1254"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1342"/>
|
||||
<source>Sink callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1282"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1354"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1290"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1363"/>
|
||||
<source>Source callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1376"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1873"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1385"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1882"/>
|
||||
<source>Sink input callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1395"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1404"/>
|
||||
<source>Source output callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1443"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1452"/>
|
||||
<source>Client callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1459"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1473"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1468"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1482"/>
|
||||
<source>Server info callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1508"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1517"/>
|
||||
<source>Failed to initialize stream_restore extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1525"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1534"/>
|
||||
<source>pa_ext_stream_restore_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1542"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1551"/>
|
||||
<source>Failed to initialize device manager extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1561"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1570"/>
|
||||
<source>pa_ext_device_manager_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1578"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1587"/>
|
||||
<source>pa_context_get_sink_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1591"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1600"/>
|
||||
<source>pa_context_get_source_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1604"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1617"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1613"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1626"/>
|
||||
<source>pa_context_get_sink_input_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1630"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1639"/>
|
||||
<source>pa_context_get_client_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1670"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1679"/>
|
||||
<source>pa_context_get_card_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1710"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1719"/>
|
||||
<source>pa_context_subscribe() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1726"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1735"/>
|
||||
<source>pa_context_client_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1733"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1742"/>
|
||||
<source>pa_context_get_card_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1740"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1749"/>
|
||||
<source>pa_context_get_sink_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1747"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1756"/>
|
||||
<source>pa_context_get_source_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1754"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1763"/>
|
||||
<source>pa_context_get_sink_input_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1761"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1770"/>
|
||||
<source>pa_context_get_source_output_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1777"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1786"/>
|
||||
<source>Connection failed, attempting reconnect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1797"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1806"/>
|
||||
<source>Ukui Media Volume Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -198,16 +198,24 @@
|
|||
<context>
|
||||
<name>UkmediaMainWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2454"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2461"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2548"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2646"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2737"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2743"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2748"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2795"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2829"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3045"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="923"/>
|
||||
<source>xunguang</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2495"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2502"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2589"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2687"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2778"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2784"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2789"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2836"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2855"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2861"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2866"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2877"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3093"/>
|
||||
<source>None</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -358,67 +366,67 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="327"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="337"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="805"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="923"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1313"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="338"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="812"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="931"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1322"/>
|
||||
<source>pa_context_set_default_source() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="356"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="358"/>
|
||||
<source>pa_context_set_sink_port_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="370"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="372"/>
|
||||
<source>pa_context_set_source_port_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="399"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="401"/>
|
||||
<source> (plugged in)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="403"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="550"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="405"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="556"/>
|
||||
<source> (unavailable)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="405"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="547"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="407"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="553"/>
|
||||
<source> (unplugged)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="696"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="702"/>
|
||||
<source>Failed to read data from stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="746"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="752"/>
|
||||
<source>Peak detect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="747"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="753"/>
|
||||
<source>Failed to create monitoring stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="762"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="768"/>
|
||||
<source>Failed to connect monitoring stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="881"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="889"/>
|
||||
<source>Ignoring sink-input due to it being designated as an event and thus handled by the Event widget</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1194"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1202"/>
|
||||
<source>Establishing connection to PulseAudio. Please wait...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -0,0 +1,431 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="bo_CN">
|
||||
<context>
|
||||
<name>Audio</name>
|
||||
<message>
|
||||
<location filename="../audio.ui" line="26"/>
|
||||
<location filename="../audio.cpp" line="38"/>
|
||||
<source>Audio</source>
|
||||
<translation>སྒྲ་ཕབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../audio.cpp" line="93"/>
|
||||
<source>UkccPlugin</source>
|
||||
<translation>ཝུའུ་ཁི་ལན་གྱི་ཕུའུ་ལུའུ་ཀིན།</translation>
|
||||
<extra-contents_path>/UkccPlugin/UkccPlugin</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../audio.cpp" line="95"/>
|
||||
<source>ukccplugin test</source>
|
||||
<translation>ukccplugin ཚད་ལེན་ཚོད་ལྟ།</translation>
|
||||
<extra-contents_path>/UkccPlugin/ukccplugin test</extra-contents_path>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="217"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1640"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1719"/>
|
||||
<source>pa_context_get_server_info() failed</source>
|
||||
<translation>pa_context_get_server_info()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1228"/>
|
||||
<source>Card callback failure</source>
|
||||
<translation>བྱང་བུ་ཕྱིར་སློག་བྱེད་མ་ཐུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1246"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1333"/>
|
||||
<source>Sink callback failure</source>
|
||||
<translation>ཕྱིར་ལྡོག་བྱེད་པར་ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1282"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1354"/>
|
||||
<source>Source callback failure</source>
|
||||
<translation>འབྱུང་ཁུངས་ཕྱིར་ལྡོག་བྱེད་མ་ཐུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1376"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1873"/>
|
||||
<source>Sink input callback failure</source>
|
||||
<translation>མ་དངུལ་འཇོག་པའི་ཕྱིར་ལྡོག་ལ་ཕམ་ཉེས་བྱུང</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1395"/>
|
||||
<source>Source output callback failure</source>
|
||||
<translation>འབྱུང་ཁུངས་ཕྱིར་ལྡོག་བྱེད་པར་ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1443"/>
|
||||
<source>Client callback failure</source>
|
||||
<translation>མངགས་བཅོལ་བྱེད་མཁན་གྱིས་ཕྱིར་སློག་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1459"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1473"/>
|
||||
<source>Server info callback failure</source>
|
||||
<translation>ཞབས་ཞུའི་ཡོ་བྱད་ཀྱི་ཆ་འཕྲིན་ཕྱིར་ལྡོག་བྱེད་མ་ཐུབ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1508"/>
|
||||
<source>Failed to initialize stream_restore extension: %s</source>
|
||||
<translation>stream_restore་རིང་དུ་གཏོང་བའི་ཐོག་མའི་དུས་ཚོད་ལ་སླེབས་མ་ཐུབ་པ། %s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1525"/>
|
||||
<source>pa_ext_stream_restore_read() failed</source>
|
||||
<translation>pa_ext_stream_restore_read()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1542"/>
|
||||
<source>Failed to initialize device manager extension: %s</source>
|
||||
<translation>སྒྲིག་ཆས་དོ་དམ་གྱི་དུས་འགྱངས་ལ་ཐོག་མའི་དུས་འགྱངས་བྱེད་མ་ཐུབ་པ། %s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1561"/>
|
||||
<source>pa_ext_device_manager_read() failed</source>
|
||||
<translation>pa_ext_device_manager_read()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1578"/>
|
||||
<source>pa_context_get_sink_info_by_index() failed</source>
|
||||
<translation>pa_context_get_sink_info_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1591"/>
|
||||
<source>pa_context_get_source_info_by_index() failed</source>
|
||||
<translation>pa_context_get_source_info_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1604"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1617"/>
|
||||
<source>pa_context_get_sink_input_info() failed</source>
|
||||
<translation>pa_context_get_sink_input_info()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1630"/>
|
||||
<source>pa_context_get_client_info() failed</source>
|
||||
<translation>pa_context_get_client_info()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1670"/>
|
||||
<source>pa_context_get_card_info_by_index() failed</source>
|
||||
<translation>pa_context_get_card_info_by_index()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1710"/>
|
||||
<source>pa_context_subscribe() failed</source>
|
||||
<translation>pa_context_subscribe()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1726"/>
|
||||
<source>pa_context_client_info_list() failed</source>
|
||||
<translation>pa_context_client_info_list()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1733"/>
|
||||
<source>pa_context_get_card_info_list() failed</source>
|
||||
<translation>pa_context_get_card_info_list()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1740"/>
|
||||
<source>pa_context_get_sink_info_list() failed</source>
|
||||
<translation>pa_context_get_sink_info_list()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1747"/>
|
||||
<source>pa_context_get_source_info_list() failed</source>
|
||||
<translation>pa_context_get_source_info_list()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1754"/>
|
||||
<source>pa_context_get_sink_input_info_list() failed</source>
|
||||
<translation>pa_context_get_sink_input_info_list()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1761"/>
|
||||
<source>pa_context_get_source_output_info_list() failed</source>
|
||||
<translation>pa_context_get_source_output_info_list()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1777"/>
|
||||
<source>Connection failed, attempting reconnect</source>
|
||||
<translation>འབྲེལ་མཐུད་བྱེད་མ་ཐུབ་པར་ཡང་བསྐྱར་འབྲེལ་མཐུད་བྱེད་རྩིས་བྱས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1797"/>
|
||||
<source>Ukui Media Volume Control</source>
|
||||
<translation>ཝུའུ་ཁི་ལན་གྱི་སྨྱན་སྦྱོར་གྱི་བོངས་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaInputWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_input_widget.cpp" line="53"/>
|
||||
<source>Input</source>
|
||||
<translation>མ་དངུལ་འཇོག་པ།</translation>
|
||||
<extra-contents_path>/Audio/Input</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_input_widget.cpp" line="58"/>
|
||||
<source>Input Device</source>
|
||||
<translation>ནང་འཇུག་སྒྲིག་ཆས།</translation>
|
||||
<extra-contents_path>/Audio/Input Device</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_input_widget.cpp" line="61"/>
|
||||
<source>Volume</source>
|
||||
<translation>བོངས་ཚད།</translation>
|
||||
<extra-contents_path>/Audio/Volume</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_input_widget.cpp" line="66"/>
|
||||
<source>Input Level</source>
|
||||
<translation>མ་དངུལ་འཇོག་པའི་ཆུ་ཚད</translation>
|
||||
<extra-contents_path>/Audio/Input Level</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_input_widget.cpp" line="77"/>
|
||||
<source>Noise Reduction</source>
|
||||
<translation>སུན་སྒྲ་ཇེ་ཉུང་དུ་གཏོང</translation>
|
||||
<extra-contents_path>/audio/Noise</extra-contents_path>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaMainWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2454"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2461"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2548"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2646"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2737"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2743"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2748"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2795"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2829"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3045"/>
|
||||
<source>None</source>
|
||||
<translation>གཅིག་ཀྱང་མེད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaOutputWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="72"/>
|
||||
<source>Output</source>
|
||||
<translation>ཐོན་ཚད།</translation>
|
||||
<extra-contents_path>/Audio/Output</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="76"/>
|
||||
<source>Output Device</source>
|
||||
<translation>ཐོན་སྐྱེད་སྒྲིག་ཆས།</translation>
|
||||
<extra-contents_path>/Audio/Output Device</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="79"/>
|
||||
<source>Master Volume</source>
|
||||
<translation>སློབ་དཔོན་གྱི་བམ་པོ།</translation>
|
||||
<extra-contents_path>/Audio/Master Volume</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="84"/>
|
||||
<source>Balance</source>
|
||||
<translation>དོ་མཉམ་</translation>
|
||||
<extra-contents_path>/Audio/Balance</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="85"/>
|
||||
<source>Left</source>
|
||||
<translation>གཡོན་ཕྱོགས་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="87"/>
|
||||
<source>Right</source>
|
||||
<translation>གཡས་ཕྱོགས་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="90"/>
|
||||
<source>Volume Increase</source>
|
||||
<translation>གྲངས་འབོར་འཕར་སྣོན་བྱུང་བ</translation>
|
||||
<extra-contents_path>/audio/Noise</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="83"/>
|
||||
<source>Volume above 100% can cause sound distortion and damage your speakers.</source>
|
||||
<translation>སྒྲ་ཚད་བརྒྱ་ཆ་༡༠༠ལས་བརྒལ་ན་སྒྲ་ནུས་བདེན་མེད་དང་ཁྱོད་ཀྱི་སྒྲ་ཕབ་ཆས་ལ་གནོད་པ་བྱེད་སྲིད།.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaSoundEffectsWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="58"/>
|
||||
<source>System Sound</source>
|
||||
<translation>མ་ལག་འཐུས་སྒོ་ཚང་བ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="61"/>
|
||||
<source>Sound Theme</source>
|
||||
<translation>སྒྲའི་བརྗོད་བྱ་གཙོ་བོ།</translation>
|
||||
<extra-contents_path>/Audio/Sound Theme</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="64"/>
|
||||
<source>Alert Sound</source>
|
||||
<translation>ཉེན་བརྡའི་སྒྲ་</translation>
|
||||
<extra-contents_path>/Audio/Alert Sound</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="67"/>
|
||||
<source>Beep Switch</source>
|
||||
<translation>སྦྲང་མའི་གློག་སྒོ།</translation>
|
||||
<extra-contents_path>/Audio/Beep Switch</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="69"/>
|
||||
<source>Poweroff Music</source>
|
||||
<translation>སྒུལ་ཤུགས་རོལ་དབྱངས།</translation>
|
||||
<extra-contents_path>/Audio/Poweroff Music</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="71"/>
|
||||
<source>Startup Music</source>
|
||||
<translation>གསར་གཏོད་རོལ་དབྱངས།</translation>
|
||||
<extra-contents_path>/Audio/Startup Music</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="73"/>
|
||||
<source>Wakeup Music</source>
|
||||
<translation>གཉིད་ལས་སད་པའི་རོལ་མོ།</translation>
|
||||
<extra-contents_path>/Audio/Wakeup Music</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="75"/>
|
||||
<source>Volume Change</source>
|
||||
<translation>སྒྲ་གདངས་འགྱུར་ལྡོག</translation>
|
||||
<extra-contents_path>/Audio/Volume Change</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="77"/>
|
||||
<source>Logout Music</source>
|
||||
<translation>ཐོ་འགོད་རོལ་དབྱངས།</translation>
|
||||
<extra-contents_path>/Audio/Logout Music</extra-contents_path>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaVolumeControl</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="67"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="92"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="96"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="111"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="164"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="239"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="243"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="255"/>
|
||||
<source>pa_context_set_sink_volume_by_index() failed</source>
|
||||
<translation>pa_context_set_sink_volume_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="133"/>
|
||||
<source>pa_context_set_source_mute_by_index() failed</source>
|
||||
<translation>pa_context_set_source_mute_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="138"/>
|
||||
<source>pa_context_set_source_volume_by_index() failed</source>
|
||||
<translation>pa_context_set_source_volume_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="272"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="276"/>
|
||||
<source>pa_context_set_source_output_volume() failed</source>
|
||||
<translation>pa_context_set_source_output_volume()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="288"/>
|
||||
<source>pa_context_set_source_output_mute() failed</source>
|
||||
<translation>pa_context_set_source_output_mute()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="300"/>
|
||||
<source>pa_context_set_card_profile_by_index() failed</source>
|
||||
<translation>pa_context_set_card_profile_by_index()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="314"/>
|
||||
<source>pa_context_set_default_sink() failed</source>
|
||||
<translation>pa_context_set_default_sink()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="327"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="337"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="805"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="923"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1313"/>
|
||||
<source>pa_context_set_default_source() failed</source>
|
||||
<translation>pa_context_set_default_source()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="356"/>
|
||||
<source>pa_context_set_sink_port_by_name() failed</source>
|
||||
<translation>pa_context_set_sink_port_by_name()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="370"/>
|
||||
<source>pa_context_set_source_port_by_name() failed</source>
|
||||
<translation>pa_context_set_source_port_by_name()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="399"/>
|
||||
<source> (plugged in)</source>
|
||||
<translation> (ནང་དུ་བཅུག་པ་)།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="403"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="550"/>
|
||||
<source> (unavailable)</source>
|
||||
<translation> (སྤྱོད་གོ་མི་ཆོད་པ)།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="405"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="547"/>
|
||||
<source> (unplugged)</source>
|
||||
<translation> (ཁ་ཐོར་ཡ་བྲལ་དུ་སོང་བ་)།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="696"/>
|
||||
<source>Failed to read data from stream</source>
|
||||
<translation>ཆུ་ཕྲན་ནས་གཞི་གྲངས་ཀློག་མ་ཐུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="746"/>
|
||||
<source>Peak detect</source>
|
||||
<translation>ཡང་རྩེར་ཞིབ་དཔྱད་ཚད་ལེན</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="747"/>
|
||||
<source>Failed to create monitoring stream</source>
|
||||
<translation>ལྟ་ཞིབ་ཚད་ལེན་གྱི་ཆུ་ཕྲན་གསར་སྐྲུན་བྱེད་མ་ཐུབ་པ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="762"/>
|
||||
<source>Failed to connect monitoring stream</source>
|
||||
<translation>ལྟ་ཞིབ་ཚད་ལེན་གྱི་ཆུ་ཕྲན་སྦྲེལ་མཐུད་བྱེད་མ་ཐུབ་པ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="881"/>
|
||||
<source>Ignoring sink-input due to it being designated as an event and thus handled by the Event widget</source>
|
||||
<translation>དོན་རྐྱེན་ཞིག་ཏུ་བརྩིས་ནས་དོན་རྐྱེན་ཆུང་ཆུང་ཞིག་ཏུ་བརྩིས་ནས་ཐག་གཅོད་བྱས་པའི་རྐྱེན་གྱིས་ཆུ་ནང་དུ་འཛུལ་བར་སྣང་མེད་བྱས་པ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1194"/>
|
||||
<source>Establishing connection to PulseAudio. Please wait...</source>
|
||||
<translation>ཕུའུ་ལུའུ་ཧྲི་ཨོ་ཏོ་དང་འབྲེལ་བ་བཙུགས་པ་རེད། སྐུ་མཁྱེན་སྒུག་རོགས།...</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
|
@ -26,138 +26,138 @@
|
|||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="217"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1640"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1719"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1649"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1728"/>
|
||||
<source>pa_context_get_server_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1228"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1236"/>
|
||||
<source>Card callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1246"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1333"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1254"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1342"/>
|
||||
<source>Sink callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1282"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1354"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1290"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1363"/>
|
||||
<source>Source callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1376"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1873"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1385"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1882"/>
|
||||
<source>Sink input callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1395"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1404"/>
|
||||
<source>Source output callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1443"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1452"/>
|
||||
<source>Client callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1459"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1473"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1468"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1482"/>
|
||||
<source>Server info callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1508"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1517"/>
|
||||
<source>Failed to initialize stream_restore extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1525"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1534"/>
|
||||
<source>pa_ext_stream_restore_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1542"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1551"/>
|
||||
<source>Failed to initialize device manager extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1561"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1570"/>
|
||||
<source>pa_ext_device_manager_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1578"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1587"/>
|
||||
<source>pa_context_get_sink_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1591"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1600"/>
|
||||
<source>pa_context_get_source_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1604"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1617"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1613"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1626"/>
|
||||
<source>pa_context_get_sink_input_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1630"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1639"/>
|
||||
<source>pa_context_get_client_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1670"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1679"/>
|
||||
<source>pa_context_get_card_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1710"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1719"/>
|
||||
<source>pa_context_subscribe() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1726"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1735"/>
|
||||
<source>pa_context_client_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1733"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1742"/>
|
||||
<source>pa_context_get_card_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1740"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1749"/>
|
||||
<source>pa_context_get_sink_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1747"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1756"/>
|
||||
<source>pa_context_get_source_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1754"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1763"/>
|
||||
<source>pa_context_get_sink_input_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1761"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1770"/>
|
||||
<source>pa_context_get_source_output_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1777"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1786"/>
|
||||
<source>Connection failed, attempting reconnect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1797"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1806"/>
|
||||
<source>Ukui Media Volume Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -198,16 +198,24 @@
|
|||
<context>
|
||||
<name>UkmediaMainWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2454"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2461"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2548"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2646"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2737"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2743"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2748"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2795"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2829"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3045"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="923"/>
|
||||
<source>xunguang</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2495"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2502"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2589"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2687"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2778"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2784"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2789"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2836"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2855"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2861"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2866"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2877"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3093"/>
|
||||
<source>None</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -358,67 +366,67 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="327"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="337"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="805"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="923"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1313"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="338"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="812"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="931"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1322"/>
|
||||
<source>pa_context_set_default_source() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="356"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="358"/>
|
||||
<source>pa_context_set_sink_port_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="370"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="372"/>
|
||||
<source>pa_context_set_source_port_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="399"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="401"/>
|
||||
<source> (plugged in)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="403"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="550"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="405"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="556"/>
|
||||
<source> (unavailable)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="405"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="547"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="407"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="553"/>
|
||||
<source> (unplugged)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="696"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="702"/>
|
||||
<source>Failed to read data from stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="746"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="752"/>
|
||||
<source>Peak detect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="747"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="753"/>
|
||||
<source>Failed to create monitoring stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="762"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="768"/>
|
||||
<source>Failed to connect monitoring stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="881"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="889"/>
|
||||
<source>Ignoring sink-input due to it being designated as an event and thus handled by the Event widget</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1194"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1202"/>
|
||||
<source>Establishing connection to PulseAudio. Please wait...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -26,138 +26,138 @@
|
|||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="217"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1649"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1728"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1668"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1747"/>
|
||||
<source>pa_context_get_server_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1236"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1247"/>
|
||||
<source>Card callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1254"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1342"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1265"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1361"/>
|
||||
<source>Sink callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1290"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1363"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1301"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1382"/>
|
||||
<source>Source callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1385"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1882"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1404"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1901"/>
|
||||
<source>Sink input callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1404"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1423"/>
|
||||
<source>Source output callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1452"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1471"/>
|
||||
<source>Client callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1468"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1482"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1487"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1501"/>
|
||||
<source>Server info callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1517"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1536"/>
|
||||
<source>Failed to initialize stream_restore extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1534"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1553"/>
|
||||
<source>pa_ext_stream_restore_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1551"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1570"/>
|
||||
<source>Failed to initialize device manager extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1570"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1589"/>
|
||||
<source>pa_ext_device_manager_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1587"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1606"/>
|
||||
<source>pa_context_get_sink_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1600"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1619"/>
|
||||
<source>pa_context_get_source_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1613"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1626"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1632"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1645"/>
|
||||
<source>pa_context_get_sink_input_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1639"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1658"/>
|
||||
<source>pa_context_get_client_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1679"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1698"/>
|
||||
<source>pa_context_get_card_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1719"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1738"/>
|
||||
<source>pa_context_subscribe() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1735"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1754"/>
|
||||
<source>pa_context_client_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1742"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1761"/>
|
||||
<source>pa_context_get_card_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1749"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1768"/>
|
||||
<source>pa_context_get_sink_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1756"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1775"/>
|
||||
<source>pa_context_get_source_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1763"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1782"/>
|
||||
<source>pa_context_get_sink_input_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1770"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1789"/>
|
||||
<source>pa_context_get_source_output_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1786"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1805"/>
|
||||
<source>Connection failed, attempting reconnect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1806"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1825"/>
|
||||
<source>Ukui Media Volume Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -185,11 +185,11 @@
|
|||
<message>
|
||||
<location filename="../ukmedia_input_widget.cpp" line="66"/>
|
||||
<source>Input Level</source>
|
||||
<translation>输入反馈</translation>
|
||||
<translation>音量反馈</translation>
|
||||
<extra-contents_path>/Audio/Input Level</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_input_widget.cpp" line="77"/>
|
||||
<location filename="../ukmedia_input_widget.cpp" line="75"/>
|
||||
<source>Noise Reduction</source>
|
||||
<translation>智能降噪</translation>
|
||||
<extra-contents_path>/audio/Noise</extra-contents_path>
|
||||
|
@ -198,29 +198,27 @@
|
|||
<context>
|
||||
<name>UkmediaMainWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="915"/>
|
||||
<source>Light-Seeking</source>
|
||||
<translation type="unfinished">寻光</translation>
|
||||
<translation type="obsolete">寻光</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="919"/>
|
||||
<source>HeYin</source>
|
||||
<translation type="unfinished">和印</translation>
|
||||
<translation type="obsolete">和印</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2485"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2492"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2579"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2677"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2427"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2434"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2521"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2619"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2710"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2716"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2721"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2768"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2774"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2779"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2826"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2845"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2851"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2856"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2867"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3083"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2787"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2793"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2798"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="2809"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3025"/>
|
||||
<source>None</source>
|
||||
<translation>空</translation>
|
||||
</message>
|
||||
|
@ -228,44 +226,48 @@
|
|||
<context>
|
||||
<name>UkmediaOutputWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="72"/>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="63"/>
|
||||
<source>Output</source>
|
||||
<translation>输出</translation>
|
||||
<extra-contents_path>/Audio/Output</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="76"/>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="67"/>
|
||||
<source>Output Device</source>
|
||||
<translation>选择输出设备</translation>
|
||||
<extra-contents_path>/Audio/Output Device</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="79"/>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="70"/>
|
||||
<source>Master Volume</source>
|
||||
<translation>音量</translation>
|
||||
<extra-contents_path>/Audio/Master Volume</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="84"/>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="75"/>
|
||||
<source>Balance</source>
|
||||
<translation>声道平衡</translation>
|
||||
<extra-contents_path>/Audio/Balance</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="85"/>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="76"/>
|
||||
<source>Left</source>
|
||||
<translation>左</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="87"/>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="78"/>
|
||||
<source>Right</source>
|
||||
<translation>右</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="90"/>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="82"/>
|
||||
<source>Volume Increase</source>
|
||||
<translation>音量增强</translation>
|
||||
<extra-contents_path>/audio/Noise</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_output_widget.cpp" line="83"/>
|
||||
<source>Volume above 100% can cause sound distortion and damage your speakers.</source>
|
||||
<translation>音量超过100%时可能会导致音效失真并损害你的扬声器。</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -282,43 +284,39 @@
|
|||
<extra-contents_path>/Audio/Sound Theme</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="64"/>
|
||||
<source>Alert Sound</source>
|
||||
<translation>通知</translation>
|
||||
<extra-contents_path>/Audio/Alert Sound</extra-contents_path>
|
||||
<translation type="vanished">通知</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="67"/>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="64"/>
|
||||
<source>Beep Switch</source>
|
||||
<translation>提示音</translation>
|
||||
<extra-contents_path>/Audio/Beep Switch</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="69"/>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="66"/>
|
||||
<source>Poweroff Music</source>
|
||||
<translation>关机</translation>
|
||||
<extra-contents_path>/Audio/Poweroff Music</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="71"/>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="68"/>
|
||||
<source>Startup Music</source>
|
||||
<translation>开机</translation>
|
||||
<extra-contents_path>/Audio/Startup Music</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="73"/>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="70"/>
|
||||
<source>Wakeup Music</source>
|
||||
<translation>唤醒</translation>
|
||||
<extra-contents_path>/Audio/Wakeup Music</extra-contents_path>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="75"/>
|
||||
<source>Volume Change</source>
|
||||
<translation>音量调节</translation>
|
||||
<extra-contents_path>/Audio/Volume Change</extra-contents_path>
|
||||
<translation type="vanished">音量调节</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="77"/>
|
||||
<location filename="../ukmedia_sound_effects_widget.cpp" line="72"/>
|
||||
<source>Logout Music</source>
|
||||
<translation>注销</translation>
|
||||
<extra-contents_path>/Audio/Logout Music</extra-contents_path>
|
||||
|
@ -372,9 +370,9 @@
|
|||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="327"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="338"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="812"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="931"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1322"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="823"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="942"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1341"/>
|
||||
<source>pa_context_set_default_source() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -426,12 +424,12 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="889"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="900"/>
|
||||
<source>Ignoring sink-input due to it being designated as an event and thus handled by the Event widget</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1202"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1213"/>
|
||||
<source>Establishing connection to PulseAudio. Please wait...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -69,8 +69,6 @@ UkmediaInputWidget::UkmediaInputWidget(QWidget *parent) : QWidget(parent)
|
|||
m_pInputLevelProgressBar->setStyle(new CustomStyle);
|
||||
m_pInputLevelProgressBar->setTextVisible(false);
|
||||
|
||||
m_pIpVolumeSlider->setOrientation(Qt::Horizontal);
|
||||
m_pIpVolumeSlider->setRange(0,100);
|
||||
m_pInputIconBtn->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
//~ contents_path /audio/Noise
|
||||
|
|
|
@ -63,21 +63,22 @@ UkmediaMainWidget::UkmediaMainWidget(QWidget *parent)
|
|||
m_pVolumeControl = new UkmediaVolumeControl;
|
||||
initWidget();
|
||||
|
||||
m_pSoundList = new QStringList;
|
||||
m_pThemeNameList = new QStringList;
|
||||
m_pThemeDisplayNameList = new QStringList;
|
||||
m_pSoundNameList = new QStringList;
|
||||
m_pSoundThemeList = new QStringList;
|
||||
m_pSoundThemeDirList = new QStringList;
|
||||
m_pSoundThemeXmlNameList = new QStringList;
|
||||
|
||||
// m_pSoundList = new QStringList;
|
||||
// m_pSoundNameList = new QStringList;
|
||||
// m_pSoundThemeList = new QStringList;
|
||||
// m_pSoundThemeDirList = new QStringList;
|
||||
// m_pSoundThemeXmlNameList = new QStringList;
|
||||
|
||||
initGsettings();
|
||||
setupThemeSelector(this);
|
||||
updateTheme(this);
|
||||
//报警声音,从指定路径获取报警声音文件
|
||||
populateModelFromDir(this,SOUND_SET_DIR);/*SOUND_SET_DIR*/
|
||||
//初始化combobox的值
|
||||
comboboxCurrentTextInit();
|
||||
|
||||
// 报警声音,从指定路径获取报警声音文件
|
||||
// populateModelFromDir(this,SOUND_SET_DIR);/*SOUND_SET_DIR*/
|
||||
// 初始化combobox的值
|
||||
// comboboxCurrentTextInit();
|
||||
|
||||
time = new QTimer();
|
||||
dealSlot();//处理槽函数
|
||||
|
@ -88,9 +89,9 @@ UkmediaMainWidget::UkmediaMainWidget(QWidget *parent)
|
|||
*/
|
||||
void UkmediaMainWidget::initWidget()
|
||||
{
|
||||
m_pOutputWidget = new UkmediaOutputWidget(this);
|
||||
m_pInputWidget = new UkmediaInputWidget(this);
|
||||
m_pSoundWidget = new UkmediaSoundEffectsWidget(this);
|
||||
m_pOutputWidget = new UkmediaOutputWidget();
|
||||
m_pInputWidget = new UkmediaInputWidget();
|
||||
m_pSoundWidget = new UkmediaSoundEffectsWidget();
|
||||
cboxfirstEntry = true;
|
||||
mThemeName = UKUI_THEME_WHITE;
|
||||
QVBoxLayout *m_pvLayout = new QVBoxLayout();
|
||||
|
@ -105,12 +106,6 @@ void UkmediaMainWidget::initWidget()
|
|||
this->setMaximumWidth(16777215);
|
||||
this->layout()->setContentsMargins(0,0,0,0);
|
||||
|
||||
//设置滑动条的最大值为100
|
||||
m_pInputWidget->m_pIpVolumeSlider->setMaximum(100);//输入音量滑动条
|
||||
m_pOutputWidget->m_pOpVolumeSlider->setMaximum(100);//输出音量滑动条
|
||||
m_pOutputWidget->m_pOpBalanceSlider->setMaximum(100);//输出音量声道平衡滑动条
|
||||
m_pOutputWidget->m_pOpBalanceSlider->setMinimum(-100);
|
||||
m_pOutputWidget->m_pOpBalanceSlider->setSingleStep(100);//声道平衡步长
|
||||
m_pInputWidget->m_pInputLevelProgressBar->setMaximum(101);
|
||||
}
|
||||
|
||||
|
@ -228,6 +223,13 @@ void UkmediaMainWidget::initGsettings()
|
|||
m_pOutputWidget->m_pVolumeIncreaseButton->setChecked(status);
|
||||
m_pOutputWidget->setOutputVolumeSliderRang(status);
|
||||
}
|
||||
if(m_pSoundSettings->keys().contains("themeName")) {
|
||||
QString soundThemeStr = m_pSoundSettings->get(SOUND_THEME_KEY).toString();
|
||||
if(soundThemeStr != "custom"){
|
||||
int index = m_pSoundWidget->m_pSoundThemeCombobox->findData(soundThemeStr);
|
||||
m_pSoundWidget->m_pSoundThemeCombobox->setCurrentIndex(index);
|
||||
}
|
||||
}
|
||||
connect(m_pSoundSettings, SIGNAL(changed(const QString &)),this,SLOT(onKeyChanged(const QString &)));
|
||||
}
|
||||
|
||||
|
@ -243,9 +245,10 @@ void UkmediaMainWidget::initGsettings()
|
|||
//检测设计开关机音乐
|
||||
if (QGSettings::isSchemaInstalled(UKUI_SWITCH_SETTING)) {
|
||||
m_pBootSetting = new QGSettings(UKUI_SWITCH_SETTING);
|
||||
if (m_pBootSetting->keys().contains("startupMusic")) {
|
||||
bool startup = m_pBootSetting->get(UKUI_STARTUP_MUSIC_KEY).toBool();//开机音乐
|
||||
m_pSoundWidget->m_pStartupButton->setChecked(startup);
|
||||
if (QGSettings::isSchemaInstalled(KEY_SOUNDS_SCHEMA)){
|
||||
if (m_pSoundSettings->keys().contains("startupMusic")) {
|
||||
m_pSoundWidget->m_pStartupButton->setChecked(m_pSoundSettings->get(STARTUP_MUSIC).toBool());//开机音乐
|
||||
}
|
||||
}
|
||||
if (m_pBootSetting->keys().contains("poweroffMusic")) {
|
||||
bool poweroff = m_pBootSetting->get(UKUI_POWEROFF_MUSIC_KEY).toBool();//关机音乐
|
||||
|
@ -264,27 +267,19 @@ void UkmediaMainWidget::initGsettings()
|
|||
|
||||
if(m_pSoundWidget->m_pAlertSoundSwitchButton->isChecked())
|
||||
{
|
||||
m_pSoundWidget->m_pAlertSoundWidget->show();
|
||||
m_pSoundWidget->m_pVolumeChangeWidget->show();
|
||||
m_pSoundWidget->m_pThemeWidget->show();
|
||||
m_pSoundWidget->line1->show();
|
||||
m_pSoundWidget->line2->show();
|
||||
m_pSoundWidget->line3->show();
|
||||
}
|
||||
else {
|
||||
m_pSoundWidget->m_pAlertSoundWidget->hide();
|
||||
m_pSoundWidget->m_pVolumeChangeWidget->hide();
|
||||
m_pSoundWidget->m_pThemeWidget->hide();
|
||||
m_pSoundWidget->line1->hide();
|
||||
m_pSoundWidget->line2->hide();
|
||||
m_pSoundWidget->line3->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::initButtonSliderStatus(QString key)
|
||||
{
|
||||
if (key == "dnsNoiseReduction") {
|
||||
if (m_pSoundSettings->keys().contains(DNS_NOISE_REDUCTION))
|
||||
if (m_pSoundSettings->keys().contains("dnsNoiseReduction"))
|
||||
m_pInputWidget->m_pNoiseReducteButton->setChecked(m_pSoundSettings->get(DNS_NOISE_REDUCTION).toBool());
|
||||
}
|
||||
else if (key == "volumeIncrease") {
|
||||
|
@ -293,6 +288,15 @@ void UkmediaMainWidget::initButtonSliderStatus(QString key)
|
|||
m_pOutputWidget->setOutputVolumeSliderRang(m_pSoundSettings->get(VOLUME_INCREASE).toBool());
|
||||
}
|
||||
}
|
||||
else if(key == "themeName") {
|
||||
if (m_pSoundSettings->keys().contains("themeName")) {
|
||||
QString soundThemeStr = m_pSoundSettings->get(SOUND_THEME_KEY).toString();
|
||||
if(soundThemeStr != "custom"){
|
||||
int index = m_pSoundWidget->m_pSoundThemeCombobox->findData(soundThemeStr);
|
||||
m_pSoundWidget->m_pSoundThemeCombobox->setCurrentIndex(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -373,10 +377,10 @@ void UkmediaMainWidget::dealSlot()
|
|||
|
||||
connect(m_pOutputWidget->m_pOpBalanceSlider,SIGNAL(valueChanged(int)),this,SLOT(balanceSliderChangedSlot(int)));
|
||||
//点击报警音量时播放报警声音
|
||||
connect(m_pSoundWidget->m_pAlertSoundCombobox,SIGNAL(currentIndexChanged(int)),this,SLOT(comboxIndexChangedSlot(int)));
|
||||
connect(m_pSoundWidget->m_pLagoutCombobox ,SIGNAL(currentIndexChanged(int)),this,SLOT(comboxIndexChangedSlot(int)));
|
||||
// connect(m_pSoundWidget->m_pSoundThemeCombobox,SIGNAL(currentIndexChanged(int)),this,SLOT(themeComboxIndexChangedSlot(int)));
|
||||
connect(m_pSoundWidget->m_pVolumeChangeCombobox,SIGNAL(currentIndexChanged (int)),this,SLOT(volumeChangedComboboxChangeSlot(int)));
|
||||
connect(m_pSoundWidget->m_pSoundThemeCombobox,SIGNAL(currentIndexChanged(int)),this,SLOT(themeComboxIndexChangedSlot(int)));
|
||||
// connect(m_pSoundWidget->m_pAlertSoundCombobox,SIGNAL(currentIndexChanged(int)),this,SLOT(comboxIndexChangedSlot(int)));
|
||||
// connect(m_pSoundWidget->m_pLagoutCombobox ,SIGNAL(currentIndexChanged(int)),this,SLOT(comboxIndexChangedSlot(int)));
|
||||
// connect(m_pSoundWidget->m_pVolumeChangeCombobox,SIGNAL(currentIndexChanged (int)),this,SLOT(volumeChangedComboboxChangeSlot(int)));
|
||||
|
||||
//输入输出Combobox槽函数的设置
|
||||
connect(m_pOutputWidget->m_pDeviceSelectBox,SIGNAL(currentIndexChanged(int)),this,SLOT(cboxoutputListWidgetCurrentRowChangedSlot(int)));
|
||||
|
@ -506,6 +510,7 @@ QPixmap UkmediaMainWidget::drawLightColoredPixmap(const QPixmap &source)
|
|||
/*
|
||||
* 初始化combobox的值
|
||||
*/
|
||||
#if 0
|
||||
void UkmediaMainWidget::comboboxCurrentTextInit()
|
||||
{
|
||||
QList<char *> existsPath = listExistsPath();
|
||||
|
@ -554,19 +559,19 @@ void UkmediaMainWidget::comboboxCurrentTextInit()
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 是否播放开机音乐
|
||||
*/
|
||||
void UkmediaMainWidget::startupButtonSwitchChangedSlot(bool status)
|
||||
{
|
||||
bool bBootStatus = true;
|
||||
if (m_pBootSetting->keys().contains("startupMusic")) {
|
||||
bBootStatus = m_pBootSetting->get(UKUI_STARTUP_MUSIC_KEY).toBool();
|
||||
if (bBootStatus != status) {
|
||||
m_pBootSetting->set(UKUI_STARTUP_MUSIC_KEY,status);
|
||||
}
|
||||
}
|
||||
if (QGSettings::isSchemaInstalled(KEY_SOUNDS_SCHEMA)){
|
||||
if (m_pSoundSettings->keys().contains("startupMusic")) {
|
||||
m_pSoundSettings->set(STARTUP_MUSIC,status);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -623,20 +628,12 @@ void UkmediaMainWidget::alertSoundButtonSwitchChangedSlot(bool status)
|
|||
}
|
||||
|
||||
if (status == true) {
|
||||
m_pSoundWidget->m_pAlertSoundWidget->show();
|
||||
m_pSoundWidget->m_pVolumeChangeWidget->show();
|
||||
m_pSoundWidget->m_pThemeWidget->show();
|
||||
m_pSoundWidget->line1->show();
|
||||
m_pSoundWidget->line2->show();
|
||||
m_pSoundWidget->line3->show();
|
||||
}
|
||||
else {
|
||||
m_pSoundWidget->m_pAlertSoundWidget->hide();
|
||||
m_pSoundWidget->m_pVolumeChangeWidget->hide();
|
||||
m_pSoundWidget->m_pThemeWidget->hide();
|
||||
m_pSoundWidget->line1->hide();
|
||||
m_pSoundWidget->line2->hide();
|
||||
m_pSoundWidget->line3->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -663,12 +660,12 @@ void UkmediaMainWidget::bootMusicSettingsChanged()
|
|||
{
|
||||
bool bBootStatus = true;
|
||||
bool status;
|
||||
if (m_pBootSetting->keys().contains("startupMusic")) {
|
||||
bBootStatus = m_pBootSetting->get(UKUI_STARTUP_MUSIC_KEY).toBool();
|
||||
if (status != bBootStatus ) {
|
||||
m_pSoundWidget->m_pStartupButton->setChecked(bBootStatus);
|
||||
}
|
||||
}
|
||||
// if (m_pBootSetting->keys().contains("startupMusic")) {
|
||||
// bBootStatus = m_pBootSetting->get(UKUI_STARTUP_MUSIC_KEY).toBool();
|
||||
// if (status != bBootStatus ) {
|
||||
// m_pSoundWidget->m_pStartupButton->setChecked(bBootStatus);
|
||||
// }
|
||||
// }
|
||||
if (m_pBootSetting->keys().contains("poweroffMusic")) {
|
||||
bBootStatus = m_pBootSetting->get(UKUI_POWEROFF_MUSIC_KEY).toBool();
|
||||
if (status != bBootStatus ) {
|
||||
|
@ -707,6 +704,8 @@ void UkmediaMainWidget::ukuiThemeChangedSlot(const QString &themeStr)
|
|||
m_pOutputWidget->m_pOutputIconBtn->repaint();
|
||||
// m_pSoundWidget->m_pAlertIconBtn->repaint();
|
||||
m_pInputWidget->m_pInputIconBtn->repaint();
|
||||
Q_EMIT qApp->paletteChanged(qApp->palette());
|
||||
this->repaint();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -909,19 +908,8 @@ void UkmediaMainWidget::soundThemeInDir (UkmediaMainWidget *m_pWidget,GHashTable
|
|||
}
|
||||
qDebug() << "sound theme in dir" << "displayname:" << m_pIndexName << "theme name:" << m_pName << "theme:"<< themeName;
|
||||
if (m_pName && !strstr(m_pName,"ubuntu") && !strstr(m_pName,"freedesktop") && !strstr(m_pName,"custom")) {
|
||||
m_pWidget->m_pThemeDisplayNameList->append(m_pIndexName);
|
||||
m_pWidget->m_pThemeNameList->append(m_pName);
|
||||
if(strstr(m_pIndexName,"ukui-xunguang")){
|
||||
QString themestr = tr("Light-Seeking");
|
||||
m_pWidget->m_pSoundWidget->m_pSoundThemeCombobox->addItem(themestr);
|
||||
}
|
||||
else if(strstr(m_pIndexName,"ukui-heyin")){
|
||||
QString themestr = tr("HeYin");
|
||||
m_pWidget->m_pSoundWidget->m_pSoundThemeCombobox->addItem(themestr);
|
||||
}
|
||||
else{
|
||||
m_pWidget->m_pSoundWidget->m_pSoundThemeCombobox->addItem(m_pIndexName);
|
||||
}
|
||||
m_pWidget->m_pSoundWidget->m_pSoundThemeCombobox->addItem(m_pIndexName,m_pName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1124,6 +1112,7 @@ char *UkmediaMainWidget::customThemeDirPath (const char *child)
|
|||
/*
|
||||
获取报警声音文件的路径
|
||||
*/
|
||||
#if 0
|
||||
void UkmediaMainWidget::populateModelFromDir (UkmediaMainWidget *m_pWidget,const char *dirname)//从目录查找报警声音文件
|
||||
{
|
||||
g_debug("populate model from dir");
|
||||
|
@ -1246,6 +1235,7 @@ void UkmediaMainWidget::populateModelFromNode (UkmediaMainWidget *m_pWidget,xmlN
|
|||
xmlFree (filename);
|
||||
xmlFree (name);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Adapted from yelp-toc-pager.c */
|
||||
xmlChar *UkmediaMainWidget::xmlGetAndTrimNames (xmlNodePtr node)
|
||||
|
@ -1360,6 +1350,7 @@ void UkmediaMainWidget::playAlretSoundFromPath (UkmediaMainWidget *w,QString pat
|
|||
/*
|
||||
点击combox播放声音
|
||||
*/
|
||||
#if 0
|
||||
void UkmediaMainWidget::comboxIndexChangedSlot(int index)
|
||||
{
|
||||
g_debug("combox index changed slot");
|
||||
|
@ -1498,6 +1489,7 @@ void UkmediaMainWidget::settingMenuComboboxChangedSlot(int index)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
点击输入音量按钮静音
|
||||
|
@ -1532,60 +1524,18 @@ void UkmediaMainWidget::themeComboxIndexChangedSlot(int index)
|
|||
}
|
||||
//设置系统主题
|
||||
QString theme = m_pThemeNameList->at(index);
|
||||
QByteArray ba = theme.toLatin1();
|
||||
const char *m_pThemeName = ba.data();
|
||||
|
||||
if (strcmp(m_pThemeName,"freedesktop") == 0) {
|
||||
int index = 0;
|
||||
for (int i=0;i<m_pSoundList->count();i++) {
|
||||
QString str = m_pSoundList->at(i);
|
||||
if (str.contains("gudou",Qt::CaseSensitive)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString displayName = m_pSoundNameList->at(index);
|
||||
m_pSoundWidget->m_pAlertSoundCombobox->setCurrentText(displayName);
|
||||
}
|
||||
|
||||
QString dirName = m_pSoundThemeDirList->at(index);
|
||||
int themeIndex = m_pSoundThemeList->indexOf(m_pThemeName);
|
||||
if (themeIndex < 0 )
|
||||
return;
|
||||
qDebug() << "index changed:" << m_pSoundThemeXmlNameList->at(themeIndex) << m_pThemeNameList->at(index) << m_pThemeName << dirName.toLatin1().data() ;//<< path;
|
||||
QString xmlName = m_pSoundThemeXmlNameList->at(themeIndex);
|
||||
const gchar *path = g_build_filename (dirName.toLatin1().data(), xmlName.toLatin1().data(), nullptr);
|
||||
m_pSoundList->clear();
|
||||
m_pSoundNameList->clear();
|
||||
m_pSoundWidget->m_pAlertSoundCombobox->blockSignals(true);
|
||||
m_pSoundWidget->m_pLagoutCombobox->blockSignals(true);
|
||||
m_pSoundWidget->m_pVolumeChangeCombobox->blockSignals(true);
|
||||
m_pSoundWidget->m_pAlertSoundCombobox->clear();
|
||||
m_pSoundWidget->m_pLagoutCombobox->clear();
|
||||
m_pSoundWidget->m_pVolumeChangeCombobox->clear();
|
||||
m_pSoundWidget->m_pAlertSoundCombobox->blockSignals(false);
|
||||
m_pSoundWidget->m_pLagoutCombobox->blockSignals(false);
|
||||
m_pSoundWidget->m_pVolumeChangeCombobox->blockSignals(false);
|
||||
populateModelFromFile (this, path);
|
||||
|
||||
/* special case for no sounds */
|
||||
if (strcmp (m_pThemeName, NO_SOUNDS_THEME_NAME) == 0) {
|
||||
//设置提示音关闭
|
||||
if (QGSettings::isSchemaInstalled(KEY_SOUNDS_SCHEMA)){
|
||||
if (m_pSoundSettings->keys().contains("eventSounds")) {
|
||||
m_pSoundSettings->set(EVENT_SOUNDS_KEY,false);
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
if (QGSettings::isSchemaInstalled(KEY_SOUNDS_SCHEMA)){
|
||||
if (m_pSoundSettings->keys().contains("eventSounds")) {
|
||||
m_pSoundSettings->set(EVENT_SOUNDS_KEY,true);
|
||||
}
|
||||
if (QGSettings::isSchemaInstalled(KEY_SOUNDS_SCHEMA)){
|
||||
if (m_pSoundSettings->keys().contains("themeName")) {
|
||||
m_pSoundSettings->set(SOUND_THEME_KEY,theme);
|
||||
}
|
||||
}
|
||||
|
||||
if(QGSettings::isSchemaInstalled(UKUI_GLOBALTHEME_SETTINGS)){
|
||||
m_pSoundThemeSetting = new QGSettings(UKUI_GLOBALTHEME_SETTINGS);
|
||||
if(m_pSoundThemeSetting->keys().contains("globalThemeName"))
|
||||
m_pSoundThemeSetting->set("global-theme-name","custom");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2594,7 +2544,6 @@ void UkmediaMainWidget::addComboboxAvailableOutputPort()
|
|||
if (comboboxOutputPortIsNeedAdd(at.key(),it.value()))
|
||||
{
|
||||
currentCboxOutputPortLabelMap.insertMulti(at.key(),it.value());
|
||||
|
||||
m_pOutputWidget->m_pDeviceSelectBox->blockSignals(true);
|
||||
m_pOutputWidget->m_pDeviceSelectBox->insertItem(i,it.value(),findCardName(at.key(),m_pVolumeControl->cardMap));
|
||||
m_pOutputWidget->m_pDeviceSelectBox->blockSignals(false);
|
||||
|
@ -2649,6 +2598,7 @@ void UkmediaMainWidget::deleteNotAvailableComboboxOutputPort()
|
|||
|
||||
m_pOutputWidget->m_pDeviceSelectBox->blockSignals(true);
|
||||
m_pOutputWidget->m_pDeviceSelectBox->removeItem(index);
|
||||
m_pOutputWidget->m_pDeviceSelectBox->hidePopup();
|
||||
m_pOutputWidget->m_pDeviceSelectBox->blockSignals(false);
|
||||
qDebug()<< "deleteNotAvailableComboboxOutputPort" <<index;
|
||||
it = currentCboxOutputPortLabelMap.erase(it);
|
||||
|
@ -2840,7 +2790,7 @@ void UkmediaMainWidget::updateCboxDevicePort()
|
|||
QMap<QString,QString> temp;
|
||||
currentCboxInputPortLabelMap.clear();
|
||||
currentCboxOutputPortLabelMap.clear();
|
||||
qDebug() << "updateCboxDevicePort---------------" ;
|
||||
|
||||
if (m_pVolumeControl->inputPortMap.count() == 0 ||(m_pVolumeControl->inputPortMap.count() == 1 && inputComboboxDeviceContainBluetooth())) {
|
||||
int index = m_pInputWidget->m_pInputDeviceSelectBox->findText(tr("None"));
|
||||
if(index != -1){
|
||||
|
|
|
@ -53,6 +53,9 @@ extern "C" {
|
|||
#include <QGSettings>
|
||||
#include <QAudioInput>
|
||||
#include <set>
|
||||
#include <qjsondocument.h>
|
||||
#include <qjsonobject.h>
|
||||
#include <QSettings>
|
||||
|
||||
#define UKUI_THEME_SETTING "org.ukui.style"
|
||||
#define UKUI_THEME_NAME "style-name"
|
||||
|
@ -76,12 +79,16 @@ extern "C" {
|
|||
#define UKUI_LOGOUT_MUSIC_KEY "logout-music"
|
||||
#define UKUI_WAKEUP_MUSIC_KEY "weakup-music"
|
||||
|
||||
#define STARTUP_MUSIC "startup-music"
|
||||
#define VOLUME_INCREASE "volume-increase"
|
||||
#define DNS_NOISE_REDUCTION "dns-noise-reduction"
|
||||
#define EVENT_SOUNDS_KEY "event-sounds"
|
||||
#define INPUT_SOUNDS_KEY "input-feedback-sounds"
|
||||
#define SOUND_THEME_KEY "theme-name"
|
||||
|
||||
#define UKUI_GLOBALTHEME_SETTINGS "org.ukui.globaltheme.settings"
|
||||
#define GLOBAL_THEME_NAME "global-theme-name"
|
||||
|
||||
#define DEFAULT_ALERT_ID "__default"
|
||||
#define CUSTOM_THEME_NAME "__custom"
|
||||
#define NO_SOUNDS_THEME_NAME "__no_sounds"
|
||||
|
@ -134,7 +141,7 @@ public:
|
|||
void outputVolumeDarkThemeImage(int value,bool status);
|
||||
int getInputVolume();
|
||||
int getOutputVolume();
|
||||
void comboboxCurrentTextInit();
|
||||
// void comboboxCurrentTextInit();
|
||||
QList<char *> listExistsPath();
|
||||
QString findFreePath();
|
||||
void addValue(QString name,QString filename);
|
||||
|
@ -152,9 +159,9 @@ public:
|
|||
static int getFileType (const char *sound_name,char **linked_name);
|
||||
static char *customThemeDirPath (const char *child);
|
||||
|
||||
static void populateModelFromDir (UkmediaMainWidget *w,const char *dirname);
|
||||
static void populateModelFromFile (UkmediaMainWidget *w,const char *filename);
|
||||
static void populateModelFromNode (UkmediaMainWidget *w,xmlNodePtr node);
|
||||
// static void populateModelFromDir (UkmediaMainWidget *w,const char *dirname);
|
||||
// static void populateModelFromFile (UkmediaMainWidget *w,const char *filename);
|
||||
// static void populateModelFromNode (UkmediaMainWidget *w,xmlNodePtr node);
|
||||
static xmlChar *xmlGetAndTrimNames (xmlNodePtr node);
|
||||
|
||||
static void playAlretSoundFromPath (UkmediaMainWidget *w,QString path);
|
||||
|
@ -220,7 +227,7 @@ private Q_SLOTS:
|
|||
|
||||
void initVoulmeSlider(); //初始化音量滑动条的值
|
||||
void themeComboxIndexChangedSlot(int index); //主题下拉框改变
|
||||
void comboxIndexChangedSlot(int index);
|
||||
// void comboxIndexChangedSlot(int index);
|
||||
void outputWidgetSliderChangedSlot(int v); //输出音量改变
|
||||
void inputWidgetSliderChangedSlot(int v); //输入滑动条更改
|
||||
void inputMuteButtonSlot(); //输入音量静音控制
|
||||
|
@ -243,9 +250,9 @@ private Q_SLOTS:
|
|||
void volumeIncreaseBtuuonSwitchChangedSlot(bool status);
|
||||
void bootMusicSettingsChanged();
|
||||
|
||||
void windowClosedComboboxChangedSlot(int index);
|
||||
void volumeChangedComboboxChangeSlot(int index);
|
||||
void settingMenuComboboxChangedSlot(int index);
|
||||
// void windowClosedComboboxChangedSlot(int index);
|
||||
// void volumeChangedComboboxChangeSlot(int index);
|
||||
// void settingMenuComboboxChangedSlot(int index);
|
||||
|
||||
void cboxoutputListWidgetCurrentRowChangedSlot(int row);//combobox output list widget选项改变
|
||||
void cboxinputListWidgetCurrentRowChangedSlot(int row);//combobox input list widget选项改变
|
||||
|
@ -258,7 +265,6 @@ private:
|
|||
UkmediaVolumeControl *m_pVolumeControl;
|
||||
|
||||
QStringList *m_pSoundList;
|
||||
QStringList *m_pThemeDisplayNameList;
|
||||
QStringList *m_pThemeNameList;
|
||||
QStringList *m_pSoundThemeList;
|
||||
QStringList *m_pSoundThemeDirList;
|
||||
|
@ -272,6 +278,8 @@ private:
|
|||
QGSettings *m_pThemeSetting;
|
||||
// QGSettings *m_pWindowClosedSetting;
|
||||
QString mThemeName;
|
||||
QGSettings *m_pSoundThemeSetting;
|
||||
|
||||
bool m_hasMusic;
|
||||
bool firstEnterSystem = true;
|
||||
|
||||
|
|
|
@ -21,18 +21,10 @@
|
|||
#include "ukui_list_widget_item.h"
|
||||
#include <QHBoxLayout>
|
||||
#include <QDebug>
|
||||
AudioSlider::AudioSlider(QWidget *parent)
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
}
|
||||
|
||||
AudioSlider::~AudioSlider()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
UkmediaOutputWidget::UkmediaOutputWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
connect(qApp, &QApplication::paletteChanged, this, &UkmediaOutputWidget::onPaletteChanged);
|
||||
//加载qss样式文件
|
||||
QFile QssFile("://combox.qss");
|
||||
QssFile.open(QFile::ReadOnly);
|
||||
|
@ -57,15 +49,15 @@ UkmediaOutputWidget::UkmediaOutputWidget(QWidget *parent) : QWidget(parent)
|
|||
m_pVolumeIncreaseWidget->setFrameShape(QFrame::Shape::Box);
|
||||
//设置大小
|
||||
m_pOutputWidget->setMinimumSize(550,0);
|
||||
m_pOutputWidget->setMaximumSize(16777215,244);
|
||||
m_pOutputWidget->setMaximumSize(16777215,274);
|
||||
m_pMasterVolumeWidget->setMinimumSize(550,60);
|
||||
m_pMasterVolumeWidget->setMaximumSize(16777215,60);
|
||||
m_pChannelBalanceWidget->setMinimumSize(550,60);
|
||||
m_pChannelBalanceWidget->setMaximumSize(16777215,60);
|
||||
m_pOutputSlectWidget->setMinimumSize(550,60);
|
||||
m_pOutputSlectWidget->setMaximumSize(16777215,60);
|
||||
m_pVolumeIncreaseWidget->setMinimumSize(550,60);
|
||||
m_pVolumeIncreaseWidget->setMaximumSize(16777215,60);
|
||||
m_pVolumeIncreaseWidget->setMinimumSize(550,90);
|
||||
m_pVolumeIncreaseWidget->setMaximumSize(16777215,90);
|
||||
|
||||
m_pOutputLabel = new TitleLabel(this);
|
||||
//~ contents_path /Audio/Output
|
||||
|
@ -83,16 +75,27 @@ UkmediaOutputWidget::UkmediaOutputWidget(QWidget *parent) : QWidget(parent)
|
|||
//~ contents_path /Audio/Balance
|
||||
m_pOpBalanceLabel = new QLabel(tr("Balance"),m_pChannelBalanceWidget);
|
||||
m_pLeftBalanceLabel = new QLabel(tr("Left"),m_pChannelBalanceWidget);
|
||||
m_pOpBalanceSlider = new UkmediaVolumeSlider(m_pChannelBalanceWidget,true);
|
||||
m_pOpBalanceSlider = new UkmediaVolumeSlider(m_pChannelBalanceWidget);
|
||||
m_pRightBalanceLabel = new QLabel(tr("Right"),m_pChannelBalanceWidget);
|
||||
|
||||
//~ contents_path /audio/Noise
|
||||
m_pVolumeIncreaseLabel = new QLabel(tr("Volume Increase"));
|
||||
m_pVolumeIncreaseButton = new KSwitchButton();
|
||||
VolumeIncreaseTipsWidget = new QWidget(m_pVolumeIncreaseWidget);
|
||||
m_pVolumeIncreaseLabel = new QLabel(tr("Volume Increase"),VolumeIncreaseTipsWidget);
|
||||
VolumeIncreaseTipsLabel = new QLabel(tr("Volume above 100% can cause sound distortion and damage your speakers."),VolumeIncreaseTipsWidget);
|
||||
m_pVolumeIncreaseButton = new KSwitchButton();
|
||||
|
||||
QPalette palette = VolumeIncreaseTipsLabel->palette();
|
||||
QColor color = palette.color(QPalette::PlaceholderText);
|
||||
palette.setColor(QPalette::WindowText,color);
|
||||
VolumeIncreaseTipsLabel->setPalette(palette);
|
||||
|
||||
QVBoxLayout *vlay = new QVBoxLayout(this);
|
||||
vlay->addWidget(m_pVolumeIncreaseLabel);
|
||||
vlay->addWidget(VolumeIncreaseTipsLabel);
|
||||
vlay->setSpacing(0);
|
||||
VolumeIncreaseTipsWidget->setLayout(vlay);
|
||||
VolumeIncreaseTipsWidget->layout()->setContentsMargins(0,20,0,25);
|
||||
|
||||
m_pOpVolumeSlider->setOrientation(Qt::Horizontal);
|
||||
m_pOpBalanceSlider->setOrientation(Qt::Horizontal);
|
||||
m_pOpVolumeSlider->setRange(0,100);
|
||||
m_pOutputIconBtn->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
|
||||
|
@ -154,7 +157,7 @@ UkmediaOutputWidget::UkmediaOutputWidget(QWidget *parent) : QWidget(parent)
|
|||
//音量增强
|
||||
QHBoxLayout *volumeIncreaseLayout = new QHBoxLayout(m_pVolumeIncreaseWidget);
|
||||
volumeIncreaseLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
volumeIncreaseLayout->addWidget(m_pVolumeIncreaseLabel);
|
||||
volumeIncreaseLayout->addWidget(VolumeIncreaseTipsWidget);
|
||||
volumeIncreaseLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Expanding));
|
||||
volumeIncreaseLayout->addWidget(m_pVolumeIncreaseButton);
|
||||
volumeIncreaseLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
|
@ -212,6 +215,13 @@ QFrame* UkmediaOutputWidget::myLine()
|
|||
return line;
|
||||
}
|
||||
|
||||
void UkmediaOutputWidget::onPaletteChanged(){
|
||||
QPalette palette = VolumeIncreaseTipsLabel->palette();
|
||||
QColor color = palette.color(QPalette::PlaceholderText);
|
||||
palette.setColor(QPalette::WindowText,color);
|
||||
VolumeIncreaseTipsLabel->setPalette(palette);
|
||||
}
|
||||
|
||||
UkmediaOutputWidget::~UkmediaOutputWidget()
|
||||
{
|
||||
|
||||
|
|
|
@ -36,72 +36,10 @@
|
|||
#include <QComboBox>
|
||||
#include "switchbutton.h"
|
||||
#include "kswitchbutton.h"
|
||||
#include <QApplication>
|
||||
|
||||
using namespace kdk;
|
||||
|
||||
class AudioSlider : public QSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AudioSlider(QWidget *parent = nullptr);
|
||||
~AudioSlider();
|
||||
friend class UkmediaInputWidget;
|
||||
|
||||
Q_SIGNALS:
|
||||
void silderPressSignal();
|
||||
void silderReleaseSignal();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
//注意应先调用父类的鼠标点击处理事件,这样可以不影响拖动的情况
|
||||
|
||||
//获取鼠标的位置,这里并不能直接从ev中取值(因为如果是拖动的话,鼠标开始点击的位置没有意义了)
|
||||
int value = 0;
|
||||
int currentX = ev->pos().x();
|
||||
double per = currentX * 1.0 / this->width();
|
||||
if ((this->maximum() - this->minimum()) >= 50) { //减小鼠标点击像素的影响
|
||||
value = qRound(per*(this->maximum() - this->minimum())) + this->minimum();
|
||||
if (value <= (this->maximum() / 2 - this->maximum() / 10 + this->minimum() / 10)) {
|
||||
value = qRound(per*(this->maximum() - this->minimum() - 1)) + this->minimum();
|
||||
} else if (value > (this->maximum() / 2 + this->maximum() / 10 + this->minimum() / 10)) {
|
||||
value = qRound(per*(this->maximum() - this->minimum() + 1)) + this->minimum();
|
||||
} else {
|
||||
value = qRound(per*(this->maximum() - this->minimum())) + this->minimum();
|
||||
}
|
||||
} else {
|
||||
value = qRound(per*(this->maximum() - this->minimum())) + this->minimum();
|
||||
}
|
||||
this->setValue(value);
|
||||
QSlider::mousePressEvent(ev);
|
||||
//向父窗口发送自定义事件event type,这样就可以在父窗口中捕获这个事件进行处理
|
||||
QEvent evEvent(static_cast<QEvent::Type>(QEvent::User + 1));
|
||||
QCoreApplication::sendEvent(parentWidget(), &evEvent);
|
||||
}
|
||||
void mouseReleaseEvent(QMouseEvent *ev)
|
||||
{
|
||||
if(mousePress){
|
||||
Q_EMIT silderReleaseSignal();
|
||||
}
|
||||
mousePress = false;
|
||||
mouseClickFlag = true;
|
||||
QSlider::mouseReleaseEvent(ev);
|
||||
}
|
||||
void wheelEvent(QWheelEvent* ev)
|
||||
{
|
||||
if(mouseClickFlag)
|
||||
QSlider::wheelEvent(ev);
|
||||
}
|
||||
void leaveEvent(QEvent *ev)
|
||||
{
|
||||
mouseClickFlag = false;
|
||||
QSlider::leaveEvent(ev);
|
||||
}
|
||||
private:
|
||||
bool mousePress = false;
|
||||
bool mouseClickFlag = false;
|
||||
};
|
||||
|
||||
class UkmediaOutputWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -114,6 +52,7 @@ public:
|
|||
Q_SIGNALS:
|
||||
|
||||
public Q_SLOTS:
|
||||
void onPaletteChanged();
|
||||
|
||||
private:
|
||||
QFrame* myLine();
|
||||
|
@ -121,12 +60,14 @@ private:
|
|||
QFrame *m_pMasterVolumeWidget;
|
||||
QFrame *m_pChannelBalanceWidget;
|
||||
QFrame *m_pVolumeIncreaseWidget;
|
||||
QWidget *VolumeIncreaseTipsWidget;
|
||||
|
||||
TitleLabel *m_pOutputLabel;
|
||||
QLabel *m_pOutputDeviceLabel;
|
||||
QLabel *m_pOpVolumeLabel;
|
||||
QLabel *m_pOpVolumePercentLabel;
|
||||
QLabel *m_pOpBalanceLabel;
|
||||
QLabel *VolumeIncreaseTipsLabel;
|
||||
QLabel *m_pLeftBalanceLabel;
|
||||
QLabel *m_pRightBalanceLabel;
|
||||
QLabel *m_pVolumeIncreaseLabel;
|
||||
|
|
|
@ -38,8 +38,8 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
m_pAlertSoundFrame = new QFrame(this);
|
||||
m_pAlertSoundSwitchWidget = new QFrame(m_pAlertSoundFrame);
|
||||
m_pThemeWidget = new QFrame(m_pAlertSoundSwitchWidget);
|
||||
m_pAlertSoundWidget = new QFrame(m_pAlertSoundSwitchWidget);
|
||||
m_pVolumeChangeWidget = new QFrame(m_pAlertSoundSwitchWidget);
|
||||
// m_pAlertSoundWidget = new QFrame(m_pAlertSoundSwitchWidget);
|
||||
// m_pVolumeChangeWidget = new QFrame(m_pAlertSoundSwitchWidget);
|
||||
|
||||
m_pSystemSoundWidget->setFrameShape(QFrame::Shape::Box);
|
||||
m_pStartupMusicWidget->setFrameShape(QFrame::Shape::Box);
|
||||
|
@ -50,8 +50,8 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
m_pAlertSoundFrame->setFrameShape(QFrame::Shape::Box);
|
||||
m_pAlertSoundSwitchWidget->setFrameShape(QFrame::Shape::Box);
|
||||
m_pThemeWidget->setFrameShape(QFrame::Shape::Box);
|
||||
m_pAlertSoundWidget->setFrameShape(QFrame::Shape::Box);
|
||||
m_pVolumeChangeWidget->setFrameShape(QFrame::Shape::Box);
|
||||
// m_pAlertSoundWidget->setFrameShape(QFrame::Shape::Box);
|
||||
// m_pVolumeChangeWidget->setFrameShape(QFrame::Shape::Box);
|
||||
|
||||
//~ contents_path /Audio/System Sound 系统音效文本框
|
||||
m_pSoundEffectLabel = new TitleLabel(this);
|
||||
|
@ -60,9 +60,6 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
//~ contents_path /Audio/Sound Theme
|
||||
m_pSoundThemeLabel = new QLabel(tr("Sound Theme"),m_pThemeWidget);//提示音下的系统音效主题
|
||||
m_pSoundThemeCombobox = new QComboBox(m_pThemeWidget);
|
||||
//~ contents_path /Audio/Alert Sound
|
||||
m_pShutdownlabel = new QLabel(tr("Alert Sound"),m_pAlertSoundWidget);//提示音下的通知提示
|
||||
m_pAlertSoundCombobox = new QComboBox(m_pAlertSoundWidget);
|
||||
//~ contents_path /Audio/Beep Switch
|
||||
m_pAlertSoundSwitchLabel = new QLabel(tr("Beep Switch"),m_pAlertSoundSwitchWidget);//提示音
|
||||
//~ contents_path /Audio/Poweroff Music
|
||||
|
@ -71,17 +68,19 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
m_pStartupMusicLabel = new QLabel(tr("Startup Music"),m_pStartupMusicWidget);//开机
|
||||
//~ contents_path /Audio/Wakeup Music
|
||||
m_pWakeupMusicLabel = new QLabel(tr("Wakeup Music"),m_pWakeupMusicWidget);//唤醒
|
||||
//~ contents_path /Audio/Volume Change
|
||||
m_pVolumeChangeLabel = new QLabel(tr("Volume Change"),m_pVolumeChangeWidget);//音量调节
|
||||
//~ contents_path /Audio/Logout Music
|
||||
m_pLagoutLabel = new QLabel(tr("Logout Music"),m_pLagoutWidget);//注销
|
||||
|
||||
m_pLagoutCombobox = new QComboBox(m_pLagoutWidget);
|
||||
// m_pShutdownlabel = new QLabel(tr("Alert Sound"),m_pAlertSoundWidget);//提示音下的通知提示
|
||||
// m_pAlertSoundCombobox = new QComboBox(m_pAlertSoundWidget);
|
||||
// m_pVolumeChangeLabel = new QLabel(tr("Volume Change"),m_pVolumeChangeWidget);//音量调节
|
||||
// m_pLagoutCombobox = new QComboBox(m_pLagoutWidget);
|
||||
// m_pVolumeChangeCombobox = new QComboBox(m_pVolumeChangeWidget);
|
||||
|
||||
m_pStartupButton = new KSwitchButton(m_pStartupMusicWidget);
|
||||
m_pLogoutButton = new KSwitchButton(m_pLagoutWidget);
|
||||
m_pWakeupMusicButton = new KSwitchButton(m_pWakeupMusicWidget);
|
||||
m_pPoweroffButton = new KSwitchButton(m_pPoweroffMusicWidget);
|
||||
m_pVolumeChangeCombobox = new QComboBox(m_pVolumeChangeWidget);
|
||||
m_pAlertSoundSwitchButton = new KSwitchButton(m_pAlertSoundSwitchWidget);
|
||||
|
||||
//设置大小
|
||||
|
@ -96,39 +95,36 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
m_pWakeupMusicWidget->setMinimumSize(550,60);
|
||||
m_pWakeupMusicWidget->setMaximumSize(16777215,60);
|
||||
|
||||
m_pAlertSoundWidget->setMinimumSize(550,0);
|
||||
m_pAlertSoundWidget->setMaximumSize(16777215,240);
|
||||
m_pAlertSoundSwitchWidget->setMinimumSize(550,60);
|
||||
m_pAlertSoundSwitchWidget->setMaximumSize(16777215,60);
|
||||
m_pThemeWidget->setMinimumSize(550,60);
|
||||
m_pThemeWidget->setMaximumSize(16777215,60);
|
||||
m_pAlertSoundWidget->setMinimumSize(550,60);
|
||||
m_pAlertSoundWidget->setMaximumSize(16777215,60);
|
||||
m_pVolumeChangeWidget->setMinimumSize(550,60);
|
||||
m_pVolumeChangeWidget->setMaximumSize(16777215,60);
|
||||
|
||||
m_pSoundEffectLabel->setFixedSize(150,32);
|
||||
m_pSoundThemeLabel->setFixedSize(150,40);
|
||||
m_pShutdownlabel->setFixedSize(120,40);
|
||||
m_pPoweroffMusicLabel->setFixedSize(150,32);
|
||||
m_pSoundThemeCombobox->setFixedHeight(40);
|
||||
|
||||
// m_pAlertSoundWidget->setMinimumSize(550,0);
|
||||
// m_pAlertSoundWidget->setMaximumSize(16777215,240);
|
||||
// m_pAlertSoundWidget->setMinimumSize(550,60);
|
||||
// m_pAlertSoundWidget->setMaximumSize(16777215,60);
|
||||
// m_pVolumeChangeWidget->setMinimumSize(550,60);
|
||||
// m_pVolumeChangeWidget->setMaximumSize(16777215,60);
|
||||
// m_pShutdownlabel->setFixedSize(120,40);
|
||||
// m_pLagoutLabel->setFixedSize(150,32);
|
||||
// m_pWakeupMusicLabel->setFixedSize(150,32);
|
||||
m_pVolumeChangeLabel->setFixedSize(150,40);
|
||||
m_pPoweroffMusicLabel->setFixedSize(150,32);
|
||||
|
||||
// m_pVolumeChangeLabel->setFixedSize(150,40);
|
||||
// m_pSoundThemeCombobox->setMinimumSize(50,32);
|
||||
// m_pSoundThemeCombobox->setMaximumSize(900,32);
|
||||
|
||||
// m_pAlertSoundCombobox->setMinimumSize(50,32);
|
||||
// m_pAlertSoundCombobox->setMaximumSize(900,32);
|
||||
// m_pLagoutCombobox->setMinimumSize(50,32);
|
||||
// m_pLagoutCombobox->setMaximumSize(900,32);
|
||||
|
||||
// m_pVolumeChangeCombobox->setMinimumSize(50,32);
|
||||
// m_pVolumeChangeCombobox->setMaximumSize(900,32);
|
||||
|
||||
m_pSoundThemeCombobox->setFixedHeight(40);
|
||||
m_pAlertSoundCombobox->setFixedHeight(40);
|
||||
m_pVolumeChangeCombobox->setFixedHeight(40);
|
||||
// m_pAlertSoundCombobox->setFixedHeight(40);
|
||||
// m_pVolumeChangeCombobox->setFixedHeight(40);
|
||||
|
||||
//添加布局
|
||||
QHBoxLayout *themeLayout = new QHBoxLayout(m_pThemeWidget);
|
||||
|
@ -141,15 +137,15 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
m_pThemeWidget->setLayout(themeLayout);
|
||||
m_pThemeWidget->layout()->setContentsMargins(0,0,0,0);
|
||||
|
||||
QHBoxLayout *AlertLayout = new QHBoxLayout(m_pAlertSoundWidget);
|
||||
AlertLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
AlertLayout->addWidget(m_pShutdownlabel);
|
||||
AlertLayout->addItem(new QSpacerItem(113,20,QSizePolicy::Fixed));
|
||||
AlertLayout->addWidget(m_pAlertSoundCombobox);
|
||||
AlertLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
AlertLayout->setSpacing(0);
|
||||
m_pAlertSoundWidget->setLayout(AlertLayout);
|
||||
m_pAlertSoundWidget->layout()->setContentsMargins(0,0,0,0);
|
||||
// QHBoxLayout *AlertLayout = new QHBoxLayout(m_pAlertSoundWidget);
|
||||
// AlertLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
// AlertLayout->addWidget(m_pShutdownlabel);
|
||||
// AlertLayout->addItem(new QSpacerItem(113,20,QSizePolicy::Fixed));
|
||||
// AlertLayout->addWidget(m_pAlertSoundCombobox);
|
||||
// AlertLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
// AlertLayout->setSpacing(0);
|
||||
// m_pAlertSoundWidget->setLayout(AlertLayout);
|
||||
// m_pAlertSoundWidget->layout()->setContentsMargins(0,0,0,0);
|
||||
|
||||
//开机音乐设置开关
|
||||
QHBoxLayout *startupLayout = new QHBoxLayout(m_pStartupMusicWidget);
|
||||
|
@ -172,7 +168,7 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
lagoutLayout->setSpacing(0);
|
||||
m_pLagoutWidget->setLayout(lagoutLayout);
|
||||
m_pLagoutWidget->layout()->setContentsMargins(0,0,0,0);
|
||||
m_pLagoutCombobox->setVisible(false);
|
||||
// m_pLagoutCombobox->setVisible(false);
|
||||
|
||||
//提示音开关布局
|
||||
QHBoxLayout *alertSoundLayout = new QHBoxLayout(m_pAlertSoundSwitchWidget);
|
||||
|
@ -196,16 +192,17 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
m_pWakeupMusicWidget->setLayout(wakeupMusicLayout);
|
||||
m_pWakeupMusicWidget->layout()->setContentsMargins(0,0,0,0);
|
||||
|
||||
//音量改变提示音
|
||||
QHBoxLayout *volumeChangedLayout = new QHBoxLayout(m_pVolumeChangeWidget);
|
||||
volumeChangedLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
volumeChangedLayout->addWidget(m_pVolumeChangeLabel);
|
||||
volumeChangedLayout->addItem(new QSpacerItem(83,20,QSizePolicy::Fixed));
|
||||
volumeChangedLayout->addWidget(m_pVolumeChangeCombobox);
|
||||
volumeChangedLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
volumeChangedLayout->setSpacing(0);
|
||||
m_pVolumeChangeWidget->setLayout(volumeChangedLayout);
|
||||
m_pVolumeChangeWidget->layout()->setContentsMargins(0,0,0,0);
|
||||
// //音量改变提示音
|
||||
// QHBoxLayout *volumeChangedLayout = new QHBoxLayout(m_pVolumeChangeWidget);
|
||||
// volumeChangedLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
// volumeChangedLayout->addWidget(m_pVolumeChangeLabel);
|
||||
// volumeChangedLayout->addItem(new QSpacerItem(83,20,QSizePolicy::Fixed));
|
||||
// volumeChangedLayout->addWidget(m_pVolumeChangeCombobox);
|
||||
// volumeChangedLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
// volumeChangedLayout->setSpacing(0);
|
||||
// m_pVolumeChangeWidget->setLayout(volumeChangedLayout);
|
||||
// m_pVolumeChangeWidget->layout()->setContentsMargins(0,0,0,0);
|
||||
|
||||
//关机提示音
|
||||
QHBoxLayout *poweroffLayout = new QHBoxLayout(m_pPoweroffMusicWidget);
|
||||
poweroffLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Fixed));
|
||||
|
@ -221,8 +218,6 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
QFrame *poweroffAndLagout = myLine();
|
||||
QFrame *lagoutAndWakeup = myLine();
|
||||
line1 = myLine();
|
||||
line2 = myLine();
|
||||
line3 = myLine();
|
||||
|
||||
QVBoxLayout *systemSoundLayout = new QVBoxLayout(m_pSystemSoundWidget);
|
||||
systemSoundLayout->setContentsMargins(0,0,0,0);
|
||||
|
@ -241,10 +236,8 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
SoundLayout->addWidget(m_pAlertSoundSwitchWidget);
|
||||
SoundLayout->addWidget(line1);
|
||||
SoundLayout->addWidget(m_pThemeWidget);
|
||||
SoundLayout->addWidget(line2);
|
||||
SoundLayout->addWidget(m_pVolumeChangeWidget);
|
||||
SoundLayout->addWidget(line3);
|
||||
SoundLayout->addWidget(m_pAlertSoundWidget);
|
||||
// SoundLayout->addWidget(m_pVolumeChangeWidget);
|
||||
// SoundLayout->addWidget(m_pAlertSoundWidget);
|
||||
SoundLayout->setSpacing(0);
|
||||
m_pAlertSoundFrame->setLayout(SoundLayout);
|
||||
|
||||
|
@ -256,10 +249,6 @@ UkmediaSoundEffectsWidget::UkmediaSoundEffectsWidget(QWidget *parent) : QWidget(
|
|||
m_pSoundLayout->addItem(new QSpacerItem(16,8,QSizePolicy::Fixed));
|
||||
m_pSoundLayout->addWidget(m_pAlertSoundFrame);
|
||||
|
||||
// m_pAlertSoundWidget->hide();
|
||||
// m_pVolumeChangeWidget->hide();
|
||||
// m_pThemeWidget->hide();
|
||||
|
||||
this->setLayout(m_pSoundLayout);
|
||||
m_pSoundLayout->setSpacing(0);
|
||||
this->layout()->setContentsMargins(0,0,0,0);
|
||||
|
|
|
@ -61,31 +61,19 @@ private:
|
|||
QFrame *m_pAlertSoundFrame;//存放注销、唤醒、开机、关机提示音的窗口
|
||||
QFrame *m_pAlertSoundSwitchWidget;//提示音开关窗口
|
||||
QFrame *m_pThemeWidget;//提示音下的系统音效主题
|
||||
QFrame *m_pAlertSoundWidget;//提示音下的通知提示
|
||||
QFrame *m_pVolumeChangeWidget;//提示音下的音量调节
|
||||
QFrame *line1;
|
||||
QFrame *line2;
|
||||
QFrame *line3;
|
||||
|
||||
|
||||
QString qss;
|
||||
QStyledItemDelegate *itemDelegate;
|
||||
TitleLabel *m_pSoundEffectLabel;
|
||||
QLabel *m_pSoundThemeLabel;
|
||||
QLabel *m_pShutdownlabel;
|
||||
QLabel *m_pLagoutLabel;
|
||||
QLabel *m_pAlertSoundSwitchLabel;
|
||||
// QLabel *m_pAlertSoundLabel;
|
||||
// QLabel *m_pAlertVolumeLabel;
|
||||
QLabel *m_pWakeupMusicLabel;
|
||||
QLabel *m_pVolumeChangeLabel;
|
||||
QLabel *m_pPoweroffMusicLabel;
|
||||
QLabel *m_pStartupMusicLabel;
|
||||
|
||||
QComboBox *m_pSoundThemeCombobox;
|
||||
QComboBox *m_pAlertSoundCombobox;
|
||||
QComboBox *m_pLagoutCombobox;
|
||||
QComboBox *m_pVolumeChangeCombobox;
|
||||
QVBoxLayout *m_pSoundLayout;
|
||||
|
||||
KSwitchButton *m_pStartupButton;
|
||||
|
@ -93,6 +81,23 @@ private:
|
|||
KSwitchButton *m_pLogoutButton;
|
||||
KSwitchButton *m_pAlertSoundSwitchButton;
|
||||
KSwitchButton *m_pWakeupMusicButton;
|
||||
|
||||
|
||||
// 2209 remove volumechange、alertsound widget,Follow the theme to switch with one click
|
||||
|
||||
// QLabel *m_pShutdownlabel;
|
||||
// QLabel *m_pAlertSoundLabel;
|
||||
// QLabel *m_pAlertVolumeLabel;
|
||||
// QLabel *m_pVolumeChangeLabel;
|
||||
// QComboBox *m_pAlertSoundCombobox;
|
||||
// QComboBox *m_pLagoutCombobox;
|
||||
// QComboBox *m_pVolumeChangeCombobox;
|
||||
// QFrame *m_pAlertSoundWidget;//提示音下的通知提示
|
||||
// QFrame *m_pVolumeChangeWidget;//提示音下的音量调节
|
||||
// QFrame *line2;
|
||||
// QFrame *line3;
|
||||
|
||||
|
||||
// UkmediaVolumeSlider *m_pAlertSlider;
|
||||
// UkuiButtonDrawSvg *m_pAlertIconBtn;
|
||||
};
|
||||
|
|
|
@ -781,11 +781,23 @@ void UkmediaVolumeControl::updateSource(const pa_source_info &info) {
|
|||
else
|
||||
volume = info.volume.values[0];
|
||||
|
||||
if(pa_proplist_gets(info.proplist,PA_PROP_DEVICE_MASTER_DEVICE))
|
||||
masterDevice = pa_proplist_gets(info.proplist,PA_PROP_DEVICE_MASTER_DEVICE);
|
||||
|
||||
//默认的输出音量
|
||||
if (info.name && strcmp(defaultSourceName.data(),info.name) == 0) {
|
||||
//sourceIndex和inputChannel必须在此处刷新
|
||||
sourceIndex = info.index;
|
||||
inputChannel = info.volume.channels;
|
||||
defaultInputCard = info.card;
|
||||
if(masterDevice != "" && strcmp(info.name,NOISE_REDUCE_SOURCE) == 0){
|
||||
int cardIndex = findPortSourceIndex(masterDevice);
|
||||
if(cardIndex){
|
||||
defaultInputCard = cardIndex;
|
||||
sourcePortName = findSourcePortName(cardIndex);
|
||||
QTimer::singleShot(100,this,SLOT(timeoutSlot()));
|
||||
}
|
||||
}
|
||||
if (info.active_port) {
|
||||
if(strcmp(sourcePortName.toLatin1().data(),info.active_port->name) != 0) {
|
||||
sourcePortName = info.active_port->name;
|
||||
|
@ -794,7 +806,6 @@ void UkmediaVolumeControl::updateSource(const pa_source_info &info) {
|
|||
else
|
||||
sourcePortName = info.active_port->name;
|
||||
}
|
||||
defaultInputCard = info.card;
|
||||
if (sourceVolume != volume || sourceMuted != info.mute) {
|
||||
sourceVolume = volume;
|
||||
sourceMuted = info.mute;
|
||||
|
@ -831,7 +842,7 @@ void UkmediaVolumeControl::updateSource(const pa_source_info &info) {
|
|||
if(!sourcePortMapList.contains(temp)){
|
||||
sourcePortMap.insertMulti(info.card,temp);
|
||||
}
|
||||
qDebug() << "update Source" << "defauleSourceName:" << defaultSourceName.data() << "sinkport" << sourcePortName << "sourceVolume" << sourceVolume ;
|
||||
qDebug() << "update Source" << "defauleSourceName:" << defaultSourceName.data() << "sourcePortName" << sourcePortName << "sourceVolume" << sourceVolume ;
|
||||
}
|
||||
|
||||
if (is_new)
|
||||
|
@ -1308,6 +1319,14 @@ void UkmediaVolumeControl::sourceIndexCb(pa_context *c, const pa_source_info *i,
|
|||
else
|
||||
w->sourcePortName = "";
|
||||
|
||||
if(w->masterDevice != "" && strcmp(i->name,NOISE_REDUCE_SOURCE) == 0){
|
||||
int cardIndex = w->findPortSourceIndex(w->masterDevice);
|
||||
if(cardIndex){
|
||||
w->defaultInputCard = cardIndex;
|
||||
w->sourcePortName = w->findSourcePortName(cardIndex);
|
||||
}
|
||||
}
|
||||
|
||||
if(w->sourceVolume != volume || w->sourceMuted != i->mute){
|
||||
w->sourceVolume = volume;
|
||||
w->sourceMuted = i->mute;
|
||||
|
@ -2158,3 +2177,43 @@ bool UkmediaVolumeControl::isExitInputPort(QString name)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int UkmediaVolumeControl::findPortSourceIndex(QString name)
|
||||
{
|
||||
QMap<int, QMap<QString,QString>>::iterator it;
|
||||
QMap<QString,QString> portNameMap;
|
||||
QMap<QString,QString>::iterator tempMap;
|
||||
int cardIndex = -1;
|
||||
for (it=sourcePortMap.begin();it!=sourcePortMap.end();) {
|
||||
portNameMap = it.value();
|
||||
for (tempMap=portNameMap.begin();tempMap!=portNameMap.end();) {
|
||||
if (tempMap.key() == name) {
|
||||
cardIndex = it.key();
|
||||
break;
|
||||
}
|
||||
++tempMap;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return cardIndex;
|
||||
}
|
||||
|
||||
QString UkmediaVolumeControl::findSourcePortName(int cardIndex)
|
||||
{
|
||||
QMap<int, QMap<QString,QString>>::iterator it;
|
||||
QMap<QString,QString> portNameMap;
|
||||
QMap<QString,QString>::iterator tempMap;
|
||||
QString portName = "";
|
||||
for (it=inputPortMap.begin();it!=inputPortMap.end();) {
|
||||
if(it.key() == cardIndex){
|
||||
portNameMap = it.value();
|
||||
for (tempMap=portNameMap.begin();tempMap!=portNameMap.end();) {
|
||||
portName = tempMap.key();
|
||||
break;
|
||||
}
|
||||
++tempMap;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return portName;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <QDialog>
|
||||
#include "ukui_custom_style.h"
|
||||
|
||||
#define NOISE_REDUCE_SOURCE "noiseReduceSource"
|
||||
#define PANGUW_SINK "alsa_output.platform-raoliang-sndcard.analog-stereo"
|
||||
|
||||
#define DECAY_STEP .04
|
||||
|
@ -127,6 +128,8 @@ public:
|
|||
void removeInputProfile(int index);
|
||||
bool isExitInputPort(QString name);
|
||||
QString stringRemoveUnrecignizedChar(QString str);
|
||||
int findPortSourceIndex(QString name);
|
||||
QString findSourcePortName(int cardIndex);
|
||||
|
||||
|
||||
std::vector< std::pair<QByteArray,QByteArray> > profiles;
|
||||
|
@ -159,6 +162,7 @@ public:
|
|||
QString sourcePortName; //输入设备端口名
|
||||
int defaultOutputCard;
|
||||
int defaultInputCard;
|
||||
QString masterDevice = "";
|
||||
|
||||
pa_channel_map defaultChannelMap;
|
||||
friend class UkmediaMainWidget;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*
|
||||
|
@ -26,83 +26,62 @@
|
|||
#include <QStylePainter>
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QToolTip>
|
||||
|
||||
UkuiMediaSliderTipLabel::UkuiMediaSliderTipLabel(){
|
||||
setAttribute(Qt::WA_TranslucentBackground);
|
||||
}
|
||||
|
||||
UkuiMediaSliderTipLabel::~UkuiMediaSliderTipLabel(){
|
||||
}
|
||||
|
||||
void UkuiMediaSliderTipLabel::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QStyleOptionFrame opt;
|
||||
initStyleOption(&opt);
|
||||
QStylePainter p(this);
|
||||
// p.setBrush(QBrush(QColor(0x1A,0x1A,0x1A,0x4C)));
|
||||
p.setBrush(QBrush(QColor(0xFF,0xFF,0xFF,0x33)));
|
||||
p.setPen(Qt::NoPen);
|
||||
p.drawRoundedRect(this->rect(), 1, 1);
|
||||
QPainterPath path;
|
||||
path.addRoundedRect(opt.rect,6,6);
|
||||
p.setRenderHint(QPainter::Antialiasing);
|
||||
setProperty("blurRegion",QRegion(path.toFillPolygon().toPolygon()));
|
||||
p.drawPrimitive(QStyle::PE_PanelTipLabel, opt);
|
||||
this->setProperty("blurRegion", QRegion(QRect(0, 0, 1, 1)));
|
||||
QLabel::paintEvent(e);
|
||||
}
|
||||
|
||||
UkmediaVolumeSlider::UkmediaVolumeSlider(QWidget *parent,bool needTip)
|
||||
AudioSlider::AudioSlider(QWidget *parent)
|
||||
: KSlider(parent)
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
if (needTip) {
|
||||
state = needTip;
|
||||
m_pTiplabel = new UkuiMediaSliderTipLabel();
|
||||
m_pTiplabel->setWindowFlags(Qt::ToolTip);
|
||||
// qApp->installEventFilter(new AppEventFilter(this));
|
||||
m_pTiplabel->setFixedSize(70,30);
|
||||
m_pTiplabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
}
|
||||
setRange(0,100);
|
||||
setSliderType(SmoothSlider);
|
||||
setOrientation(Qt::Horizontal);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setNodeVisible(false);
|
||||
}
|
||||
|
||||
void UkmediaVolumeSlider::mousePressEvent(QMouseEvent *ev)
|
||||
AudioSlider::~AudioSlider()
|
||||
{
|
||||
if (state) {
|
||||
m_pTiplabel->show();
|
||||
}
|
||||
//注意应先调用父类的鼠标点击处理事件,这样可以不影响拖动的情况
|
||||
QSlider::mousePressEvent(ev);
|
||||
//获取鼠标的位置,这里并不能直接从ev中取值(因为如果是拖动的话,鼠标开始点击的位置没有意义了)
|
||||
int value = 0;
|
||||
int currentX = ev->pos().x();
|
||||
double per = currentX * 1.0 / this->width();
|
||||
if ((this->maximum() - this->minimum()) >= 50) { //减小鼠标点击像素的影响
|
||||
value = qRound(per*(this->maximum() - this->minimum())) + this->minimum();
|
||||
if (value <= (this->maximum() / 2 - this->maximum() / 10 + this->minimum() / 10)) {
|
||||
value = qRound(per*(this->maximum() - this->minimum() - 1)) + this->minimum();
|
||||
} else if (value > (this->maximum() / 2 + this->maximum() / 10 + this->minimum() / 10)) {
|
||||
value = qRound(per*(this->maximum() - this->minimum() + 1)) + this->minimum();
|
||||
} else {
|
||||
value = qRound(per*(this->maximum() - this->minimum())) + this->minimum();
|
||||
|
||||
}
|
||||
|
||||
UkmediaVolumeSlider::UkmediaVolumeSlider(QWidget *parent)
|
||||
: KSlider(parent)
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
setRange(-100,100);
|
||||
setSingleStep(100);
|
||||
setTickInterval(100);
|
||||
setSliderType(SmoothSlider);
|
||||
setOrientation(Qt::Horizontal);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
this->installEventFilter(this);
|
||||
}
|
||||
|
||||
void UkmediaVolumeSlider::showTooltip()
|
||||
{
|
||||
QString percent = QString::number(this->value());
|
||||
percent.append("%");
|
||||
|
||||
QStyleOptionSlider opt;
|
||||
this->initStyleOption(&opt);
|
||||
QRect handleRect = this->style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);
|
||||
QPoint point = this->mapToGlobal(handleRect.topLeft());
|
||||
QFontMetrics fontMetrics = QFontMetrics(this->font());
|
||||
QRect fontRect = fontMetrics.boundingRect(percent);
|
||||
|
||||
QToolTip::showText(point - QPoint(fontRect.width()/2 +3, fontRect.height() + 35), percent);
|
||||
return;
|
||||
}
|
||||
|
||||
bool UkmediaVolumeSlider::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched == this) {
|
||||
if (event->type() == QEvent::HoverEnter || event->type() == QEvent::KeyRelease
|
||||
|| event->type() == QEvent::MouseMove || event->type() == QEvent::MouseButtonRelease) {
|
||||
showTooltip();
|
||||
}
|
||||
} else {
|
||||
value = qRound(per*(this->maximum() - this->minimum())) + this->minimum();
|
||||
}
|
||||
this->setValue(value);
|
||||
//向父窗口发送自定义事件event type,这样就可以在父窗口中捕获这个事件进行处理
|
||||
QEvent evEvent(static_cast<QEvent::Type>(QEvent::User + 1));
|
||||
QCoreApplication::sendEvent(parentWidget(), &evEvent);
|
||||
}
|
||||
|
||||
void UkmediaVolumeSlider::mouseReleaseEvent(QMouseEvent *ev)
|
||||
{
|
||||
mouseClickFlag = true;
|
||||
QSlider::mouseReleaseEvent(ev);
|
||||
}
|
||||
void UkmediaVolumeSlider::wheelEvent(QWheelEvent* ev)
|
||||
{
|
||||
if(mouseClickFlag)
|
||||
QSlider::wheelEvent(ev);
|
||||
return QSlider::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void UkmediaVolumeSlider::initStyleOption(QStyleOptionSlider *option)
|
||||
|
@ -110,42 +89,6 @@ void UkmediaVolumeSlider::initStyleOption(QStyleOptionSlider *option)
|
|||
QSlider::initStyleOption(option);
|
||||
}
|
||||
|
||||
void UkmediaVolumeSlider::leaveEvent(QEvent *e)
|
||||
{
|
||||
if (state) {
|
||||
m_pTiplabel->hide();
|
||||
}
|
||||
mouseClickFlag = false;
|
||||
QSlider::leaveEvent(e);
|
||||
}
|
||||
|
||||
void UkmediaVolumeSlider::enterEvent(QEvent *e)
|
||||
{
|
||||
if (state) {
|
||||
m_pTiplabel->show();
|
||||
}
|
||||
}
|
||||
|
||||
void UkmediaVolumeSlider::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QRect rect;
|
||||
QStyleOptionSlider m_option;
|
||||
QSlider::paintEvent(e);
|
||||
if (state) {
|
||||
|
||||
this->initStyleOption(&m_option);
|
||||
rect = this->style()->subControlRect(QStyle::CC_Slider, &m_option,QStyle::SC_SliderHandle,this);
|
||||
QPoint gPos = this->mapToGlobal(rect.topLeft());
|
||||
QString percent;
|
||||
percent = QString::number(this->value());
|
||||
percent.append("%");
|
||||
m_pTiplabel->setText(percent);
|
||||
m_pTiplabel->move(gPos.x()-(m_pTiplabel->width()/2)+9,gPos.y()-m_pTiplabel->height()-1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
UkmediaVolumeSlider::~UkmediaVolumeSlider()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*
|
||||
|
@ -27,51 +27,34 @@
|
|||
#include <QLabel>
|
||||
#include <QMouseEvent>
|
||||
#include "titlelabel.h"
|
||||
#include "kslider.h"
|
||||
#include <QDomDocument>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QDebug>
|
||||
|
||||
using namespace kdk;
|
||||
|
||||
static QColor symbolic_color = Qt::gray;
|
||||
|
||||
class UkuiMediaSliderTipLabel:public QLabel
|
||||
class AudioSlider : public KSlider
|
||||
{
|
||||
public:
|
||||
UkuiMediaSliderTipLabel();
|
||||
~UkuiMediaSliderTipLabel();
|
||||
protected:
|
||||
void paintEvent(QPaintEvent*);
|
||||
public:
|
||||
AudioSlider(QWidget *parent = nullptr);
|
||||
~AudioSlider();
|
||||
};
|
||||
|
||||
class UkmediaVolumeSlider : public QSlider
|
||||
class UkmediaVolumeSlider : public KSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
// UkmediaVolumeSlider(QWidget *parent = nullptr);
|
||||
UkmediaVolumeSlider(QWidget *parent = nullptr,bool needTip = false);
|
||||
void initStyleOption(QStyleOptionSlider *option);
|
||||
UkmediaVolumeSlider(QWidget *parent = nullptr);
|
||||
~UkmediaVolumeSlider();
|
||||
private:
|
||||
UkuiMediaSliderTipLabel *m_pTiplabel;
|
||||
bool state = false;
|
||||
bool mouseClickFlag = false;
|
||||
bool mousePress =false;
|
||||
Q_SIGNALS:
|
||||
void silderPressedSignal(int);
|
||||
void initStyleOption(QStyleOptionSlider *option);
|
||||
void showTooltip();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *ev);
|
||||
void mouseReleaseEvent(QMouseEvent *ev);
|
||||
void mouseMoveEvent(QMouseEvent *e)
|
||||
{
|
||||
// setCursor(QCursor(Qt::OpenHandCursor));
|
||||
// m_displayLabel->move((this->width()-m_displayLabel->width())*this->value()/(this->maximum()-this->minimum()),3);
|
||||
QSlider::mouseMoveEvent(e);
|
||||
}
|
||||
void leaveEvent(QEvent *e);
|
||||
void wheelEvent(QWheelEvent* ev);
|
||||
void enterEvent(QEvent *e);
|
||||
void paintEvent(QPaintEvent *e);
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
ukui-media (3.1.0.2022+0310-ok2~1214) yangtze; urgency=medium
|
||||
|
||||
* 同步主线代码
|
||||
|
||||
-- pengziping <pengziping@pengziping.kylinos.cn> Wed, 14 Dec 2022 11:26:31 +0800
|
||||
|
||||
ukui-media (3.1.0.2022+0310-ok2~0824) yangtze; urgency=medium
|
||||
|
||||
* close-cd #136812 应用音量调节时,下方存在另一个滑动条
|
||||
|
|
|
@ -6,8 +6,6 @@ ukui-volume-control-applet-qt/data/img/* /usr/share/ukui-media/img
|
|||
ukui-volume-control-applet-qt/data/qss/* /usr/share/ukui-media/qss
|
||||
ukui-volume-control-applet-qt/data/sounds/ukui-sound.xml /usr/share/ukui-media/sounds
|
||||
ukui-volume-control-applet-qt/data/sounds/xunguang.xml /usr/share/sounds
|
||||
ukui-volume-control-applet-qt/data/sounds/*.ogg /usr/share/ukui-media/sounds
|
||||
ukui-volume-control-applet-qt/data/sounds/*.ogg /usr/share/sounds
|
||||
ukui-volume-control-applet-qt/data/org.ukui.audio.gschema.xml /usr/share/glib-2.0/schemas
|
||||
ukui-volume-control-applet-qt/data/org.ukui.sound.gschema.xml /usr/share/glib-2.0/schemas
|
||||
scripts/detection_output_mode.sh /usr/share/ukui-media/scripts
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
#ifndef FORMATS_H
|
||||
#define FORMATS_H 1
|
||||
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
|
||||
/* 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 */
|
|
@ -0,0 +1,77 @@
|
|||
#include "user_conf.h"
|
||||
#include "ukui_login_sound.h"
|
||||
#include <QDebug>
|
||||
#include <QString>
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
#include <ukui-log4qt.h>
|
||||
#include <QDir>
|
||||
|
||||
//开机音乐播放路径
|
||||
#define PLAY_STARTUP_WAV "/usr/share/ukui/ukui-session-manager/startup.wav"
|
||||
//默认音频设备
|
||||
#define DEFAULT_AUDIO_DEV "default"
|
||||
//声卡存放文件
|
||||
#define AUDIO_JSON "/.config/audio.json"
|
||||
//开机按钮选项
|
||||
#define IS_STARTUP_PLAY_JSON "/.config/startupMusic.json"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
initUkuiLog4qt("ukui-login-sound");
|
||||
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
//配置信息:设备、用户
|
||||
UserConf info;
|
||||
|
||||
//播放开机音乐
|
||||
UkuiLoginSound playback;
|
||||
|
||||
QFile file("/tmp/PlayStartupWav.json");
|
||||
if(!file.exists())
|
||||
{
|
||||
qDebug()<<"start up";
|
||||
qDebug()<<"create /tmp/PlayStartupWav.json";
|
||||
info.insertJson();
|
||||
|
||||
if((info.readLightdmConf()=="")&&(info.readLastUser()==""))
|
||||
{
|
||||
//1、装机第一次登录的情况,使用默认设备进行播放
|
||||
qDebug() << "1 First enter";
|
||||
playback.aplayMain(2,PLAY_STARTUP_WAV,DEFAULT_AUDIO_DEV);
|
||||
}else
|
||||
{
|
||||
QString userFilePath = "/home/";
|
||||
QString audioDEV = "default";
|
||||
|
||||
//判断用户是否开启开机音乐
|
||||
if(info.readLightdmConf()!="")
|
||||
{
|
||||
//2、存在自动登录用户的情况下,使用自动登录用户的设备进行播放
|
||||
userFilePath += info.readLightdmConf();
|
||||
audioDEV =info.readJson(userFilePath,AUDIO_JSON,"card");
|
||||
qDebug() << "2 user.readLightdmConf()!=null audioDEV: " << audioDEV <<" userFilePath:" << userFilePath;
|
||||
}
|
||||
else if(info.readLastUser()!="")
|
||||
{
|
||||
//3、没有自动登录用户的时候,使用上一次用户的播放设备
|
||||
userFilePath += info.readLastUser();
|
||||
audioDEV =info.readJson(userFilePath,AUDIO_JSON,"card");
|
||||
qDebug() << "3 user.readLastUser()!="" audioDEV: " << audioDEV << " readLastUserFile: " << userFilePath;
|
||||
}
|
||||
|
||||
QString StartupState = info.readJson(userFilePath,IS_STARTUP_PLAY_JSON,"startupPlayMusic");
|
||||
qDebug() << " StartupState" << StartupState << userFilePath << audioDEV;
|
||||
if(StartupState == "true")
|
||||
playback.aplayMain(2,PLAY_STARTUP_WAV,audioDEV.toLatin1().data());
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
qDebug() << "not first enter,so will not play startup.wav";
|
||||
}
|
||||
file.close();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
QT += core gui
|
||||
|
||||
#greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = ukui-login-sound
|
||||
|
||||
target.path = /usr/bin
|
||||
|
||||
CONFIG += \
|
||||
c++11 \
|
||||
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 += \
|
||||
main.cpp \
|
||||
ukui_login_sound.cpp \
|
||||
user_conf.cpp
|
||||
|
||||
HEADERS += \
|
||||
formats.h \
|
||||
ukui_login_sound.h \
|
||||
user_conf.h
|
||||
|
||||
PKGCONFIG += alsa
|
||||
|
||||
LIBS += -lukui-log4qt
|
||||
|
||||
|
||||
# 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 \
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,189 @@
|
|||
#ifndef APLAYPLAY_H
|
||||
#define APLAYPLAY_H
|
||||
|
||||
#define _GNU_SOURCE
|
||||
//#include "aconfig.h"
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#include <fcntl.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <time.h>
|
||||
#include <locale.h>
|
||||
#include <alsa/asoundlib.h>
|
||||
#include <assert.h>
|
||||
#include <termios.h>
|
||||
#include <signal.h>
|
||||
#include <poll.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <endian.h>
|
||||
#include "formats.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QObject>
|
||||
|
||||
#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 <asm/byteorder.h>
|
||||
#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 char *command;
|
||||
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 *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 QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
UkuiLoginSound(QObject *parent = nullptr);
|
||||
~UkuiLoginSound();
|
||||
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);
|
||||
|
||||
int aplayMain(int argc, char *filename,char *playdev);
|
||||
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
|
|
@ -0,0 +1,104 @@
|
|||
#include "user_conf.h".h"
|
||||
|
||||
#define LIGHTDM_CONF_FILE "/etc/lightdm/lightdm.conf"
|
||||
#define UKUI_GREETER_CONF_FILE "/var/lib/lightdm/.cache/ukui-greeter.conf"
|
||||
|
||||
//存放于用户目录 /home/username/.config/audio.json
|
||||
|
||||
UserConf::UserConf(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QString UserConf::readJson(QString username,QString jsonFile,QString key)
|
||||
{
|
||||
QString filename = username;
|
||||
filename += jsonFile;
|
||||
qDebug() << "readJson filename" << filename;
|
||||
|
||||
QFile file(filename);
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||
qDebug() << "can't open error!";
|
||||
return "can't open error!";
|
||||
}
|
||||
|
||||
// 读取文件的全部内容
|
||||
QTextStream stream(&file);
|
||||
stream.setCodec("UTF-8"); // 设置读取编码是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 "Json格式错误!";
|
||||
}
|
||||
|
||||
QJsonObject rootObj = doc.object();
|
||||
|
||||
//获取键值对
|
||||
QJsonValue card = rootObj.value(key);
|
||||
|
||||
return card.toString();
|
||||
}
|
||||
|
||||
void UserConf::insertJson()
|
||||
{
|
||||
QJsonObject rootObj;
|
||||
// 插入元素
|
||||
|
||||
rootObj.insert("First", "yes"); //是否为第一次开机
|
||||
// 将json对象里的数据转换为字符串
|
||||
QJsonDocument doc;
|
||||
// 将object设置为本文档的主要对象
|
||||
doc.setObject(rootObj);
|
||||
|
||||
QFile file("/tmp/PlayStartupWav.json");
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||
qDebug() << "can't open error!";
|
||||
return;
|
||||
}
|
||||
|
||||
QTextStream stream(&file);
|
||||
stream.setCodec("UTF-8"); // 设置写入编码是UTF8
|
||||
// 写入文件
|
||||
stream << doc.toJson();
|
||||
file.close();
|
||||
|
||||
}
|
||||
|
||||
QString UserConf::readLightdmConf()
|
||||
{
|
||||
//Qt中使用QSettings类读写conf文件
|
||||
//QSettings构造函数的第一个参数是conf文件的路径,第二个参数表示针对conf文件,第三个参数可以省略
|
||||
settings = new QSettings(LIGHTDM_CONF_FILE,QSettings::IniFormat);
|
||||
|
||||
// 通过value获取值
|
||||
// 格式: settings->value(""节名/键名"");
|
||||
settings->value("SeatDefaults/autologin-user");
|
||||
|
||||
return settings->value("SeatDefaults/autologin-user").toString();
|
||||
}
|
||||
|
||||
QString UserConf::readLastUser()
|
||||
{
|
||||
//Qt中使用QSettings类读写conf文件
|
||||
//QSettings构造函数的第一个参数是conf文件的路径,第二个参数表示针对conf文件,第三个参数可以省略
|
||||
settings = new QSettings(UKUI_GREETER_CONF_FILE,QSettings::IniFormat);
|
||||
|
||||
// 通过value获取值 格式: settings->value(""节名/键名"");
|
||||
settings->value("Greeter/lastLoginUser");
|
||||
|
||||
return settings->value("Greeter/lastLoginUser").toString();
|
||||
}
|
||||
|
||||
UserConf::~UserConf()
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef AUDIOJSON_H
|
||||
#define AUDIOJSON_H
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <qjsondocument.h>
|
||||
#include <qjsonobject.h>
|
||||
#include <qbytearray.h>
|
||||
#include <qstring.h>
|
||||
#include <QSettings>
|
||||
#include <QObject>
|
||||
|
||||
class UserConf : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UserConf(QObject *parent = nullptr);
|
||||
~UserConf();
|
||||
|
||||
QString readJson(QString username, QString jsonFile,QString key);
|
||||
void insertJson();
|
||||
|
||||
QString readLightdmConf();
|
||||
QString readLastUser();
|
||||
|
||||
// 配置文件对象
|
||||
QSettings *settings;
|
||||
};
|
||||
|
||||
#endif // AUDIOJSON_H
|
|
@ -16,9 +16,9 @@ UkuiMediaControlLed::UkuiMediaControlLed()
|
|||
|
||||
void UkuiMediaControlLed::outputMuteChanged(QString str)
|
||||
{
|
||||
QDir dir("/sys/class/leds/platform::mute/brightness");
|
||||
QFile file("/sys/class/leds/platform::mute/brightness");
|
||||
|
||||
if(!dir.exists()){
|
||||
if(!file.exists()){
|
||||
qDebug() << " THE DIRECTORY OR FILE IS NOT EXIST ";
|
||||
return;
|
||||
}
|
||||
|
@ -38,9 +38,9 @@ void UkuiMediaControlLed::outputMuteChanged(QString str)
|
|||
|
||||
void UkuiMediaControlLed::inputMuteChanged(QString str)
|
||||
{
|
||||
QDir dir("/sys/class/leds/platform::micmute/brightness");
|
||||
QFile file("/sys/class/leds/platform::micmute/brightness");
|
||||
|
||||
if(!dir.exists()){
|
||||
if(!file.exists()){
|
||||
qDebug() << " THE DIRECTORY OR FILE IS NOT EXIST ";
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ CONFIG += ordered
|
|||
SUBDIRS = \
|
||||
audio \
|
||||
ukui-volume-control-applet-qt \
|
||||
ukui-media-control-led
|
||||
ukui-media-control-led \
|
||||
ukui-login-sound
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<description>Whether to play sounds on user events.</description>
|
||||
</key>
|
||||
<key name="theme-name" type="s">
|
||||
<default>'ukui-xunguang'</default>
|
||||
<default>'Light-Seeking'</default>
|
||||
<summary>Sound theme name</summary>
|
||||
<description>The XDG sound theme to use for event sounds.</description>
|
||||
</key>
|
||||
|
@ -40,5 +40,15 @@
|
|||
<summary>Volume Increase</summary>
|
||||
<description>Output volume Increase</description>
|
||||
</key>
|
||||
<key name="volume-increase-value" type="i">
|
||||
<default>125</default>
|
||||
<summary>Volume Increase's value</summary>
|
||||
<description>Output volume Increase's Value</description>
|
||||
</key>
|
||||
<key name="startup-music" type="b">
|
||||
<default>true</default>
|
||||
<summary>startup music</summary>
|
||||
<description>Whether to play startup music</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,67 +1,52 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
<soundEffect>
|
||||
<device-connected>
|
||||
<filename>deviceconnected</filename>
|
||||
</device-connected>
|
||||
<device-disconnected>
|
||||
<filename>devicedisconnected</filename>
|
||||
</device-disconnected>
|
||||
<network-connected>
|
||||
<filename>networkconnected</filename>
|
||||
</network-connected>
|
||||
<network-disconnected>
|
||||
<filename>networkdisconnected</filename>
|
||||
</network-disconnected>
|
||||
<network-wrong>
|
||||
<filename>networkwrong</filename>
|
||||
</network-wrong>
|
||||
<prompt-box-succeed>
|
||||
<filename>promptboxsucceed</filename>
|
||||
</prompt-box-succeed>
|
||||
<prompt-box-warning>
|
||||
<filename>promptboxwarning</filename>
|
||||
</prompt-box-warning>
|
||||
<prompt-box-failed>
|
||||
<filename>promptboxfailed</filename>
|
||||
</prompt-box-failed>
|
||||
<recycle-bin-clear>
|
||||
<filename>recyclebinclear</filename>
|
||||
</recycle-bin-clear>
|
||||
<recycle-bin-delete>
|
||||
<filename>recyclebindelete</filename>
|
||||
</recycle-bin-delete>
|
||||
<copyormove-succeed>
|
||||
<filename>copyormovesucceed</filename>
|
||||
</copyormove-succeed>
|
||||
<copyormove-failed>
|
||||
<filename>copyormovefailed</filename>
|
||||
</copyormove-failed>
|
||||
<photo>
|
||||
<filename>photo</filename>
|
||||
</photo>
|
||||
<record-start>
|
||||
<filename>recordstart</filename>
|
||||
</record-start>
|
||||
<record-finish>
|
||||
<filename>recordfinish</filename>
|
||||
</record-finish>
|
||||
<prtsc-start>
|
||||
<filename>prtscstart</filename>
|
||||
</prtsc-start>
|
||||
<prtsc-finish>
|
||||
<filename>prtscfinish</filename>
|
||||
</prtsc-finish>
|
||||
<volume-change>
|
||||
<filename>volumechange</filename>
|
||||
</volume-change>
|
||||
<low-power>
|
||||
<filename>lowpower</filename>
|
||||
</low-power>
|
||||
<generic-notification>
|
||||
<filename>genericnotification</filename>
|
||||
</generic-notification>
|
||||
<special-notification>
|
||||
<filename>specialnotification</filename>
|
||||
</special-notification>
|
||||
<dialog-complete>
|
||||
<filename>dialogcomplete</filename>
|
||||
</dialog-complete>
|
||||
<dialog-warning>
|
||||
<filename>dialogwarning</filename>
|
||||
</dialog-warning>
|
||||
<dialog-error>
|
||||
<filename>dialogerror</filename>
|
||||
</dialog-error>
|
||||
<devconnection-succeed>
|
||||
<filename>devconnectionsucceeded</filename>
|
||||
</devconnection-succeed>
|
||||
<devconnection-failed>
|
||||
<filename>devconnectionfailed</filename>
|
||||
</devconnection-failed>
|
||||
<devconnection-break>
|
||||
<filename>devconnectionbreak</filename>
|
||||
</devconnection-break>
|
||||
<power-connected>
|
||||
<filename>powerconnected</filename>
|
||||
</power-connected>
|
||||
<power-disconnected>
|
||||
<filename>powerdisconnected</filename>
|
||||
</power-disconnected>
|
||||
<low-power>
|
||||
<filename>lowpower</filename>
|
||||
</low-power>
|
||||
<volume-change>
|
||||
<filename>volumechange</filename>
|
||||
</volume-change>
|
||||
<copyormove-succeed>
|
||||
<filename>copyormovesucceed</filename>
|
||||
</copyormove-succeed>
|
||||
<recycle-bin-clear>
|
||||
<filename>recyclebinclear</filename>
|
||||
</recycle-bin-clear>
|
||||
<operation-notsupported>
|
||||
<filename>operationnotsupported</filename>
|
||||
</operation-notsupported>
|
||||
<photo>
|
||||
<filename>photo</filename>
|
||||
</photo>
|
||||
<screen>
|
||||
<filename>screen</filename>
|
||||
</screen>
|
||||
</soundEffect>
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp org.ukui.media.xml -i ukmedia_main_widget.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 <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
/*
|
||||
* Implementation of adaptor class MediaAdaptor
|
||||
*/
|
||||
|
||||
MediaAdaptor::MediaAdaptor(QObject *parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
// constructor
|
||||
setAutoRelaySignals(true);
|
||||
}
|
||||
|
||||
MediaAdaptor::~MediaAdaptor()
|
||||
{
|
||||
// destructor
|
||||
}
|
||||
|
||||
QStringList MediaAdaptor::getAllInputDevices()
|
||||
{
|
||||
// handle method call org.ukui.media.getAllInputDevices
|
||||
QStringList out0;
|
||||
QMetaObject::invokeMethod(parent(), "getAllInputDevices", Q_RETURN_ARG(QStringList, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
QStringList MediaAdaptor::getAllOutputDevices()
|
||||
{
|
||||
// handle method call org.ukui.media.getAllOutputDevices
|
||||
QStringList out0;
|
||||
QMetaObject::invokeMethod(parent(), "getAllOutputDevices", Q_RETURN_ARG(QStringList, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
QString MediaAdaptor::getDefaultInputDevice()
|
||||
{
|
||||
// handle method call org.ukui.media.getDefaultInputDevice
|
||||
QString out0;
|
||||
QMetaObject::invokeMethod(parent(), "getDefaultInputDevice", Q_RETURN_ARG(QString, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool MediaAdaptor::getDefaultInputMuteState()
|
||||
{
|
||||
// handle method call org.ukui.media.getDefaultInputMuteState
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "getDefaultInputMuteState", Q_RETURN_ARG(bool, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
int MediaAdaptor::getDefaultInputVolume()
|
||||
{
|
||||
// handle method call org.ukui.media.getDefaultInputVolume
|
||||
int out0;
|
||||
QMetaObject::invokeMethod(parent(), "getDefaultInputVolume", Q_RETURN_ARG(int, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
QString MediaAdaptor::getDefaultOutputDevice()
|
||||
{
|
||||
// handle method call org.ukui.media.getDefaultOutputDevice
|
||||
QString out0;
|
||||
QMetaObject::invokeMethod(parent(), "getDefaultOutputDevice", Q_RETURN_ARG(QString, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool MediaAdaptor::getDefaultOutputMuteState()
|
||||
{
|
||||
// handle method call org.ukui.media.getDefaultOutputMuteState
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "getDefaultOutputMuteState", Q_RETURN_ARG(bool, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
int MediaAdaptor::getDefaultOutputVolume()
|
||||
{
|
||||
// handle method call org.ukui.media.getDefaultOutputVolume
|
||||
int out0;
|
||||
QMetaObject::invokeMethod(parent(), "getDefaultOutputVolume", Q_RETURN_ARG(int, out0));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool MediaAdaptor::setDefaultInputDevice(const QString &deviceName)
|
||||
{
|
||||
// handle method call org.ukui.media.setDefaultInputDevice
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "setDefaultInputDevice", Q_RETURN_ARG(bool, out0), Q_ARG(QString, deviceName));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool MediaAdaptor::setDefaultInputMuteState(bool mute)
|
||||
{
|
||||
// handle method call org.ukui.media.setDefaultInputMuteState
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "setDefaultInputMuteState", Q_RETURN_ARG(bool, out0), Q_ARG(bool, mute));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool MediaAdaptor::setDefaultInputVolume(int value)
|
||||
{
|
||||
// handle method call org.ukui.media.setDefaultInputVolume
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "setDefaultInputVolume", Q_RETURN_ARG(bool, out0), Q_ARG(int, value));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool MediaAdaptor::setDefaultOutputDevice(const QString &deviceName)
|
||||
{
|
||||
// handle method call org.ukui.media.setDefaultOutputDevice
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "setDefaultOutputDevice", Q_RETURN_ARG(bool, out0), Q_ARG(QString, deviceName));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool MediaAdaptor::setDefaultOutputMuteState(bool mute)
|
||||
{
|
||||
// handle method call org.ukui.media.setDefaultOutputMuteState
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "setDefaultOutputMuteState", Q_RETURN_ARG(bool, out0), Q_ARG(bool, mute));
|
||||
return out0;
|
||||
}
|
||||
|
||||
bool MediaAdaptor::setDefaultOutputVolume(int value)
|
||||
{
|
||||
// handle method call org.ukui.media.setDefaultOutputVolume
|
||||
bool out0;
|
||||
QMetaObject::invokeMethod(parent(), "setDefaultOutputVolume", Q_RETURN_ARG(bool, out0), Q_ARG(int, value));
|
||||
return out0;
|
||||
}
|
||||
|
||||
int MediaAdaptor::getBatteryLevel(const QString &deviceName)
|
||||
{
|
||||
// handle method call org.ukui.media.bluetooth.getBatteryLevel
|
||||
int out0;
|
||||
QMetaObject::invokeMethod(parent(), "getBatteryLevel", Q_RETURN_ARG(int, out0), Q_ARG(QString, deviceName));
|
||||
return out0;
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp org.ukui.media.xml -i ukmedia_main_widget.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 <QtCore/QObject>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include "ukmedia_main_widget.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
/*
|
||||
* Adaptor class for interface org.ukui.media
|
||||
*/
|
||||
class MediaAdaptor: public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.ukui.media")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.ukui.media\">\n"
|
||||
" <method name=\"getDefaultOutputDevice\">\n"
|
||||
" <arg direction=\"out\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"getDefaultInputDevice\">\n"
|
||||
" <arg direction=\"out\" type=\"s\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"getAllOutputDevices\">\n"
|
||||
" <arg direction=\"out\" type=\"as\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"getAllInputDevices\">\n"
|
||||
" <arg direction=\"out\" type=\"as\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"getDefaultOutputVolume\">\n"
|
||||
" <arg direction=\"out\" type=\"i\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"getDefaultInputVolume\">\n"
|
||||
" <arg direction=\"out\" type=\"i\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"getDefaultOutputMuteState\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"getDefaultInputMuteState\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"setDefaultOutputVolume\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"value\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"setDefaultInputVolume\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"value\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"setDefaultOutputMuteState\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"mute\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"setDefaultInputMuteState\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"b\" name=\"mute\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"setDefaultOutputDevice\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"deviceName\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"setDefaultInputDevice\">\n"
|
||||
" <arg direction=\"out\" type=\"b\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"deviceName\"/>\n"
|
||||
" </method>\n"
|
||||
" </interface>\n"
|
||||
" <interface name=\"org.ukui.media.bluetooth\">\n"
|
||||
" <method name=\"getBatteryLevel\">\n"
|
||||
" <arg direction=\"out\" type=\"i\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"deviceName\"/>\n"
|
||||
" </method>\n"
|
||||
" <signal name=\"batteryChanged\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"device\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"battery\"/>\n"
|
||||
" </signal>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
MediaAdaptor(QObject *parent);
|
||||
virtual ~MediaAdaptor();
|
||||
|
||||
public: // PROPERTIES
|
||||
public Q_SLOTS: // METHODS
|
||||
QStringList getAllInputDevices();
|
||||
QStringList getAllOutputDevices();
|
||||
QString getDefaultInputDevice();
|
||||
bool getDefaultInputMuteState();
|
||||
int getDefaultInputVolume();
|
||||
QString getDefaultOutputDevice();
|
||||
bool getDefaultOutputMuteState();
|
||||
int getDefaultOutputVolume();
|
||||
bool setDefaultInputDevice(const QString &deviceName);
|
||||
bool setDefaultInputMuteState(bool mute);
|
||||
bool setDefaultInputVolume(int value);
|
||||
bool setDefaultOutputDevice(const QString &deviceName);
|
||||
bool setDefaultOutputMuteState(bool mute);
|
||||
bool setDefaultOutputVolume(int value);
|
||||
int getBatteryLevel(const QString &deviceName);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
void batteryChanged(const QString &device, int battery);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,7 @@
|
|||
INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/dbus-adaptor.h \
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/dbus-adaptor.cpp \
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="org.ukui.media">
|
||||
<method name="getDefaultOutputDevice">
|
||||
<arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="getDefaultInputDevice">
|
||||
<arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="getAllOutputDevices">
|
||||
<arg type="as" direction="out"/>
|
||||
</method>
|
||||
<method name="getAllInputDevices">
|
||||
<arg type="as" direction="out"/>
|
||||
</method>
|
||||
<method name="getDefaultOutputVolume">
|
||||
<arg type="i" direction="out"/>
|
||||
</method>
|
||||
<method name="getDefaultInputVolume">
|
||||
<arg type="i" direction="out"/>
|
||||
</method>
|
||||
<method name="getDefaultOutputMuteState">
|
||||
<arg type="b" direction="out"/>
|
||||
</method>
|
||||
<method name="getDefaultInputMuteState">
|
||||
<arg type="b" direction="out"/>
|
||||
</method>
|
||||
<method name="setDefaultOutputVolume">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="value" type="i" direction="in"/>
|
||||
</method>
|
||||
<method name="setDefaultInputVolume">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="value" type="i" direction="in"/>
|
||||
</method>
|
||||
<method name="setDefaultOutputMuteState">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="mute" type="b" direction="in"/>
|
||||
</method>
|
||||
<method name="setDefaultInputMuteState">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="mute" type="b" direction="in"/>
|
||||
</method>
|
||||
<method name="setDefaultOutputDevice">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="deviceName" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="setDefaultInputDevice">
|
||||
<arg type="b" direction="out"/>
|
||||
<arg name="deviceName" type="s" direction="in"/>
|
||||
</method>
|
||||
</interface>
|
||||
<interface name="org.ukui.media.bluetooth">
|
||||
<method name="getBatteryLevel">
|
||||
<arg direction="out" type="i"/>
|
||||
<arg direction="in" type="s" name="deviceName"/>
|
||||
</method>
|
||||
<signal name="batteryChanged">
|
||||
</signal>
|
||||
</interface>
|
||||
</node>
|
|
@ -1 +0,0 @@
|
|||
<クdハ<>箆!ソ`。スン
|
|
@ -1,369 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1">
|
||||
<context>
|
||||
<name>ApplicationVolumeWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="27"/>
|
||||
<source>Application Volume</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="29"/>
|
||||
<source>System Volume</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="81"/>
|
||||
<source>Sound Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1668"/>
|
||||
<source>pa_context_subscribe() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1691"/>
|
||||
<source>pa_context_get_card_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1698"/>
|
||||
<source>pa_context_get_sink_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1705"/>
|
||||
<source>pa_context_get_source_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1426"/>
|
||||
<source>Failed to initialize stream_restore extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1441"/>
|
||||
<source>pa_ext_stream_restore_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1540"/>
|
||||
<source>pa_context_get_sink_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1554"/>
|
||||
<source>pa_context_get_source_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1628"/>
|
||||
<source>pa_context_get_card_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1171"/>
|
||||
<source>Card callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1199"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1281"/>
|
||||
<source>Sink callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1301"/>
|
||||
<source>Source callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="86"/>
|
||||
<source>Fatal Error: Unable to connect to PulseAudio</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="193"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1603"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1677"/>
|
||||
<source>pa_context_get_server_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1321"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1851"/>
|
||||
<source>Sink input callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1340"/>
|
||||
<source>Source output callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1359"/>
|
||||
<source>Client callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1375"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1401"/>
|
||||
<source>Server info callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1459"/>
|
||||
<source>Failed to initialize device restore extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1480"/>
|
||||
<source>pa_ext_device_restore_read_sink_formats() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1498"/>
|
||||
<source>Failed to initialize device manager extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1517"/>
|
||||
<source>pa_ext_device_manager_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1567"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1580"/>
|
||||
<source>pa_context_get_sink_input_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1593"/>
|
||||
<source>pa_context_get_client_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1684"/>
|
||||
<source>pa_context_client_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1711"/>
|
||||
<source>pa_context_get_sink_input_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1718"/>
|
||||
<source>pa_context_get_source_output_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1733"/>
|
||||
<source>Connection failed, attempting reconnect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1752"/>
|
||||
<source>Ukui Media Volume Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaMainWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="103"/>
|
||||
<source>Output volume control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="105"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="107"/>
|
||||
<source>Sound preference(S)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="165"/>
|
||||
<source>System Volume</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="167"/>
|
||||
<source>App Volume</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="959"/>
|
||||
<source>Current volume:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaSystemVolumeWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="57"/>
|
||||
<source>Volume</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="68"/>
|
||||
<source>Output</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="84"/>
|
||||
<source>Sound Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaVolumeControl</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="97"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="119"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="123"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="135"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="153"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="236"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="240"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="252"/>
|
||||
<source>pa_context_set_sink_volume_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="269"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="273"/>
|
||||
<source>pa_context_set_source_output_volume() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="285"/>
|
||||
<source>pa_context_set_source_output_mute() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="297"/>
|
||||
<source>pa_context_set_card_profile_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="311"/>
|
||||
<source>pa_context_set_default_sink() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="327"/>
|
||||
<source>pa_context_set_default_source() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="341"/>
|
||||
<source>pa_context_set_sink_port_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="355"/>
|
||||
<source>pa_context_set_source_port_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="368"/>
|
||||
<source>pa_context_kill_sink_input() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="397"/>
|
||||
<source> (plugged in)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="401"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="532"/>
|
||||
<source> (unavailable)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="403"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="529"/>
|
||||
<source> (unplugged)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="680"/>
|
||||
<source>Failed to read data from stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="722"/>
|
||||
<source>Peak detect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="723"/>
|
||||
<source>Failed to create monitoring stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="738"/>
|
||||
<source>Failed to connect monitoring stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="853"/>
|
||||
<source>Ignoring sink-input due to it being designated as an event and thus handled by the Event widget</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1142"/>
|
||||
<source>Establishing connection to PulseAudio. Please wait...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1384"/>
|
||||
<source>pa_context_get_sink_info_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1388"/>
|
||||
<source>pa_context_get_source_info_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkuiMediaSetHeadsetWidget</name>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="36"/>
|
||||
<source>Sound Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="37"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="38"/>
|
||||
<source>Select Sound Device</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="66"/>
|
||||
<source>Headphone</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="67"/>
|
||||
<source>Headset</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="68"/>
|
||||
<source>Microphone</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
Binary file not shown.
|
@ -0,0 +1,473 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="bo_CN">
|
||||
<context>
|
||||
<name>ApplicationVolumeWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="28"/>
|
||||
<source>Application Volume</source>
|
||||
<translation>བཀོལ་སྤྱོད་བྱེད་ཚད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="30"/>
|
||||
<source>System Volume</source>
|
||||
<translation>མ་ལག་གི་བོངས་ཚད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="82"/>
|
||||
<source>Sound Settings</source>
|
||||
<translation>སྒྲའི་སྒྲིག་བཀོད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DeviceSwitchWidget</name>
|
||||
<message>
|
||||
<source>Go Into Mini Mode</source>
|
||||
<translation type="vanished">进入Mini模式</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Output volume control</source>
|
||||
<translation type="vanished">输出音量控制</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Mute</source>
|
||||
<translation type="vanished">静音</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sound preference(S)</source>
|
||||
<translation type="vanished">声音首选项</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Device Volume</source>
|
||||
<translation type="vanished">设备音量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application Volume</source>
|
||||
<translation type="vanished">应用音量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>is using</source>
|
||||
<translation type="vanished">正在使用</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth</source>
|
||||
<translation type="vanished">蓝牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="vanished">错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to connect to the sound system, please check whether the pulseaudio service is running!</source>
|
||||
<translation type="vanished">无法连接到系统声音,请检查pulseaudio服务是否正在运行!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Dummy output</source>
|
||||
<translation type="vanished">伪输出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Speaker (Realtek Audio)</source>
|
||||
<translation type="vanished">扬声器(Realtek Audio)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Headphone</source>
|
||||
<translation type="vanished">模拟耳机</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1709"/>
|
||||
<source>pa_context_subscribe() failed</source>
|
||||
<translation>pa_context_subscribe()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1732"/>
|
||||
<source>pa_context_get_card_info_list() failed</source>
|
||||
<translation>pa_context_get_card_info_list()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1739"/>
|
||||
<source>pa_context_get_sink_info_list() failed</source>
|
||||
<translation>pa_context_get_sink_info_list()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1746"/>
|
||||
<source>pa_context_get_source_info_list() failed</source>
|
||||
<translation>pa_context_get_source_info_list()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1472"/>
|
||||
<source>Failed to initialize stream_restore extension: %s</source>
|
||||
<translation>stream_restore་རིང་དུ་གཏོང་བའི་ཐོག་མའི་དུས་ཚོད་ལ་སླེབས་མ་ཐུབ་པ། %s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1487"/>
|
||||
<source>pa_ext_stream_restore_read() failed</source>
|
||||
<translation>pa_ext_stream_restore_read()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1580"/>
|
||||
<source>pa_context_get_sink_info_by_index() failed</source>
|
||||
<translation>pa_context_get_sink_info_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1593"/>
|
||||
<source>pa_context_get_source_info_by_index() failed</source>
|
||||
<translation>pa_context_get_source_info_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1669"/>
|
||||
<source>pa_context_get_card_info_by_index() failed</source>
|
||||
<translation>pa_context_get_card_info_by_index()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1177"/>
|
||||
<source>Card callback failure</source>
|
||||
<translation>བྱང་བུ་ཕྱིར་སློག་བྱེད་མ་ཐུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1205"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1325"/>
|
||||
<source>Sink callback failure</source>
|
||||
<translation>ཕྱིར་ལྡོག་བྱེད་པར་ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1284"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1345"/>
|
||||
<source>Source callback failure</source>
|
||||
<translation>འབྱུང་ཁུངས་ཕྱིར་ལྡོག་བྱེད་མ་ཐུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="86"/>
|
||||
<source>Fatal Error: Unable to connect to PulseAudio</source>
|
||||
<translation>སྲོག་ལ་ཐུག་པའི་ནོར་འཁྲུལ། ཕུའུ་ལུའུ་ཧྲི་ཨོ་ཏོ་དང་འབྲེལ་མཐུད་བྱེད་ཐབས་བྲལ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="200"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1642"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1718"/>
|
||||
<source>pa_context_get_server_info() failed</source>
|
||||
<translation>pa_context_get_server_info()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1366"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1862"/>
|
||||
<source>Sink input callback failure</source>
|
||||
<translation>མ་དངུལ་འཇོག་པའི་ཕྱིར་ལྡོག་ལ་ཕམ་ཉེས་བྱུང</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1385"/>
|
||||
<source>Source output callback failure</source>
|
||||
<translation>འབྱུང་ཁུངས་ཕྱིར་ལྡོག་བྱེད་པར་ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1404"/>
|
||||
<source>Client callback failure</source>
|
||||
<translation>མངགས་བཅོལ་བྱེད་མཁན་གྱིས་ཕྱིར་སློག་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1420"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1447"/>
|
||||
<source>Server info callback failure</source>
|
||||
<translation>ཞབས་ཞུའི་ཡོ་བྱད་ཀྱི་ཆ་འཕྲིན་ཕྱིར་ལྡོག་བྱེད་མ་ཐུབ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1505"/>
|
||||
<source>Failed to initialize device restore extension: %s</source>
|
||||
<translation>设备恢复扩展%s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1526"/>
|
||||
<source>pa_ext_device_restore_read_sink_formats() failed</source>
|
||||
<translation>pa_ext_device_restore_read_sink_formats()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1544"/>
|
||||
<source>Failed to initialize device manager extension: %s</source>
|
||||
<translation>སྒྲིག་ཆས་དོ་དམ་གྱི་དུས་འགྱངས་ལ་ཐོག་མའི་དུས་འགྱངས་བྱེད་མ་ཐུབ་པ། %s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1563"/>
|
||||
<source>pa_ext_device_manager_read() failed</source>
|
||||
<translation>pa_ext_device_manager_read()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1606"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1619"/>
|
||||
<source>pa_context_get_sink_input_info() failed</source>
|
||||
<translation>pa_context_get_sink_input_info()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1632"/>
|
||||
<source>pa_context_get_client_info() failed</source>
|
||||
<translation>pa_context_get_client_info()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1725"/>
|
||||
<source>pa_context_client_info_list() failed</source>
|
||||
<translation>pa_context_client_info_list()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1752"/>
|
||||
<source>pa_context_get_sink_input_info_list() failed</source>
|
||||
<translation>pa_context_get_sink_input_info_list()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1759"/>
|
||||
<source>pa_context_get_source_output_info_list() failed</source>
|
||||
<translation>pa_context_get_source_output_info_list()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1774"/>
|
||||
<source>Connection failed, attempting reconnect</source>
|
||||
<translation>འབྲེལ་མཐུད་བྱེད་མ་ཐུབ་པར་ཡང་བསྐྱར་འབྲེལ་མཐུད་བྱེད་རྩིས་བྱས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1793"/>
|
||||
<source>moduleInfoCb callback failure</source>
|
||||
<translation>moduleInfoCb ཕྱིར་ལྡོག་བྱེད་པར་ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1810"/>
|
||||
<source>Ukui Media Volume Control</source>
|
||||
<translation>ཝུའུ་ཁི་ལན་གྱི་སྨྱན་སྦྱོར་གྱི་བོངས་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3280"/>
|
||||
<source>pa_context_load_module() failed</source>
|
||||
<translation>pa_context_load_module()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaDeviceWidget</name>
|
||||
<message>
|
||||
<source>Input Device</source>
|
||||
<translation type="vanished">输入设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Microphone</source>
|
||||
<translation type="vanished">麦克风</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Output Device</source>
|
||||
<translation type="vanished">输出设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Speaker Realtek Audio</source>
|
||||
<translation type="vanished">扬声器(Realtek Audio)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Input device can not be detected</source>
|
||||
<translation type="vanished">无法检测到输入设备</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaMainWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="107"/>
|
||||
<source>Output volume control</source>
|
||||
<translation>ཐོན་ཚད་ཚོད་འཛིན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Mute</source>
|
||||
<translation type="vanished">静音</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="109"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="111"/>
|
||||
<source>Sound preference(S)</source>
|
||||
<translation>སྒྲ་གདངས་ཀྱི་དགའ་ཕྱོགས་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="172"/>
|
||||
<source>System Volume</source>
|
||||
<translation>མ་ལག་གི་བོངས་ཚད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="174"/>
|
||||
<source>App Volume</source>
|
||||
<translation>ཉེར་སྤྱོད་གྲངས་འབོར།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="1078"/>
|
||||
<source>Current volume:</source>
|
||||
<translation>མིག་སྔའི་བོངས་ཚད་ནི།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaMiniMasterVolumeWidget</name>
|
||||
<message>
|
||||
<source>Speaker (Realtek Audio)</source>
|
||||
<translation type="vanished">扬声器(Realtek Audio)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Go Into Full Mode</source>
|
||||
<translation type="vanished">进入完整模式</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaSystemVolumeWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="58"/>
|
||||
<source>Volume</source>
|
||||
<translation>བོངས་ཚད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="69"/>
|
||||
<source>Output</source>
|
||||
<translation>ཐོན་ཚད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="85"/>
|
||||
<source>Sound Settings</source>
|
||||
<translation>སྒྲའི་སྒྲིག་བཀོད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaVolumeControl</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="97"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="121"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="125"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="138"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="160"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="252"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="256"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="269"/>
|
||||
<source>pa_context_set_sink_volume_by_index() failed</source>
|
||||
<translation>pa_context_set_sink_volume_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="287"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="291"/>
|
||||
<source>pa_context_set_source_output_volume() failed</source>
|
||||
<translation>pa_context_set_source_output_volume()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="304"/>
|
||||
<source>pa_context_set_source_output_mute() failed</source>
|
||||
<translation>pa_context_set_source_output_mute()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="317"/>
|
||||
<source>pa_context_set_card_profile_by_index() failed</source>
|
||||
<translation>pa_context_set_card_profile_by_index()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="333"/>
|
||||
<source>pa_context_set_default_sink() failed</source>
|
||||
<translation>pa_context_set_default_sink()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="349"/>
|
||||
<source>pa_context_set_default_source() failed</source>
|
||||
<translation>pa_context_set_default_source()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="365"/>
|
||||
<source>pa_context_set_sink_port_by_name() failed</source>
|
||||
<translation>pa_context_set_sink_port_by_name()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="380"/>
|
||||
<source>pa_context_set_source_port_by_name() failed</source>
|
||||
<translation>pa_context_set_source_port_by_name()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="393"/>
|
||||
<source>pa_context_kill_sink_input() failed</source>
|
||||
<translation>pa_context_kill_sink_input()ཕམ་ཉེས་བྱུང་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="422"/>
|
||||
<source> (plugged in)</source>
|
||||
<translation> (ནང་དུ་བཅུག་པ་)།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="426"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="561"/>
|
||||
<source> (unavailable)</source>
|
||||
<translation> (སྤྱོད་གོ་མི་ཆོད་པ)།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="428"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="558"/>
|
||||
<source> (unplugged)</source>
|
||||
<translation> (ཁ་ཐོར་ཡ་བྲལ་དུ་སོང་བ་)།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="734"/>
|
||||
<source>Failed to read data from stream</source>
|
||||
<translation>ཆུ་ཕྲན་ནས་གཞི་གྲངས་ཀློག་མ་ཐུབ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="776"/>
|
||||
<source>Peak detect</source>
|
||||
<translation>ཡང་རྩེར་ཞིབ་དཔྱད་ཚད་ལེན</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="777"/>
|
||||
<source>Failed to create monitoring stream</source>
|
||||
<translation>ལྟ་ཞིབ་ཚད་ལེན་གྱི་ཆུ་ཕྲན་གསར་སྐྲུན་བྱེད་མ་ཐུབ་པ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="792"/>
|
||||
<source>Failed to connect monitoring stream</source>
|
||||
<translation>ལྟ་ཞིབ་ཚད་ལེན་གྱི་ཆུ་ཕྲན་སྦྲེལ་མཐུད་བྱེད་མ་ཐུབ་པ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="909"/>
|
||||
<source>Ignoring sink-input due to it being designated as an event and thus handled by the Event widget</source>
|
||||
<translation>དོན་རྐྱེན་ཞིག་ཏུ་བརྩིས་ནས་དོན་རྐྱེན་ཆུང་ཆུང་ཞིག་ཏུ་བརྩིས་ནས་ཐག་གཅོད་བྱས་པའི་རྐྱེན་གྱིས་ཆུ་ནང་དུ་འཛུལ་བར་སྣང་མེད་བྱས་པ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1148"/>
|
||||
<source>Establishing connection to PulseAudio. Please wait...</source>
|
||||
<translation>ཕུའུ་ལུའུ་ཧྲི་ཨོ་ཏོ་དང་འབྲེལ་བ་བཙུགས་པ་རེད། སྐུ་མཁྱེན་སྒུག་རོགས།...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1429"/>
|
||||
<source>pa_context_get_sink_info_by_name() failed</source>
|
||||
<translation>pa_context_get_sink_info_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1433"/>
|
||||
<source>pa_context_get_source_info_by_name() failed</source>
|
||||
<translation>pa_context_get_source_info_by_index()ཕམ་ཁ་བྱུང་བ་རེད།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkuiMediaSetHeadsetWidget</name>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="36"/>
|
||||
<source>Sound Settings</source>
|
||||
<translation>སྒྲའི་སྒྲིག་བཀོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="37"/>
|
||||
<source>Cancel</source>
|
||||
<translation>ཕྱིར་འཐེན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="38"/>
|
||||
<source>Select Sound Device</source>
|
||||
<translation>སྒྲའི་སྒྲིག་ཆས་བདམས་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="66"/>
|
||||
<source>Headphone</source>
|
||||
<translation>རྣ་ཉན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="67"/>
|
||||
<source>Headset</source>
|
||||
<translation>རྣ་ཉན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui_media_set_headset_widget.cpp" line="68"/>
|
||||
<source>Microphone</source>
|
||||
<translation>སྐད་སྦུག</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
|
@ -4,17 +4,17 @@
|
|||
<context>
|
||||
<name>ApplicationVolumeWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="27"/>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="28"/>
|
||||
<source>Application Volume</source>
|
||||
<translation>应用</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="29"/>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="30"/>
|
||||
<source>System Volume</source>
|
||||
<translation>系统音量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="81"/>
|
||||
<location filename="../ukmedia_application_volume_widget.cpp" line="82"/>
|
||||
<source>Sound Settings</source>
|
||||
<translation>声音设置</translation>
|
||||
</message>
|
||||
|
@ -77,63 +77,64 @@
|
|||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1668"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1709"/>
|
||||
<source>pa_context_subscribe() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1691"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1732"/>
|
||||
<source>pa_context_get_card_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1698"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1739"/>
|
||||
<source>pa_context_get_sink_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1705"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1746"/>
|
||||
<source>pa_context_get_source_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1426"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1472"/>
|
||||
<source>Failed to initialize stream_restore extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1441"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1487"/>
|
||||
<source>pa_ext_stream_restore_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1540"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1580"/>
|
||||
<source>pa_context_get_sink_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1554"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1593"/>
|
||||
<source>pa_context_get_source_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1628"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1669"/>
|
||||
<source>pa_context_get_card_info_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1171"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1177"/>
|
||||
<source>Card callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1199"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1281"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1205"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1325"/>
|
||||
<source>Sink callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1301"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1284"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1345"/>
|
||||
<source>Source callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -143,90 +144,100 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="193"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1603"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1677"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="200"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1642"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1718"/>
|
||||
<source>pa_context_get_server_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1321"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1851"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1366"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1862"/>
|
||||
<source>Sink input callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1340"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1385"/>
|
||||
<source>Source output callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1359"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1404"/>
|
||||
<source>Client callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1375"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1401"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1420"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1447"/>
|
||||
<source>Server info callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1459"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1505"/>
|
||||
<source>Failed to initialize device restore extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1480"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1526"/>
|
||||
<source>pa_ext_device_restore_read_sink_formats() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1498"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1544"/>
|
||||
<source>Failed to initialize device manager extension: %s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1517"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1563"/>
|
||||
<source>pa_ext_device_manager_read() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1567"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1580"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1606"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1619"/>
|
||||
<source>pa_context_get_sink_input_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1593"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1632"/>
|
||||
<source>pa_context_get_client_info() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1684"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1725"/>
|
||||
<source>pa_context_client_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1711"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1752"/>
|
||||
<source>pa_context_get_sink_input_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1718"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1759"/>
|
||||
<source>pa_context_get_source_output_info_list() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1733"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1774"/>
|
||||
<source>Connection failed, attempting reconnect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1752"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1793"/>
|
||||
<source>moduleInfoCb callback failure</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1810"/>
|
||||
<source>Ukui Media Volume Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="3291"/>
|
||||
<source>pa_context_load_module() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>UkmediaDeviceWidget</name>
|
||||
|
@ -254,7 +265,7 @@
|
|||
<context>
|
||||
<name>UkmediaMainWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="103"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="107"/>
|
||||
<source>Output volume control</source>
|
||||
<translation>输出音量控制</translation>
|
||||
</message>
|
||||
|
@ -263,23 +274,23 @@
|
|||
<translation type="vanished">静音</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="105"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="107"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="109"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="111"/>
|
||||
<source>Sound preference(S)</source>
|
||||
<translation>设置声音项</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="165"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="172"/>
|
||||
<source>System Volume</source>
|
||||
<translation>系统音量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="167"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="174"/>
|
||||
<source>App Volume</source>
|
||||
<translation>应用音量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="959"/>
|
||||
<location filename="../ukmedia_main_widget.cpp" line="1089"/>
|
||||
<source>Current volume:</source>
|
||||
<translation>当前音量:</translation>
|
||||
</message>
|
||||
|
@ -298,17 +309,17 @@
|
|||
<context>
|
||||
<name>UkmediaSystemVolumeWidget</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="57"/>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="58"/>
|
||||
<source>Volume</source>
|
||||
<translation>音量</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="68"/>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="69"/>
|
||||
<source>Output</source>
|
||||
<translation>输出</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="84"/>
|
||||
<location filename="../ukmedia_system_volume_widget.cpp" line="85"/>
|
||||
<source>Sound Settings</source>
|
||||
<translation>声音设置</translation>
|
||||
</message>
|
||||
|
@ -317,111 +328,111 @@
|
|||
<name>UkmediaVolumeControl</name>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="97"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="119"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="123"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="135"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="153"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="236"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="240"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="121"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="125"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="138"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="160"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="252"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="256"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="269"/>
|
||||
<source>pa_context_set_sink_volume_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="269"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="273"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="287"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="291"/>
|
||||
<source>pa_context_set_source_output_volume() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="285"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="304"/>
|
||||
<source>pa_context_set_source_output_mute() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="297"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="317"/>
|
||||
<source>pa_context_set_card_profile_by_index() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="311"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="333"/>
|
||||
<source>pa_context_set_default_sink() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="327"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="349"/>
|
||||
<source>pa_context_set_default_source() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="341"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="365"/>
|
||||
<source>pa_context_set_sink_port_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="355"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="380"/>
|
||||
<source>pa_context_set_source_port_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="368"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="393"/>
|
||||
<source>pa_context_kill_sink_input() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="397"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="422"/>
|
||||
<source> (plugged in)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="401"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="532"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="426"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="561"/>
|
||||
<source> (unavailable)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="403"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="529"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="428"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="558"/>
|
||||
<source> (unplugged)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="680"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="734"/>
|
||||
<source>Failed to read data from stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="722"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="776"/>
|
||||
<source>Peak detect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="723"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="777"/>
|
||||
<source>Failed to create monitoring stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="738"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="792"/>
|
||||
<source>Failed to connect monitoring stream</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="853"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="909"/>
|
||||
<source>Ignoring sink-input due to it being designated as an event and thus handled by the Event widget</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1142"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1148"/>
|
||||
<source>Establishing connection to PulseAudio. Please wait...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1384"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1429"/>
|
||||
<source>pa_context_get_sink_info_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1388"/>
|
||||
<location filename="../ukmedia_volume_control.cpp" line="1433"/>
|
||||
<source>pa_context_get_source_info_by_name() failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -28,7 +28,7 @@ ApplicationVolumeWidget::ApplicationVolumeWidget(QWidget *parent) : QWidget (par
|
|||
applicationLabel = new QLabel(tr("Application Volume"),this);
|
||||
app_volume_list = new QStringList;
|
||||
systemVolumeLabel = new QLabel(tr("System Volume"),this);
|
||||
systemVolumeBtn = new UkuiMediaMuteButton(this);
|
||||
systemVolumeBtn = new QPushButton(this);
|
||||
systemVolumeSlider = new UkmediaVolumeSlider(this);
|
||||
systemVolumeDisplayLabel = new QLabel(this);
|
||||
systemVolumeSliderWidget = new QWidget(this);
|
||||
|
@ -60,21 +60,28 @@ ApplicationVolumeWidget::ApplicationVolumeWidget(QWidget *parent) : QWidget (par
|
|||
//音量滑动条
|
||||
QHBoxLayout *systemVolumeSliderLayout = new QHBoxLayout();
|
||||
systemVolumeSliderWidget->setFixedSize(412,48);
|
||||
|
||||
systemVolumeBtn->setFixedSize(36,36);
|
||||
systemVolumeBtn->setActive(true);
|
||||
systemVolumeBtn->setCheckable(true);
|
||||
systemVolumeBtn->setProperty("isRoundButton",true); //圆形按钮
|
||||
systemVolumeBtn->setProperty("useButtonPalette",true); //灰色按钮
|
||||
systemVolumeBtn->setProperty("needTranslucent", true); //灰色半透明按钮
|
||||
|
||||
systemVolumeSlider->setOrientation(Qt::Horizontal);
|
||||
systemVolumeSlider->setFocusPolicy(Qt::StrongFocus);
|
||||
systemVolumeSlider->setProperty("needTranslucent", true); // Increase translucent effect
|
||||
systemVolumeSlider->setRange(0,100);
|
||||
systemVolumeSlider->setFixedSize(273,48);
|
||||
systemVolumeSlider->setFixedSize(284,48);
|
||||
systemVolumeDisplayLabel->setFixedSize(55,48);
|
||||
systemVolumeDisplayLabel->setAlignment(Qt::AlignCenter);
|
||||
systemVolumeSliderLayout->addWidget(systemVolumeBtn);
|
||||
systemVolumeSliderLayout->addSpacing(8);
|
||||
systemVolumeSliderLayout->addWidget(systemVolumeSlider);
|
||||
systemVolumeSliderLayout->addSpacing(16);
|
||||
systemVolumeSliderLayout->addSpacing(3);
|
||||
systemVolumeSliderLayout->addWidget(systemVolumeDisplayLabel);
|
||||
systemVolumeSliderLayout->setSpacing(0);
|
||||
systemVolumeSliderWidget->setLayout(systemVolumeSliderLayout);
|
||||
systemVolumeSliderLayout->setContentsMargins(16,0,24,0);
|
||||
systemVolumeSliderLayout->setContentsMargins(16,0,2,0);
|
||||
systemVolumeSlider->setObjectName("systemVolumeSlider");
|
||||
this->setFixedSize(420,436);
|
||||
|
||||
|
@ -86,7 +93,7 @@ ApplicationVolumeWidget::ApplicationVolumeWidget(QWidget *parent) : QWidget (par
|
|||
volumeSettingFrame = new QFrame(this);
|
||||
volumeSettingFrame->setFixedHeight(52);
|
||||
QHBoxLayout *volumeSettingLayout = new QHBoxLayout(volumeSettingFrame);
|
||||
volumeSettingLayout->setContentsMargins(16,0,24,8);
|
||||
volumeSettingLayout->setContentsMargins(16,0,24,0);
|
||||
volumeSettingLayout->addWidget(volumeSettingButton);
|
||||
volumeSettingLayout->addStretch();
|
||||
volumeSettingFrame->setLayout(volumeSettingLayout);
|
||||
|
@ -120,11 +127,11 @@ ApplicationVolumeWidget::ApplicationVolumeWidget(QWidget *parent) : QWidget (par
|
|||
mainLayout->addWidget(applicationLabelWidget);
|
||||
mainLayout->addSpacing(8);
|
||||
mainLayout->addWidget(appArea);
|
||||
mainLayout->addSpacing(8);
|
||||
mainLayout->addSpacing(2);
|
||||
mainLayout->addWidget(volumeSettingFrame);
|
||||
mainLayout->setSpacing(0);
|
||||
this->setLayout(mainLayout);
|
||||
mainLayout->setContentsMargins(8,16,0,0);
|
||||
mainLayout->setContentsMargins(8,16,8,0);
|
||||
}
|
||||
|
||||
void ApplicationVolumeWidget::fullushBlueRecordStream()
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
private:
|
||||
QLabel *applicationLabel;
|
||||
QLabel *systemVolumeLabel;
|
||||
UkuiMediaMuteButton *systemVolumeBtn;
|
||||
QPushButton *systemVolumeBtn;
|
||||
UkmediaVolumeSlider *systemVolumeSlider;
|
||||
QLabel *systemVolumeDisplayLabel;
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ UkmediaMainWidget::UkmediaMainWidget(QMainWindow *parent) : QMainWindow(parent)
|
|||
|
||||
//初始化gsetting
|
||||
initGsettings();
|
||||
initStrings();
|
||||
//初始化界面
|
||||
initWidget();
|
||||
//初始化托盘图标
|
||||
|
@ -158,6 +159,7 @@ void UkmediaMainWidget::initWidget()
|
|||
headsetWidget = new UkuiMediaSetHeadsetWidget; // osd弹窗
|
||||
|
||||
m_pTabWidget = new QTabWidget(this);
|
||||
m_pTabWidget->setFocusPolicy(Qt::StrongFocus);
|
||||
this->setCentralWidget(m_pTabWidget);
|
||||
m_pTabWidget->tabBar()->setFixedWidth(this->width()+1);
|
||||
systemWidget = new UkmediaSystemVolumeWidget(m_pTabWidget);
|
||||
|
@ -265,8 +267,26 @@ void UkmediaMainWidget::initVolumeLed()
|
|||
void UkmediaMainWidget::UkmediaDbusRegister()
|
||||
{
|
||||
QDBusConnection::sessionBus().unregisterService("org.ukui.media");
|
||||
QDBusConnection::sessionBus().registerService("org.ukui.media");
|
||||
QDBusConnection::sessionBus().registerObject("/", this,QDBusConnection :: ExportAllSlots | QDBusConnection :: ExportAllSignals);
|
||||
// QDBusConnection::sessionBus().registerService("org.ukui.media");
|
||||
// QDBusConnection::sessionBus().registerObject("/", this,QDBusConnection :: ExportAllSlots | QDBusConnection :: ExportAllSignals);
|
||||
MediaAdaptor(this);
|
||||
QDBusConnection con=QDBusConnection::sessionBus();
|
||||
if(!con.registerService("org.ukui.media"))
|
||||
{
|
||||
qDebug()<<"error1:"<<con.lastError().message();
|
||||
}
|
||||
if(!con.registerObject("/org/ukui/media",this,
|
||||
QDBusConnection::ExportAllSlots|
|
||||
QDBusConnection::ExportAllSignals))
|
||||
{
|
||||
qDebug()<<"error2:"<<con.lastError().message();
|
||||
}
|
||||
if(!con.registerObject("/bluetooth",this,
|
||||
QDBusConnection::ExportAllSlots|
|
||||
QDBusConnection::ExportAllSignals))
|
||||
{
|
||||
qDebug()<<"error2:"<<con.lastError().message();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -332,6 +352,7 @@ void UkmediaMainWidget::initDefaultSinkVolume()
|
|||
if(outputCardName.contains(BLUEZ,Qt::CaseInsensitive))
|
||||
volume = OUTPUT_VOLUME;
|
||||
m_pVolumeControl->setSinkVolume(m_pVolumeControl->sinkIndex,volume);
|
||||
m_pVolumeControl->setSinkMute(false);
|
||||
m_pVolumeControl->customSoundFile->addXmlNode(m_pVolumeControl->sinkPortName,false);
|
||||
qDebug() << "初始化输出音量为:" << volume ;
|
||||
if (temp != "")
|
||||
|
@ -342,6 +363,7 @@ void UkmediaMainWidget::initDefaultSinkVolume()
|
|||
{
|
||||
volume = OUTPUT_VOLUME;
|
||||
m_pVolumeControl->setSinkVolume(m_pVolumeControl->sinkIndex,volume);
|
||||
m_pVolumeControl->setSinkMute(false);
|
||||
m_pVolumeControl->customSoundFile->addXmlNode(m_pVolumeControl->defaultSinkName,false);
|
||||
qDebug()<< "初始化音量SinkPortName不存在的情况" << volume;
|
||||
}
|
||||
|
@ -355,13 +377,25 @@ void UkmediaMainWidget::initDefaultSourceVolume()
|
|||
{
|
||||
m_pVolumeControl->customSoundFile->addXmlNode(m_pVolumeControl->defaultSourceName,false);
|
||||
m_pVolumeControl->setSourceVolume(m_pVolumeControl->sourceIndex,MIC_VOLUME);
|
||||
m_pVolumeControl->setSourceMute(false);
|
||||
qDebug()<< "初始化音量SourcePortName不存在的情况" <<m_pVolumeControl->defaultSourceName ;
|
||||
}
|
||||
|
||||
else if(m_pVolumeControl->sourcePortName != "" && !m_pVolumeControl->customSoundFile->isExist(stringRemoveUnrecignizedChar(m_pVolumeControl->sourcePortName)))
|
||||
{
|
||||
if(m_pVolumeControl->sourcePortName.contains("hda"))
|
||||
{
|
||||
QString str = "hda-";
|
||||
QString preSourcePortName = m_pVolumeControl->sourcePortName;
|
||||
int index = preSourcePortName.indexOf(str);
|
||||
str = preSourcePortName.remove(index,4);
|
||||
if(m_pVolumeControl->customSoundFile->isExist(stringRemoveUnrecignizedChar(preSourcePortName))){
|
||||
qDebug() << "自适应升级输入音量问题";
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_pVolumeControl->customSoundFile->addXmlNode(m_pVolumeControl->sourcePortName,false);
|
||||
m_pVolumeControl->setSourceVolume(m_pVolumeControl->sourceIndex,MIC_VOLUME);
|
||||
m_pVolumeControl->setSourceMute(false);
|
||||
qDebug() << "初始化输入音量为100" ;
|
||||
}
|
||||
}
|
||||
|
@ -517,9 +551,11 @@ void UkmediaMainWidget::dealSlot()
|
|||
QGSettings * settings = new QGSettings(ba, bba);
|
||||
filenameStr = settings->get(FILENAME_KEY).toString();
|
||||
QString nameStr = settings->get(NAME_KEY).toString();
|
||||
if (nameStr == "volume-changed") {
|
||||
if (nameStr == "volume-change") {
|
||||
break;
|
||||
}
|
||||
else
|
||||
filenameStr = "";
|
||||
}
|
||||
}
|
||||
const QByteArray text = filenameStr.toLocal8Bit();
|
||||
|
@ -544,8 +580,14 @@ void UkmediaMainWidget::dealSlot()
|
|||
systemWidget->m_pSystemVolumeSlider->blockSignals(false);
|
||||
appWidget->systemVolumeSlider->blockSignals(false);
|
||||
setVolumeSettingMute(outputStatus);
|
||||
if(QGSettings::isSchemaInstalled(UKUI_VOLUME_BRIGHTNESS_GSETTING_ID))
|
||||
m_pVolumeSetting->blockSignals(true);
|
||||
setVolumeSettingValue(paVolumeToValue(value));
|
||||
initOutputListWidgetItem();
|
||||
if(QGSettings::isSchemaInstalled(UKUI_VOLUME_BRIGHTNESS_GSETTING_ID))
|
||||
QTimer::singleShot(100,this,[=](){
|
||||
m_pVolumeSetting->blockSignals(false);
|
||||
});
|
||||
themeChangeIcons();
|
||||
});
|
||||
|
||||
|
@ -556,6 +598,20 @@ void UkmediaMainWidget::dealSlot()
|
|||
themeChangeIcons();
|
||||
});
|
||||
|
||||
connect(QApplication::desktop(),&QDesktopWidget::resized,this,[=](){
|
||||
if(this->isHidden())
|
||||
return;
|
||||
else
|
||||
this->hide();
|
||||
});
|
||||
|
||||
connect(QApplication::desktop(),&QDesktopWidget::screenCountChanged,this,[=](){
|
||||
if(this->isHidden())
|
||||
return;
|
||||
else
|
||||
this->hide();
|
||||
});
|
||||
|
||||
connect(m_pVolumeControl,SIGNAL(addSinkInputSignal(const gchar *,const gchar*,int,int,int)),this,SLOT(addAppToAppwidget(const gchar*,const gchar *,int,int,int)));
|
||||
connect(m_pVolumeControl,SIGNAL(sinkInputVolumeChangedSignal(const gchar *,const gchar*,int)),this,SLOT(sinkInputVolumeChangedSlot(const gchar*,const gchar *,int)));
|
||||
connect(m_pVolumeControl,SIGNAL(removeSinkInputSignal(const gchar *)),this,SLOT(removeSubAppWidget(const gchar*)));
|
||||
|
@ -607,9 +663,11 @@ void UkmediaMainWidget::dealSlot()
|
|||
QGSettings * settings = new QGSettings(ba, bba);
|
||||
filenameStr = settings->get(FILENAME_KEY).toString();
|
||||
QString nameStr = settings->get(NAME_KEY).toString();
|
||||
if (nameStr == "volume-changed") {
|
||||
if (nameStr == "volume-change") {
|
||||
break;
|
||||
}
|
||||
else
|
||||
filenameStr = "";
|
||||
}
|
||||
}
|
||||
const QByteArray text = filenameStr.toLocal8Bit();
|
||||
|
@ -668,8 +726,10 @@ void UkmediaMainWidget::dealSlot()
|
|||
qDebug() << "removre sink signal";
|
||||
systemWidget->m_pOutputListWidget->blockSignals(true);
|
||||
});
|
||||
connect(m_pVolumeControl,SIGNAL(bluetoothBatteryChanged(QString, int)),this, SLOT(batteryLevelChanged(QString, int)));
|
||||
connect(appWidget->volumeSettingButton,SIGNAL(clicked()),this,SLOT(jumpControlPanelSlot()));
|
||||
connect(systemWidget->volumeSettingButton,SIGNAL(clicked()),this,SLOT(jumpControlPanelSlot()));
|
||||
monitorSessionStatus();
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::initGsettings()
|
||||
|
@ -718,11 +778,22 @@ void UkmediaMainWidget::initGsettings()
|
|||
}
|
||||
}
|
||||
|
||||
if(QGSettings::isSchemaInstalled(UKUI_GLOBALTHEME_SETTINGS)){
|
||||
m_pSoundThemeSetting = new QGSettings(UKUI_GLOBALTHEME_SETTINGS);
|
||||
if(m_pSoundThemeSetting->keys().contains("globalThemeName")){
|
||||
QString soundThemestr = m_pSoundThemeSetting->get(GLOBAL_THEME_NAME).toString();
|
||||
if(m_pSoundSettings->keys().contains("themeName") && soundThemestr != "custom"){
|
||||
m_pSoundSettings->set(SOUND_THEME_KEY,soundThemestr);
|
||||
}
|
||||
}
|
||||
connect(m_pSoundThemeSetting, SIGNAL(changed(const QString &)),this,SLOT(soundThemeChangedSlot(const QString &)));
|
||||
}
|
||||
|
||||
//给侧边栏提供音量之设置
|
||||
if (QGSettings::isSchemaInstalled(UKUI_VOLUME_BRIGHTNESS_GSETTING_ID)) {
|
||||
m_pVolumeSetting = new QGSettings(UKUI_VOLUME_BRIGHTNESS_GSETTING_ID);
|
||||
|
||||
connect(m_pVolumeSetting,SIGNAL(changed(const QString &)),this,SLOT(volumeSettingChangedSlot()));
|
||||
connect(m_pVolumeSetting,SIGNAL(changed(const QString &)),this,SLOT(volumeSettingChangedSlot(const QString &)));
|
||||
}
|
||||
|
||||
//如果为第一次运行需要关闭dp对应的配置文件
|
||||
|
@ -731,6 +802,15 @@ void UkmediaMainWidget::initGsettings()
|
|||
if (m_pInitSystemVolumeSetting->keys().contains("firstRun")) {
|
||||
bool isFirstRun = m_pInitSystemVolumeSetting->get(FIRST_RUN).toBool();
|
||||
if (isFirstRun) {
|
||||
//亿道厂商预留设计 初始化关闭降噪功能
|
||||
QProcess process;
|
||||
process.start("/bin/bash",QStringList() << "-c" << "dmesg |grep DMI:");
|
||||
process.waitForFinished();
|
||||
QString str = process.readAllStandardOutput();
|
||||
process.close();
|
||||
if(str.contains("UNIS L3891 G2") && m_pSoundSettings->keys().contains("dnsNoiseReduction"))
|
||||
m_pSoundSettings->set(DNS_NOISE_REDUCTION,false);
|
||||
qDebug() << "初始化默认关闭降噪";
|
||||
m_pInitSystemVolumeSetting->set(FIRST_RUN,false);
|
||||
}
|
||||
}
|
||||
|
@ -738,42 +818,45 @@ void UkmediaMainWidget::initGsettings()
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
* 更新设备时更新字体(对listwidget的特殊处理)
|
||||
*/
|
||||
void UkmediaMainWidget::updateOutputListWidgetFont() {
|
||||
QString fontType;
|
||||
if (m_pFontSetting->keys().contains("systemFont")) {
|
||||
fontType = m_pFontSetting->get("systemFont").toString();
|
||||
}
|
||||
if (m_pFontSetting->keys().contains("systemFontSize")) {
|
||||
int font = m_pFontSetting->get("system-font-size").toInt();
|
||||
QFont fontSize(fontType,font);
|
||||
for (int row=0;row<systemWidget->m_pOutputListWidget->count();row++) {
|
||||
QListWidgetItem *item = systemWidget->m_pOutputListWidget->item(row);
|
||||
UkuiListWidgetItem *wid = (UkuiListWidgetItem *)systemWidget->m_pOutputListWidget->itemWidget(item);
|
||||
wid->portLabel->setFont(fontSize);
|
||||
}
|
||||
}
|
||||
void UkmediaMainWidget::initStrings()
|
||||
{
|
||||
const static QString s_login1Name = QStringLiteral("logind");
|
||||
const static QString s_login1Service = QStringLiteral("org.freedesktop.login1");
|
||||
const static QString s_login1Path = QStringLiteral("/org/freedesktop/login1");
|
||||
const static QString s_login1ManagerInterface = QStringLiteral("org.freedesktop.login1.Manager");
|
||||
const static QString s_login1SeatInterface = QStringLiteral("org.freedesktop.login1.Seat");
|
||||
const static QString s_login1SessionInterface = QStringLiteral("org.freedesktop.login1.Session");
|
||||
const static QString s_login1ActiveProperty = QStringLiteral("Active");
|
||||
const static QString s_dbusPropertiesInterface = QStringLiteral("org.freedesktop.DBus.Properties");
|
||||
|
||||
m_sessionControllerName = s_login1Name;
|
||||
m_sessionControllerService = s_login1Service;
|
||||
m_sessionControllerPath = s_login1Path;
|
||||
m_sessionControllerManagerInterface = s_login1ManagerInterface;
|
||||
m_sessionControllerSeatInterface = s_login1SeatInterface;
|
||||
m_sessionControllerSessionInterface = s_login1SessionInterface;
|
||||
m_sessionControllerActiveProperty = s_login1ActiveProperty;
|
||||
m_sessionControllerPropertiesInterface = s_dbusPropertiesInterface;
|
||||
}
|
||||
|
||||
|
||||
void UkmediaMainWidget::initAlertSound()
|
||||
{
|
||||
eventList = new QStringList;
|
||||
eventIdNameList = new QStringList;
|
||||
|
||||
eventList->append("window-close");
|
||||
eventList->append("system-setting");
|
||||
eventList->append("volume-changed");
|
||||
eventList->append("alert-sound");
|
||||
eventIdNameList->append("gudou");
|
||||
eventIdNameList->append("gudou");
|
||||
eventIdNameList->append("gudou");
|
||||
eventIdNameList->append("gudou");
|
||||
for (int i=0;i<eventList->count();i++) {
|
||||
// getValue();
|
||||
addValue(eventList->at(i),eventIdNameList->at(i));
|
||||
}
|
||||
// eventList->append("window-close");
|
||||
// eventList->append("system-setting");
|
||||
// eventList->append("volume-changed");
|
||||
// eventList->append("alert-sound");
|
||||
// eventIdNameList->append("gudou");
|
||||
// eventIdNameList->append("gudou");
|
||||
// eventIdNameList->append("gudou");
|
||||
// eventIdNameList->append("gudou");
|
||||
// for (int i=0;i<eventList->count();i++) {
|
||||
// // getValue();
|
||||
// addValue(eventList->at(i),eventIdNameList->at(i));
|
||||
// }
|
||||
|
||||
QDomDocument doc("xunguang");
|
||||
QString audioPath = "/usr/share/sounds/xunguang.xml";
|
||||
|
@ -783,8 +866,12 @@ void UkmediaMainWidget::initAlertSound()
|
|||
qDebug()<<"open xunguang.xml failed!!!";
|
||||
return;
|
||||
}
|
||||
if (!doc.setContent(&file)){
|
||||
QString errorStr = "";
|
||||
int errorLine = -1;
|
||||
int errorCol = -1;
|
||||
if (!doc.setContent(&file,true,&errorStr,&errorLine,&errorCol)){
|
||||
file.close();
|
||||
qDebug()<<"open xunguang.xml failed111!!!" << errorStr << errorLine << errorCol;
|
||||
return;
|
||||
}
|
||||
file.close();
|
||||
|
@ -959,9 +1046,11 @@ void UkmediaMainWidget::handleTimeout()
|
|||
QGSettings * settings = new QGSettings(ba, bba);
|
||||
filenameStr = settings->get(FILENAME_KEY).toString();
|
||||
QString nameStr = settings->get(NAME_KEY).toString();
|
||||
if (nameStr == "volume-changed") {
|
||||
if (nameStr == "volume-change") {
|
||||
break;
|
||||
}
|
||||
else
|
||||
filenameStr = "";
|
||||
}
|
||||
}
|
||||
const QByteArray text = filenameStr.toLocal8Bit();
|
||||
|
@ -1003,9 +1092,11 @@ void UkmediaMainWidget::handleTimeout()
|
|||
QGSettings * settings = new QGSettings(ba, bba);
|
||||
filenameStr = settings->get(FILENAME_KEY).toString();
|
||||
QString nameStr = settings->get(NAME_KEY).toString();
|
||||
if (nameStr == "volume-changed") {
|
||||
if (nameStr == "volume-change") {
|
||||
break;
|
||||
}
|
||||
else
|
||||
filenameStr = "";
|
||||
}
|
||||
}
|
||||
const QByteArray text = filenameStr.toLocal8Bit();
|
||||
|
@ -1041,15 +1132,10 @@ void UkmediaMainWidget::setVolumeSettingValue(int value)
|
|||
if (m_pSoundSettings->keys().contains("volumeIncrease")) {
|
||||
if(m_pSoundSettings->get("volume-increase").toBool()){
|
||||
int value_increase = (value / 1.25) +0.5;
|
||||
m_pVolumeSetting->blockSignals(true);
|
||||
m_pVolumeSetting->set(UKUI_VOLUME_KEY,value_increase);
|
||||
m_pVolumeSetting->blockSignals(false);
|
||||
}
|
||||
else {
|
||||
m_pVolumeSetting->blockSignals(true);
|
||||
else
|
||||
m_pVolumeSetting->set(UKUI_VOLUME_KEY,value);
|
||||
m_pVolumeSetting->blockSignals(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1101,18 +1187,15 @@ void UkmediaMainWidget::fontSizeChangedSlot(const QString &themeStr)
|
|||
if (m_pFontSetting->keys().contains("systemFontSize")) {
|
||||
int font = m_pFontSetting->get("system-font-size").toInt();
|
||||
QFont fontSize(fontType,font);
|
||||
//listWidget目前使用了qss,需要做特殊处理
|
||||
for (int row=0;row<systemWidget->m_pOutputListWidget->count();row++) {
|
||||
QListWidgetItem *item = systemWidget->m_pOutputListWidget->item(row);
|
||||
UkuiListWidgetItem *wid = (UkuiListWidgetItem *)systemWidget->m_pOutputListWidget->itemWidget(item);
|
||||
wid->portLabel->setFont(fontSize);
|
||||
}
|
||||
}
|
||||
Q_EMIT font_change();
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::volumeSettingChangedSlot()
|
||||
void UkmediaMainWidget::volumeSettingChangedSlot(const QString &key)
|
||||
{
|
||||
if(key != "volumesize")
|
||||
return;
|
||||
|
||||
if (m_pVolumeSetting->keys().contains("volumesize")) {
|
||||
int valueSetting = m_pVolumeSetting->get(UKUI_VOLUME_KEY).toInt();
|
||||
if (valueSetting == 0)
|
||||
|
@ -1151,6 +1234,19 @@ void UkmediaMainWidget::ukuiThemeChangedSlot(const QString &themeStr)
|
|||
this->repaint();
|
||||
}
|
||||
|
||||
/*
|
||||
* 系统音效主题改变
|
||||
*/
|
||||
void UkmediaMainWidget::soundThemeChangedSlot(const QString &soundThemeStr)
|
||||
{
|
||||
if(m_pSoundThemeSetting->keys().contains("globalThemeName")){
|
||||
QString soundstr = m_pSoundThemeSetting->get(GLOBAL_THEME_NAME).toString();
|
||||
if(m_pSoundSettings->keys().contains("themeName") && soundstr != "custom")
|
||||
m_pSoundSettings->set(SOUND_THEME_KEY,soundstr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 滑动条控制输出音量
|
||||
*/
|
||||
|
@ -1336,16 +1432,16 @@ void UkmediaMainWidget::outputVolumeDarkThemeImage(int value,bool status)
|
|||
{
|
||||
QString iconStr = outputVolumeToIconStr(status,value);
|
||||
|
||||
systemWidget->m_pSystemVolumeBtn->setButtonIcon(QIcon::fromTheme(iconStr));
|
||||
appWidget->systemVolumeBtn->setButtonIcon(QIcon::fromTheme(iconStr));
|
||||
systemWidget->m_pSystemVolumeBtn->setIcon(QIcon::fromTheme(iconStr));
|
||||
appWidget->systemVolumeBtn->setIcon(QIcon::fromTheme(iconStr));
|
||||
bool isActive = m_pVolumeControl->getSinkMute();
|
||||
if(iconStr == "audio-volume-muted-symbolic" && isActive) {
|
||||
systemWidget->m_pSystemVolumeBtn->setActive(false);
|
||||
appWidget->systemVolumeBtn->setActive(false);
|
||||
systemWidget->m_pSystemVolumeBtn->setChecked(false);
|
||||
appWidget->systemVolumeBtn->setChecked(false);
|
||||
}
|
||||
else {
|
||||
systemWidget->m_pSystemVolumeBtn->setActive(true);
|
||||
appWidget->systemVolumeBtn->setActive(true);
|
||||
systemWidget->m_pSystemVolumeBtn->setChecked(true);
|
||||
appWidget->systemVolumeBtn->setChecked(true);
|
||||
}
|
||||
soundSystemTrayIcon->setIcon(QIcon::fromTheme(iconStr));
|
||||
|
||||
|
@ -1447,7 +1543,7 @@ QPixmap UkmediaMainWidget::drawDarkColoredPixmap(const QPixmap &source)
|
|||
*/
|
||||
void UkmediaMainWidget::advancedWidgetShow()
|
||||
{
|
||||
#define MARGIN 4
|
||||
#define MARGIN 8
|
||||
QDBusInterface iface("org.ukui.panel",
|
||||
"/panel/position",
|
||||
"org.ukui.panel",
|
||||
|
@ -1525,6 +1621,15 @@ QString UkmediaMainWidget::appNameToIconName(const gchar *appName,const gchar *a
|
|||
iconName.append(".desktop");
|
||||
}
|
||||
|
||||
/*
|
||||
fixed bug#136619【无线投屏】投屏后,应用音量中没有投屏的应用音量
|
||||
需要更改 /etc/xdg/autostart/miracle-agent.desktop 文件
|
||||
+ 改成 Icon=kylin-miracast
|
||||
*/
|
||||
if(strcmp(appName,"kylin-miracast") == 0 || strcmp(appName,"miraclecast") == 0)
|
||||
{
|
||||
iconName = "/etc/xdg/autostart/miracle-agent.desktop";
|
||||
}
|
||||
|
||||
return iconName;
|
||||
}
|
||||
|
@ -1662,6 +1767,19 @@ void UkmediaMainWidget::sinkInputVolumeChangedSlot(const gchar *appName, const g
|
|||
qDebug() << "sinkInputVolumeChangedSlot" << appName << appIconName << value << appSliderStr;
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::switchStartupPlayMusic()
|
||||
{
|
||||
//向 /home/username/.config/startupMusic.json 文件中插入属性
|
||||
|
||||
QString switchStartupState;
|
||||
|
||||
if (m_pSoundSettings->keys().contains("startupMusic")) {
|
||||
switchStartupState = m_pSoundSettings->get(STARTUP_MUSIC).toString();
|
||||
m_pVolumeControl->insertJson("startupPlayMusic",switchStartupState,"/.config/startupMusic.json");
|
||||
qDebug() << " switchStartupState" << switchStartupState;
|
||||
}
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::soundSettingChanged(const QString &key)
|
||||
{
|
||||
qDebug() << "soundSettingChanged" << key;
|
||||
|
@ -1669,6 +1787,8 @@ void UkmediaMainWidget::soundSettingChanged(const QString &key)
|
|||
switchModuleEchoCancel();
|
||||
else if (key == "volumeIncrease")
|
||||
resetVolumeSliderRange();
|
||||
else if (key == "startupMusic")
|
||||
switchStartupPlayMusic();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1722,6 +1842,7 @@ void UkmediaMainWidget::initSubApplicationWidget(QString pAppIcon)
|
|||
appWidget->appMuteBtn->setVisible(false);
|
||||
appWidget->appSlider = new UkmediaVolumeSlider(subAppwidget);
|
||||
appWidget->appSlider->setOrientation(Qt::Horizontal);
|
||||
appWidget->appSlider->setProperty("needTranslucent", true); // Increase translucent effect
|
||||
appWidget->appIconBtn->setFixedSize(36,36);
|
||||
appWidget->appIconBtn->setFlat(true);
|
||||
appWidget->appIconBtn->setFocusPolicy(Qt::NoFocus);
|
||||
|
@ -1741,7 +1862,7 @@ void UkmediaMainWidget::initSubApplicationWidget(QString pAppIcon)
|
|||
appWidget->appIconBtn->setPalette(paleteAppIcon);
|
||||
|
||||
appWidget->appSlider->setMaximum(100);
|
||||
appWidget->appSlider->setFixedSize(273,48);
|
||||
appWidget->appSlider->setFixedSize(284,48);
|
||||
appWidget->appIconBtn->adjustSize();
|
||||
appWidget->appIconBtn->setProperty("useIconHighlightEffect",true);
|
||||
appWidget->appIconBtn->setProperty("iconHighlightEffectMode",true);
|
||||
|
@ -1761,11 +1882,11 @@ void UkmediaMainWidget::initSubApplicationWidget(QString pAppIcon)
|
|||
appSliderLayout->addWidget(appWidget->appIconBtn);
|
||||
appSliderLayout->addSpacing(8);
|
||||
appSliderLayout->addWidget(appWidget->appSlider);
|
||||
// appSliderLayout->addItem(new QSpacerItem(16,20,QSizePolicy::Maximum));
|
||||
appSliderLayout->addSpacing(3);
|
||||
appSliderLayout->addWidget(appWidget->appVolumeLabel);
|
||||
appSliderLayout->setSpacing(0);
|
||||
subAppwidget->setLayout(appSliderLayout);
|
||||
appSliderLayout->setContentsMargins(16,0,24,0);
|
||||
appSliderLayout->setContentsMargins(16,0,2,0);
|
||||
appWidget->m_pVlayout->addWidget(subAppwidget);
|
||||
// //设置布局的垂直间距以及设置vlayout四周的间距
|
||||
appWidget->displayAppVolumeWidget->resize(404,m_pVolumeControl->sinkInputList.count()*50);
|
||||
|
@ -2051,64 +2172,8 @@ void UkmediaMainWidget::onPrepareForSleep(bool sleep)
|
|||
*/
|
||||
void UkmediaMainWidget::deviceChangedShowSlot(QString dev_name)
|
||||
{
|
||||
#define MARGIN 4
|
||||
QDBusInterface iface("org.ukui.panel",
|
||||
"/panel/position",
|
||||
"org.ukui.panel",
|
||||
QDBusConnection::sessionBus());
|
||||
QDBusReply<QVariantList> reply=iface.call("GetPrimaryScreenGeometry");
|
||||
QVariantList position_list=reply.value();
|
||||
|
||||
|
||||
|
||||
QPixmap dev_Icon;
|
||||
|
||||
if ( mThemeName == "ukui-white" || mThemeName == "ukui-light") {
|
||||
dev_Icon = drawDarkColoredPixmap((QIcon::fromTheme(dev_name)).pixmap(48,48));
|
||||
}
|
||||
else if (mThemeName == UKUI_THEME_BLACK || mThemeName == "ukui-black" || mThemeName == "ukui-default") {
|
||||
dev_Icon = drawLightColoredPixmap((QIcon::fromTheme(dev_name)).pixmap(48,48));
|
||||
}
|
||||
|
||||
//获取透明度
|
||||
// if (QGSettings::isSchemaInstalled(UKUI_THEME_SETTING)){
|
||||
// if (m_pTransparencySetting->keys().contains("transparency")) {
|
||||
// transparency = m_pTransparencySetting->get("transparency").toDouble();
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!osdWidget->isHidden()) {
|
||||
osdWidget->hide();
|
||||
|
||||
if (timer != nullptr) {
|
||||
timer->disconnect();
|
||||
timer = nullptr;
|
||||
delete timer;
|
||||
}
|
||||
}
|
||||
|
||||
osdWidget->UkmediaOsdSetIcon(dev_Icon,mThemeName);
|
||||
|
||||
kdk::UkuiStyleHelper::self()->removeHeader(osdWidget);
|
||||
|
||||
osdWidget->show();
|
||||
|
||||
QRect rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-osdWidget->width()-200,
|
||||
position_list.at(1).toInt()+reply.value().at(3).toInt()-osdWidget->height()-MARGIN,
|
||||
osdWidget->width(),osdWidget->height());
|
||||
|
||||
kdk::WindowManager::setGeometry(osdWidget->windowHandle(),rect);
|
||||
|
||||
// osdWidget->setWindowOpacity(transparency);
|
||||
timer = new MyTimer(osdWidget); //this 为parent类, 表示当前窗口
|
||||
connect(timer, SIGNAL(timeOut()), this, SLOT(osdDisplayWidgetHide()));
|
||||
|
||||
}
|
||||
|
||||
//osd超时隐藏
|
||||
void UkmediaMainWidget::osdDisplayWidgetHide()
|
||||
{
|
||||
this->osdWidget->hide();
|
||||
osdWidget->setIcon(dev_name);
|
||||
osdWidget->dialogShow();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2222,8 +2287,6 @@ void UkmediaMainWidget::outputListWidgetCurrentRowChangedSlot(int row)
|
|||
UkuiListWidgetItem *inputWid = (UkuiListWidgetItem *)systemWidget->m_pInputListWidget->itemWidget(inputCurrrentItem);
|
||||
bool isContainBlue = inputDeviceContainBluetooth();
|
||||
|
||||
wid->deviceButton->buttonState = PUSH_BUTTON_CLICK;
|
||||
wid->deviceButton->setActive(true);
|
||||
setDeviceButtonState(row);
|
||||
|
||||
//当输出设备从蓝牙切换到其他设备时,需将蓝牙声卡的配置文件切换为a2dp-sink
|
||||
|
@ -2475,27 +2538,37 @@ void UkmediaMainWidget::addOutputListWidgetItem(QString portName, QString portLa
|
|||
UkuiListWidgetItem *itemW = new UkuiListWidgetItem(this);
|
||||
int i = systemWidget->m_pOutputListWidget->count();
|
||||
QListWidgetItem * item = new QListWidgetItem(systemWidget->m_pOutputListWidget);
|
||||
item->setSizeHint(QSize(200,48)); //QSize(120, 40) spacing: 12px;
|
||||
item->setSizeHint(QSize(200,48));
|
||||
itemW->setButtonIcon(portName);
|
||||
itemW->setLabelText(portLabel,cardName);
|
||||
systemWidget->m_pOutputListWidget->blockSignals(true);
|
||||
systemWidget->m_pOutputListWidget->setItemWidget(item, itemW);
|
||||
systemWidget->m_pOutputListWidget->blockSignals(false);
|
||||
itemW->setLabelText(portLabel,cardName);
|
||||
itemW->setButtonIcon(portName);
|
||||
systemWidget->m_pOutputListWidget->blockSignals(true);
|
||||
systemWidget->m_pOutputListWidget->insertItem(i,item);
|
||||
updateOutputListWidgetFont();
|
||||
systemWidget->m_pOutputListWidget->blockSignals(false);
|
||||
|
||||
connect(itemW->deviceButton, &QPushButton::clicked, this, [=](){
|
||||
if(!itemW->deviceButton->isChecked()){
|
||||
itemW->deviceButton->setChecked(true);
|
||||
}
|
||||
else{
|
||||
systemWidget->m_pOutputListWidget->setCurrentRow(i);
|
||||
outputListWidgetCurrentRowChangedSlot(systemWidget->m_pOutputListWidget->currentRow());
|
||||
outputListWidgetRow = systemWidget->m_pOutputListWidget->currentRow();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::setDeviceButtonState(int row)
|
||||
{
|
||||
for (int i=0;i<systemWidget->m_pOutputListWidget->count();i++) {
|
||||
if (i == row)
|
||||
continue;
|
||||
QListWidgetItem *item = systemWidget->m_pOutputListWidget->item(i);
|
||||
UkuiListWidgetItem *wid = (UkuiListWidgetItem *)systemWidget->m_pOutputListWidget->itemWidget(item);
|
||||
wid->deviceButton->buttonState = PUSH_BUTTON_NORMAL;
|
||||
wid->deviceButton->setActive(false);
|
||||
if (i == row){
|
||||
if(!wid->deviceButton->isChecked())
|
||||
wid->deviceButton->setChecked(true);
|
||||
continue;
|
||||
}
|
||||
wid->deviceButton->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2630,10 +2703,8 @@ bool UkmediaMainWidget::inputPortIsNeedAdd(int index, QString name)
|
|||
void UkmediaMainWidget::deleteNotAvailableOutputPort()
|
||||
{
|
||||
qDebug() << "deleteNotAvailableOutputPort";
|
||||
//删除不可用的输出端口
|
||||
QMap<int,QString>::iterator it;
|
||||
for(it=currentOutputPortLabelMap.begin();it!=currentOutputPortLabelMap.end();) {
|
||||
//没找到,需要删除
|
||||
if (outputPortIsNeedDelete(it.key(),it.value())) {
|
||||
qDebug() << "outputPortIsNeedDelete" << it.key() << it.value();
|
||||
int index = indexOfOutputPortInOutputListWidget(it.value());
|
||||
|
@ -2652,7 +2723,6 @@ void UkmediaMainWidget::deleteNotAvailableOutputPort()
|
|||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 添加可用的输出端口到output list widget
|
||||
*/
|
||||
|
@ -2661,32 +2731,15 @@ void UkmediaMainWidget::addAvailableOutputPort()
|
|||
QMap<int,QMap<QString,QString>>::iterator at;
|
||||
QMap<QString,QString>::iterator it;
|
||||
QMap<QString,QString> tempMap;
|
||||
int i = systemWidget->m_pOutputListWidget->count();
|
||||
//增加端口
|
||||
for(at=m_pVolumeControl->outputPortMap.begin();at!=m_pVolumeControl->outputPortMap.end();)
|
||||
{
|
||||
tempMap = at.value();
|
||||
// qDebug() << "addAvailableOutputPort" << at.key() <<at.value();
|
||||
for (it=tempMap.begin();it!=tempMap.end();) {
|
||||
//需添加到list widget
|
||||
if (outputPortIsNeedAdd(at.key(),it.value())) {
|
||||
qDebug() << "add output list widget" << at.key()<< it.value() << it.key();
|
||||
UkuiListWidgetItem *itemW = new UkuiListWidgetItem(this);
|
||||
|
||||
QListWidgetItem * item = new QListWidgetItem(systemWidget->m_pOutputListWidget);
|
||||
item->setSizeHint(QSize(200,48)); //QSize(120, 40) spacing: 12px;
|
||||
systemWidget->m_pOutputListWidget->blockSignals(true);
|
||||
systemWidget->m_pOutputListWidget->setItemWidget(item, itemW);
|
||||
systemWidget->m_pOutputListWidget->blockSignals(false);
|
||||
|
||||
itemW->setLabelText(it.value(),findCardName(at.key(),m_pVolumeControl->cardMap));
|
||||
itemW->setButtonIcon(it.key());
|
||||
itemW->deviceButton->setActive(false);
|
||||
addOutputListWidgetItem(it.key(),it.value(),findCardName(at.key(),m_pVolumeControl->cardMap));
|
||||
currentOutputPortLabelMap.insertMulti(at.key(),it.value());
|
||||
systemWidget->m_pOutputListWidget->blockSignals(true);
|
||||
systemWidget->m_pOutputListWidget->insertItem(i,item);
|
||||
updateOutputListWidgetFont();
|
||||
systemWidget->m_pOutputListWidget->blockSignals(false);
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
@ -3084,8 +3137,6 @@ void UkmediaMainWidget::findOutputListWidgetItem(QString cardName,QString portLa
|
|||
if (wid->deviceLabel->text() == cardName && portLabel == wid->portLabel->fullText) {
|
||||
systemWidget->m_pOutputListWidget->blockSignals(true);
|
||||
systemWidget->m_pOutputListWidget->setCurrentRow(row);
|
||||
wid->deviceButton->buttonState = PUSH_BUTTON_CLICK;
|
||||
wid->deviceButton->setActive(true);
|
||||
setDeviceButtonState(row);
|
||||
systemWidget->m_pOutputListWidget->blockSignals(false);
|
||||
wid->deviceButton->repaint();
|
||||
|
@ -3098,13 +3149,6 @@ void UkmediaMainWidget::findOutputListWidgetItem(QString cardName,QString portLa
|
|||
|
||||
void UkmediaMainWidget::findInputListWidgetItem(QString cardName,QString portLabel)
|
||||
{
|
||||
//增加输入设备插入拔出信号
|
||||
|
||||
QDBusMessage message = QDBusMessage::createSignal("/","org.ukui.media","sourcePortChanged");
|
||||
message << "portChanged";
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
qDebug() << "sourcePortChanged" << endl;
|
||||
|
||||
for (int row=0;row<systemWidget->m_pInputListWidget->count();row++) {
|
||||
QListWidgetItem *item = systemWidget->m_pInputListWidget->item(row);
|
||||
UkuiListWidgetItem *wid = (UkuiListWidgetItem *)systemWidget->m_pInputListWidget->itemWidget(item);
|
||||
|
@ -3264,8 +3308,8 @@ void UkmediaMainWidget::switchModuleEchoCancel()
|
|||
if ( strstr(m_pVolumeControl->defaultSourceName,"alsa_input") && !strstr(m_pVolumeControl->defaultSourceName,"input.usb")) {
|
||||
sourceState = true;
|
||||
}
|
||||
qDebug() << "switchModuleEchoCancel" << m_pVolumeControl->defaultSourceName << switchState << sourceState;
|
||||
if (switchState && sourceState && !isLoadEchoCancel && !strstr(m_pVolumeControl->defaultSourceName,"noiseReduceSource")) {
|
||||
qDebug() << "switchModuleEchoCancel" << "loadechocancel"<< isLoadEchoCancel << m_pVolumeControl->defaultSourceName << switchState << sourceState;
|
||||
if (switchState && sourceState) {
|
||||
pa_operation *o;
|
||||
qDebug() << "load module echo cancel";
|
||||
isLoadEchoCancel = true;
|
||||
|
@ -3273,7 +3317,7 @@ void UkmediaMainWidget::switchModuleEchoCancel()
|
|||
m_pVolumeControl->showError(QObject::tr("pa_context_load_module() failed").toUtf8().constData());
|
||||
}
|
||||
}
|
||||
else if (isLoadEchoCancel && !switchState) {
|
||||
else if (strstr(m_pVolumeControl->defaultSourceName,"noiseReduceSource") && !switchState) {
|
||||
isLoadEchoCancel = false;
|
||||
m_pVolumeControl->getModuleIndexByName("module-echo-cancel");
|
||||
|
||||
|
@ -3282,6 +3326,9 @@ void UkmediaMainWidget::switchModuleEchoCancel()
|
|||
pa_context_unload_module(m_pVolumeControl->getContext(),m_pVolumeControl->findModuleIndex,nullptr,nullptr);
|
||||
});
|
||||
}
|
||||
else {
|
||||
isLoadEchoCancel = false;
|
||||
}
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::resetVolumeSliderRange()
|
||||
|
@ -3298,7 +3345,225 @@ void UkmediaMainWidget::resetVolumeSliderRange()
|
|||
}
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::monitorSessionStatus()
|
||||
{
|
||||
//get session path
|
||||
// m_sessionActiveBus = QDBusConnection::systemBus();
|
||||
QString methodName;
|
||||
QVariantList args;
|
||||
methodName = QStringLiteral("GetSessionByPID");
|
||||
args << (quint32) QCoreApplication::applicationPid();
|
||||
|
||||
QDBusMessage message = QDBusMessage::createMethodCall(m_sessionControllerService,
|
||||
m_sessionControllerPath,
|
||||
m_sessionControllerManagerInterface,
|
||||
methodName);
|
||||
message.setArguments(args);
|
||||
QDBusPendingReply<QDBusObjectPath> session = QDBusConnection::systemBus().asyncCall(message);
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(session, this);
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this,
|
||||
[this](QDBusPendingCallWatcher *self) {
|
||||
QDBusPendingReply<QDBusObjectPath> reply = *self;
|
||||
self->deleteLater();
|
||||
if (!reply.isValid()) {
|
||||
qDebug()<< "The session is not registered with " << m_sessionControllerName << " " << reply.error().message();
|
||||
return;
|
||||
}
|
||||
m_sessionPath = reply.value().path();
|
||||
qDebug() << "Session path:" << m_sessionPath;
|
||||
|
||||
//get sessionactive
|
||||
QDBusConnection::systemBus().connect(m_sessionControllerService,
|
||||
m_sessionPath,
|
||||
m_sessionControllerPropertiesInterface,
|
||||
QStringLiteral("PropertiesChanged"),
|
||||
this,
|
||||
SLOT(getSessionActive()));
|
||||
});
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::getSessionActive()
|
||||
{
|
||||
const static QString s_dbusPropertiesInterface = QStringLiteral("org.freedesktop.DBus.Properties");
|
||||
QDBusMessage message = QDBusMessage::createMethodCall(m_sessionControllerService,
|
||||
m_sessionPath,
|
||||
s_dbusPropertiesInterface,
|
||||
QStringLiteral("Get"));
|
||||
message.setArguments(QVariantList({m_sessionControllerSessionInterface, m_sessionControllerActiveProperty}));
|
||||
QDBusPendingReply<QVariant> reply = QDBusConnection::systemBus().asyncCall(message);
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this,
|
||||
[this](QDBusPendingCallWatcher *self) {
|
||||
QDBusPendingReply<QVariant> reply = *self;
|
||||
self->deleteLater();
|
||||
if (!reply.isValid()) {
|
||||
qDebug() << "Failed to get Active Property of " << m_sessionControllerName << " session:" << reply.error().message();
|
||||
return;
|
||||
}
|
||||
const bool active = reply.value().toBool();
|
||||
onPrepareForSleep(!active);
|
||||
|
||||
qDebug() << "active -----" <<active;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
QString UkmediaMainWidget::getDefaultOutputDevice()
|
||||
{
|
||||
if(m_pVolumeControl->defaultSinkName == ""){
|
||||
return "NULL";
|
||||
}
|
||||
return m_pVolumeControl->defaultSinkName;
|
||||
}
|
||||
|
||||
QString UkmediaMainWidget::getDefaultInputDevice()
|
||||
{
|
||||
if(m_pVolumeControl->defaultSourceName == ""){
|
||||
return "NULL";
|
||||
}
|
||||
return m_pVolumeControl->defaultSourceName;
|
||||
}
|
||||
|
||||
QStringList UkmediaMainWidget::getAllOutputDevices()
|
||||
{
|
||||
QMap<int,QString>::iterator it;
|
||||
QStringList devicesList;
|
||||
for (it=m_pVolumeControl->sinkMap.begin();it!=m_pVolumeControl->sinkMap.end();) {
|
||||
devicesList.append(it.value());
|
||||
++it;
|
||||
}
|
||||
return devicesList;
|
||||
}
|
||||
|
||||
QStringList UkmediaMainWidget::getAllInputDevices()
|
||||
{
|
||||
QMap<int,QString>::iterator it;
|
||||
QStringList devicesList;
|
||||
for (it=m_pVolumeControl->sourceMap.begin();it!=m_pVolumeControl->sourceMap.end();) {
|
||||
devicesList.append(it.value());
|
||||
++it;
|
||||
}
|
||||
return devicesList;
|
||||
}
|
||||
|
||||
int UkmediaMainWidget::getDefaultOutputVolume()
|
||||
{
|
||||
int value = m_pVolumeControl->sinkVolume;
|
||||
|
||||
if (m_pSoundSettings->keys().contains("volumeIncrease")) {
|
||||
if(m_pSoundSettings->get("volume-increase").toBool())
|
||||
value = (m_pVolumeControl->sinkVolume / 1.25) +0.5;
|
||||
}
|
||||
|
||||
return paVolumeToValue(value);
|
||||
}
|
||||
|
||||
int UkmediaMainWidget::getDefaultInputVolume()
|
||||
{
|
||||
return paVolumeToValue(m_pVolumeControl->sourceVolume);
|
||||
}
|
||||
|
||||
bool UkmediaMainWidget::getDefaultOutputMuteState()
|
||||
{
|
||||
return m_pVolumeControl->sinkMuted;
|
||||
}
|
||||
|
||||
bool UkmediaMainWidget::getDefaultInputMuteState()
|
||||
{
|
||||
return m_pVolumeControl->sourceMuted;
|
||||
}
|
||||
|
||||
bool UkmediaMainWidget::setDefaultOutputVolume(int value)
|
||||
{
|
||||
if(value < 0 || value > 100){
|
||||
qDebug() << "setDefaultOutputVolume value is invalid!";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_pSoundSettings->keys().contains("volumeIncrease")) {
|
||||
if(m_pSoundSettings->get("volume-increase").toBool())
|
||||
value = (value * 1.25) +0.5;
|
||||
}
|
||||
|
||||
m_pVolumeControl->setSinkVolume(m_pVolumeControl->sinkIndex,valueToPaVolume(value));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UkmediaMainWidget::setDefaultInputVolume(int value)
|
||||
{
|
||||
if(value < 0 || value > 100){
|
||||
qDebug() << "setDefaultOutputVolume value is invalid!";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pVolumeControl->setSourceVolume(m_pVolumeControl->sourceIndex,valueToPaVolume(value));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UkmediaMainWidget::setDefaultOutputMuteState(bool mute)
|
||||
{
|
||||
if(mute == m_pVolumeControl->sinkMuted)
|
||||
return false;
|
||||
|
||||
m_pVolumeControl->setSinkMute(mute);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UkmediaMainWidget::setDefaultInputMuteState(bool mute)
|
||||
{
|
||||
if(mute == m_pVolumeControl->sourceMuted)
|
||||
return false;
|
||||
|
||||
m_pVolumeControl->setSourceMute(mute);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UkmediaMainWidget::setDefaultOutputDevice(QString deviceName)
|
||||
{
|
||||
QMap<int, QMap<QString,QString>>::iterator it;
|
||||
QMap<QString,QString> portNameMap;
|
||||
bool isSucceed = false;
|
||||
|
||||
for (it=m_pVolumeControl->sinkPortMap.begin();it!=m_pVolumeControl->sinkPortMap.end();) {
|
||||
portNameMap = it.value();
|
||||
if(portNameMap.keys().contains(deviceName)){
|
||||
isSucceed = m_pVolumeControl->setDefaultSink(deviceName.toLatin1().data());
|
||||
return isSucceed;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return isSucceed;
|
||||
}
|
||||
|
||||
bool UkmediaMainWidget::setDefaultInputDevice(QString deviceName)
|
||||
{
|
||||
QMap<int, QMap<QString,QString>>::iterator it;
|
||||
QMap<QString,QString> portNameMap;
|
||||
bool isSucceed = false;
|
||||
|
||||
for (it=m_pVolumeControl->sourcePortMap.begin();it!=m_pVolumeControl->sourcePortMap.end();) {
|
||||
portNameMap = it.value();
|
||||
if(portNameMap.keys().contains(deviceName)){
|
||||
isSucceed = m_pVolumeControl->setDefaultSource(deviceName.toLatin1().data());
|
||||
return isSucceed;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return isSucceed;
|
||||
}
|
||||
|
||||
int UkmediaMainWidget::getBatteryLevel(QString deviceName)
|
||||
{
|
||||
qDebug() << "getBatteryLevel" << deviceName;
|
||||
return m_pVolumeControl->batteryLevel;
|
||||
}
|
||||
|
||||
void UkmediaMainWidget::batteryLevelChanged(QString dev, int battery)
|
||||
{
|
||||
qDebug() << "batteryLevelChanged" << dev << battery;
|
||||
Q_EMIT batteryChanged(dev, battery);
|
||||
}
|
||||
|
||||
UkmediaMainWidget::~UkmediaMainWidget()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#include <QLayout>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusUnixFileDescriptor>
|
||||
#include "dbus-adaptor/dbus-adaptor.h"
|
||||
|
||||
extern "C" {
|
||||
#include <gio/gio.h>
|
||||
|
@ -78,6 +79,8 @@ extern "C" {
|
|||
#define UKUI_VOLUME_KEY "volumesize" //音量大小
|
||||
#define UKUI_VOLUME_STATE "soundstate" //音量状态
|
||||
|
||||
#define UKUI_GLOBALTHEME_SETTINGS "org.ukui.globaltheme.settings"
|
||||
#define GLOBAL_THEME_NAME "global-theme-name"
|
||||
|
||||
#define KEY_SOUNDS_SCHEMA "org.ukui.sound"
|
||||
#define TIMER_TIMEOUT (2*1000)
|
||||
|
@ -88,8 +91,10 @@ extern "C" {
|
|||
#define DBUS_PATH "/org/ukui/SettingsDaemon/wayland"
|
||||
#define DBUS_INTERFACE "org.ukui.SettingsDaemon.wayland"
|
||||
|
||||
#define STARTUP_MUSIC "startup-music"
|
||||
#define DNS_NOISE_REDUCTION "dns-noise-reduction"
|
||||
#define VOLUME_INCREASE "volume-increase"
|
||||
#define SOUND_THEME_KEY "theme-name"
|
||||
//第一次运行时初始化音量
|
||||
#define UKUI_AUDIO_SCHEMA "org.ukui.audio" //定制音量
|
||||
#define FIRST_RUN "first-run" //是否第一次运行
|
||||
|
@ -137,6 +142,9 @@ typedef struct {
|
|||
const pa_card_port_info *internalspk;
|
||||
} headsetPorts;
|
||||
|
||||
class QDBusServiceWatcher;
|
||||
|
||||
|
||||
class UkmediaMainWidget : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -150,7 +158,7 @@ public:
|
|||
void initWidget(); //初始化弹出框
|
||||
void initVolumeLed();//初始化静音灯
|
||||
void initGsettings(); //初始化gsetting
|
||||
void updateOutputListWidgetFont();
|
||||
void initStrings();
|
||||
void initAlertSound();
|
||||
void initSystemVolume(); //初始化系统音量
|
||||
void myLine(QFrame *volumeLine,QFrame *volumeSettingLine);//添加分隔线
|
||||
|
@ -232,6 +240,8 @@ public:
|
|||
void uninhibit();
|
||||
void switchModuleEchoCancel(); //加载或卸载降噪模块
|
||||
void resetVolumeSliderRange(); //重新设置滑动条的范围
|
||||
void switchStartupPlayMusic(); //接收到开关按钮的gsetting信号
|
||||
void monitorSessionStatus();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
@ -244,8 +254,26 @@ Q_SIGNALS:
|
|||
void app_name_signal(QString app_name);
|
||||
void theme_change();
|
||||
void font_change();
|
||||
|
||||
void device_changed_signal(QString dev_name);//设备更换信号
|
||||
void batteryChanged(QString dev, int battery);
|
||||
|
||||
public Q_SLOTS:
|
||||
QString getDefaultOutputDevice();
|
||||
QString getDefaultInputDevice();
|
||||
QStringList getAllOutputDevices();
|
||||
QStringList getAllInputDevices();
|
||||
int getDefaultOutputVolume();
|
||||
int getDefaultInputVolume();
|
||||
bool getDefaultOutputMuteState();
|
||||
bool getDefaultInputMuteState();
|
||||
bool setDefaultOutputVolume(int value);
|
||||
bool setDefaultInputVolume(int value);
|
||||
bool setDefaultOutputMuteState(bool mute);
|
||||
bool setDefaultInputMuteState(bool mute);
|
||||
bool setDefaultOutputDevice(QString deviceName);
|
||||
bool setDefaultInputDevice(QString deviceName);
|
||||
int getBatteryLevel(QString deviceName);
|
||||
void batteryLevelChanged(QString dev, int battery);
|
||||
|
||||
private Q_SLOTS:
|
||||
void activatedSystemTrayIconSlot(QSystemTrayIcon::ActivationReason reason); //托盘图标
|
||||
|
@ -263,8 +291,9 @@ private Q_SLOTS:
|
|||
void appWidgetMuteButtonCLickedSlot();//应用音量静音按钮点击
|
||||
|
||||
void ukuiThemeChangedSlot(const QString &themeStr); //主题改变
|
||||
void soundThemeChangedSlot(const QString &soundThemeStr);
|
||||
void fontSizeChangedSlot(const QString &themeStr); //字体大小改变
|
||||
void volumeSettingChangedSlot(); //volume gseting值改变
|
||||
void volumeSettingChangedSlot(const QString &key); //volume gseting值改变
|
||||
void initVolumeSlider(); //初始化滑动条
|
||||
void initDefaultSinkVolume();//初始化默认音量
|
||||
void initDefaultSourceVolume();
|
||||
|
@ -284,12 +313,12 @@ private Q_SLOTS:
|
|||
|
||||
|
||||
void deviceChangedShowSlot(QString dev_name);//osd提示弹窗
|
||||
void osdDisplayWidgetHide(); //osd超时隐藏
|
||||
|
||||
void onTransChanged();
|
||||
void paintWithTrans();
|
||||
|
||||
void onPrepareForSleep(bool sleep);
|
||||
void getSessionActive(); //获取session的活跃状态
|
||||
|
||||
private:
|
||||
QLabel *systemWidgetLabel;
|
||||
|
@ -316,6 +345,7 @@ private:
|
|||
QGSettings *m_pVolumeSetting; //
|
||||
QGSettings *m_pFontSetting; //字体gsetting
|
||||
QGSettings *m_pInitSystemVolumeSetting; //初始化系统音量
|
||||
QGSettings *m_pSoundThemeSetting;
|
||||
|
||||
QGSettings * m_pTransGsettings; //透明度配置文件
|
||||
double m_pTransparency=0.0; //透明度
|
||||
|
@ -363,6 +393,16 @@ private:
|
|||
int updateAppVolumeCount = 0;
|
||||
int outputListWidgetRow = -1;
|
||||
|
||||
QString m_sessionControllerName;
|
||||
QString m_sessionPath;
|
||||
QString m_sessionControllerService ;
|
||||
QString m_sessionControllerPath;
|
||||
QString m_sessionControllerManagerInterface;
|
||||
QString m_sessionControllerSeatInterface ;
|
||||
QString m_sessionControllerSessionInterface ;
|
||||
QString m_sessionControllerActiveProperty ;
|
||||
QString m_sessionControllerPropertiesInterface;
|
||||
|
||||
QDBusUnixFileDescriptor m_inhibitFileDescriptor;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -16,152 +16,217 @@
|
|||
*
|
||||
*/
|
||||
#include "ukmedia_osd_display_widget.h"
|
||||
#include <QHBoxLayout>
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QDebug>
|
||||
#include <QStyleOption>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <KWindowEffects>
|
||||
#include <kwindowsystem.h>
|
||||
#include <kwindowsystem_export.h>
|
||||
#include "xatom/xatom-helper.h"
|
||||
#include <QIcon>
|
||||
|
||||
|
||||
extern double transparency;
|
||||
UkmediaOsdDisplayWidget::UkmediaOsdDisplayWidget(QWidget *parent) : QWidget (parent)
|
||||
{
|
||||
osdWidget = new QWidget(this);
|
||||
iconButton = new QPushButton(this);
|
||||
ret = 0;
|
||||
iconButton->setFocusPolicy(Qt::NoFocus);
|
||||
UkmediaOsdDisplayWidgetInit();
|
||||
// this->setMouseTracking(false);
|
||||
// setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint|Qt::X11BypassWindowManagerHint);
|
||||
// this->setWindowFlags(Qt::FramelessWindowHint|Qt::ToolTip);
|
||||
this->setWindowFlags(Qt::WindowStaysOnTopHint|Qt::Popup|Qt::ToolTip|Qt::FramelessWindowHint);
|
||||
setFixedSize(OSDWIDGET_SIZE);
|
||||
iconLabel = new QLabel(this);
|
||||
iconLabel->setFixedSize(QSize(ICON_SIZE));
|
||||
|
||||
initGsettings();
|
||||
initAttribute();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief
|
||||
* \details
|
||||
* 通过dbus获取任务栏位置
|
||||
|
||||
/**
|
||||
* @brief UkmediaOsdDisplayWidget::initAttribute
|
||||
* 初始化界面属性
|
||||
*/
|
||||
int UkmediaOsdDisplayWidget::getPanelPosition(QString str)
|
||||
void UkmediaOsdDisplayWidget::initAttribute()
|
||||
{
|
||||
QDBusInterface interface( "com.ukui.panel.desktop",
|
||||
"/",
|
||||
"com.ukui.panel.desktop",
|
||||
QDBusConnection::sessionBus() );
|
||||
QDBusReply<int> reply = interface.call("GetPanelPosition", str);
|
||||
if (reply < 0)
|
||||
return 0;
|
||||
return reply;
|
||||
mTimer = new QTimer();
|
||||
connect(mTimer,SIGNAL(timeout()),this,SLOT(timeoutHandle()));
|
||||
|
||||
setWindowFlags(Qt::FramelessWindowHint |
|
||||
Qt::Tool |
|
||||
Qt::WindowStaysOnTopHint |
|
||||
Qt::X11BypassWindowManagerHint |
|
||||
Qt::Popup);
|
||||
|
||||
setAttribute(Qt::WA_TranslucentBackground,true);
|
||||
setAutoFillBackground(true);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief
|
||||
* \details
|
||||
* 通过dbus获取任务栏高度
|
||||
|
||||
/**
|
||||
* @brief UkmediaOsdDisplayWidget::initGsettings
|
||||
* 初始化配置文件
|
||||
*/
|
||||
int UkmediaOsdDisplayWidget::getPanelHeight(QString str)
|
||||
void UkmediaOsdDisplayWidget::initGsettings()
|
||||
{
|
||||
QDBusInterface interface( "com.ukui.panel.desktop",
|
||||
"/",
|
||||
"com.ukui.panel.desktop",
|
||||
QDBusConnection::sessionBus() );
|
||||
QDBusReply<int> reply = interface.call("GetPanelSize", str);
|
||||
if (reply <= 0)
|
||||
return 46;
|
||||
return reply;
|
||||
}
|
||||
|
||||
void UkmediaOsdDisplayWidget::UkmediaOsdDisplayWidgetInit()
|
||||
{
|
||||
QVBoxLayout *hLayout = new QVBoxLayout();
|
||||
hLayout->addWidget(iconButton);
|
||||
osdWidget->setLayout(hLayout);
|
||||
|
||||
int margin = 12;
|
||||
osdWidget->layout()->setContentsMargins(margin,margin,margin,margin);
|
||||
|
||||
this->setFixedSize(72,72);
|
||||
this->iconButton->setFixedSize(48,48);
|
||||
|
||||
QSize iconSize(48,48);
|
||||
this->iconButton->setIconSize(iconSize);
|
||||
|
||||
this->setAttribute(Qt::WA_TranslucentBackground);
|
||||
QPalette palete = iconButton->palette();
|
||||
palete.setColor(QPalette::Highlight,Qt::transparent);
|
||||
palete.setBrush(QPalette::Button,QBrush(QColor(245,245,245,0.75)));
|
||||
iconButton->setPalette(palete);
|
||||
|
||||
// this->setStyleSheet("QWidget{background:rgba(245,245,245,0.75); border-radius:12px;}");
|
||||
// this->osdWidget->setStyleSheet("QWidget{background:rgba(245,245,245,0.75); border-radius:12px;}");
|
||||
// this->iconButton->setStyleSheet("QPushButton::hover{background:rgba(245,245,245,0.75);"
|
||||
// "border-radius:4px;}"
|
||||
// "QPushButton::pressed{background:rgba((245,245,245,0.75);"
|
||||
// "border-radius:4px;padding-left:0px;}");
|
||||
}
|
||||
|
||||
void UkmediaOsdDisplayWidget::UkmediaOsdSetIcon(QPixmap dev_Icon,QString themeType)
|
||||
{
|
||||
QSize iconSize(48,48);
|
||||
|
||||
if ( themeType == "ukui-white" || themeType == "ukui-light") {
|
||||
this->iconButton->setStyleSheet("QPushButton{background:rgba(245,245,245,1);"
|
||||
"border-radius:12px;padding-left:0px;}");
|
||||
this->setStyleSheet("QWidget{background:rgba(245,245,245,1); border-radius:12px;}");
|
||||
this->osdWidget->setStyleSheet("QWidget{background:rgba(245,245,245,1); border-radius:12px;}");
|
||||
this->iconButton->setStyleSheet("QPushButton::hover{background:rgba(245,245,245,1);"
|
||||
"border-radius:4px;}"
|
||||
"QPushButton::pressed{background:rgba((245,245,245,1);"
|
||||
"border-radius:4px;padding-left:0px;}");
|
||||
}
|
||||
else if (themeType == "ukui-dark" || themeType == "ukui-black" || themeType == "ukui-default") {
|
||||
this->iconButton->setStyleSheet("QPushButton{background:rgba(23,24,26,1);"
|
||||
"border-radius:12px;padding-left:0px;}");
|
||||
this->setStyleSheet("QWidget{background:rgba(23,24,26,1); border-radius:12px;}");
|
||||
this->osdWidget->setStyleSheet("QWidget{background:rgba(23,24,26,1); border-radius:12px;}");
|
||||
this->iconButton->setStyleSheet("QPushButton::hover{background:rgba(23,24,26,1);"
|
||||
"border-radius:4px;}"
|
||||
"QPushButton::pressed{background:rgba((23,24,26,1);"
|
||||
"border-radius:4px;padding-left:0px;}");
|
||||
if(QGSettings::isSchemaInstalled(THEME)){
|
||||
m_pThemeSetting = new QGSettings(THEME);
|
||||
connect(m_pThemeSetting, &QGSettings::changed, this, &UkmediaOsdDisplayWidget::ukuiThemeChangedSlot);
|
||||
}
|
||||
|
||||
#define MARGIN 8
|
||||
QDBusInterface iface("org.ukui.panel",
|
||||
"/panel/position",
|
||||
"org.ukui.panel",
|
||||
QDBusConnection::sessionBus());
|
||||
QDBusReply<QVariantList> reply=iface.call("GetPrimaryScreenGeometry");
|
||||
QVariantList position_list=reply.value();
|
||||
|
||||
this->iconButton->setIconSize(iconSize);
|
||||
this->iconButton->setProperty("useIconHighlightEffect",true);
|
||||
this->iconButton->setProperty("iconHighlightEffectMode",true);
|
||||
//this->iconButton->setIcon(QIcon(drawDarkColoredPixmap((QIcon::fromTheme(muteButtonStr).pixmap(iconSize)))));
|
||||
this->setAttribute(Qt::WA_TranslucentBackground);
|
||||
this->iconButton->setIcon(dev_Icon);
|
||||
this->setGeometry(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-200,
|
||||
position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
||||
this->width(),this->height());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UkmediaOsdDisplayWidget::dialogShow
|
||||
* 弹出窗口
|
||||
*/
|
||||
void UkmediaOsdDisplayWidget::dialogShow()
|
||||
{
|
||||
repaintWidget();
|
||||
show();
|
||||
mTimer->start(2000);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UkmediaOsdDisplayWidget::timeoutHandle
|
||||
* 超时隐藏窗口
|
||||
*/
|
||||
void UkmediaOsdDisplayWidget::timeoutHandle()
|
||||
{
|
||||
hide();
|
||||
mTimer->stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UkmediaOsdDisplayWidget::setIcon
|
||||
* 设置弹窗图标
|
||||
*/
|
||||
void UkmediaOsdDisplayWidget::setIcon(QString iconStr)
|
||||
{
|
||||
mIconName.clear();
|
||||
mIconName = iconStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UkmediaOsdDisplayWidget::repaintWidget
|
||||
* 重绘窗口
|
||||
*/
|
||||
void UkmediaOsdDisplayWidget::repaintWidget()
|
||||
{
|
||||
if(m_pThemeSetting->get("style-name").toString() == "ukui-light"){
|
||||
setPalette(QPalette(QColor("#F5F5F5")));//设置窗口背景
|
||||
} else{
|
||||
setPalette(QPalette(QColor("#232426")));//设置窗口背景色
|
||||
}
|
||||
QPixmap m_pixmap = QIcon::fromTheme(mIconName).pixmap(QSize(48,48));
|
||||
iconLabel->setPixmap(drawLightColoredPixmap(m_pixmap,m_pThemeSetting->get("style-name").toString()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UkmediaOsdDisplayWidget::ukuiThemeChangedSlot
|
||||
* 更换系统主题自动刷新界面
|
||||
*/
|
||||
void UkmediaOsdDisplayWidget::ukuiThemeChangedSlot(const QString &themeStr)
|
||||
{
|
||||
if(!this->isHidden()) {
|
||||
hide();
|
||||
repaintWidget();
|
||||
show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief UkmediaOsdDisplayWidget::getGlobalOpacity
|
||||
* 获取系统透明度
|
||||
*/
|
||||
double UkmediaOsdDisplayWidget::getGlobalOpacity()
|
||||
{
|
||||
double transparency=0.0;
|
||||
if(QGSettings::isSchemaInstalled(TRANSPARENCY))
|
||||
{
|
||||
QGSettings gsetting(TRANSPARENCY);
|
||||
if(gsetting.keys().contains(QString("transparency")))
|
||||
transparency=gsetting.get("transparency").toDouble();
|
||||
}
|
||||
return transparency;
|
||||
}
|
||||
|
||||
|
||||
QPixmap UkmediaOsdDisplayWidget::drawLightColoredPixmap(const QPixmap &source, const QString &style)
|
||||
{
|
||||
int value = 255;
|
||||
if(style == "ukui-light"){
|
||||
value = 0;
|
||||
}
|
||||
|
||||
QColor gray(255,255,255);
|
||||
QColor standard (0,0,0);
|
||||
QImage img = source.toImage();
|
||||
for (int x = 0; x < img.width(); x++) {
|
||||
for (int y = 0; y < img.height(); y++) {
|
||||
auto color = img.pixelColor(x, y);
|
||||
if (color.alpha() > 0) {
|
||||
if (qAbs(color.red()-gray.red())<20 && qAbs(color.green()-gray.green())<20 && qAbs(color.blue()-gray.blue())<20) {
|
||||
color.setRed(value);
|
||||
color.setGreen(value);
|
||||
color.setBlue(value);
|
||||
img.setPixelColor(x, y, color);
|
||||
}
|
||||
else {
|
||||
color.setRed(value);
|
||||
color.setGreen(value);
|
||||
color.setBlue(value);
|
||||
img.setPixelColor(x, y, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return QPixmap::fromImage(img);
|
||||
}
|
||||
|
||||
|
||||
void UkmediaOsdDisplayWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QStyleOption opt;
|
||||
int rounded;
|
||||
opt.init(this);
|
||||
QPainter p(this);
|
||||
double transparence = transparency * 255;
|
||||
QColor color = palette().color(QPalette::Base);
|
||||
color.setAlpha(transparence);
|
||||
QBrush brush = QBrush(color);
|
||||
p.setBrush(brush);
|
||||
p.setPen(Qt::NoPen);
|
||||
QRect rect = this->rect();
|
||||
QPainterPath path;
|
||||
opt.rect.adjust(0,0,0,0);
|
||||
rounded = 12;
|
||||
path.addRoundedRect(opt.rect,rounded,rounded);
|
||||
p.setRenderHint(QPainter::Antialiasing); // 反锯齿;
|
||||
p.drawRoundedRect(opt.rect,rounded,rounded);
|
||||
this->setAttribute(Qt::WA_TranslucentBackground);
|
||||
setProperty("blurRegion",QRegion(path.toFillPolygon().toPolygon()));
|
||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||
// QWidget::paintEvent(event);
|
||||
qreal opacity = getGlobalOpacity();
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::Antialiasing); // 反锯齿;
|
||||
painter.setPen(Qt::transparent);
|
||||
qreal radius=12;
|
||||
path.moveTo(rect.topRight() - QPointF(radius, 0));
|
||||
path.lineTo(rect.topLeft() + QPointF(radius, 0));
|
||||
path.quadTo(rect.topLeft(), rect.topLeft() + QPointF(0, radius));
|
||||
path.lineTo(rect.bottomLeft() + QPointF(0, -radius));
|
||||
path.quadTo(rect.bottomLeft(), rect.bottomLeft() + QPointF(radius, 0));
|
||||
path.lineTo(rect.bottomRight() - QPointF(radius, 0));
|
||||
path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius));
|
||||
path.lineTo(rect.topRight() + QPointF(0, radius));
|
||||
path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0));
|
||||
|
||||
painter.setBrush(this->palette().base());
|
||||
painter.setPen(Qt::transparent);
|
||||
painter.setOpacity(opacity);
|
||||
painter.drawPath(path);
|
||||
|
||||
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
|
||||
|
||||
QWidget::paintEvent(event);
|
||||
}
|
||||
|
||||
|
||||
void UkmediaOsdDisplayWidget::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
iconLabel->move((width() - iconLabel->width())/2,(height() - iconLabel->height())/2);
|
||||
QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
|
||||
UkmediaOsdDisplayWidget::~UkmediaOsdDisplayWidget()
|
||||
{
|
||||
|
||||
delete mTimer;
|
||||
mTimer = nullptr;
|
||||
}
|
||||
|
|
|
@ -19,32 +19,53 @@
|
|||
#define UKMEDIAOSDDISPLAYWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPushButton>
|
||||
#include <QtDBus/QDBusConnection>
|
||||
#include <QtDBus/QDBusMessage>
|
||||
#include <QtDBus/QDBusInterface>
|
||||
#include <QtDBus/QDBusObjectPath>
|
||||
#include <QLabel>
|
||||
#include <QDBusReply>
|
||||
#include "customstyle.h"
|
||||
#include "ukmedia_custom_class.h"
|
||||
#include <QGSettings>
|
||||
#include <QApplication>
|
||||
#include <QBoxLayout>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusReply>
|
||||
#include <QDebug>
|
||||
#include <QX11Info>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
#include <QIcon>
|
||||
|
||||
#define OSDWIDGET_SIZE 72,72
|
||||
#define ICON_SIZE 48,48
|
||||
#define TRANSPARENCY "org.ukui.control-center.personalise"
|
||||
#define THEME "org.ukui.style"
|
||||
|
||||
class UkmediaOsdDisplayWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
UkmediaOsdDisplayWidget(QWidget *parent = nullptr);
|
||||
~UkmediaOsdDisplayWidget();
|
||||
int getPanelPosition(QString str);
|
||||
int getPanelHeight(QString str);
|
||||
|
||||
void UkmediaOsdDisplayWidgetInit();
|
||||
void UkmediaOsdSetIcon(QPixmap dev_Icon,QString themeType);
|
||||
friend class DeviceSwitchWidget;
|
||||
private:
|
||||
QWidget *osdWidget;
|
||||
double size;
|
||||
QPushButton *iconButton;
|
||||
int ret;
|
||||
|
||||
void initAttribute();
|
||||
void initGsettings();
|
||||
void setIcon(QString iconStr);
|
||||
void dialogShow();
|
||||
|
||||
QTimer *mTimer;
|
||||
QLabel *iconLabel;
|
||||
QString mIconName;
|
||||
|
||||
QGSettings *m_pThemeSetting;
|
||||
QPixmap drawLightColoredPixmap(const QPixmap &source, const QString &style);
|
||||
|
||||
public Q_SLOTS:
|
||||
void repaintWidget();
|
||||
void timeoutHandle();
|
||||
void ukuiThemeChangedSlot(const QString &themeStr);
|
||||
double getGlobalOpacity();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
};
|
||||
|
||||
#endif // UKMEDIAOSDDISPLAYWIDGET_H
|
||||
|
|
|
@ -27,26 +27,37 @@ UkmediaSystemVolumeWidget::UkmediaSystemVolumeWidget(QWidget *parent) : QWidget(
|
|||
m_pInputListWidget = new QListWidget(this);
|
||||
m_pSysSliderWidget = new QWidget(this);
|
||||
|
||||
m_pOutputListWidget->setFixedSize(404,245);//系统音量输出下面的一个大窗口用来存放各种输出设备widget
|
||||
m_pOutputListWidget->setFixedSize(404,245);
|
||||
m_pOutputListWidget->setFrameShape(QFrame::Shape::NoFrame);
|
||||
|
||||
QPalette pal = m_pOutputListWidget->palette();
|
||||
pal.setBrush(QPalette::Base, QColor(0,0,0,0)); //背景透明
|
||||
m_pOutputListWidget->setPalette(pal);
|
||||
m_pOutputListWidget->setProperty("needTranslucent", true);
|
||||
m_pOutputListWidget->setSelectionMode(QAbstractItemView:: NoSelection);
|
||||
|
||||
QWidget *outputWidget = new QWidget(this);
|
||||
outputWidget->setFixedSize(404,245);
|
||||
QHBoxLayout *outputWidgetLayout = new QHBoxLayout;
|
||||
outputWidgetLayout->addWidget(m_pOutputListWidget);
|
||||
outputWidgetLayout->setSpacing(0);
|
||||
outputWidgetLayout->setContentsMargins(0,0,8,0);
|
||||
outputWidgetLayout->setContentsMargins(0,0,0,0);
|
||||
outputWidget->setLayout(outputWidgetLayout);
|
||||
|
||||
|
||||
|
||||
m_pInputListWidget->hide();
|
||||
m_pSysSliderWidget->setFixedSize(412,48);
|
||||
m_pSystemVolumeBtn = new UkuiMediaMuteButton(m_pSysSliderWidget);
|
||||
m_pSysSliderWidget->setFixedSize(404,48);
|
||||
m_pSystemVolumeBtn = new QPushButton(m_pSysSliderWidget);
|
||||
m_pSystemVolumeBtn->setFixedSize(36,36);
|
||||
m_pSystemVolumeBtn->setActive(true);
|
||||
m_pSystemVolumeBtn->setCheckable(true);
|
||||
m_pSystemVolumeBtn->setProperty("isRoundButton",true); //圆形按钮
|
||||
m_pSystemVolumeBtn->setProperty("useButtonPalette",true); //灰色按钮
|
||||
m_pSystemVolumeBtn->setProperty("needTranslucent", true); //灰色半透明按钮
|
||||
|
||||
m_pSystemVolumeSlider = new UkmediaVolumeSlider(m_pSysSliderWidget);
|
||||
m_pSystemVolumeSlider->setOrientation(Qt::Horizontal);
|
||||
m_pSystemVolumeSlider->setFixedSize(273,48);
|
||||
m_pSystemVolumeSlider->setFocusPolicy(Qt::StrongFocus);
|
||||
m_pSystemVolumeSlider->setProperty("needTranslucent", true); // Increase translucent effect
|
||||
m_pSystemVolumeSlider->setFixedSize(284,48);
|
||||
m_pSystemVolumeSlider->setRange(0,100);
|
||||
|
||||
m_pSystemVolumeSliderLabel = new QLabel(m_pSysSliderWidget);
|
||||
|
@ -62,7 +73,7 @@ UkmediaSystemVolumeWidget::UkmediaSystemVolumeWidget(QWidget *parent) : QWidget(
|
|||
QHBoxLayout *systemVolumeLabelLayout = new QHBoxLayout;
|
||||
systemVolumeLabelLayout->addWidget(m_pSystemVolumeLabel);
|
||||
systemVolumeLabelWidget->setLayout(systemVolumeLabelLayout);
|
||||
systemVolumeLabelLayout->setContentsMargins(16,0,0,0);
|
||||
systemVolumeLabelLayout->setContentsMargins(16,0,16,0);
|
||||
|
||||
//输出label布局
|
||||
m_pOutputLabel = new QLabel(this);
|
||||
|
@ -73,7 +84,7 @@ UkmediaSystemVolumeWidget::UkmediaSystemVolumeWidget(QWidget *parent) : QWidget(
|
|||
QHBoxLayout *outputLabelLayout = new QHBoxLayout;
|
||||
outputLabelLayout->addWidget(m_pOutputLabel);
|
||||
outputLabelWidget->setLayout(outputLabelLayout);
|
||||
outputLabelLayout->setContentsMargins(16,0,0,0);
|
||||
outputLabelLayout->setContentsMargins(16,0,16,0);
|
||||
|
||||
QPalette palette = m_pSystemVolumeLabel->palette();
|
||||
QColor color = palette.color(QPalette::PlaceholderText);
|
||||
|
@ -92,18 +103,19 @@ UkmediaSystemVolumeWidget::UkmediaSystemVolumeWidget(QWidget *parent) : QWidget(
|
|||
volumeSettingLayout->addWidget(volumeSettingButton);
|
||||
volumeSettingLayout->addStretch();
|
||||
volumeSettingFrame->setLayout(volumeSettingLayout);
|
||||
volumeSettingLayout->setContentsMargins(16,0,24,8);
|
||||
volumeSettingLayout->setContentsMargins(16,0,24,0);
|
||||
|
||||
//系统音量滑动条布局
|
||||
QHBoxLayout *sysVolumeLay = new QHBoxLayout();
|
||||
sysVolumeLay->addWidget(m_pSystemVolumeBtn);
|
||||
sysVolumeLay->addSpacing(8);
|
||||
sysVolumeLay->addWidget(m_pSystemVolumeSlider);
|
||||
sysVolumeLay->setSpacing(3);
|
||||
sysVolumeLay->addWidget(m_pSystemVolumeSliderLabel);
|
||||
sysVolumeLay->setSpacing(0);
|
||||
m_pSystemVolumeSliderLabel->setAlignment(Qt::AlignCenter);
|
||||
m_pSysSliderWidget->setLayout(sysVolumeLay);
|
||||
sysVolumeLay->setContentsMargins(16,0,24,0);
|
||||
sysVolumeLay->setContentsMargins(16,0,2,0);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(systemVolumeLabelWidget);
|
||||
|
@ -113,28 +125,12 @@ UkmediaSystemVolumeWidget::UkmediaSystemVolumeWidget(QWidget *parent) : QWidget(
|
|||
mainLayout->addWidget(outputLabelWidget);
|
||||
mainLayout->addSpacing(8);
|
||||
mainLayout->addWidget(outputWidget);
|
||||
mainLayout->addSpacing(8);
|
||||
mainLayout->addSpacing(2);
|
||||
mainLayout->addWidget(volumeSettingFrame);
|
||||
mainLayout->setSpacing(0);
|
||||
this->setLayout(mainLayout);
|
||||
mainLayout->setContentsMargins(8,16,0,0);
|
||||
mainLayout->setContentsMargins(8,16,8,0);
|
||||
this->setFixedSize(420,436);
|
||||
m_pOutputListWidget->setStyleSheet(
|
||||
"QListWidget{"
|
||||
"background-color:rgba(0,0,0,0);"
|
||||
"padding-left:0;"
|
||||
"padding-right:0;"
|
||||
"padding-top:0;"
|
||||
"padding-bottom:0;}"
|
||||
"QListWidget::item{"
|
||||
"background-color:rgba(0,0,0,0);"
|
||||
"border-radius:6px;}"
|
||||
);
|
||||
|
||||
// listwidget选中item项默认为蓝色,暂时没找到方法设置透明
|
||||
// QPalette pal = m_pOutputListWidget->palette();
|
||||
// pal.setBrush(QPalette::Base, QColor(0,0,0,0)); //背景透明
|
||||
// m_pOutputListWidget->setPalette(pal);
|
||||
}
|
||||
|
||||
void UkmediaSystemVolumeWidget::onPaletteChanged(){
|
||||
|
|
|
@ -46,7 +46,7 @@ private:
|
|||
QFrame *volumeSettingFrame;
|
||||
UkuiSettingButton *volumeSettingButton;
|
||||
|
||||
UkuiMediaMuteButton *m_pSystemVolumeBtn;//系统音量界面的音量按钮(点击可以静音)
|
||||
QPushButton *m_pSystemVolumeBtn;
|
||||
|
||||
public Q_SLOTS:
|
||||
void onPaletteChanged();
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
#include <QSettings>
|
||||
#include <QDebug>
|
||||
#include <QSlider>
|
||||
#include <qjsondocument.h>
|
||||
#include <qjsonobject.h>
|
||||
#include <QSettings>
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
//pa_sink_info *m_pDefaultSink;
|
||||
/* Used for profile sorting */
|
||||
|
@ -577,6 +581,10 @@ void UkmediaVolumeControl::updateCard(UkmediaVolumeControl *c, const pa_card_inf
|
|||
}
|
||||
}
|
||||
|
||||
if (strstr(info.name, "bluez_card")) {
|
||||
getBatteryLevel(info.name);
|
||||
}
|
||||
|
||||
|
||||
/* Because the port info for sinks and sources is discontinued we need
|
||||
* to update the port info for them here. */
|
||||
|
@ -585,6 +593,89 @@ void UkmediaVolumeControl::updateCard(UkmediaVolumeControl *c, const pa_card_inf
|
|||
Q_EMIT checkDeviceSelectionSianal(&info);
|
||||
}
|
||||
|
||||
/*
|
||||
获取声卡名,参考aplay -L
|
||||
*/
|
||||
|
||||
QString card_get(int card)
|
||||
{
|
||||
snd_ctl_t *handle;
|
||||
int err, dev, idx;
|
||||
snd_ctl_card_info_t *info;
|
||||
snd_pcm_info_t *pcminfo;
|
||||
snd_ctl_card_info_alloca(&info);
|
||||
snd_pcm_info_alloca(&pcminfo);
|
||||
|
||||
char name[32];
|
||||
sprintf(name, "hw:%d", card);
|
||||
if ((err = snd_ctl_open(&handle, name, 0)) < 0) {
|
||||
qInfo("control open (%i): %s", card, snd_strerror(err));
|
||||
}
|
||||
if ((err = snd_ctl_card_info(handle, info)) < 0) {
|
||||
qInfo("control hardware info (%i): %s", card, snd_strerror(err));
|
||||
snd_ctl_close(handle);
|
||||
}
|
||||
dev = -1;
|
||||
while (1) {
|
||||
unsigned int count;
|
||||
if (dev < 0)
|
||||
break;
|
||||
snd_pcm_info_set_device(pcminfo, dev);
|
||||
snd_pcm_info_set_subdevice(pcminfo, 0);
|
||||
snd_pcm_info_set_stream(pcminfo, SND_PCM_STREAM_PLAYBACK);
|
||||
if ((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) {
|
||||
// if (err != -ENOENT)
|
||||
// error("control digital audio info (%i): %s", card, snd_strerror(err));
|
||||
continue;
|
||||
}
|
||||
qDebug() <<"card_get"<< card << snd_ctl_card_info_get_id(info);
|
||||
|
||||
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) {
|
||||
qInfo("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);
|
||||
|
||||
return snd_ctl_card_info_get_id(info);
|
||||
}
|
||||
|
||||
void UkmediaVolumeControl::insertJson(QString key,QString key_value,QString jsonfile)
|
||||
{
|
||||
QJsonObject rootObj;
|
||||
|
||||
rootObj.insert(key, key_value); //完成拍摄
|
||||
|
||||
// 将json对象里的数据转换为字符串
|
||||
QJsonDocument doc;
|
||||
// 将object设置为本文档的主要对象
|
||||
doc.setObject(rootObj);
|
||||
|
||||
QString filename = QDir::homePath();
|
||||
filename += jsonfile;
|
||||
|
||||
QFile file(filename);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||
qDebug() << "can't open error!";
|
||||
return ;
|
||||
}
|
||||
|
||||
QTextStream stream(&file);
|
||||
stream.setCodec("UTF-8"); // 设置写入编码是UTF8
|
||||
// 写入文件
|
||||
stream << doc.toJson();
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Update output device when the default output device or port is updated
|
||||
*/
|
||||
|
@ -606,7 +697,17 @@ bool UkmediaVolumeControl::updateSink(UkmediaVolumeControl *w,const pa_sink_info
|
|||
channelMap = info.channel_map;
|
||||
sinkIndex = info.index;
|
||||
if (info.active_port) {
|
||||
if((strcmp(info.active_port->name,sinkPortName.toLatin1().data()) != 0)){
|
||||
|
||||
//获取当前声卡名
|
||||
QString now_card ="hw:CARD=";
|
||||
now_card +=card_get(atoi(pa_proplist_gets(info.proplist,"alsa.card")));
|
||||
now_card +=",DEV=";
|
||||
now_card += pa_proplist_gets(info.proplist,"alsa.device");
|
||||
|
||||
//向 /home/username/.config/audio.json 文件中插入属性
|
||||
insertJson("card",now_card,"/.config/audio.json");
|
||||
|
||||
if((strcmp(info.active_port->name,sinkPortName.toLatin1().data()) != 0)){
|
||||
//拔出耳机转为扬声器时,音乐暂停信号
|
||||
if ((strstr(sinkPortName.toLatin1().data(),"headphone") || strstr(sinkPortName.toLatin1().data(),"Headphone")) \
|
||||
&& strstr(info.active_port->name,"speaker") || strstr(info.active_port->name,"Speaker")) {
|
||||
|
@ -615,14 +716,6 @@ bool UkmediaVolumeControl::updateSink(UkmediaVolumeControl *w,const pa_sink_info
|
|||
QDBusConnection::sessionBus().send(message);
|
||||
qDebug() << "sinkPortChanged" << sinkPortName;
|
||||
}
|
||||
// if(sinkPortName == "")
|
||||
// {
|
||||
// QDBusMessage message = QDBusMessage::createSignal("/","org.ukui.media","sinkPortChanged");
|
||||
// message << "portChanged";
|
||||
// QDBusConnection::sessionBus().send(message);
|
||||
// qDebug() << "sinkPortChanged IN sinkindexCb with NO SINK" << w->sinkPortName;
|
||||
// qDebug() << "sinkPortChanged" << sinkPortName;
|
||||
// }
|
||||
|
||||
//defaultSinkName不变时不走serverinfo需要手动设置outputListwidgetItem项
|
||||
if(strcmp(sinkPortName.toLatin1().data(),info.active_port->name) != 0){
|
||||
|
@ -670,6 +763,8 @@ bool UkmediaVolumeControl::updateSink(UkmediaVolumeControl *w,const pa_sink_info
|
|||
if(sinkMuted != info.mute) {
|
||||
sinkMuted = info.mute;
|
||||
Q_EMIT updateMute(sinkMuted);
|
||||
if(sinkVolume = volume)
|
||||
sendSinkVolumeChangeSignal(sinkVolume,sinkMuted);
|
||||
}
|
||||
if (sinkVolume != volume) {
|
||||
if(temp != "")
|
||||
|
@ -677,6 +772,7 @@ bool UkmediaVolumeControl::updateSink(UkmediaVolumeControl *w,const pa_sink_info
|
|||
sinkVolume = volume;
|
||||
sinkMuted = info.mute;
|
||||
Q_EMIT updateVolume(sinkVolume);
|
||||
sendSinkVolumeChangeSignal(sinkVolume,sinkMuted);
|
||||
}
|
||||
}
|
||||
qDebug() << "UpdateSink--->" << "sinkIndex:" << sinkIndex << "sinkPortName:" << sinkPortName << "sinkVolume:" << sinkVolume << "channel:" << channel;
|
||||
|
@ -936,7 +1032,7 @@ void UkmediaVolumeControl::updateSinkInput(const pa_sink_input_info &info) {
|
|||
}
|
||||
//fixed bug:100614、100610 无线投屏时应用音量界面里应用音量没有图标显示
|
||||
else if (description && (strcmp(description,"castplayer") == 0 || strcmp(description,"miraclecast") == 0 )) {
|
||||
appBinary = nullptr;
|
||||
appBinary = "kylin-miracast";
|
||||
}
|
||||
|
||||
if(appBinary) {
|
||||
|
@ -987,7 +1083,7 @@ void UkmediaVolumeControl::updateSourceOutput(const pa_source_output_info &info)
|
|||
}
|
||||
//fixed bug:100614、100610 无线投屏时应用音量界面里应用音量没有图标显示
|
||||
else if (description && (strcmp(description,"castplayer") == 0 || strcmp(description,"miraclecast") == 0 )) {
|
||||
appBinary = nullptr;
|
||||
appBinary = "kylin-miracast";
|
||||
}
|
||||
|
||||
if(appBinary) {
|
||||
|
@ -1117,7 +1213,6 @@ void UkmediaVolumeControl::removeSinkInput(uint32_t index)
|
|||
|
||||
if(!sinkInputIndexMap.values().contains(description) || sinkInputIndexMap.isEmpty())
|
||||
{
|
||||
qDebug() << "移除" << description << "应用窗口";
|
||||
sinkInputValueMap.remove(description);//如果所有相同description的index都被移除,需要移除valueMap对应的description
|
||||
sinkInputMuteMap.remove(description);
|
||||
if(description != "")
|
||||
|
@ -1136,7 +1231,6 @@ void UkmediaVolumeControl::removeSourceOutput(uint32_t index)
|
|||
|
||||
if(!sourceOutputIndexMap.values().contains(description) || sourceOutputIndexMap.isEmpty())
|
||||
{
|
||||
qDebug() << "移除" << description << "应用窗口";
|
||||
sourceOutputValueMap.remove(description);
|
||||
sinkInputMuteMap.remove(description);
|
||||
if(description != "")
|
||||
|
@ -1200,6 +1294,62 @@ void UkmediaVolumeControl::cardCb(pa_context *c, const pa_card_info *i, int eol,
|
|||
w->updateCard(w,*i);
|
||||
}
|
||||
|
||||
void UkmediaVolumeControl::batteryLevelCb(pa_context *c, const pa_card_info *i, int eol, void *userdata) {
|
||||
UkmediaVolumeControl *w = static_cast<UkmediaVolumeControl*>(userdata);
|
||||
|
||||
if (eol < 0) {
|
||||
if (pa_context_errno(c) == PA_ERR_NOENTITY)
|
||||
return;
|
||||
|
||||
w->showError(QObject::tr("Card callback failure").toUtf8().constData());
|
||||
return;
|
||||
}
|
||||
|
||||
if (eol > 0) {
|
||||
decOutstanding(w);
|
||||
return;
|
||||
}
|
||||
qDebug() << "batteryLevelCb" << i->index << eol;
|
||||
const char *battery = pa_proplist_gets(i->proplist,"bluetooth.battery");
|
||||
if (battery) {
|
||||
|
||||
qDebug() << "get bluetooth battery is:" << battery << atoi(battery);
|
||||
w->batteryLevel = atoi(battery);
|
||||
}
|
||||
else
|
||||
w->batteryLevel = -1;
|
||||
}
|
||||
|
||||
void UkmediaVolumeControl::bluetoothCardCb(pa_context *c, const pa_card_info *i, int eol, void *userdata) {
|
||||
UkmediaVolumeControl *w = static_cast<UkmediaVolumeControl*>(userdata);
|
||||
|
||||
if (eol < 0) {
|
||||
if (pa_context_errno(c) == PA_ERR_NOENTITY)
|
||||
return;
|
||||
|
||||
w->showError(QObject::tr("Card callback failure").toUtf8().constData());
|
||||
return;
|
||||
}
|
||||
|
||||
if (eol > 0) {
|
||||
decOutstanding(w);
|
||||
return;
|
||||
}
|
||||
qDebug() << "bluetooth card cb" << i->index << eol;
|
||||
const char *battery = pa_proplist_gets(i->proplist,"bluetooth.battery");
|
||||
QString device_name = i->name;
|
||||
if (battery) {
|
||||
|
||||
qDebug() << "bluetooth battery is ===" << battery << atoi(battery)<< i->name << strtok(device_name.toLatin1().data(),".");
|
||||
// char *str = strtok(battery,".");
|
||||
w->batteryLevel = atoi(battery);
|
||||
Q_EMIT w->bluetoothBatteryChanged(i->name, w->batteryLevel);
|
||||
}
|
||||
else
|
||||
w->batteryLevel = -1;
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_EXT_DEVICE_RESTORE_API
|
||||
static void ext_device_restore_subscribeCb(pa_context *c, pa_device_type_t type, uint32_t idx, void *userdata);
|
||||
#endif
|
||||
|
@ -1251,11 +1401,14 @@ void UkmediaVolumeControl::sinkIndexCb(pa_context *c, const pa_sink_info *i, int
|
|||
if(w->sinkMuted != i->mute){
|
||||
w->sinkMuted = i->mute;
|
||||
Q_EMIT w->updateMute(w->sinkMuted);
|
||||
if(w->sinkVolume = volume)
|
||||
w->sendSinkVolumeChangeSignal(w->sinkVolume, w->sinkMuted);
|
||||
}
|
||||
|
||||
if(w->sinkVolume != volume){
|
||||
w->sinkVolume = volume;
|
||||
Q_EMIT w->updateVolume(w->sinkVolume);
|
||||
w->sendSinkVolumeChangeSignal(w->sinkVolume, w->sinkMuted);
|
||||
}
|
||||
|
||||
qDebug() << "sinkIndexCB" << w->sinkPortName;
|
||||
|
@ -1322,6 +1475,10 @@ void UkmediaVolumeControl::sourceIndexCb(pa_context *c, const pa_source_info *i,
|
|||
Q_EMIT w->updateSourceVolume(w->sourceVolume);
|
||||
}
|
||||
|
||||
//增加输入设备插拔信号
|
||||
//可以通过此命令查看是否发送信号成功:dbus-monitor --session type='signal',sender='org.ukui.media'
|
||||
w->sendSourcePortChangedSignal();
|
||||
|
||||
qDebug() << "sourceIndexCb---" << w->sourcePortName;
|
||||
}
|
||||
|
||||
|
@ -1468,6 +1625,16 @@ void UkmediaVolumeControl::timeoutSlot()
|
|||
Q_EMIT deviceChangedSignal();
|
||||
}
|
||||
|
||||
void UkmediaVolumeControl::getBatteryLevel(QString dev)
|
||||
{
|
||||
pa_operation *o;
|
||||
if (!(o = pa_context_get_card_info_by_name(getContext(), dev.toLatin1().data(), batteryLevelCb, this))) {
|
||||
showError(QObject::tr("pa_context_get_card_info_by_index() failed").toUtf8().constData());
|
||||
return ;
|
||||
}
|
||||
pa_operation_unref(o);
|
||||
}
|
||||
|
||||
void UkmediaVolumeControl::extStreamRestoreReadCb(
|
||||
pa_context *c,
|
||||
const pa_ext_stream_restore_info *i,
|
||||
|
@ -1655,6 +1822,17 @@ void UkmediaVolumeControl::subscribeCb(pa_context *c, pa_subscription_event_type
|
|||
}
|
||||
break;
|
||||
|
||||
case PA_SUBSCRIPTION_EVENT_BLUETOOTH_BATTERY:
|
||||
|
||||
qDebug() << "PA_SUBSCRIPTION_EVENT_BLUETOOTH_BATTERY" ;
|
||||
pa_operation *o;
|
||||
if (!(o = pa_context_get_card_info_by_index(c, index, bluetoothCardCb, w))) {
|
||||
w->showError(QObject::tr("pa_context_get_card_info_by_index() failed").toUtf8().constData());
|
||||
return;
|
||||
}
|
||||
pa_operation_unref(o);
|
||||
break;
|
||||
|
||||
case PA_SUBSCRIPTION_EVENT_CARD:
|
||||
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE) {
|
||||
qDebug() << "remove cards------";
|
||||
|
@ -2064,4 +2242,22 @@ void UkmediaVolumeControl::sendPortChangedSignal()
|
|||
QDBusMessage message = QDBusMessage::createSignal("/","org.ukui.media","sinkPortChanged");
|
||||
message<<"portChanged";
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
qDebug() << " sendPortChangedSignal sinkPortChanged " << endl;
|
||||
}
|
||||
|
||||
void UkmediaVolumeControl::sendSourcePortChangedSignal()
|
||||
{
|
||||
QDBusMessage message = QDBusMessage::createSignal("/","org.ukui.media","sourcePortChanged");
|
||||
message<<"portChanged";
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
qDebug() << " sendPortChangedSignal sourcePortChanged " << endl;
|
||||
}
|
||||
|
||||
void UkmediaVolumeControl::sendSinkVolumeChangeSignal(int vol, bool ismute)
|
||||
{
|
||||
QDBusMessage message = QDBusMessage::createSignal("/","org.ukui.media","sinkVolumeChanged");
|
||||
int value = (vol / 65536.0 * 100.0) + 0.5;
|
||||
message << value << ismute;
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
qDebug() << "sendSinkVolumeChangeSignal" << endl;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@ public:
|
|||
UkmediaVolumeControl();
|
||||
virtual ~UkmediaVolumeControl();
|
||||
|
||||
void insertJson(QString key,QString key_value,QString jsonfile);
|
||||
|
||||
int boolToInt(bool b);
|
||||
void updateCard(UkmediaVolumeControl *c,const pa_card_info &info);
|
||||
bool updateSink(UkmediaVolumeControl *c,const pa_sink_info &info);
|
||||
|
@ -99,6 +101,8 @@ public:
|
|||
QString stringRemoveUnrecignizedChar(QString str);//移除xml中不能识别的字符
|
||||
bool setSourcePort(const gchar *portName, const gchar *name); //设置输入设备的端口
|
||||
|
||||
void sendSinkVolumeChangeSignal(int vol, bool ismute); //音量改变信号
|
||||
|
||||
|
||||
bool killSinkInput(int index); //kill 索引为index的sink input
|
||||
//#if HAVE_EXT_DEVICE_RESTORE_API
|
||||
|
@ -117,6 +121,8 @@ public:
|
|||
void showError(const char *txt);
|
||||
static void decOutstanding(UkmediaVolumeControl *w);
|
||||
static void cardCb(pa_context *, const pa_card_info *i, int eol, void *userdata);
|
||||
static void bluetoothCardCb(pa_context *c, const pa_card_info *i, int eol, void *userdata);
|
||||
static void batteryLevelCb(pa_context *c, const pa_card_info *i, int eol, void *userdata);
|
||||
static void sinkIndexCb(pa_context *c, const pa_sink_info *i, int eol, void *userdata);
|
||||
static void sourceIndexCb(pa_context *c, const pa_source_info *i, int eol, void *userdata);
|
||||
|
||||
|
@ -152,6 +158,7 @@ public:
|
|||
QString findSinkActivePortName(QString name);
|
||||
bool isExitInputPort(QString name);
|
||||
void sendPortChangedSignal();
|
||||
void sendSourcePortChangedSignal();
|
||||
|
||||
std::vector< std::pair<QByteArray,QByteArray> > profiles;
|
||||
std::map<QByteArray, PortInfo> ports;
|
||||
|
@ -231,10 +238,11 @@ Q_SIGNALS:
|
|||
void deviceChangedSignal();
|
||||
void removeSinkSignal();
|
||||
void device_changed_signal(QString str);
|
||||
void bluetoothBatteryChanged(QString dev, int battery);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void timeoutSlot();
|
||||
|
||||
void getBatteryLevel(QString dev);
|
||||
public:
|
||||
void setConnectionState(gboolean connected);
|
||||
pa_stream* createMonitorStreamForSource(uint32_t source_idx, uint32_t stream_idx, bool suspend);
|
||||
|
@ -250,6 +258,7 @@ public:
|
|||
int sourceIndex; //输入设备索引
|
||||
// int sinkInputVolume;
|
||||
pa_mainloop_api* api;
|
||||
int batteryLevel;
|
||||
|
||||
//针对一个应用产生多个sinkinput,indexMap记录应用产生sinkinput的每个index, valueMap刷新应用的最新音量
|
||||
QMap<int, QString> sinkInputIndexMap;
|
||||
|
|
|
@ -13,6 +13,7 @@ QMAKE_CXXFLAGS += -std=c++11
|
|||
|
||||
include(QtSingleApplication/qtsingleapplication.pri)
|
||||
include(xatom/xatom.pri)
|
||||
include(dbus-adaptor/dbus-adaptor.pri)
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
|
|
|
@ -17,119 +17,58 @@
|
|||
*/
|
||||
#include "ukui_list_widget_item.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QStyleOption>
|
||||
#include <QDebug>
|
||||
#include <QHBoxLayout>
|
||||
//#include <QSvgRenderer>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QPainterPath>
|
||||
bool isCheckBluetoothInput;
|
||||
|
||||
UkuiListWidgetItem::UkuiListWidgetItem(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
this->setFixedSize(388,48);
|
||||
QHBoxLayout *hLayout = new QHBoxLayout;
|
||||
this->setFixedSize(404,48);
|
||||
|
||||
deviceButton = new UkuiMediaButton(this);
|
||||
portLabel = new FixLabel(this);
|
||||
deviceLabel = new QLabel(this);
|
||||
hLayout = new QHBoxLayout(this);
|
||||
portLabel = new FixLabel(this);
|
||||
deviceLabel = new QLabel(this);
|
||||
deviceButton = new QPushButton(this);
|
||||
|
||||
portLabel->setFixedSize(326,24);
|
||||
deviceLabel->setFixedSize(326,24);
|
||||
deviceLabel->hide(); // 记录cardname
|
||||
|
||||
deviceButton->setFixedSize(36,36);
|
||||
portLabel->setFixedSize(310,24);
|
||||
deviceLabel->setFixedSize(306,24);
|
||||
deviceLabel->hide();
|
||||
deviceButton->setCheckable(true);
|
||||
deviceButton->setProperty("isRoundButton", true);
|
||||
deviceButton->setProperty("useButtonPalette", true);
|
||||
deviceButton->setProperty("needTranslucent", true);
|
||||
|
||||
hLayout->addWidget(deviceButton);
|
||||
hLayout->addSpacing(10);
|
||||
hLayout->addWidget(portLabel);
|
||||
hLayout->setSpacing(0);
|
||||
|
||||
this->setLayout(hLayout);
|
||||
hLayout->setContentsMargins(16,6,16,6);
|
||||
|
||||
this->show();
|
||||
}
|
||||
|
||||
UkuiListWidgetItem::~UkuiListWidgetItem()
|
||||
{
|
||||
}
|
||||
|
||||
void UkuiListWidgetItem::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QStyleOption opt;
|
||||
opt.init(this);
|
||||
QPainter p(this);
|
||||
QColor color ;
|
||||
switch (state) {
|
||||
case WIDGET_NORMAL_STATE:
|
||||
color = QColor(0xF0,0xF0,0xF0,0x00);
|
||||
break;
|
||||
case WIDGET_HOVER_STATE:
|
||||
color = QColor(200,200,200,50);
|
||||
break;
|
||||
}
|
||||
|
||||
// color.setAlpha(transparence);
|
||||
QBrush brush = QBrush(color);
|
||||
p.setBrush(brush);
|
||||
p.setPen(Qt::NoPen);
|
||||
QPainterPath path;
|
||||
opt.rect.adjust(0,0,0,0);
|
||||
path.addRoundedRect(opt.rect,6,6);
|
||||
p.setRenderHint(QPainter::Antialiasing); // 反锯齿;
|
||||
p.drawRoundedRect(opt.rect,6,6);
|
||||
setProperty("blurRegion",QRegion(path.toFillPolygon().toPolygon()));
|
||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||
QWidget::paintEvent(event);
|
||||
}
|
||||
|
||||
|
||||
void UkuiListWidgetItem::setSelected(bool selected){
|
||||
|
||||
}
|
||||
|
||||
void UkuiListWidgetItem::leaveEvent(QEvent *e)
|
||||
{
|
||||
state = WIDGET_NORMAL_STATE;
|
||||
this->update();
|
||||
QWidget::leaveEvent(e);
|
||||
}
|
||||
void UkuiListWidgetItem::mouseReleaseEvent(QMouseEvent *e)
|
||||
{
|
||||
// state = WIDGET_NORMAL_STATE;
|
||||
QWidget::mouseReleaseEvent(e);
|
||||
}
|
||||
void UkuiListWidgetItem::enterEvent(QEvent *e)
|
||||
{
|
||||
state = WIDGET_HOVER_STATE;
|
||||
this->update();
|
||||
QWidget::enterEvent(e);
|
||||
}
|
||||
|
||||
void UkuiListWidgetItem::setButtonIcon(QString str)
|
||||
void UkuiListWidgetItem::setButtonIcon(QString iconName)
|
||||
{
|
||||
QString iconStr;
|
||||
if (str.contains("headphone") || str.contains("Headphone") || str.contains("headset")) {
|
||||
|
||||
if (iconName.contains("headphone") || iconName.contains("Headphone") || iconName.contains("headset"))
|
||||
iconStr = "audio-headphones-symbolic";
|
||||
}
|
||||
else {
|
||||
else
|
||||
iconStr = "audio-volume-high-symbolic";
|
||||
}
|
||||
deviceButton->setButtonIcon(QIcon::fromTheme(iconStr));
|
||||
deviceButton->setProperty("useIconHighlightEffect", 0x8);
|
||||
|
||||
deviceButton->setIcon(QIcon::fromTheme(iconStr));
|
||||
}
|
||||
|
||||
void UkuiListWidgetItem::setLabelText(QString portLabel, QString deviceLabel){
|
||||
|
||||
void UkuiListWidgetItem::setLabelText(QString portLabel, QString deviceLabel)
|
||||
{
|
||||
this->portLabel->setText(portLabel,true);
|
||||
this->deviceLabel->setText(deviceLabel);
|
||||
}
|
||||
|
||||
void UkuiListWidgetItem::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
|
||||
QWidget::mousePressEvent(event);
|
||||
qDebug() << "Mouse Press Event" << this->portLabel->fullText << this->deviceLabel->text();
|
||||
//蓝牙输入去除勾选
|
||||
|
@ -143,3 +82,7 @@ void UkuiListWidgetItem::mousePressEvent(QMouseEvent *event)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
UkuiListWidgetItem::~UkuiListWidgetItem()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -20,45 +20,32 @@
|
|||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QDebug>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPixmap>
|
||||
#include <QString>
|
||||
#include <QListWidgetItem>
|
||||
#include <QPushButton>
|
||||
#include <qvariant.h>
|
||||
#include "ukmedia_custom_class.h"
|
||||
|
||||
enum WidgetState{
|
||||
WIDGET_NORMAL_STATE,
|
||||
WIDGET_HOVER_STATE
|
||||
};
|
||||
|
||||
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);
|
||||
void setButtonIcon(QString str);
|
||||
FixLabel *portLabel;
|
||||
QLabel *deviceLabel;
|
||||
UkuiMediaButton *deviceButton;
|
||||
void setButtonIcon(QString iconName);
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *ev);
|
||||
void mouseReleaseEvent(QMouseEvent *e)override;
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void enterEvent(QEvent *e);
|
||||
void leaveEvent(QEvent *e);
|
||||
QLabel *deviceLabel;
|
||||
FixLabel *portLabel;
|
||||
QPushButton *deviceButton;
|
||||
|
||||
private:
|
||||
QWidget * widget;
|
||||
int state = WIDGET_NORMAL_STATE;
|
||||
QHBoxLayout *hLayout;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
|
||||
};
|
||||
|
||||
#endif // UKUILISTWIDGETITEM_H
|
||||
|
|
Loading…
Reference in New Issue