File indexing completed on 2025-02-02 05:23:21
0001 /* 0002 SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 function name(volume, muted, prefix) { 0008 if (!prefix) { 0009 prefix = "audio-volume"; 0010 } 0011 var icon = null; 0012 var percent = volume / maxVolumeValue; 0013 if (percent <= 0.0 || muted) { 0014 icon = prefix + "-muted"; 0015 } else if (percent <= 0.25) { 0016 icon = prefix + "-low"; 0017 } else if (percent <= 0.75) { 0018 icon = prefix + "-medium"; 0019 } else { 0020 icon = prefix + "-high"; 0021 } 0022 return icon; 0023 } 0024 0025 function formFactorIcon(formFactor) { 0026 switch(formFactor) { 0027 case "internal": 0028 return "audio-card"; 0029 case "speaker": 0030 return "audio-speakers-symbolic"; 0031 case "phone": 0032 return "phone"; 0033 case "handset": 0034 return "phone"; 0035 case "tv": 0036 return "video-television"; 0037 case "webcam": 0038 return "camera-web"; 0039 case "microphone": 0040 return "audio-input-microphone"; 0041 case "headset": 0042 return "audio-headset"; 0043 case "headphone": 0044 return "audio-headphones"; 0045 case "hands-free": 0046 return "hands-free"; 0047 case "car": 0048 return "car"; 0049 case "hifi": 0050 return "hifi"; 0051 case "computer": 0052 return "computer"; 0053 case "portable": 0054 return "portable"; 0055 } 0056 return ""; 0057 } 0058