diff --git a/mopidy_touchscreen/.idea/workspace.xml b/mopidy_touchscreen/.idea/workspace.xml index 96d8847..ff3b213 100644 --- a/mopidy_touchscreen/.idea/workspace.xml +++ b/mopidy_touchscreen/.idea/workspace.xml @@ -1,7 +1,7 @@ - + - - - - - - - - - - - + - - + + @@ -48,38 +38,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -95,19 +55,11 @@ @@ -167,17 +119,9 @@ - - - - - - - + - - - - - + @@ -327,9 +251,9 @@ - - 1405618199088 - 1405618199088 + + 1406578790451 + 1406578790451 @@ -338,22 +262,22 @@ - + - - + + - - - + + + + - - + @@ -373,414 +297,97 @@ - - + - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - + - - + + - + - - - + + - + - - - + + - + - - - + + - + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mopidy_touchscreen/fonts/icomoon/Read Me.txt b/mopidy_touchscreen/fonts/icomoon/Read Me.txt new file mode 100644 index 0000000..cd97d24 --- /dev/null +++ b/mopidy_touchscreen/fonts/icomoon/Read Me.txt @@ -0,0 +1,5 @@ +Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures. + +You won't need any of the files located under the *demo-files* directory when including the generated font in your own projects. + +You can import *selection.json* back to the IcoMoon app using the *Import Icons* button (or via Main Menu > Manage Projects) to retrieve your icon selection. diff --git a/mopidy_touchscreen/fonts/icomoon/demo-files/demo.css b/mopidy_touchscreen/fonts/icomoon/demo-files/demo.css new file mode 100644 index 0000000..b2c3efe --- /dev/null +++ b/mopidy_touchscreen/fonts/icomoon/demo-files/demo.css @@ -0,0 +1,152 @@ +body { + padding: 0; + margin: 0; + font-family: sans-serif; + font-size: 1em; + line-height: 1.5; + color: #555; + background: #fff; +} +h1 { + font-size: 1.5em; + font-weight: normal; +} +small { + font-size: .66666667em; +} +a { + color: #e74c3c; + text-decoration: none; +} +a:hover, a:focus { + box-shadow: 0 1px #e74c3c; +} +.bshadow0, input { + box-shadow: inset 0 -2px #e7e7e7; +} +input:hover { + box-shadow: inset 0 -2px #ccc; +} +input, fieldset { + font-size: 1em; + margin: 0; + padding: 0; + border: 0; +} +input { + color: inherit; + line-height: 1.5; + height: 1.5em; + padding: .25em 0; +} +input:focus { + outline: none; + box-shadow: inset 0 -2px #449fdb; +} +.glyph { + font-size: 16px; + width: 15em; + padding-bottom: 1em; + margin-right: 4em; + margin-bottom: 1em; + float: left; + overflow: hidden; +} +.liga { + width: 80%; + width: calc(100% - 2.5em); +} +.talign-right { + text-align: right; +} +.talign-center { + text-align: center; +} +.bgc1 { + background: #f1f1f1; +} +.fgc1 { + color: #999; +} +.fgc0 { + color: #000; +} +p { + margin-top: 1em; + margin-bottom: 1em; +} +.mvm { + margin-top: .75em; + margin-bottom: .75em; +} +.mtn { + margin-top: 0; +} +.mtl, .mal { + margin-top: 1.5em; +} +.mbl, .mal { + margin-bottom: 1.5em; +} +.mal, .mhl { + margin-left: 1.5em; + margin-right: 1.5em; +} +.mhmm { + margin-left: 1em; + margin-right: 1em; +} +.mls { + margin-left: .25em; +} +.ptl { + padding-top: 1.5em; +} +.pbs, .pvs { + padding-bottom: .25em; +} +.pvs, .pts { + padding-top: .25em; +} +.clearfix { + zoom: 1; +} +.unit { + float: left; +} +.unitRight { + float: right; +} +.size1of2 { + width: 50%; +} +.size1of1 { + width: 100%; +} +.clearfix:before, .clearfix:after { + content: " "; + display: table; +} +.clearfix:after { + clear: both; +} +.hidden-true { + display: none; +} +.textbox0 { + width: 3em; + background: #f1f1f1; + padding: .25em .5em; + line-height: 1.5; + height: 1.5em; +} +#testDrive { + padding-top: 24px; + line-height: 1.5; +} +.fs0 { + font-size: 16px; +} +.fs1 { + font-size: 32px; +} diff --git a/mopidy_touchscreen/fonts/icomoon/demo-files/demo.js b/mopidy_touchscreen/fonts/icomoon/demo-files/demo.js new file mode 100644 index 0000000..e72f449 --- /dev/null +++ b/mopidy_touchscreen/fonts/icomoon/demo-files/demo.js @@ -0,0 +1,30 @@ +if (!('boxShadow' in document.body.style)) { + document.body.setAttribute('class', 'noBoxShadow'); +} + +document.body.addEventListener("click", function(e) { + var target = e.target; + if (target.tagName === "INPUT" && + target.getAttribute('class').indexOf('liga') === -1) { + target.select(); + } +}); + +(function() { + var fontSize = document.getElementById('fontSize'), + testDrive = document.getElementById('testDrive'), + testText = document.getElementById('testText'); + function updateTest() { + testDrive.innerHTML = testText.value || String.fromCharCode(160); + if (window.icomoonLiga) { + window.icomoonLiga(testDrive); + } + } + function updateSize() { + testDrive.style.fontSize = fontSize.value + 'px'; + } + fontSize.addEventListener('change', updateSize, false); + testText.addEventListener('input', updateTest, false); + testText.addEventListener('change', updateTest, false); + updateSize(); +}()); diff --git a/mopidy_touchscreen/fonts/icomoon/demo.html b/mopidy_touchscreen/fonts/icomoon/demo.html new file mode 100644 index 0000000..255435b --- /dev/null +++ b/mopidy_touchscreen/fonts/icomoon/demo.html @@ -0,0 +1,585 @@ + + + + + IcoMoon Demo + + + + + +
+

Font Name: icomoon (Glyphs: 42)

+
+
+

Grid Size: 16

+
+
+ icon-music +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-headphones +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-connection +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-book +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-books +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-file +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-folder +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-folder-open +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-cabinet +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-spinner +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-cog +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-switch +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-list +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-list2 +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-numbered-list +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-menu +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-spam +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-close +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-checkmark +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-minus +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-plus +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-play +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-pause +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-stop +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-backward +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-forward +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-first +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-last +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-previous +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-next +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-eject +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-volume-high +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-volume-medium +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-volume-low +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-volume-mute +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-volume-mute2 +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-volume-increase +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-volume-decrease +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-loop +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-loop2 +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-loop3 +
+
+ + +
+
+ liga: + +
+
+
+
+ icon-shuffle +
+
+ + +
+
+ liga: + +
+
+
+ + +
+

Font Test Drive

+ + + +
  +
+
+ +
+

Generated by IcoMoon

+
+ + + + \ No newline at end of file diff --git a/mopidy_touchscreen/fonts/icomoon/fonts/icomoon.ttf b/mopidy_touchscreen/fonts/icomoon/fonts/icomoon.ttf new file mode 100644 index 0000000..8433147 Binary files /dev/null and b/mopidy_touchscreen/fonts/icomoon/fonts/icomoon.ttf differ diff --git a/mopidy_touchscreen/fonts/icomoon/selection.json b/mopidy_touchscreen/fonts/icomoon/selection.json new file mode 100644 index 0000000..d38b459 --- /dev/null +++ b/mopidy_touchscreen/fonts/icomoon/selection.json @@ -0,0 +1,1071 @@ +{ + "IcoMoonType": "selection", + "icons": [ + { + "icon": { + "paths": [ + "M320 192l704-192v64 128 544c0 88.366-100.29 160-224 160s-224-71.634-224-160c0-88.366 100.29-160 224-160 34.358 0 66.902 5.532 96 15.406v-329.588l-448 122.182v480c0 88.366-100.288 160-224 160-123.712 0-224-71.634-224-160 0-88.366 100.288-160 224-160 34.358 0 66.902 5.532 96 15.406v-335.406-192z" + ], + "tags": [ + "music", + "song", + "audio", + "sound" + ], + "grid": 16 + }, + "properties": { + "id": 16, + "order": 1, + "prevSize": 32, + "code": 58880, + "name": "music", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 16 + }, + { + "icon": { + "paths": [ + "M192 578.286v443.43c10.454 1.496 21.134 2.286 32 2.286h32v-448.002h-32c-10.866 0-21.546 0.79-32 2.286zM768 576v448h32c10.868 0 21.546-0.79 32-2.286v-443.428c-10.454-1.496-21.132-2.286-32-2.286h-32zM1024 512c0-282.77-229.23-512-512-512s-512 229.23-512 512c0 61.418 10.828 120.306 30.656 174.874-19.472 33.202-30.656 71.852-30.656 113.126 0 89.354 52.326 166.478 128 202.432v-404.864c-20.126 9.562-38.58 22.060-54.858 36.904-5.992-29.22-9.142-59.478-9.142-90.472 0-247.424 200.576-448 448-448s448 200.576 448 448c0 30.994-3.148 61.252-9.142 90.472-16.28-14.844-34.73-27.342-54.858-36.904v404.864c75.676-35.954 128-113.078 128-202.432 0-41.274-11.184-79.924-30.656-113.126 19.828-54.568 30.656-113.456 30.656-174.874z" + ], + "tags": [ + "headphones", + "headset", + "music", + "song", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 17, + "order": 2, + "prevSize": 32, + "code": 58881, + "name": "headphones", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 17 + }, + { + "icon": { + "paths": [ + "M640 576c105.87 0 201.87 43.066 271.402 112.598l-90.468 90.468c-46.354-46.356-110.356-75.066-180.934-75.066s-134.578 28.71-180.934 75.066l-90.468-90.468c69.532-69.532 165.532-112.598 271.402-112.598zM187.452 507.452c120.88-120.88 281.598-187.452 452.548-187.452s331.668 66.572 452.55 187.452l-90.51 90.508c-96.706-96.704-225.28-149.96-362.040-149.96-136.762 0-265.334 53.256-362.038 149.962l-90.51-90.51zM988.784 134.438c106.702 45.132 202.516 109.728 284.782 191.996v0l-90.508 90.508c-145.056-145.056-337.92-224.942-543.058-224.942-205.14 0-398 79.886-543.058 224.942l-90.51-90.51c82.268-82.266 178.082-146.862 284.784-191.994 110.504-46.738 227.852-70.438 348.784-70.438 120.932 0 238.278 23.7 348.784 70.438zM576 896c0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64z" + ], + "width": 1280, + "tags": [ + "connection", + "broadcast", + "wifi", + "wave", + "feed" + ], + "grid": 16 + }, + "properties": { + "id": 28, + "order": 3, + "prevSize": 32, + "code": 58882, + "name": "connection", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 28 + }, + { + "icon": { + "paths": [ + "M896 128v832h-672c-53.022 0-96-42.98-96-96 0-53.018 42.978-96 96-96h608v-768h-640c-70.398 0-128 57.6-128 128v768c0 70.4 57.602 128 128 128h768v-896h-64zM256 832h576v64h-576z" + ], + "tags": [ + "book", + "reading" + ], + "grid": 16 + }, + "properties": { + "id": 31, + "order": 5, + "prevSize": 32, + "code": 58883, + "name": "book", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 31 + }, + { + "icon": { + "paths": [ + "M576.234 289.27l242.712-81.432 203.584 606.784-242.712 81.432zM0 896h256v-704h-256v704zM64 320h128v64h-128v-64zM320 896h256v-704h-256v704zM384 320h128v64h-128v-64z" + ], + "tags": [ + "books", + "library", + "archive" + ], + "grid": 16 + }, + "properties": { + "id": 32, + "order": 4, + "prevSize": 32, + "code": 58884, + "name": "books", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 32 + }, + { + "icon": { + "paths": [ + "M864 0h-768c-52.8 0-96 43.2-96 96v832c0 52.8 43.2 96 96 96h768c52.8 0 96-43.2 96-96v-832c0-52.8-43.2-96-96-96zM832 896h-704v-768h704v768zM256 448h448v64h-448zM256 576h448v64h-448zM256 704h448v64h-448zM256 320h448v64h-448z" + ], + "tags": [ + "file", + "list", + "paper", + "page", + "document" + ], + "grid": 16 + }, + "properties": { + "id": 34, + "order": 6, + "prevSize": 32, + "code": 58885, + "name": "file", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 34 + }, + { + "icon": { + "paths": [ + "M0 320h1024l-64 640h-896l-64-640zM928 192l32 64h-896l64-128h352l32 64h416z" + ], + "tags": [ + "folder", + "directory", + "category", + "browse" + ], + "grid": 16 + }, + "properties": { + "id": 46, + "order": 7, + "prevSize": 32, + "code": 58886, + "name": "folder", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 46 + }, + { + "icon": { + "paths": [ + "M832 960l192-512h-832l-192 512zM128 384l-128 576v-832h288l128 128h416v128z" + ], + "tags": [ + "folder-open", + "directory", + "category", + "browse" + ], + "grid": 16 + }, + "properties": { + "id": 47, + "order": 8, + "prevSize": 32, + "code": 58887, + "name": "folder-open", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 47 + }, + { + "icon": { + "paths": [ + "M704 0h-384l-192 128v256h768v-256l-192-128zM640 320h-64v-42.666c0-11.734-9.6-21.334-21.334-21.334h-85.332c-11.732 0-21.334 9.6-21.334 21.334l-0 42.666h-64v-106.666c0-11.734 9.602-21.334 21.334-21.334h213.33c11.734 0 21.336 9.6 21.336 21.334v106.666zM128 704.002h768v-256.002h-768v256.002zM384 533.332c0-11.734 9.602-21.332 21.334-21.332h213.33c11.734 0 21.336 9.598 21.336 21.332v106.668h-64v-42.668c0-11.734-9.6-21.332-21.334-21.332h-85.332c-11.732 0-21.334 9.598-21.334 21.332l-0 42.668h-64v-106.668zM128 1024h768v-255.998h-768v255.998zM384 853.332c0-11.734 9.602-21.332 21.334-21.332h213.33c11.734 0 21.336 9.598 21.336 21.332v106.668h-64v-42.668c0-11.734-9.6-21.332-21.334-21.332h-85.332c-11.732 0-21.334 9.598-21.334 21.332l-0 42.668h-64v-106.668z" + ], + "tags": [ + "cabinet", + "storage", + "drawer", + "archive", + "office" + ], + "grid": 16 + }, + "properties": { + "id": 88, + "order": 9, + "prevSize": 32, + "code": 58888, + "name": "cabinet", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 88 + }, + { + "icon": { + "paths": [ + "M1024 384h-384l143.53-143.53c-72.53-72.526-168.96-112.47-271.53-112.47-102.57 0-199 39.944-271.53 112.47-72.526 72.53-112.47 168.96-112.47 271.53 0 102.57 39.944 199 112.47 271.53 72.53 72.526 168.96 112.47 271.53 112.47 102.57 0 199-39.944 271.528-112.472 6.056-6.054 11.86-12.292 17.456-18.668l96.32 84.282c-93.846 107.166-231.664 174.858-385.304 174.858-282.77 0-512-229.23-512-512 0-282.77 229.23-512 512-512 141.386 0 269.368 57.326 362.016 149.984l149.984-149.984v384z" + ], + "tags": [ + "spinner", + "loading", + "busy", + "wait", + "wheel", + "repeat" + ], + "grid": 16 + }, + "properties": { + "id": 125, + "order": 12, + "prevSize": 32, + "code": 58889, + "name": "spinner", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 125 + }, + { + "icon": { + "paths": [ + "M933.79 610.25c-53.726-93.054-21.416-212.304 72.152-266.488l-100.626-174.292c-28.75 16.854-62.176 26.518-97.846 26.518-107.536 0-194.708-87.746-194.708-195.99l-201.258 0c0.266 33.41-8.074 67.282-25.958 98.252-53.724 93.056-173.156 124.702-266.862 70.758l-100.624 174.292c28.97 16.472 54.050 40.588 71.886 71.478 53.638 92.908 21.512 211.92-71.708 266.224l100.626 174.292c28.65-16.696 61.916-26.254 97.4-26.254 107.196 0 194.144 87.192 194.7 194.958h201.254c-0.086-33.074 8.272-66.57 25.966-97.218 53.636-92.906 172.776-124.594 266.414-71.012l100.626-174.29c-28.78-16.466-53.692-40.498-71.434-71.228zM512 719.332c-114.508 0-207.336-92.824-207.336-207.334 0-114.508 92.826-207.334 207.336-207.334 114.508 0 207.332 92.826 207.332 207.334-0.002 114.51-92.824 207.334-207.332 207.334z" + ], + "tags": [ + "cog", + "preferences", + "settings", + "gear", + "generate", + "control", + "options" + ], + "grid": 16 + }, + "properties": { + "id": 142, + "order": 10, + "prevSize": 32, + "code": 58890, + "name": "cog", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 142 + }, + { + "icon": { + "paths": [ + "M640 146.588v135.958c36.206 15.804 69.5 38.408 98.274 67.18 60.442 60.44 93.726 140.8 93.726 226.274s-33.286 165.834-93.726 226.274c-60.44 60.44-140.798 93.726-226.274 93.726s-165.834-33.286-226.274-93.726c-60.44-60.44-93.726-140.8-93.726-226.274s33.286-165.834 93.726-226.274c28.774-28.774 62.068-51.378 98.274-67.182v-135.956c-185.048 55.080-320 226.472-320 429.412 0 247.424 200.578 448 448 448 247.424 0 448-200.576 448-448 0-202.94-134.95-374.332-320-429.412zM448 0h128v512h-128z" + ], + "tags": [ + "switch", + "power", + "turn off", + "off", + "shutdown" + ], + "grid": 16 + }, + "properties": { + "id": 177, + "order": 11, + "prevSize": 32, + "code": 58891, + "name": "switch", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 177 + }, + { + "icon": { + "paths": [ + "M0 0h256v256h-256zM384 64h640v128h-640zM0 384h256v256h-256zM384 448h640v128h-640zM0 768h256v256h-256zM384 832h640v128h-640z" + ], + "tags": [ + "list", + "bullet", + "ul", + "todo", + "menu" + ], + "grid": 16 + }, + "properties": { + "id": 180, + "order": 13, + "prevSize": 32, + "code": 58892, + "name": "list", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 180 + }, + { + "icon": { + "paths": [ + "M384 64h640v128h-640v-128zM384 448h640v128h-640v-128zM384 832h640v128h-640v-128zM0 128c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 512c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128zM0 896c0-70.692 57.308-128 128-128 70.692 0 128 57.308 128 128 0 70.692-57.308 128-128 128-70.692 0-128-57.308-128-128z" + ], + "tags": [ + "list", + "bullet", + "ul", + "todo", + "menu" + ], + "grid": 16 + }, + "properties": { + "id": 181, + "order": 14, + "prevSize": 32, + "code": 58893, + "name": "list2", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 181 + }, + { + "icon": { + "paths": [ + "M384 832h640v128h-640zM384 448h640v128h-640zM384 64h640v128h-640zM192 0v256h-64v-192h-64v-64zM128 526v50h128v64h-192v-146l128-60v-50h-128v-64h192v146zM256 704v320h-192v-64h128v-64h-128v-64h128v-64h-128v-64z" + ], + "tags": [ + "numbered-list", + "list", + "items", + "nl" + ], + "grid": 16 + }, + "properties": { + "id": 182, + "order": 15, + "prevSize": 32, + "code": 58894, + "name": "numbered-list", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 182 + }, + { + "icon": { + "paths": [ + "M64 192h896v192h-896zM64 448h896v192h-896zM64 704h896v192h-896z" + ], + "tags": [ + "menu", + "list", + "items", + "lines", + "options" + ], + "grid": 16 + }, + "properties": { + "id": 184, + "order": 16, + "prevSize": 32, + "code": 58895, + "name": "menu", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 184 + }, + { + "icon": { + "paths": [ + "M1024 736 736 0h-448l-288 288v448l288 288h448l288-288v-448l-288-288zM576 832h-128v-128h128v128zM576 576h-128v-384h128v384z" + ], + "tags": [ + "spam", + "notice", + "notification", + "exclamation" + ], + "grid": 16 + }, + "properties": { + "id": 252, + "order": 17, + "prevSize": 32, + "code": 58896, + "name": "spam", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 252 + }, + { + "icon": { + "paths": [ + "M1014.662 822.66c-0.004-0.004-0.008-0.008-0.012-0.010l-310.644-310.65 310.644-310.65c0.004-0.004 0.008-0.006 0.012-0.010 3.344-3.346 5.762-7.254 7.312-11.416 4.246-11.376 1.824-24.682-7.324-33.83l-146.746-146.746c-9.148-9.146-22.45-11.566-33.828-7.32-4.16 1.55-8.070 3.968-11.418 7.31 0 0.004-0.004 0.006-0.008 0.010l-310.648 310.652-310.648-310.65c-0.004-0.004-0.006-0.006-0.010-0.010-3.346-3.342-7.254-5.76-11.414-7.31-11.38-4.248-24.682-1.826-33.83 7.32l-146.748 146.748c-9.148 9.148-11.568 22.452-7.322 33.828 1.552 4.16 3.97 8.072 7.312 11.416 0.004 0.002 0.006 0.006 0.010 0.010l310.65 310.648-310.65 310.652c-0.002 0.004-0.006 0.006-0.008 0.010-3.342 3.346-5.76 7.254-7.314 11.414-4.248 11.376-1.826 24.682 7.322 33.83l146.748 146.746c9.15 9.148 22.452 11.568 33.83 7.322 4.16-1.552 8.070-3.97 11.416-7.312 0.002-0.004 0.006-0.006 0.010-0.010l310.648-310.65 310.648 310.65c0.004 0.002 0.008 0.006 0.012 0.008 3.348 3.344 7.254 5.762 11.414 7.314 11.378 4.246 24.684 1.826 33.828-7.322l146.746-146.748c9.148-9.148 11.57-22.454 7.324-33.83-1.552-4.16-3.97-8.068-7.314-11.414z" + ], + "tags": [ + "close", + "cancel", + "quit", + "remove", + "cross" + ], + "grid": 16 + }, + "properties": { + "id": 253, + "order": 18, + "prevSize": 32, + "code": 58897, + "name": "close", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 253 + }, + { + "icon": { + "paths": [ + "M864 128l-480 480-224-224-160 160 384 384 640-640z" + ], + "tags": [ + "checkmark", + "tick", + "correct", + "accept", + "ok" + ], + "grid": 16 + }, + "properties": { + "id": 254, + "order": 19, + "prevSize": 32, + "code": 58898, + "name": "checkmark", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 254 + }, + { + "icon": { + "paths": [ + "M0 416v192c0 17.672 14.328 32 32 32h960c17.672 0 32-14.328 32-32v-192c0-17.672-14.328-32-32-32h-960c-17.672 0-32 14.328-32 32z" + ], + "tags": [ + "minus", + "minimize", + "subtract" + ], + "grid": 16 + }, + "properties": { + "id": 257, + "order": 20, + "prevSize": 32, + "code": 58899, + "name": "minus", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 257 + }, + { + "icon": { + "paths": [ + "M992 384h-352v-352c0-17.672-14.328-32-32-32h-192c-17.672 0-32 14.328-32 32v352h-352c-17.672 0-32 14.328-32 32v192c0 17.672 14.328 32 32 32h352v352c0 17.672 14.328 32 32 32h192c17.672 0 32-14.328 32-32v-352h352c17.672 0 32-14.328 32-32v-192c0-17.672-14.328-32-32-32z" + ], + "tags": [ + "plus", + "add", + "sum" + ], + "grid": 16 + }, + "properties": { + "id": 258, + "order": 21, + "prevSize": 32, + "code": 58900, + "name": "plus", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 258 + }, + { + "icon": { + "paths": [ + "M192 128l640 384-640 384z" + ], + "tags": [ + "play", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 266, + "order": 22, + "prevSize": 32, + "code": 58901, + "name": "play", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 266 + }, + { + "icon": { + "paths": [ + "M128 128h320v768h-320zM576 128h320v768h-320z" + ], + "tags": [ + "pause", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 267, + "order": 23, + "prevSize": 32, + "code": 58902, + "name": "pause", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 267 + }, + { + "icon": { + "paths": [ + "M128 128h768v768h-768z" + ], + "tags": [ + "stop", + "media control", + "audio", + "square" + ], + "grid": 16 + }, + "properties": { + "id": 268, + "order": 24, + "prevSize": 32, + "code": 58903, + "name": "stop", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 268 + }, + { + "icon": { + "paths": [ + "M576 160v320l320-320v704l-320-320v320l-352-352z" + ], + "tags": [ + "backward", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 269, + "order": 25, + "prevSize": 32, + "code": 58904, + "name": "backward", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 269 + }, + { + "icon": { + "paths": [ + "M512 864v-320l-320 320v-704l320 320v-320l352 352z" + ], + "tags": [ + "forward", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 270, + "order": 26, + "prevSize": 32, + "code": 58905, + "name": "forward", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 270 + }, + { + "icon": { + "paths": [ + "M128 896v-768h128v352l320-320v320l320-320v704l-320-320v320l-320-320v352z" + ], + "tags": [ + "first", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 271, + "order": 27, + "prevSize": 32, + "code": 58906, + "name": "first", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 271 + }, + { + "icon": { + "paths": [ + "M896 128v768h-128v-352l-320 320v-320l-320 320v-704l320 320v-320l320 320v-352z" + ], + "tags": [ + "last", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 272, + "order": 28, + "prevSize": 32, + "code": 58907, + "name": "last", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 272 + }, + { + "icon": { + "paths": [ + "M256 896v-768h128v352l320-320v704l-320-320v352z" + ], + "tags": [ + "previous", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 273, + "order": 29, + "prevSize": 32, + "code": 58908, + "name": "previous", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 273 + }, + { + "icon": { + "paths": [ + "M768 128v768h-128v-352l-320 320v-704l320 320v-352z" + ], + "tags": [ + "next", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 274, + "order": 30, + "prevSize": 32, + "code": 58909, + "name": "next", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 274 + }, + { + "icon": { + "paths": [ + "M0 768h1024v128h-1024zM512 128l512 512h-1024z" + ], + "tags": [ + "eject", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 275, + "order": 31, + "prevSize": 32, + "code": 58910, + "name": "eject", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 275 + }, + { + "icon": { + "paths": [ + "M890.040 922.040c-12.286 0-24.568-4.686-33.942-14.058-18.744-18.746-18.744-49.136 0-67.882 87.638-87.642 135.904-204.16 135.904-328.1 0-123.938-48.266-240.458-135.904-328.098-18.744-18.746-18.744-49.138 0-67.882 18.744-18.744 49.138-18.744 67.882 0 105.77 105.772 164.022 246.4 164.022 395.98 0 149.582-58.252 290.208-164.022 395.98-9.372 9.374-21.656 14.060-33.94 14.060zM719.53 831.53c-12.286 0-24.568-4.686-33.942-14.058-18.744-18.744-18.744-49.136 0-67.882 131.006-131.006 131.006-344.17 0-475.176-18.744-18.746-18.744-49.138 0-67.882 18.744-18.742 49.138-18.744 67.882 0 81.594 81.592 126.53 190.076 126.53 305.468 0 115.39-44.936 223.876-126.53 305.47-9.372 9.374-21.656 14.060-33.94 14.060zM549.020 741.020c-12.286 0-24.568-4.686-33.942-14.058-18.746-18.746-18.746-49.136 0-67.882 81.1-81.1 81.1-213.058 0-294.156-18.746-18.746-18.746-49.138 0-67.882 18.746-18.744 49.136-18.744 67.882 0 118.53 118.53 118.53 311.392 0 429.922-9.372 9.37-21.656 14.056-33.94 14.056zM401.332 78.668c25.668-25.668 46.668-16.968 46.668 19.332v828c0 36.3-21 44.998-46.668 19.33l-241.332-241.33h-160v-384h160l241.332-241.332z" + ], + "width": 1088, + "tags": [ + "volume-high", + "speaker", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 276, + "order": 32, + "prevSize": 32, + "code": 58911, + "name": "volume-high", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 276 + }, + { + "icon": { + "paths": [ + "M719.53 831.53c-12.286 0-24.568-4.686-33.942-14.058-18.744-18.744-18.744-49.136 0-67.882 131.006-131.006 131.006-344.17 0-475.176-18.744-18.746-18.744-49.138 0-67.882 18.744-18.742 49.138-18.744 67.882 0 81.594 81.592 126.53 190.076 126.53 305.468 0 115.39-44.936 223.876-126.53 305.47-9.372 9.374-21.656 14.060-33.94 14.060zM549.020 741.020c-12.286 0-24.568-4.686-33.942-14.058-18.746-18.746-18.746-49.136 0-67.882 81.1-81.1 81.1-213.058 0-294.156-18.746-18.746-18.746-49.138 0-67.882 18.746-18.744 49.136-18.744 67.882 0 118.53 118.53 118.53 311.392 0 429.922-9.372 9.37-21.656 14.056-33.94 14.056zM401.332 78.668c25.668-25.668 46.668-16.968 46.668 19.332v828c0 36.3-21 44.998-46.668 19.33l-241.332-241.33h-160v-384h160l241.332-241.332z" + ], + "tags": [ + "volume-medium", + "speaker", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 277, + "order": 33, + "prevSize": 32, + "code": 58912, + "name": "volume-medium", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 277 + }, + { + "icon": { + "paths": [ + "M549.020 741.020c-12.286 0-24.568-4.686-33.942-14.058-18.746-18.746-18.746-49.136 0-67.882 81.1-81.1 81.1-213.058 0-294.156-18.746-18.746-18.746-49.138 0-67.882 18.746-18.744 49.136-18.744 67.882 0 118.53 118.53 118.53 311.392 0 429.922-9.372 9.37-21.656 14.056-33.94 14.056zM401.332 78.668c25.668-25.668 46.668-16.968 46.668 19.332v828c0 36.3-21 44.998-46.668 19.33l-241.332-241.33h-160v-384h160l241.332-241.332z" + ], + "tags": [ + "volume-low", + "speaker", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 278, + "order": 34, + "prevSize": 32, + "code": 58913, + "name": "volume-low", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 278 + }, + { + "icon": { + "paths": [ + "M401.332 78.668c25.668-25.668 46.668-16.968 46.668 19.332v828c0 36.3-21 44.998-46.668 19.33l-241.332-241.33h-160v-384h160l241.332-241.332z" + ], + "tags": [ + "volume-mute", + "speaker", + "media control", + "audio", + "mute" + ], + "grid": 16 + }, + "properties": { + "id": 279, + "order": 35, + "prevSize": 32, + "code": 58914, + "name": "volume-mute", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 279 + }, + { + "icon": { + "paths": [ + "M401.332 78.668c25.668-25.668 46.668-16.968 46.668 19.332v828c0 36.3-21 44.998-46.668 19.33l-241.332-241.33h-160v-384h160l241.332-241.332zM960 619.148v84.852h-84.852l-107.148-107.148-107.148 107.148h-84.852v-84.852l107.148-107.148-107.148-107.148v-84.852h84.852l107.148 107.148 107.148-107.148h84.852v84.852l-107.148 107.148z" + ], + "tags": [ + "volume-mute", + "speaker", + "media control", + "audio", + "mute" + ], + "grid": 16 + }, + "properties": { + "id": 280, + "order": 36, + "prevSize": 32, + "code": 58915, + "name": "volume-mute2", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 280 + }, + { + "icon": { + "paths": [ + "M428.164 63.918c11.976 0 19.836 11.878 19.838 34.082v828c0 22.206-7.856 34.082-19.836 34.082-7.604 0-16.868-4.788-26.834-14.752l-241.332-241.33h-160v-384h160l241.332-241.332c9.966-9.966 19.228-14.75 26.832-14.75zM1024 576h-192v192h-128v-192h-192v-128h192v-192h128v192h192z" + ], + "tags": [ + "volume-increase", + "speaker", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 281, + "order": 37, + "prevSize": 32, + "code": 58916, + "name": "volume-increase", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 281 + }, + { + "icon": { + "paths": [ + "M428.164 63.918c11.976 0 19.836 11.878 19.838 34.082v828c0 22.206-7.856 34.082-19.836 34.082-7.604 0-16.868-4.788-26.834-14.752l-241.332-241.33h-160v-384h160l241.332-241.332c9.966-9.966 19.228-14.75 26.832-14.75zM512 448h512v128h-512z" + ], + "tags": [ + "volume-decrease", + "speaker", + "media control", + "audio" + ], + "grid": 16 + }, + "properties": { + "id": 282, + "order": 38, + "prevSize": 32, + "code": 58917, + "name": "volume-decrease", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 282 + }, + { + "icon": { + "paths": [ + "M128 320h640v192l256-256-256-256v192h-768v384h128zM896 704h-640v-192l-256 256 256 256v-192h768v-384h-128z" + ], + "tags": [ + "loop", + "repeat", + "reload", + "refresh", + "update", + "upgrade", + "synchronize", + "media control", + "arrows" + ], + "grid": 16 + }, + "properties": { + "id": 283, + "order": 39, + "prevSize": 32, + "code": 58918, + "name": "loop", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 283 + }, + { + "icon": { + "paths": [ + "M874.022 149.98c-92.652-92.656-220.636-149.98-362.022-149.98-219.488 0-406.69 138.128-479.498 332.188l119.876 44.954c54.604-145.546 195.006-249.142 359.622-249.142 106.040 0 202.020 43 271.506 112.494l-143.506 143.506h384v-384l-149.978 149.98zM512 896c-106.040 0-202.026-42.992-271.512-112.488l143.512-143.512h-384v384l149.994-149.994c92.646 92.662 220.618 149.994 362.006 149.994 219.49 0 406.692-138.128 479.5-332.188l-119.876-44.954c-54.604 145.546-195.006 249.142-359.624 249.142z" + ], + "tags": [ + "loop", + "repeat", + "reload", + "refresh", + "update", + "upgrade", + "synchronize", + "media control", + "arrows" + ], + "grid": 16 + }, + "properties": { + "id": 284, + "order": 40, + "prevSize": 32, + "code": 58919, + "name": "loop2", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 284 + }, + { + "icon": { + "paths": [ + "M320 640v-192h192l-256-256-256 256h192v320h384l-128-128zM832 576v-320h-384l128 128h128v192h-192l256 256 256-256z" + ], + "tags": [ + "loop", + "repeat", + "reload", + "refresh", + "update", + "upgrade", + "synchronize", + "media control", + "arrows" + ], + "grid": 16 + }, + "properties": { + "id": 285, + "order": 41, + "prevSize": 32, + "code": 58920, + "name": "loop3", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 285 + }, + { + "icon": { + "paths": [ + "M1024 256l-256-256v192c-130.772 0-230.752 31.208-305.65 95.408-5.25 4.5-10.284 9.1-15.162 13.774 27.52 38.164 48.716 77.516 67.772 115.090 48.322-58.402 118.054-96.272 253.040-96.272v192 0 192c-216.446 0-265.126-97.36-326.756-220.622-34.306-68.612-69.78-139.56-135.592-195.97-74.9-64.2-174.88-95.408-305.652-95.408v128c216.446 0 265.126 97.36 326.756 220.622 34.306 68.612 69.78 139.56 135.592 195.97 74.9 64.2 174.882 95.408 305.652 95.408v192l256-256-256-256 256-256zM0 704v128c130.772 0 230.75-31.208 305.65-95.408 5.25-4.498 10.284-9.1 15.162-13.776-27.52-38.162-48.718-77.516-67.772-115.090-48.32 58.402-118.052 96.274-253.040 96.274z" + ], + "tags": [ + "shuffle", + "media control", + "random" + ], + "grid": 16 + }, + "properties": { + "id": 286, + "order": 42, + "prevSize": 32, + "code": 58921, + "name": "shuffle", + "ligatures": "" + }, + "setIdx": 0, + "iconIdx": 286 + } + ], + "height": 1024, + "metadata": { + "name": "icomoon" + }, + "preferences": { + "fontPref": { + "prefix": "icon-", + "metadata": { + "fontFamily": "icomoon" + }, + "showGlyphs": true, + "metrics": { + "emSize": 512, + "baseline": 6.25, + "whitespace": 50 + }, + "resetPoint": 58880, + "showQuickUse": true, + "quickUsageToken": false, + "showMetrics": true, + "showMetadata": false + }, + "imagePref": { + "color": 0, + "height": 32, + "columns": 16, + "margin": 16, + "png": false, + "sprites": true + }, + "historySize": 100, + "showCodes": true, + "gridSize": 16, + "showLiga": false, + "showGrid": true, + "showGlyphs": true, + "showQuickUse": true, + "search": "" + } +} \ No newline at end of file diff --git a/mopidy_touchscreen/fonts/icomoon/style.css b/mopidy_touchscreen/fonts/icomoon/style.css new file mode 100644 index 0000000..b0bf36f --- /dev/null +++ b/mopidy_touchscreen/fonts/icomoon/style.css @@ -0,0 +1,151 @@ +@font-face { + font-family: 'icomoon'; + src:url('fonts/icomoon.eot?r8gz57'); + src:url('fonts/icomoon.eot?#iefixr8gz57') format('embedded-opentype'), + url('fonts/icomoon.woff?r8gz57') format('woff'), + url('fonts/icomoon.ttf?r8gz57') format('truetype'), + url('fonts/icomoon.svg?r8gz57#icomoon') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="icon-"], [class*=" icon-"] { + font-family: 'icomoon'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-music:before { + content: "\e600"; +} +.icon-headphones:before { + content: "\e601"; +} +.icon-connection:before { + content: "\e602"; +} +.icon-book:before { + content: "\e603"; +} +.icon-books:before { + content: "\e604"; +} +.icon-file:before { + content: "\e605"; +} +.icon-folder:before { + content: "\e606"; +} +.icon-folder-open:before { + content: "\e607"; +} +.icon-cabinet:before { + content: "\e608"; +} +.icon-spinner:before { + content: "\e609"; +} +.icon-cog:before { + content: "\e60a"; +} +.icon-switch:before { + content: "\e60b"; +} +.icon-list:before { + content: "\e60c"; +} +.icon-list2:before { + content: "\e60d"; +} +.icon-numbered-list:before { + content: "\e60e"; +} +.icon-menu:before { + content: "\e60f"; +} +.icon-spam:before { + content: "\e610"; +} +.icon-close:before { + content: "\e611"; +} +.icon-checkmark:before { + content: "\e612"; +} +.icon-minus:before { + content: "\e613"; +} +.icon-plus:before { + content: "\e614"; +} +.icon-play:before { + content: "\e615"; +} +.icon-pause:before { + content: "\e616"; +} +.icon-stop:before { + content: "\e617"; +} +.icon-backward:before { + content: "\e618"; +} +.icon-forward:before { + content: "\e619"; +} +.icon-first:before { + content: "\e61a"; +} +.icon-last:before { + content: "\e61b"; +} +.icon-previous:before { + content: "\e61c"; +} +.icon-next:before { + content: "\e61d"; +} +.icon-eject:before { + content: "\e61e"; +} +.icon-volume-high:before { + content: "\e61f"; +} +.icon-volume-medium:before { + content: "\e620"; +} +.icon-volume-low:before { + content: "\e621"; +} +.icon-volume-mute:before { + content: "\e622"; +} +.icon-volume-mute2:before { + content: "\e623"; +} +.icon-volume-increase:before { + content: "\e624"; +} +.icon-volume-decrease:before { + content: "\e625"; +} +.icon-loop:before { + content: "\e626"; +} +.icon-loop2:before { + content: "\e627"; +} +.icon-loop3:before { + content: "\e628"; +} +.icon-shuffle:before { + content: "\e629"; +} diff --git a/mopidy_touchscreen/list_view.py b/mopidy_touchscreen/list_view.py index 841ce82..746fbb8 100644 --- a/mopidy_touchscreen/list_view.py +++ b/mopidy_touchscreen/list_view.py @@ -48,7 +48,7 @@ class ListView(): else: width = self.size[0] while i < self.list_size and z < self.max_rows: - item = TouchAndTextItem(self.fonts['dejavusans'], self.list[i], (self.pos[0], self.pos[1]+self.base_size*z), (width, -1)) + item = TouchAndTextItem(self.fonts['base'], self.list[i], (self.pos[0], self.pos[1]+self.base_size*z), (width, -1)) self.screen_objects.set_touch_object(str(i), item) i += 1 z += 1 diff --git a/mopidy_touchscreen/main_screen.py b/mopidy_touchscreen/main_screen.py index cc7a326..278eb52 100644 --- a/mopidy_touchscreen/main_screen.py +++ b/mopidy_touchscreen/main_screen.py @@ -44,19 +44,19 @@ class MainScreen(): width = self.size[0]-self.base_size / 2-x #Track name - label = TextItem(self.fonts['dejavusans'],track.name,(x,self.base_size*2), (width,self.size[1])) + label = TextItem(self.fonts['base'],track.name,(x,self.base_size*2), (width,self.size[1])) self.touch_text_manager.set_object("track_name", label) #Album name - label = TextItem(self.fonts['dejavusans'],track.album.name,(x,self.base_size*3), (width,self.size[1])) + label = TextItem(self.fonts['base'],track.album.name,(x,self.base_size*3), (width,self.size[1])) self.touch_text_manager.set_object("album_name",label) #Artist - label = TextItem(self.fonts['dejavusans'],self.getFirstArtist(track),(x,self.base_size*4), (width,self.size[1])) + label = TextItem(self.fonts['base'],self.getFirstArtist(track),(x,self.base_size*4), (width,self.size[1])) self.touch_text_manager.set_object("artist_name",label) #Progress - progress = Progressbar(self.fonts['dejavusans'],time.strftime('%M:%S', time.gmtime(0))+"/"+time.strftime('%M:%S', time.gmtime(0)),(0,self.base_size*6), (self.size[0],self.base_size),track.length/1000, False) + progress = Progressbar(self.fonts['base'],time.strftime('%M:%S', time.gmtime(0))+"/"+time.strftime('%M:%S', time.gmtime(0)),(0,self.base_size*6), (self.size[0],self.base_size),track.length/1000, False) self.touch_text_manager.set_touch_object("time_progress", progress) self.track = track @@ -105,13 +105,13 @@ class MainScreen(): logger.error(self.track.name) width = self.size[0] -self.base_size - current = TextItem(self.fonts['dejavusans'],self.track.name,(self.base_size/2,self.base_size*2),(width, self.base_size)) + current = TextItem(self.fonts['base'],self.track.name,(self.base_size/2,self.base_size*2),(width, self.base_size)) self.touch_text_manager.set_object("track_name", current) - current = TextItem(self.fonts['dejavusans'],self.track.album.name,(self.base_size/2,self.base_size*3),(width, self.base_size)) + current = TextItem(self.fonts['base'],self.track.album.name,(self.base_size/2,self.base_size*3),(width, self.base_size)) self.touch_text_manager.set_object("album_name", current) - current = TextItem(self.fonts['dejavusans'],self.getFirstArtist(self.track),(self.base_size/2,self.base_size*4),(width, self.base_size)) + current = TextItem(self.fonts['base'],self.getFirstArtist(self.track),(self.base_size/2,self.base_size*4),(width, self.base_size)) self.touch_text_manager.set_object("artist_name", current) #self.touch_text_manager.set_object("album_name",), (self.size[0]-self.base_size,self.size[1]), (255, 255, 255)) diff --git a/mopidy_touchscreen/menu_screen.py b/mopidy_touchscreen/menu_screen.py new file mode 100644 index 0000000..96405b0 --- /dev/null +++ b/mopidy_touchscreen/menu_screen.py @@ -0,0 +1,18 @@ +from .list_view import ListView + +class MenuScreen(): + + def __init__(self, size, base_size, manager): + self.size = size + self.base_size = base_size + self.manager = manager + self.list_view = ListView((0,self.base_size),(self.size[0],self.size[1]-2*self.base_size), self.base_size, manager.fonts) + self.list_view.set_list(["Exit mopidy", "Shutdown", "Restart"]) + + def update(self, screen): + self.list_view.render(screen) + + def touch_event(self, touch_event): + clicked = self.list_view.touch_event(touch_event) + if clicked is not None: + pass \ No newline at end of file diff --git a/mopidy_touchscreen/playlist_screen.py b/mopidy_touchscreen/playlist_screen.py index 0dfc7aa..c7b52d5 100644 --- a/mopidy_touchscreen/playlist_screen.py +++ b/mopidy_touchscreen/playlist_screen.py @@ -28,3 +28,4 @@ class PlaylistScreen(): if clicked is not None: self.manager.core.tracklist.clear() self.manager.core.tracklist.add(uri=self.playlists[clicked].uri) + self.manager.core.playback.play() diff --git a/mopidy_touchscreen/screen_manager.py b/mopidy_touchscreen/screen_manager.py index dcf1339..f4001c9 100644 --- a/mopidy_touchscreen/screen_manager.py +++ b/mopidy_touchscreen/screen_manager.py @@ -4,10 +4,12 @@ from .screen_objects import * from .tracklist import Tracklist from .playlist_screen import PlaylistScreen from .dynamic_background import DynamicBackground -import pygame import logging import mopidy import traceback +import os +from .menu_screen import MenuScreen +import pygame logger = logging.getLogger(__name__) @@ -21,12 +23,14 @@ class ScreenManager(): self.background = DynamicBackground() self.current_screen = 0 self.base_size = self.size[1] / 8 - self.fonts['dejavuserif'] = pygame.font.SysFont("dejavuserif", self.base_size) - self.fonts['dejavusans'] = pygame.font.SysFont("dejavusans", self.base_size) + font = os.path.join(os.path.dirname(os.path.realpath(__file__)),"fonts","icomoon","fonts", "icomoon.ttf") + self.fonts['base'] = pygame.font.SysFont("verdana", self.base_size) + self.fonts['icon'] = pygame.font.Font(font, self.base_size) try: self.screens = [MainScreen(size, self, "/home/ander", core, self.fonts), Tracklist(size, self.base_size, self), - PlaylistScreen(size, self.base_size, self)] + PlaylistScreen(size, self.base_size, self), + MenuScreen(size, self.base_size, self)] except: traceback.print_exc() self.track = None @@ -38,51 +42,65 @@ class ScreenManager(): self.top_bar.fill((0, 0, 0, 128)) #Play/pause - button = TouchAndTextItem(self.fonts['dejavusans'], " ll", (0, 0), None) + button = TouchAndTextItem(self.fonts['icon'], u"\ue615 ", (0, 0), None) self.screen_objects_manager.set_touch_object("pause_play", button) x = button.get_right_pos() #Random - button = TouchAndTextItem(self.fonts['dejavuserif'], u"\u2928", (x, 0), None) + button = TouchAndTextItem(self.fonts['icon'], u"\ue629 ", (x, 0), None) self.screen_objects_manager.set_touch_object("random", button) x = button.get_right_pos() #Repeat - button = TouchAndTextItem(self.fonts['dejavuserif'], u"\u27F21", (x, 0), None) + button = TouchAndTextItem(self.fonts['icon'], u"\ue626", (x, 0), None) self.screen_objects_manager.set_touch_object("repeat", button) x = button.get_right_pos() + #Repeat + button = TouchAndTextItem(self.fonts['base'], " 1 ", (x, 0), None) + self.screen_objects_manager.set_touch_object("single", button) + x = button.get_right_pos() + + + logger.error(font) #Mute - button = TouchAndTextItem(self.fonts['dejavusans'], "Mute", (x, 0), None) + button = TouchAndTextItem(self.fonts['icon'], u"\ue61f ", (x, 0), None) self.screen_objects_manager.set_touch_object("mute", button) x = button.get_right_pos() #Volume - progress = Progressbar(self.fonts['dejavusans'], "100", (x, 0), (self.size[0] - x, self.base_size), 100, True) + progress = Progressbar(self.fonts['base'], "100", (x, 0), (self.size[0] - x, self.base_size), 100, True) self.screen_objects_manager.set_touch_object("volume", progress) progress.set_value(self.core.playback.volume.get()) #Menu buttons #Main button - button = TouchAndTextItem(self.fonts['dejavusans'], "Main", (0, self.base_size * 7), None) + button = TouchAndTextItem(self.fonts['icon'], u" \ue600 ", (0, self.base_size * 7), None) self.screen_objects_manager.set_touch_object("menu_0", button) x = button.get_right_pos() #Tracklist button - button = TouchAndTextItem(self.fonts['dejavusans'], "Tracklist", (x, self.base_size * 7), None) + button = TouchAndTextItem(self.fonts['icon'], u"\ue60d ", (x, self.base_size * 7), None) self.screen_objects_manager.set_touch_object("menu_1", button) x = button.get_right_pos() - #Playlist button - button = TouchAndTextItem(self.fonts['dejavusans'], "Playlist", (x, self.base_size * 7), None) + #Playlist button + button = TouchAndTextItem(self.fonts['icon'], u"\ue605 ", (x, self.base_size * 7), None) self.screen_objects_manager.set_touch_object("menu_2", button) + x = button.get_right_pos() + + #Menu button + button = TouchAndTextItem(self.fonts['icon'], u" \ue60a ", (x, self.base_size * 7), None) + self.screen_objects_manager.set_touch_object("menu_3", button) + x = button.get_right_pos() #Down bar self.down_bar = pygame.Surface((self.size[0], self.base_size), pygame.SRCALPHA) self.down_bar.fill((0, 0, 0, 128)) self.options_changed() + self.mute_changed(self.core.playback.mute.get()) self.playback_state_changed(self.core.playback.state.get(), self.core.playback.state.get()) self.change_screen(self.current_screen) @@ -111,7 +129,7 @@ class ScreenManager(): value = self.screen_objects_manager.get_touch_object(key).get_pos_value( touch_event.current_pos) self.backend.tell({'action': 'volume', 'value': value}) - self.screen_objects_manager.get_touch_object(key).set_value(value) + self.volume_changed(value) elif key == "pause_play": if self.core.playback.state.get() == mopidy.core.PlaybackState.PLAYING: self.core.playback.pause() @@ -128,57 +146,46 @@ class ScreenManager(): self.core.tracklist.set_random(random) self.options_changed() elif key == "repeat": - self.change_repeat_single() + self.core.tracklist.set_repeat(not self.core.tracklist.repeat.get()) + elif key == "single": + self.core.tracklist.set_single(not self.core.tracklist.single.get()) elif key[:-1] == "menu_": self.change_screen(int(key[-1:])) self.screens[self.current_screen].touch_event(touch_event) def volume_changed(self, volume): + if not self.core.playback.mute.get(): + if volume > 80: + self.screen_objects_manager.get_touch_object("mute").set_text(u"\ue61f", False) + elif volume > 50: + self.screen_objects_manager.get_touch_object("mute").set_text(u"\ue620", False) + elif volume > 20: + self.screen_objects_manager.get_touch_object("mute").set_text(u"\ue621", False) + else: + logger.error("sartu naiz") + self.screen_objects_manager.get_touch_object("mute").set_text(u"\ue622", False) self.screen_objects_manager.get_touch_object("volume").set_value(volume) def playback_state_changed(self, old_state, new_state): if new_state == mopidy.core.PlaybackState.PLAYING: - self.screen_objects_manager.get_touch_object("pause_play").set_text(" ll", True) + self.screen_objects_manager.get_touch_object("pause_play").set_text(u"\ue616", False) else: - self.screen_objects_manager.get_touch_object("pause_play").set_text(u" \u25B8", True) + self.screen_objects_manager.get_touch_object("pause_play").set_text(u"\ue615", False) def mute_changed(self, mute): - self.screen_objects_manager.get_touch_object("mute").set_active(mute) + self.screen_objects_manager.get_touch_object("mute").set_active(not mute) + if mute: + self.screen_objects_manager.get_touch_object("mute").set_text(u"\ue623", False) + else: + self.volume_changed(self.core.playback.volume.get()) def tracklist_changed(self): self.screens[1].tracklist_changed() def options_changed(self): self.screen_objects_manager.get_touch_object("random").set_active(self.core.tracklist.random.get()) - repeat = self.core.tracklist.repeat.get() - single = self.core.tracklist.single.get() - repeat_button = self.screen_objects_manager.get_touch_object("repeat") - repeat_button.set_active(repeat) - if single: - repeat_button.set_text(u"\u27F21", True) - else: - repeat_button.set_text(u"\u27F2", True) - - def change_repeat_single(self): - repeat = self.core.tracklist.repeat.get() - single = self.core.tracklist.single.get() - if single: - if repeat: - repeat = False - single = False - else: - repeat = True - single = False - else: - if repeat: - # repeat = True - single = True - else: - # repeat = False - single = True - self.core.tracklist.set_repeat(repeat) - self.core.tracklist.set_single(single) - self.options_changed() + self.screen_objects_manager.get_touch_object("repeat").set_active(self.core.tracklist.repeat.get()) + self.screen_objects_manager.get_touch_object("single").set_active(self.core.tracklist.single.get()) def change_screen(self, new_screen): self.screen_objects_manager.get_touch_object("menu_"+str(self.current_screen)).set_active(False) diff --git a/mopidy_touchscreen/screen_objects.py b/mopidy_touchscreen/screen_objects.py index b91c47b..bd8364e 100644 --- a/mopidy_touchscreen/screen_objects.py +++ b/mopidy_touchscreen/screen_objects.py @@ -149,6 +149,10 @@ class TouchAndTextItem(TouchObject, TextItem): def update(self): TextItem.update(self) + def set_text(self, text, change_size): + TextItem.set_text(self, text, change_size) + self.active_box = self.font.render(text, True, self.active_color) + def render(self, surface): if self.fit_horizontal: pass diff --git a/mopidy_touchscreen/touch_manager.py b/mopidy_touchscreen/touch_manager.py index c531e8a..1778e5b 100644 --- a/mopidy_touchscreen/touch_manager.py +++ b/mopidy_touchscreen/touch_manager.py @@ -14,12 +14,13 @@ class TouchManager(): left = 2 right = 3 - def __init__(self,size): + def __init__(self, size): self.down_pos = (0, 0) self.up_pos = (0, 0) self.screen_size = size self.max_move_margin = self.screen_size[1] / 6 self.min_swipe_move = self.screen_size[1] / 3 + self.down_button = -1 def event(self, event): if event.type == pygame.MOUSEBUTTONUP: @@ -31,14 +32,17 @@ class TouchManager(): touch_event = TouchEvent(TouchManager.swipe, self.down_pos, self.up_pos, True) touch_event.direction = TouchManager.down return touch_event - else: + elif event.button == 1 and self.down_button == 1: return self.mouse_up(event) + else: + return None elif event.type == pygame.MOUSEBUTTONDOWN: self.mouse_down(event) return None def mouse_down(self, event): self.down_pos = event.pos + self.down_button = event.button def mouse_up(self, event): self.up_pos = event.pos diff --git a/mopidy_touchscreen/tracklist.py b/mopidy_touchscreen/tracklist.py index d7e7ba4..a5eae91 100644 --- a/mopidy_touchscreen/tracklist.py +++ b/mopidy_touchscreen/tracklist.py @@ -7,8 +7,9 @@ class Tracklist(): self.size = size self.base_size = base_size self.manager = manager - self.list_view = ListView((0,self.base_size),(self.size[0],self.size[1]-2*self.base_size), self.base_size, manager.fonts) + self.list_view = ListView((0, self.base_size),(self.size[0],self.size[1]-2*self.base_size), self.base_size, manager.fonts) self.tracks = [] + self.tracks_strings = [] self.update_list() def update(self, screen): @@ -25,7 +26,9 @@ class Tracklist(): self.list_view.set_list(self.tracks_strings) def touch_event(self, touch_event): - self.list_view.touch_event(touch_event) + pos = self.list_view.touch_event(touch_event) + if pos is not None: + self.manager.core.playback.change_track(self.tracks[pos], on_error_step=1) def track_started(self, track): self.list_view.set_selected([self.manager.core.tracklist.index(track).get()]) \ No newline at end of file