├── .editorconfig ├── .gitignore ├── .travis.yml ├── README.md ├── Screenshot.png ├── data ├── com.github.artemanufrij.metronome.appdata.xml.in ├── com.github.artemanufrij.metronome.desktop.in ├── icons │ ├── 32 │ │ └── com.github.artemanufrij.metronome.svg │ ├── 48 │ │ └── com.github.artemanufrij.metronome.svg │ ├── com.github.artemanufrij.metronome.svg │ ├── led_gray.png │ ├── led_green.png │ ├── led_red.png │ ├── symbol-quaver.png │ ├── symbol_crotchet.png │ ├── symbol_minim.png │ └── symbol_semibreve.png ├── meson.build └── sounds │ ├── beat.wav │ ├── click_1.wav │ ├── click_2.wav │ ├── click_4.wav │ └── click_8.wav ├── debian ├── changelog ├── compat ├── control ├── copyright ├── rules └── source │ └── format ├── meson.build ├── meson └── post_install.py ├── po ├── LINGUAS ├── POTFILES ├── com.github.artemanufrij.metronome.pot ├── de.po ├── extra │ ├── LINGUAS │ ├── POTFILES │ ├── de.po │ ├── extra.pot │ ├── fr.po │ ├── lt.po │ ├── meson.build │ ├── nl.po │ └── pt.po ├── fr.po ├── lt.po ├── meson.build ├── nl.po └── pt.po ├── schemas ├── com.github.artemanufrij.metronome.gschema.xml └── meson.build └── src ├── Config.vala.in ├── Metronome.vala ├── Objects ├── Click.vala └── Preset.vala ├── Settings.vala ├── Widgets ├── PresetRow.vala ├── Presets.vala └── Volumes.vala └── meson.build /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig 2 | root = true 3 | 4 | # elementary defaults 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = tab 9 | indent_style = space 10 | insert_final_newline = true 11 | max_line_length = 80 12 | tab_width = 4 13 | 14 | # Markup files 15 | [{*.html,*.xml,*.xml.in,*.yml}] 16 | tab_width = 2 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | build/ 3 | builddir/ 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | language: node_js 4 | 5 | node_js: 6 | - 10/* 7 | 8 | sudo: required 9 | 10 | services: 11 | - docker 12 | 13 | addons: 14 | apt: 15 | sources: 16 | - ubuntu-toolchain-r-test 17 | packages: 18 | - libstdc++-5-dev 19 | 20 | install: 21 | - npm i -g @elementaryos/houston 22 | 23 | script: 24 | - houston ci 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

Metronome

3 |


A simple metronome

4 |

Designed for elementary OS

5 |
6 | 7 | [![Build Status](https://travis-ci.org/artemanufrij/metronome.svg?branch=master)](https://travis-ci.org/artemanufrij/metronome) 8 | 9 | ### Donate 10 | PayPal | LiberaPay | Patreon 11 | 12 |

13 | 14 | Get it on AppCenter 15 | 16 |

17 |

18 | 19 |

20 | 21 | ## Install from Github. 22 | 23 | As first you need elementary SDK 24 | ``` 25 | sudo apt install elementary-sdk 26 | ``` 27 | 28 | Install dependencies 29 | ``` 30 | sudo apt install libgstreamer1.0-dev 31 | ``` 32 | 33 | Clone repository and change directory 34 | ``` 35 | git clone https://github.com/artemanufrij/metronome.git 36 | cd metronome 37 | ``` 38 | 39 | Compile, install and start Metronome on your system 40 | ``` 41 | meson build --prefix=/usr 42 | cd build 43 | sudo ninja install 44 | com.github.artemanufrij.metronome 45 | ``` 46 | -------------------------------------------------------------------------------- /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/Screenshot.png -------------------------------------------------------------------------------- /data/com.github.artemanufrij.metronome.appdata.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.github.artemanufrij.metronome 5 | CC0-1.0 6 | GPL-3.0+ 7 | Metronome 8 | A simple click 9 | 10 |

A simple metronome for all musicians that helps to practice several rythms at many speeds

11 |
12 | 13 | Music 14 | 15 | 16 | #d1ff82 17 | rgb(0,0,0) 18 | 1 19 | 20 | Artem Anufrij 21 | https://github.com/artemanufrij/metronome 22 | https://github.com/artemanufrij/metronome/issues 23 | https://github.com/artemanufrij/metronome/issues 24 | artem.anufrij@live.de 25 | 26 | 27 | https://raw.githubusercontent.com/artemanufrij/metronome/master/Screenshot.png 28 | 29 | 30 | 31 | 32 | 33 | Moved to meson (by Ryo Nakano) 34 |

Translation:

35 |
    36 |
  • French (by dabou)
  • 37 |
  • Dutch (by Heimen Stoffels)
  • 38 |
39 |
40 |
41 | 42 | 43 | Prepare for JUNO 44 | 45 | 46 |
47 | 48 | none 49 | none 50 | none 51 | none 52 | none 53 | none 54 | none 55 | none 56 | none 57 | none 58 | none 59 | none 60 | none 61 | none 62 | none 63 | none 64 | none 65 | none 66 | none 67 | none 68 | none 69 | none 70 | none 71 | none 72 | none 73 | none 74 | none 75 | 76 |
77 | -------------------------------------------------------------------------------- /data/com.github.artemanufrij.metronome.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=Metronome 4 | Comment=A simple click 5 | GenericName=Metronome 6 | Icon=com.github.artemanufrij.metronome 7 | Exec=com.github.artemanufrij.metronome %U 8 | Terminal=false 9 | Categories=AudioVideo;GNOME;GTK;Audio; 10 | X-GNOME-Gettext-Domain=metronome 11 | Keywords=Metronome;Click; 12 | -------------------------------------------------------------------------------- /data/icons/32/com.github.artemanufrij.metronome.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 25 | 29 | 33 | 34 | 37 | 41 | 45 | 46 | 49 | 53 | 57 | 58 | 61 | 65 | 69 | 70 | 79 | 83 | 88 | 94 | 99 | 104 | 110 | 111 | 120 | 129 | 133 | 138 | 144 | 149 | 154 | 160 | 161 | 165 | 170 | 176 | 181 | 186 | 192 | 193 | 204 | 205 | 224 | 226 | 227 | 229 | image/svg+xml 230 | 232 | 233 | 234 | 235 | 236 | 242 | 251 | 260 | 269 | 278 | 279 | 284 | 290 | 301 | 302 | 306 | 315 | 316 | 317 | -------------------------------------------------------------------------------- /data/icons/48/com.github.artemanufrij.metronome.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 25 | 29 | 33 | 34 | 37 | 41 | 45 | 46 | 49 | 53 | 57 | 58 | 61 | 65 | 69 | 70 | 73 | 77 | 81 | 82 | 85 | 89 | 93 | 94 | 104 | 114 | 124 | 128 | 133 | 139 | 144 | 149 | 155 | 156 | 160 | 165 | 171 | 176 | 181 | 187 | 188 | 192 | 197 | 203 | 208 | 213 | 219 | 220 | 230 | 233 | 237 | 241 | 245 | 246 | 257 | 268 | 279 | 280 | 299 | 301 | 302 | 304 | image/svg+xml 305 | 307 | 308 | 309 | 310 | 311 | 315 | 322 | 329 | 336 | 337 | 344 | 353 | 362 | 371 | 380 | 381 | 386 | 393 | 404 | 405 | 409 | 417 | 418 | 419 | -------------------------------------------------------------------------------- /data/icons/com.github.artemanufrij.metronome.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 25 | 29 | 33 | 34 | 37 | 41 | 45 | 46 | 49 | 53 | 57 | 61 | 62 | 65 | 69 | 73 | 74 | 77 | 81 | 85 | 86 | 89 | 93 | 97 | 98 | 107 | 117 | 126 | 130 | 135 | 141 | 146 | 151 | 157 | 158 | 162 | 167 | 173 | 178 | 183 | 189 | 190 | 194 | 199 | 205 | 210 | 215 | 221 | 222 | 232 | 243 | 254 | 265 | 268 | 272 | 276 | 277 | 278 | 297 | 299 | 300 | 302 | image/svg+xml 303 | 305 | 306 | 307 | 308 | 309 | 313 | 321 | 328 | 335 | 336 | 342 | 351 | 360 | 369 | 378 | 379 | 384 | 390 | 401 | 402 | 406 | 414 | 415 | 416 | -------------------------------------------------------------------------------- /data/icons/led_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/icons/led_gray.png -------------------------------------------------------------------------------- /data/icons/led_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/icons/led_green.png -------------------------------------------------------------------------------- /data/icons/led_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/icons/led_red.png -------------------------------------------------------------------------------- /data/icons/symbol-quaver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/icons/symbol-quaver.png -------------------------------------------------------------------------------- /data/icons/symbol_crotchet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/icons/symbol_crotchet.png -------------------------------------------------------------------------------- /data/icons/symbol_minim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/icons/symbol_minim.png -------------------------------------------------------------------------------- /data/icons/symbol_semibreve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/icons/symbol_semibreve.png -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | icon_size = ['32', '48'] 2 | 3 | foreach i : icon_size 4 | install_data( 5 | join_paths('icons', i, meson.project_name() + '.svg'), 6 | install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') 7 | ) 8 | install_data( 9 | join_paths('icons', i, meson.project_name() + '.svg'), 10 | install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps') 11 | ) 12 | endforeach 13 | 14 | misc_icons = ['symbol_crotchet', 'symbol_minim', 'symbol-quaver', 'symbol_semibreve', 'led_gray', 'led_green', 'led_red'] 15 | 16 | foreach m : misc_icons 17 | install_data( 18 | join_paths('icons', m + '.png'), 19 | install_dir: join_paths(get_option('datadir'), meson.project_name(), 'icons') 20 | ) 21 | endforeach 22 | 23 | sounds = ['click_1', 'click_2', 'click_4', 'click_8', 'beat'] 24 | 25 | foreach s : sounds 26 | install_data( 27 | join_paths('sounds', s + '.wav'), 28 | install_dir: join_paths(get_option('datadir'), meson.project_name(), 'sounds') 29 | ) 30 | endforeach 31 | 32 | i18n.merge_file( 33 | input: meson.project_name() + '.appdata.xml.in', 34 | output: meson.project_name() + '.appdata.xml', 35 | po_dir: join_paths(meson.source_root(), 'po', 'extra'), 36 | install: true, 37 | install_dir: join_paths(get_option('datadir'), 'metainfo') 38 | ) 39 | 40 | i18n.merge_file( 41 | input: meson.project_name() + '.desktop.in', 42 | output: meson.project_name() + '.desktop', 43 | po_dir: join_paths(meson.source_root(), 'po', 'extra'), 44 | type: 'desktop', 45 | install: true, 46 | install_dir: join_paths(get_option('datadir'), 'applications') 47 | ) 48 | -------------------------------------------------------------------------------- /data/sounds/beat.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/sounds/beat.wav -------------------------------------------------------------------------------- /data/sounds/click_1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/sounds/click_1.wav -------------------------------------------------------------------------------- /data/sounds/click_2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/sounds/click_2.wav -------------------------------------------------------------------------------- /data/sounds/click_4.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/sounds/click_4.wav -------------------------------------------------------------------------------- /data/sounds/click_8.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artemanufrij/metronome/7b32b05d4a3dcf6b4f888a08af2585e660126f95/data/sounds/click_8.wav -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | com.github.artemanufrij.metronome (0.2.2) xenial; urgency=low 2 | 3 | * Initial Release. 4 | 5 | -- Artem Anufrij Fri, 7 Jul 2017 04:53:39 +0100 6 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: com.github.artemanufrij.metronome 2 | Section: x11 3 | Priority: optional 4 | Maintainer: Artem Anufrij 5 | Build-Depends: debhelper (>= 10.5.1), 6 | gettext, 7 | libgstreamer1.0-dev, 8 | libgranite-dev, 9 | meson, 10 | valac (>= 0.26) 11 | Standards-Version: 4.1.1 12 | 13 | Package: com.github.artemanufrij.metronome 14 | Architecture: any 15 | Depends: ${misc:Depends}, ${shlibs:Depends} 16 | Description: Simple metronome 17 | Simple metronome for musicians, written especially for Elementary OS 18 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://dep.debian.net/deps/dep5 2 | Upstream-Name: com.github.artemanufrij.metronome 3 | Source: https://github.com/artemanufrij/metronome 4 | 5 | Files: * 6 | Copyright: Artem Anufrij 7 | License: GPL-3.0+ 8 | 9 | License: GPL-3.0+ 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | . 15 | This package is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | . 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | . 23 | On Debian systems, the complete text of the GNU General 24 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 25 | 26 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | %: 13 | dh $@ 14 | 15 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('com.github.artemanufrij.metronome', 'vala', 'c') 2 | 3 | i18n = import('i18n') 4 | 5 | add_project_arguments( 6 | '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), 7 | language: 'c' 8 | ) 9 | 10 | subdir('data') 11 | subdir('po') 12 | subdir('schemas') 13 | subdir('src') 14 | 15 | executable( 16 | meson.project_name(), 17 | sources, 18 | config_header, 19 | dependencies: [ 20 | dependency('granite'), 21 | dependency('gstreamer-1.0'), 22 | dependency('gtk+-3.0'), 23 | ], 24 | install: true 25 | ) 26 | 27 | meson.add_install_script('meson/post_install.py') 28 | -------------------------------------------------------------------------------- /meson/post_install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import subprocess 5 | 6 | schema_dir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas') 7 | icon_cache_dir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'icons', 'hicolor') 8 | 9 | if not os.environ.get('DESTDIR'): 10 | print('Compiling gsettings schemas…') 11 | subprocess.call(['glib-compile-schemas', schema_dir]) 12 | 13 | print('Updating desktop icon cache…') 14 | subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir]) 15 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | de 2 | fr 3 | lt 4 | nl 5 | pt 6 | -------------------------------------------------------------------------------- /po/POTFILES: -------------------------------------------------------------------------------- 1 | src/Widgets/Presets.vala 2 | src/Widgets/PresetRow.vala 3 | src/Metronome.vala 4 | -------------------------------------------------------------------------------- /po/com.github.artemanufrij.metronome.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.artemanufrij.metronome package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: com.github.artemanufrij.metronome\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2019-08-01 12:02+0200\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: src/Widgets/Presets.vala:43 21 | msgid "Add Preset" 22 | msgstr "" 23 | 24 | #: src/Widgets/Presets.vala:56 25 | msgid "Preset title" 26 | msgstr "" 27 | 28 | #: src/Widgets/PresetRow.vala:30 src/Metronome.vala:214 29 | msgid "BPM" 30 | msgstr "" 31 | 32 | #: src/Widgets/PresetRow.vala:36 src/Metronome.vala:247 33 | msgid "Beat" 34 | msgstr "" 35 | 36 | #: src/Widgets/PresetRow.vala:85 37 | msgid "Delete Preset" 38 | msgstr "" 39 | 40 | #: src/Widgets/PresetRow.vala:90 41 | msgid "Save current Settings" 42 | msgstr "" 43 | 44 | #: src/Metronome.vala:77 45 | msgid "Stop" 46 | msgstr "" 47 | 48 | #: src/Metronome.vala:85 src/Metronome.vala:145 49 | msgid "Start" 50 | msgstr "" 51 | 52 | #: src/Metronome.vala:279 src/Metronome.vala:285 53 | msgid "Show Presets" 54 | msgstr "" 55 | 56 | #: src/Metronome.vala:289 57 | msgid "Hide Presets" 58 | msgstr "" 59 | -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- 1 | # German translations for com.github.artemanufrij.metronome package. 2 | # Copyright (C) 2019 THE com.github.artemanufrij.metronome'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.artemanufrij.metronome package. 4 | # Automatically generated, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: com.github.artemanufrij.metronome\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 12:02+0200\n" 11 | "PO-Revision-Date: 2019-08-01 11:28+0200\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: none\n" 14 | "Language: de\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: src/Widgets/Presets.vala:43 21 | msgid "Add Preset" 22 | msgstr "Voreinstellung hinzufügen" 23 | 24 | #: src/Widgets/Presets.vala:56 25 | msgid "Preset title" 26 | msgstr "Title der Einstellung" 27 | 28 | #: src/Widgets/PresetRow.vala:30 src/Metronome.vala:214 29 | msgid "BPM" 30 | msgstr "" 31 | 32 | #: src/Widgets/PresetRow.vala:36 src/Metronome.vala:247 33 | msgid "Beat" 34 | msgstr "" 35 | 36 | #: src/Widgets/PresetRow.vala:85 37 | msgid "Delete Preset" 38 | msgstr "Voreinstellung löschen" 39 | 40 | #: src/Widgets/PresetRow.vala:90 41 | msgid "Save current Settings" 42 | msgstr "Aktuelle Einstellung speichern" 43 | 44 | #: src/Metronome.vala:77 45 | msgid "Stop" 46 | msgstr "Stop" 47 | 48 | #: src/Metronome.vala:85 src/Metronome.vala:145 49 | msgid "Start" 50 | msgstr "Start" 51 | 52 | #: src/Metronome.vala:279 src/Metronome.vala:285 53 | msgid "Show Presets" 54 | msgstr "Voreinstellungen zeigen" 55 | 56 | #: src/Metronome.vala:289 57 | msgid "Hide Presets" 58 | msgstr "Voreinstellungen ausblenden" 59 | -------------------------------------------------------------------------------- /po/extra/LINGUAS: -------------------------------------------------------------------------------- 1 | de 2 | fr 3 | lt 4 | nl 5 | pt 6 | -------------------------------------------------------------------------------- /po/extra/POTFILES: -------------------------------------------------------------------------------- 1 | data/com.github.artemanufrij.metronome.desktop.in 2 | data/com.github.artemanufrij.metronome.appdata.xml.in 3 | -------------------------------------------------------------------------------- /po/extra/de.po: -------------------------------------------------------------------------------- 1 | # German translations for extra package. 2 | # Copyright (C) 2019 THE extra'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the extra package. 4 | # Automatically generated, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: extra\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 11:32+0200\n" 11 | "PO-Revision-Date: 2019-08-01 11:28+0200\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: none\n" 14 | "Language: de\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | 20 | #: data/com.github.artemanufrij.metronome.desktop.in:4 21 | #: data/com.github.artemanufrij.metronome.desktop.in:6 22 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:7 23 | msgid "Metronome" 24 | msgstr "" 25 | 26 | #: data/com.github.artemanufrij.metronome.desktop.in:5 27 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:8 28 | msgid "A simple click" 29 | msgstr "" 30 | 31 | #: data/com.github.artemanufrij.metronome.desktop.in:7 32 | msgid "com.github.artemanufrij.metronome" 33 | msgstr "" 34 | 35 | #: data/com.github.artemanufrij.metronome.desktop.in:12 36 | msgid "Metronome;Click;" 37 | msgstr "" 38 | 39 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:10 40 | msgid "" 41 | "A simple metronome for all musicians that helps to practice several rythms " 42 | "at many speeds" 43 | msgstr "" 44 | 45 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:20 46 | msgid "Artem Anufrij" 47 | msgstr "" 48 | 49 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:34 50 | msgid "Translation:" 51 | msgstr "" 52 | 53 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:36 54 | msgid "French (by dabou)" 55 | msgstr "" 56 | 57 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:37 58 | msgid "Dutch (by Heimen Stoffels)" 59 | msgstr "" 60 | 61 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:42 62 | msgid "Prepare for JUNO" 63 | msgstr "" 64 | -------------------------------------------------------------------------------- /po/extra/extra.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the extra package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: extra\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2019-08-01 11:32+0200\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: data/com.github.artemanufrij.metronome.desktop.in:4 21 | #: data/com.github.artemanufrij.metronome.desktop.in:6 22 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:7 23 | msgid "Metronome" 24 | msgstr "" 25 | 26 | #: data/com.github.artemanufrij.metronome.desktop.in:5 27 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:8 28 | msgid "A simple click" 29 | msgstr "" 30 | 31 | #: data/com.github.artemanufrij.metronome.desktop.in:7 32 | msgid "com.github.artemanufrij.metronome" 33 | msgstr "" 34 | 35 | #: data/com.github.artemanufrij.metronome.desktop.in:12 36 | msgid "Metronome;Click;" 37 | msgstr "" 38 | 39 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:10 40 | msgid "" 41 | "A simple metronome for all musicians that helps to practice several rythms " 42 | "at many speeds" 43 | msgstr "" 44 | 45 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:20 46 | msgid "Artem Anufrij" 47 | msgstr "" 48 | 49 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:34 50 | msgid "Translation:" 51 | msgstr "" 52 | 53 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:36 54 | msgid "French (by dabou)" 55 | msgstr "" 56 | 57 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:37 58 | msgid "Dutch (by Heimen Stoffels)" 59 | msgstr "" 60 | 61 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:42 62 | msgid "Prepare for JUNO" 63 | msgstr "" 64 | -------------------------------------------------------------------------------- /po/extra/fr.po: -------------------------------------------------------------------------------- 1 | # French translations for extra package. 2 | # Copyright (C) 2019 THE extra'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the extra package. 4 | # NathanBnm, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: extra\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 11:32+0200\n" 11 | "PO-Revision-Date: 2019-08-01 11:28+0200\n" 12 | "Last-Translator: NathanBnm\n" 13 | "Language-Team: none\n" 14 | "Language: fr\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 | 20 | #: data/com.github.artemanufrij.metronome.desktop.in:4 21 | #: data/com.github.artemanufrij.metronome.desktop.in:6 22 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:7 23 | msgid "Metronome" 24 | msgstr "Métronome" 25 | 26 | #: data/com.github.artemanufrij.metronome.desktop.in:5 27 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:8 28 | msgid "A simple click" 29 | msgstr "Un simple clic" 30 | 31 | #: data/com.github.artemanufrij.metronome.desktop.in:7 32 | msgid "com.github.artemanufrij.metronome" 33 | msgstr "com.github.artemanufrij.metronome" 34 | 35 | #: data/com.github.artemanufrij.metronome.desktop.in:12 36 | msgid "Metronome;Click;" 37 | msgstr "Métronome;Clic;" 38 | 39 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:10 40 | msgid "" 41 | "A simple metronome for all musicians that helps to practice several rythms " 42 | "at many speeds" 43 | msgstr "" 44 | "Un simple métronome pour tous les musiciens, pour apprendre à pratiquer avec différents rythmes " 45 | "a différentes vitesses" 46 | 47 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:20 48 | msgid "Artem Anufrij" 49 | msgstr "Artem Anufrij" 50 | 51 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:34 52 | msgid "Translation:" 53 | msgstr "Tradution :" 54 | 55 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:36 56 | msgid "French (by dabou)" 57 | msgstr "Français (by dabou)" 58 | 59 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:37 60 | msgid "Dutch (by Heimen Stoffels)" 61 | msgstr "Néerlandais (par Heimen Stoffels)" 62 | 63 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:42 64 | msgid "Prepare for JUNO" 65 | msgstr "Préparation pour JUNO" 66 | -------------------------------------------------------------------------------- /po/extra/lt.po: -------------------------------------------------------------------------------- 1 | # Lithuanian translations for extra package. 2 | # Copyright (C) 2019 THE extra'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the extra package. 4 | # Automatically generated, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: extra\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 11:32+0200\n" 11 | "PO-Revision-Date: 2019-08-01 11:28+0200\n" 12 | "Last-Translator: Automatically generated\n" 13 | "Language-Team: none\n" 14 | "Language: lt\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" 19 | "%100<10 || n%100>=20) ? 1 : 2);\n" 20 | 21 | #: data/com.github.artemanufrij.metronome.desktop.in:4 22 | #: data/com.github.artemanufrij.metronome.desktop.in:6 23 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:7 24 | msgid "Metronome" 25 | msgstr "" 26 | 27 | #: data/com.github.artemanufrij.metronome.desktop.in:5 28 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:8 29 | msgid "A simple click" 30 | msgstr "" 31 | 32 | #: data/com.github.artemanufrij.metronome.desktop.in:7 33 | msgid "com.github.artemanufrij.metronome" 34 | msgstr "" 35 | 36 | #: data/com.github.artemanufrij.metronome.desktop.in:12 37 | msgid "Metronome;Click;" 38 | msgstr "" 39 | 40 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:10 41 | msgid "" 42 | "A simple metronome for all musicians that helps to practice several rythms " 43 | "at many speeds" 44 | msgstr "" 45 | 46 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:20 47 | msgid "Artem Anufrij" 48 | msgstr "" 49 | 50 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:34 51 | msgid "Translation:" 52 | msgstr "" 53 | 54 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:36 55 | msgid "French (by dabou)" 56 | msgstr "" 57 | 58 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:37 59 | msgid "Dutch (by Heimen Stoffels)" 60 | msgstr "" 61 | 62 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:42 63 | msgid "Prepare for JUNO" 64 | msgstr "" 65 | -------------------------------------------------------------------------------- /po/extra/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext('extra', 2 | args: [ 3 | '--directory=' + meson.source_root(), 4 | '--from-code=UTF-8' 5 | ], 6 | install: false 7 | ) 8 | -------------------------------------------------------------------------------- /po/extra/nl.po: -------------------------------------------------------------------------------- 1 | # Dutch translations for extra package. 2 | # Copyright (C) 2019 THE extra'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the extra package. 4 | # Automatically generated, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: extra\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 11:32+0200\n" 11 | "PO-Revision-Date: 2019-08-04 12:28+0200\n" 12 | "Last-Translator: Heimen Stoffels \n" 13 | "Language-Team: none\n" 14 | "Language: nl\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | "X-Generator: Poedit 2.2.3\n" 20 | 21 | #: data/com.github.artemanufrij.metronome.desktop.in:4 22 | #: data/com.github.artemanufrij.metronome.desktop.in:6 23 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:7 24 | msgid "Metronome" 25 | msgstr "Metronome" 26 | 27 | #: data/com.github.artemanufrij.metronome.desktop.in:5 28 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:8 29 | msgid "A simple click" 30 | msgstr "Eenvoudig getik" 31 | 32 | #: data/com.github.artemanufrij.metronome.desktop.in:7 33 | msgid "com.github.artemanufrij.metronome" 34 | msgstr "com.github.artemanufrij.metronome" 35 | 36 | #: data/com.github.artemanufrij.metronome.desktop.in:12 37 | msgid "Metronome;Click;" 38 | msgstr "Metronome;Getik;" 39 | 40 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:10 41 | msgid "" 42 | "A simple metronome for all musicians that helps to practice several rythms " 43 | "at many speeds" 44 | msgstr "" 45 | "Een eenvoudige metronoom die alle muzikanten helpt om verschillende " 46 | "soorten ritmes onder de knie te krijgen" 47 | 48 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:20 49 | msgid "Artem Anufrij" 50 | msgstr "Artem Anufrij" 51 | 52 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:34 53 | msgid "Translation:" 54 | msgstr "Vertaling:" 55 | 56 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:36 57 | msgid "French (by dabou)" 58 | msgstr "Frans (door dabou)" 59 | 60 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:37 61 | msgid "Dutch (by Heimen Stoffels)" 62 | msgstr "Nederlands (door Heimen Stoffels)" 63 | 64 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:42 65 | msgid "Prepare for JUNO" 66 | msgstr "Voorbereiding voor JUNO" 67 | -------------------------------------------------------------------------------- /po/extra/pt.po: -------------------------------------------------------------------------------- 1 | # Portuguese (Portugal) translations for com.github.artemanufrij.metronome package. 2 | # Copyright (C) 2019 THE com.github.artemanufrij.metronome'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.artemanufrij.metronome package. 4 | # André Barata , 2020. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: extra\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 11:32+0200\n" 11 | "PO-Revision-Date: 2020-08-30 12:09+0100\n" 12 | "Language-Team: none\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "X-Generator: Poedit 2.4.1\n" 17 | "Last-Translator: André Barata \n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | "Language: pt\n" 20 | 21 | #: data/com.github.artemanufrij.metronome.desktop.in:4 22 | #: data/com.github.artemanufrij.metronome.desktop.in:6 23 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:7 24 | msgid "Metronome" 25 | msgstr "Metronome" 26 | 27 | #: data/com.github.artemanufrij.metronome.desktop.in:5 28 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:8 29 | msgid "A simple click" 30 | msgstr "Um clique simples" 31 | 32 | #: data/com.github.artemanufrij.metronome.desktop.in:7 33 | msgid "com.github.artemanufrij.metronome" 34 | msgstr "com.github.artemanufrij.metronome" 35 | 36 | #: data/com.github.artemanufrij.metronome.desktop.in:12 37 | msgid "Metronome;Click;" 38 | msgstr "Metronome;Metrónomo;Click;Clique;" 39 | 40 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:10 41 | msgid "" 42 | "A simple metronome for all musicians that helps to practice several rythms " 43 | "at many speeds" 44 | msgstr "" 45 | "Um metrónomo simples para todos os músicos que os ajuda a praticar vários " 46 | "ritmos a várias velocidades" 47 | 48 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:20 49 | msgid "Artem Anufrij" 50 | msgstr "Artem Anufrij" 51 | 52 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:34 53 | msgid "Translation:" 54 | msgstr "Traduções:" 55 | 56 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:36 57 | msgid "French (by dabou)" 58 | msgstr "Francês (por dabou)" 59 | 60 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:37 61 | msgid "Dutch (by Heimen Stoffels)" 62 | msgstr "Holandês (por Heimen Stoffels)" 63 | 64 | #: data/com.github.artemanufrij.metronome.appdata.xml.in:42 65 | msgid "Prepare for JUNO" 66 | msgstr "Preparação para o JUNO" 67 | -------------------------------------------------------------------------------- /po/fr.po: -------------------------------------------------------------------------------- 1 | # French translations for com.github.artemanufrij.metronome package. 2 | # Copyright (C) 2019 THE com.github.artemanufrij.metronome'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.artemanufrij.metronome package. 4 | # Dabou, 2018. 5 | # NathanBnm, 2019. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: com.github.artemanufrij.metronome\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2019-08-01 12:02+0200\n" 12 | "PO-Revision-Date: 2019-08-01 11:28+0200\n" 13 | "Last-Translator: NathanBnm\n" 14 | "Language-Team: none\n" 15 | "Language: fr\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 20 | 21 | #: src/Widgets/Presets.vala:43 22 | msgid "Add Preset" 23 | msgstr "Ajouter un réglage" 24 | 25 | #: src/Widgets/Presets.vala:56 26 | msgid "Preset title" 27 | msgstr "Titre du réglage" 28 | 29 | #: src/Widgets/PresetRow.vala:30 src/Metronome.vala:214 30 | msgid "BPM" 31 | msgstr "BPM" 32 | 33 | #: src/Widgets/PresetRow.vala:36 src/Metronome.vala:247 34 | msgid "Beat" 35 | msgstr "Rythme" 36 | 37 | #: src/Widgets/PresetRow.vala:85 38 | msgid "Delete Preset" 39 | msgstr "Supprimer le réglage" 40 | 41 | #: src/Widgets/PresetRow.vala:90 42 | msgid "Save current Settings" 43 | msgstr "Enregistrer les paramètres actuels" 44 | 45 | #: src/Metronome.vala:77 46 | msgid "Stop" 47 | msgstr "Arrêter" 48 | 49 | #: src/Metronome.vala:85 src/Metronome.vala:145 50 | msgid "Start" 51 | msgstr "Démarrer" 52 | 53 | #: src/Metronome.vala:279 src/Metronome.vala:285 54 | msgid "Show Presets" 55 | msgstr "Afficher les réglages" 56 | 57 | #: src/Metronome.vala:289 58 | msgid "Hide Presets" 59 | msgstr "Masquer les réglages" 60 | -------------------------------------------------------------------------------- /po/lt.po: -------------------------------------------------------------------------------- 1 | # Lithuanian translations for com.github.artemanufrij.metronome package. 2 | # Copyright (C) 2019 THE com.github.artemanufrij.metronome'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.artemanufrij.metronome package. 4 | # Moo, 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: com.github.artemanufrij.metronome\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 12:02+0200\n" 11 | "PO-Revision-Date: 2019-08-01 11:28+0200\n" 12 | "Last-Translator: Moo\n" 13 | "Language-Team: none\n" 14 | "Language: lt\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" 19 | "%100<10 || n%100>=20) ? 1 : 2);\n" 20 | 21 | #: src/Widgets/Presets.vala:43 22 | msgid "Add Preset" 23 | msgstr "Pridėti išankstinę parinktį" 24 | 25 | #: src/Widgets/Presets.vala:56 26 | msgid "Preset title" 27 | msgstr "Išankstinės parinkties pavadinimas" 28 | 29 | #: src/Widgets/PresetRow.vala:30 src/Metronome.vala:214 30 | msgid "BPM" 31 | msgstr "" 32 | 33 | #: src/Widgets/PresetRow.vala:36 src/Metronome.vala:247 34 | msgid "Beat" 35 | msgstr "" 36 | 37 | #: src/Widgets/PresetRow.vala:85 38 | msgid "Delete Preset" 39 | msgstr "Ištrinti išankstinę parinktį" 40 | 41 | #: src/Widgets/PresetRow.vala:90 42 | msgid "Save current Settings" 43 | msgstr "Įrašyti esamus nustatymus" 44 | 45 | #: src/Metronome.vala:77 46 | msgid "Stop" 47 | msgstr "Stabdyti" 48 | 49 | #: src/Metronome.vala:85 src/Metronome.vala:145 50 | msgid "Start" 51 | msgstr "Pradėti" 52 | 53 | #: src/Metronome.vala:279 src/Metronome.vala:285 54 | msgid "Show Presets" 55 | msgstr "Rodyti išankstines parinktis" 56 | 57 | #: src/Metronome.vala:289 58 | msgid "Hide Presets" 59 | msgstr "Slėpti išankstines parinktis" 60 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext(meson.project_name(), 2 | args: [ 3 | '--directory=' + meson.source_root(), 4 | '--from-code=UTF-8' 5 | ] 6 | ) 7 | 8 | subdir('extra') 9 | -------------------------------------------------------------------------------- /po/nl.po: -------------------------------------------------------------------------------- 1 | # Dutch translations for com.github.artemanufrij.metronome package. 2 | # Copyright (C) 2019 THE com.github.artemanufrij.metronome'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.artemanufrij.metronome package. 4 | # Heimen Stoffels , 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: com.github.artemanufrij.metronome\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 12:02+0200\n" 11 | "PO-Revision-Date: 2019-08-04 12:28+0200\n" 12 | "Last-Translator: Heimen Stoffels \n" 13 | "Language-Team: none\n" 14 | "Language: nl\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | "X-Generator: Poedit 2.2.3\n" 20 | 21 | #: src/Widgets/Presets.vala:43 22 | msgid "Add Preset" 23 | msgstr "Voorinstelling toevoegen" 24 | 25 | #: src/Widgets/Presets.vala:56 26 | msgid "Preset title" 27 | msgstr "Naam van voorinstelling" 28 | 29 | #: src/Widgets/PresetRow.vala:30 src/Metronome.vala:214 30 | msgid "BPM" 31 | msgstr "BPM" 32 | 33 | #: src/Widgets/PresetRow.vala:36 src/Metronome.vala:247 34 | msgid "Beat" 35 | msgstr "Beat" 36 | 37 | #: src/Widgets/PresetRow.vala:85 38 | msgid "Delete Preset" 39 | msgstr "Voorinstelling verwijderen" 40 | 41 | #: src/Widgets/PresetRow.vala:90 42 | msgid "Save current Settings" 43 | msgstr "Huidige instellingen opslaan" 44 | 45 | #: src/Metronome.vala:77 46 | msgid "Stop" 47 | msgstr "Stoppen" 48 | 49 | #: src/Metronome.vala:85 src/Metronome.vala:145 50 | msgid "Start" 51 | msgstr "Starten" 52 | 53 | #: src/Metronome.vala:279 src/Metronome.vala:285 54 | msgid "Show Presets" 55 | msgstr "Voorinstellingen tonen" 56 | 57 | #: src/Metronome.vala:289 58 | msgid "Hide Presets" 59 | msgstr "Voorinstellingen verbergen" 60 | -------------------------------------------------------------------------------- /po/pt.po: -------------------------------------------------------------------------------- 1 | # Portuguese (Portugal) translations for com.github.artemanufrij.metronome package. 2 | # Copyright (C) 2019 THE com.github.artemanufrij.metronome'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.artemanufrij.metronome package. 4 | # André Barata , 2020. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: com.github.artemanufrij.metronome\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2019-08-01 12:02+0200\n" 11 | "PO-Revision-Date: 2020-08-30 12:06+0100\n" 12 | "Language-Team: none\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "X-Generator: Poedit 2.4.1\n" 17 | "Last-Translator: André Barata \n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 | "Language: pt\n" 20 | 21 | #: src/Widgets/Presets.vala:43 22 | msgid "Add Preset" 23 | msgstr "Adicionar Predefinição" 24 | 25 | #: src/Widgets/Presets.vala:56 26 | msgid "Preset title" 27 | msgstr "Título da Predefinição" 28 | 29 | #: src/Widgets/PresetRow.vala:30 src/Metronome.vala:214 30 | msgid "BPM" 31 | msgstr "BPM" 32 | 33 | #: src/Widgets/PresetRow.vala:36 src/Metronome.vala:247 34 | msgid "Beat" 35 | msgstr "Batimentos" 36 | 37 | #: src/Widgets/PresetRow.vala:85 38 | msgid "Delete Preset" 39 | msgstr "Apagar Predefinição" 40 | 41 | #: src/Widgets/PresetRow.vala:90 42 | msgid "Save current Settings" 43 | msgstr "Guardar Definições atuais" 44 | 45 | #: src/Metronome.vala:77 46 | msgid "Stop" 47 | msgstr "Parar" 48 | 49 | #: src/Metronome.vala:85 src/Metronome.vala:145 50 | msgid "Start" 51 | msgstr "Iniciar" 52 | 53 | #: src/Metronome.vala:279 src/Metronome.vala:285 54 | msgid "Show Presets" 55 | msgstr "Mostrar Predefinições" 56 | 57 | #: src/Metronome.vala:289 58 | msgid "Hide Presets" 59 | msgstr "Esconder Predefinições" 60 | -------------------------------------------------------------------------------- /schemas/com.github.artemanufrij.metronome.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0.5 6 | Volume semibreve 7 | Volume semibreve 8 | 9 | 10 | 0 11 | Volume minim 12 | Volume minim 13 | 14 | 15 | 0 16 | Volume crotchet 17 | Volume crotchet 18 | 19 | 20 | 0 21 | Volume quaver 22 | Volume quaver 23 | 24 | 25 | 120 26 | Tempo 27 | Tempo 28 | 29 | 30 | 4 31 | Beat 32 | Beat 33 | 34 | 35 | ['Default:120;4;0.5;0.1;0;0','SKA:140;2;0.5;0.1;0;0','Waltz:92;3;0.5;0;0;0'] 36 | Settings 37 | Settings 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /schemas/meson.build: -------------------------------------------------------------------------------- 1 | install_data( 2 | meson.project_name() + '.gschema.xml', 3 | install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas') 4 | ) 5 | -------------------------------------------------------------------------------- /src/Config.vala.in: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2015-2018 Artem Anufrij 3 | // 4 | // This program is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | 18 | namespace Constants { 19 | public const string PKGDATADIR = @PKGDATADIR@; 20 | } 21 | -------------------------------------------------------------------------------- /src/Metronome.vala: -------------------------------------------------------------------------------- 1 | using Gst; 2 | 3 | namespace Metronome { 4 | 5 | public class MetronomeApp : Gtk.Application { 6 | 7 | public Gtk.Window mainwindow; 8 | 9 | // Controls 10 | Gtk.Paned root; 11 | Gtk.Grid content; 12 | Metronome.Widgets.Presets presets_sidebar; 13 | 14 | Gtk.Button start_button; 15 | 16 | Gtk.SpinButton tempo; 17 | Gtk.SpinButton beat; 18 | 19 | Gtk.Image led_green_right; 20 | Gtk.Image led_red_left; 21 | 22 | Gtk.Label tempo_value; 23 | Gtk.Label beat_value; 24 | 25 | Gtk.Popover tempo_popover; 26 | Gtk.Popover beat_popover; 27 | 28 | Gst.Element sound_semibreve; 29 | Gst.Element sound_minim; 30 | Gst.Element sound_crotchet; 31 | Gst.Element sound_quaver; 32 | Gst.Element sound_beat; 33 | 34 | internal Metronome.Widgets.Volumes volumes; 35 | internal Metronome.Objects.Click click; 36 | 37 | Settings settings; 38 | 39 | string file_click_1 = "file://" + Constants.PKGDATADIR + "/sounds/click_1.wav"; 40 | string file_click_2 = "file://" + Constants.PKGDATADIR + "/sounds/click_2.wav"; 41 | string file_click_4 = "file://" + Constants.PKGDATADIR + "/sounds/click_4.wav"; 42 | string file_click_8 = "file://" + Constants.PKGDATADIR + "/sounds/click_8.wav"; 43 | string file_beat = "file://" + Constants.PKGDATADIR + "/sounds/beat.wav"; 44 | 45 | public static MetronomeApp _instance = null; 46 | 47 | public static MetronomeApp instance { 48 | get { 49 | if (_instance == null) 50 | _instance = new MetronomeApp (); 51 | return _instance; 52 | } 53 | } 54 | 55 | 56 | protected override void activate () { 57 | 58 | debug ("sound file: %s", file_click_1); 59 | debug ("sound file: %s", file_click_2); 60 | debug ("sound file: %s", file_click_4); 61 | debug ("sound file: %s", file_click_8); 62 | debug ("sound file: %s", file_beat); 63 | 64 | if (mainwindow != null) { 65 | mainwindow.present (); // present window if app is already running 66 | return; 67 | } 68 | 69 | settings = Settings.get_default (); 70 | 71 | click = new Metronome.Objects.Click (); 72 | click.current_tempo = settings.tempo; 73 | click.current_beat = settings.beat; 74 | 75 | click.state_changed.connect((state) => { 76 | if (state == Metronome.Objects.click_state.running) { 77 | start_button.label = _("Stop"); 78 | start_button.get_style_context ().remove_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION); 79 | start_button.get_style_context ().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); 80 | 81 | led_green_right.visible = false; 82 | led_red_left.visible = false; 83 | } 84 | else { 85 | start_button.label = _("Start"); 86 | start_button.get_style_context ().remove_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); 87 | start_button.get_style_context ().add_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION); 88 | 89 | stop_sound (); 90 | } 91 | }); 92 | 93 | click.tempo_changed.connect ((current_tempo) => { 94 | debug ("current_tempo %d", (int)current_tempo); 95 | tempo_value.label = "" + current_tempo.to_string () + ""; 96 | }); 97 | 98 | click.beat_changed.connect ((current_beat) => { 99 | debug ("current_beat %d", (int)current_beat); 100 | beat_value.label = "" + current_beat.to_string () + ""; 101 | }); 102 | 103 | click.click.connect ((interval, beat) => { 104 | do_click (interval, beat); 105 | }); 106 | 107 | // SOUND 108 | sound_semibreve = ElementFactory.make ("playbin", "player"); 109 | 110 | sound_minim = ElementFactory.make ("playbin", "player"); 111 | 112 | sound_crotchet = ElementFactory.make ("playbin", "player"); 113 | 114 | sound_quaver = ElementFactory.make ("playbin", "player"); 115 | 116 | sound_beat = ElementFactory.make ("playbin", "player"); 117 | 118 | build_ui (); 119 | } 120 | 121 | private void build_ui () { 122 | mainwindow = new Gtk.Window (); 123 | mainwindow.set_resizable (false); 124 | mainwindow.add_events(Gdk.EventMask.KEY_PRESS_MASK); 125 | 126 | root = new Gtk.Paned (Gtk.Orientation.HORIZONTAL); 127 | 128 | content = new Gtk.Grid (); 129 | content.width_request = 200; 130 | content.margin = 24; 131 | content.hexpand = true; 132 | content.row_spacing = 24; 133 | content.column_spacing = 6; 134 | 135 | // TITLE BAR 136 | build_titelbar (); 137 | 138 | // VOLUME sliders 139 | build_volume_sliders (); 140 | 141 | // SIDEBAR 142 | build_presets_sidebar (); 143 | 144 | // START-STOP button 145 | start_button = new Gtk.Button.with_label (_("Start")); 146 | start_button.hexpand = true; 147 | start_button.get_style_context ().add_class ("h2"); 148 | start_button.get_style_context ().add_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION); 149 | content.attach (start_button, 1, 1, 2, 1); 150 | 151 | start_button.clicked.connect (() => { 152 | if (click.current_state == Metronome.Objects.click_state.running) 153 | click.stop (); 154 | else 155 | click.start.begin (); 156 | }); 157 | 158 | // LEDs 159 | led_green_right = new Gtk.Image.from_file (Constants.PKGDATADIR + "/icons/led_green.png"); 160 | content.attach (led_green_right, 3, 1, 1, 1); 161 | 162 | var led_gray_right = new Gtk.Image.from_file (Constants.PKGDATADIR + "/icons/led_gray.png"); 163 | content.attach (led_gray_right, 3, 1, 1, 1); 164 | 165 | led_red_left = new Gtk.Image.from_file (Constants.PKGDATADIR + "/icons/led_red.png"); 166 | content.attach (led_red_left, 0, 1, 1, 1); 167 | 168 | var led_gray_left = new Gtk.Image.from_file (Constants.PKGDATADIR + "/icons/led_gray.png"); 169 | content.attach (led_gray_left, 0, 1, 1, 1); 170 | 171 | mainwindow.add (root); 172 | mainwindow.show_all (); 173 | 174 | presets_sidebar.visible = false; 175 | led_green_right.visible = false; 176 | led_red_left.visible = false; 177 | 178 | mainwindow.destroy.connect (() => { 179 | click.stop (); 180 | save_settings (); 181 | Gtk.main_quit (); 182 | }); 183 | 184 | load_settings (); 185 | 186 | Gtk.main (); 187 | } 188 | 189 | private void build_titelbar () { 190 | var headerbar = new Gtk.HeaderBar (); 191 | headerbar.get_style_context ().add_class ("default-decoration"); 192 | headerbar.show_close_button = true; 193 | 194 | mainwindow.set_titlebar (headerbar); 195 | mainwindow.window_position = Gtk.WindowPosition.CENTER; 196 | 197 | var settings_buttons = new Granite.Widgets.ModeButton (); 198 | settings_buttons.margin_start = 24; 199 | settings_buttons.margin_end = 24; 200 | settings_buttons.margin_top = 4; 201 | settings_buttons.margin_bottom = 4; 202 | settings_buttons.mode_changed.connect(() => { 203 | if (settings_buttons.selected == 0) { 204 | tempo_popover.show_all (); 205 | } 206 | else if (settings_buttons.selected == 1) { 207 | beat_popover.show_all (); 208 | } 209 | }); 210 | 211 | headerbar.set_custom_title (settings_buttons); 212 | 213 | // TEMPO button 214 | var tempo_button = new Gtk.Grid (); 215 | tempo_value = new Gtk.Label ("%d".printf (settings.tempo)) { use_markup = true }; 216 | var tempo_bpm = new Gtk.Label ("" + _("BPM") + "") { use_markup = true }; 217 | 218 | tempo_button.attach (tempo_value, 0, 0, 1, 1); 219 | tempo_button.attach (tempo_bpm, 0, 1, 1, 1); 220 | 221 | // TEMPO input 222 | tempo = new Gtk.SpinButton.with_range (30, 240, 1); 223 | tempo.margin = 6; 224 | tempo.value_changed.connect (() => { 225 | set_new_tempo ((uint)tempo.value); 226 | }); 227 | 228 | tempo.key_press_event.connect ((event) => { 229 | if (event.keyval == Gdk.Key.Return || event.keyval == Gdk.Key.KP_Enter) { 230 | if (set_new_tempo ((uint)tempo.value)) { 231 | tempo_popover.hide (); 232 | } 233 | return true; 234 | } 235 | else 236 | click.stop (); 237 | return false; 238 | }); 239 | 240 | // TEMPO popover 241 | tempo_popover = new Gtk.Popover (tempo_button); 242 | tempo_popover.position = Gtk.PositionType.BOTTOM; 243 | tempo_popover.add (tempo); 244 | tempo_popover.closed.connect (() => { settings_buttons.selected = -1; }); 245 | 246 | // BEAT button 247 | var beat_button = new Gtk.Grid (); 248 | beat_value = new Gtk.Label ("%d".printf (settings.beat)) { use_markup = true }; 249 | var beat_beat = new Gtk.Label ("" + _("Beat") + "") { use_markup = true }; 250 | 251 | beat_button.attach (beat_value, 0, 0, 1, 1); 252 | beat_button.attach (beat_beat, 0, 1, 1, 1); 253 | 254 | // BEAT input 255 | beat = new Gtk.SpinButton.with_range (1, 9, 1); 256 | beat.margin = 6; 257 | beat.value_changed.connect (() => { 258 | set_new_beat ((uint)beat.value); 259 | }); 260 | 261 | beat.key_press_event.connect ((event) => { 262 | if (event.keyval == Gdk.Key.Return || event.keyval == Gdk.Key.KP_Enter) { 263 | if (set_new_beat ((uint)beat.value)) { 264 | beat_popover.hide (); 265 | } 266 | return true; 267 | } 268 | return false; 269 | }); 270 | 271 | beat_popover = new Gtk.Popover (beat_button); 272 | beat_popover.position = Gtk.PositionType.BOTTOM; 273 | beat_popover.add (beat); 274 | beat_popover.closed.connect (() => { settings_buttons.selected = -1; }); 275 | 276 | settings_buttons.append (tempo_button); 277 | settings_buttons.append (beat_button); 278 | 279 | var sidebar_toogle = new Gtk.Button (); 280 | sidebar_toogle.image = new Gtk.Image.from_icon_name ("pane-show-symbolic-rtl", Gtk.IconSize.LARGE_TOOLBAR); 281 | sidebar_toogle.tooltip_text = _("Show Presets"); 282 | sidebar_toogle.relief = Gtk.ReliefStyle.NONE; 283 | sidebar_toogle.clicked.connect (() => { 284 | if (presets_sidebar.visible) { 285 | presets_sidebar.visible = false; 286 | sidebar_toogle.image = new Gtk.Image.from_icon_name ("pane-show-symbolic-rtl", Gtk.IconSize.LARGE_TOOLBAR); 287 | sidebar_toogle.tooltip_text = _("Show Presets"); 288 | } else { 289 | presets_sidebar.visible = true; 290 | sidebar_toogle.image = new Gtk.Image.from_icon_name ("pane-hide-symbolic-rtl", Gtk.IconSize.LARGE_TOOLBAR); 291 | sidebar_toogle.tooltip_text = _("Hide Presets"); 292 | } 293 | }); 294 | 295 | headerbar.pack_end (sidebar_toogle); 296 | } 297 | 298 | private void build_volume_sliders () { 299 | volumes = new Metronome.Widgets.Volumes (); 300 | content.attach (volumes, 0, 0, 4, 1); 301 | root.pack1 (content, true, false); 302 | } 303 | 304 | private void build_presets_sidebar () { 305 | presets_sidebar = new Metronome.Widgets.Presets (); 306 | presets_sidebar.preset_selected.connect ((preset) => { 307 | bool click_runs = click.current_state == Metronome.Objects.click_state.running; 308 | click.stop (); 309 | 310 | push_preset_into_current_settings (preset); 311 | 312 | if (click_runs) 313 | click.start.begin (); 314 | }); 315 | root.pack2 (presets_sidebar, false, false); 316 | } 317 | 318 | private void do_click (Metronome.Objects.click_interval interval, bool beat) { 319 | switch(interval) { 320 | case Metronome.Objects.click_interval.semibreve: 321 | led_green_right.visible = true; 322 | 323 | if (beat) { 324 | debug ("play beat"); 325 | sound_beat.set_state (State.NULL); 326 | sound_beat.set ("volume", volumes.volume_semibreve); 327 | sound_beat.set ("uri", file_beat); 328 | sound_beat.set_state (State.PLAYING); 329 | 330 | led_red_left.visible = true; 331 | } else { 332 | if (volumes.volume_semibreve > 0) { 333 | debug ("play semibreve"); 334 | sound_semibreve.set_state (State.NULL); 335 | sound_semibreve.set ("volume", volumes.volume_semibreve); 336 | sound_semibreve.set ("uri", file_click_1); 337 | sound_semibreve.set_state (State.PLAYING); 338 | } 339 | } 340 | 341 | GLib.Timeout.add (60, () => { 342 | led_green_right.visible = false; 343 | led_red_left.visible = false; 344 | return false; 345 | }, GLib.Priority.HIGH); 346 | break; 347 | case Metronome.Objects.click_interval.minim: 348 | if (volumes.volume_minim > 0) { 349 | debug ("play minim"); 350 | sound_minim.set_state (State.NULL); 351 | sound_minim.set ("volume", volumes.volume_minim); 352 | sound_minim.set ("uri", file_click_2); 353 | sound_minim.set_state (State.PLAYING); 354 | } 355 | break; 356 | case Metronome.Objects.click_interval.crotchet: 357 | if (volumes.volume_crotchet > 0) { 358 | debug ("play crotchet"); 359 | sound_crotchet.set_state (State.NULL); 360 | sound_crotchet.set ("volume", volumes.volume_crotchet); 361 | sound_crotchet.set ("uri", file_click_4); 362 | sound_crotchet.set_state (State.PLAYING); 363 | } 364 | break; 365 | case Metronome.Objects.click_interval.quaver: 366 | if (volumes.volume_quaver > 0) { 367 | debug ("play quaver"); 368 | sound_quaver.set_state (State.NULL); 369 | sound_quaver.set ("volume", volumes.volume_quaver); 370 | sound_quaver.set ("uri", file_click_8); 371 | sound_quaver.set_state (State.PLAYING); 372 | } 373 | break; 374 | } 375 | } 376 | 377 | private bool set_new_tempo (uint new_tempo) { 378 | if (click.is_tempo_valid (new_tempo)) { 379 | if (click.current_tempo != new_tempo) { 380 | click.current_tempo = new_tempo; 381 | 382 | if (click.current_state == Metronome.Objects.click_state.running) { 383 | click.stop (); 384 | click.start.begin (); 385 | } 386 | } 387 | return true; 388 | } 389 | return false; 390 | } 391 | 392 | private bool set_new_beat (uint new_beat) { 393 | if (click.is_beat_valid (new_beat)) { 394 | if (click.current_beat != new_beat) { 395 | click.current_beat = new_beat; 396 | 397 | if (click.current_state == Metronome.Objects.click_state.running) { 398 | click.stop (); 399 | click.start.begin (); 400 | } 401 | } 402 | return true; 403 | } 404 | return false; 405 | } 406 | 407 | private void stop_sound () { 408 | sound_semibreve.set_state (State.NULL); 409 | sound_minim.set_state (State.NULL); 410 | sound_crotchet.set_state (State.NULL); 411 | sound_quaver.set_state (State.NULL); 412 | sound_beat.set_state (State.NULL); 413 | } 414 | 415 | private void load_settings () { 416 | tempo.value = settings.tempo; 417 | beat.value = settings.beat; 418 | volumes.volume_semibreve = settings.volume_semibreve; 419 | volumes.volume_minim = settings.volume_minim; 420 | volumes.volume_crotchet = settings.volume_crotchet; 421 | volumes.volume_quaver = settings.volume_quaver; 422 | presets_sidebar.set_presets (settings.custom_settings); 423 | } 424 | 425 | private void save_settings () { 426 | settings.tempo = (int) tempo.value; 427 | settings.beat = (int) beat.value; 428 | settings.volume_semibreve = volumes.volume_semibreve; 429 | settings.volume_minim = volumes.volume_minim; 430 | settings.volume_crotchet = volumes.volume_crotchet; 431 | settings.volume_quaver = volumes.volume_quaver; 432 | settings.custom_settings = presets_sidebar.get_presets (); 433 | } 434 | 435 | internal void push_preset_into_current_settings (Metronome.Objects.Preset preset) { 436 | tempo.set_value (preset.tempo); 437 | beat.set_value (preset.beat); 438 | 439 | volumes.volume_semibreve = preset.volume_semibreve; 440 | volumes.volume_minim = preset.volume_minim; 441 | volumes.volume_crotchet = preset.volume_crotchet; 442 | volumes.volume_quaver = preset.volume_quaver; 443 | } 444 | 445 | internal void push_current_settings_into_preset (Metronome.Objects.Preset preset) { 446 | preset.tempo = click.current_tempo; 447 | preset.beat = click.current_beat; 448 | preset.volume_semibreve = volumes.volume_semibreve; 449 | preset.volume_minim = volumes.volume_minim; 450 | preset.volume_crotchet = volumes.volume_crotchet; 451 | preset.volume_quaver = volumes.volume_quaver; 452 | } 453 | } 454 | } 455 | public static int main (string [] args) { 456 | Gst.init (ref args); 457 | Gtk.init (ref args); 458 | var app = Metronome.MetronomeApp.instance; 459 | return app.run (args); 460 | } 461 | -------------------------------------------------------------------------------- /src/Objects/Click.vala: -------------------------------------------------------------------------------- 1 | namespace Metronome.Objects { 2 | 3 | public enum click_state { running, stoped } 4 | public enum click_interval { semibreve, minim, crotchet, quaver } 5 | 6 | public class Click : GLib.Object { 7 | 8 | public signal void state_changed (click_state state); 9 | public signal void tempo_changed (uint tempo); 10 | public signal void beat_changed (uint beat); 11 | public signal void click (click_interval interval, bool beat); 12 | 13 | uint click_count; 14 | uint beat_count; 15 | 16 | uint timer_uint; 17 | 18 | click_state _current_state; 19 | public click_state current_state { 20 | get { return _current_state; } 21 | private set { 22 | _current_state = value; 23 | state_changed (current_state); 24 | } 25 | } 26 | 27 | uint _current_tempo; 28 | public uint current_tempo { 29 | get { return _current_tempo; } 30 | set { 31 | _current_tempo = value; 32 | tempo_changed (value); 33 | } 34 | } 35 | 36 | uint _current_beat; 37 | public uint current_beat { 38 | get { return _current_beat; } 39 | set { 40 | _current_beat = value; 41 | beat_changed (value); 42 | } 43 | } 44 | 45 | public Click () { 46 | current_state = click_state.stoped; 47 | click_count = 0; 48 | beat_count = 0; 49 | } 50 | 51 | public async void start () { 52 | if (!is_settings_valid ()) 53 | return; 54 | 55 | uint interval = 60000 / current_tempo / 8; 56 | 57 | current_state = click_state.running; 58 | 59 | do_click.begin (); 60 | 61 | timer_uint = GLib.Timeout.add (interval, () => { 62 | if (current_state == click_state.stoped) 63 | return false; 64 | 65 | do_click.begin (); 66 | return true; 67 | }, GLib.Priority.HIGH); 68 | } 69 | 70 | public void stop () { 71 | if (timer_uint > 0) { 72 | GLib.Source.remove (timer_uint); 73 | timer_uint = 0; 74 | } 75 | current_state = click_state.stoped; 76 | click_count = 0; 77 | beat_count = 0; 78 | } 79 | 80 | public async void do_click () { 81 | if (click_count == 0 ) { 82 | click (click_interval.semibreve, beat_count % current_beat == 0); 83 | beat_count ++; 84 | } 85 | else if (click_count % 4 == 0) 86 | click (click_interval.minim, false); 87 | else if (click_count % 2 == 0) 88 | click (click_interval.crotchet, false); 89 | else 90 | click (click_interval.quaver, false); 91 | 92 | if (click_count == 7) 93 | click_count = 0; 94 | else 95 | click_count ++; 96 | 97 | yield; 98 | } 99 | 100 | public void set_preset (Metronome.Objects.Preset preset) { 101 | current_tempo = preset.tempo; 102 | current_beat = preset.beat; 103 | if (current_state == click_state.running) { 104 | stop (); 105 | start.begin (); 106 | } 107 | } 108 | 109 | public bool is_settings_valid () { 110 | return is_tempo_valid (current_tempo) && is_beat_valid (current_beat); 111 | } 112 | 113 | public bool is_tempo_valid (uint new_tempo) { 114 | return (new_tempo >= 30 && new_tempo <= 240); 115 | } 116 | 117 | public bool is_beat_valid (uint new_beat) { 118 | return (new_beat >= 1 && new_beat <= 9); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/Objects/Preset.vala: -------------------------------------------------------------------------------- 1 | namespace Metronome.Objects { 2 | public class Preset { 3 | public signal void tempo_changed (uint tempo); 4 | public signal void beat_changed (uint beat); 5 | 6 | public string title { get; set; } 7 | 8 | uint _tempo; 9 | public uint tempo { 10 | get { 11 | return _tempo; 12 | } 13 | set { 14 | _tempo = value; 15 | tempo_changed (value); 16 | } 17 | } 18 | 19 | uint _beat; 20 | public uint beat { 21 | get { 22 | return _beat; 23 | } 24 | set { 25 | _beat = value; 26 | beat_changed (value); 27 | } 28 | } 29 | 30 | public double volume_semibreve { get; set; } 31 | public double volume_minim { get; set; } 32 | public double volume_crotchet { get; set; } 33 | public double volume_quaver { get; set; } 34 | 35 | public static Preset? parse (string custom_settings) { 36 | Preset? return_value = null; 37 | debug ("parse custom setting %s", custom_settings); 38 | 39 | string [] split_title = custom_settings.split (":"); 40 | 41 | if (split_title.length == 2) { 42 | 43 | string [] split_properties = split_title [1].split (";"); 44 | 45 | if (split_properties.length == 6) { 46 | return_value = new Preset (); 47 | return_value.title = split_title [0]; 48 | return_value.tempo = int.parse (split_properties [0]); 49 | return_value.beat = int.parse (split_properties [1]); 50 | return_value.volume_semibreve = double.parse (split_properties [2].replace (",", ".")); 51 | return_value.volume_minim = double.parse (split_properties [3].replace (",", ".")); 52 | return_value.volume_crotchet = double.parse (split_properties [4].replace (",", ".")); 53 | return_value.volume_quaver = double.parse (split_properties [5].replace (",", ".")); 54 | } 55 | } 56 | 57 | return return_value; 58 | } 59 | 60 | public string get_setting_string () { 61 | return "%s:%d;%d;%g;%g;%g;%g".printf (title, (int)tempo, (int)beat, volume_semibreve, volume_minim, volume_crotchet, volume_quaver); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Settings.vala: -------------------------------------------------------------------------------- 1 | public class Metronome.Settings : Granite.Services.Settings { 2 | private static Settings settings; 3 | public static Settings get_default () { 4 | if (settings == null) 5 | settings = new Settings (); 6 | 7 | return settings; 8 | } 9 | 10 | public double volume_semibreve { get; set; } 11 | public double volume_minim { get; set; } 12 | public double volume_crotchet { get; set; } 13 | public double volume_quaver { get; set; } 14 | public int tempo { get; set; } 15 | public int beat { get; set; } 16 | public string [] custom_settings { get; set; } 17 | private Settings () { 18 | base ("com.github.artemanufrij.metronome"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Widgets/PresetRow.vala: -------------------------------------------------------------------------------- 1 | namespace Metronome.Widgets { 2 | 3 | public class PresetRow : Gtk.ListBoxRow { 4 | public Metronome.Objects.Preset preset { get; set; } 5 | 6 | private Gtk.Label title_label; 7 | private Gtk.Label tempo_label; 8 | private Gtk.Label beat_label; 9 | 10 | public PresetRow (Metronome.Objects.Preset preset, Gtk.ListBox parent) { 11 | this.preset = preset; 12 | this.preset.beat_changed.connect ((new_beat) => { 13 | beat_label.label = "%d Beat".printf((int)new_beat); 14 | }); 15 | this.preset.tempo_changed.connect ((new_tempo) => { 16 | tempo_label.label = "%d BPM".printf((int)new_tempo); 17 | }); 18 | 19 | var grid = new Gtk.Grid (); 20 | grid.margin_top = 4; 21 | grid.row_spacing = 4; 22 | grid.expand = true; 23 | 24 | // TITLE 25 | title_label = new Gtk.Label (preset.title); 26 | title_label.halign = Gtk.Align.START; 27 | title_label.get_style_context ().add_class ("h3"); 28 | title_label.expand = true; 29 | // LABEL 30 | tempo_label = new Gtk.Label ("%d ".printf((int)preset.tempo) + _("BPM")); 31 | tempo_label.use_markup = true; 32 | tempo_label.halign = Gtk.Align.END; 33 | tempo_label.opacity = 0.6; 34 | tempo_label.margin_end = 12; 35 | 36 | beat_label = new Gtk.Label ("%d ".printf((int)preset.beat) + _("Beat")); 37 | beat_label.use_markup = true; 38 | beat_label.halign = Gtk.Align.END; 39 | beat_label.opacity = 0.6; 40 | beat_label.margin_end = 6; 41 | 42 | 43 | // ACTION MENU 44 | var menu = new ActionMenu (); 45 | menu.valign = Gtk.Align.START; 46 | menu.delete_clicked.connect (() => { 47 | parent.remove (this); 48 | }); 49 | menu.save_clicked.connect (() => { 50 | Metronome.MetronomeApp.instance.push_current_settings_into_preset (preset); 51 | }); 52 | grid.attach (menu, 0, 0, 1, 2); 53 | grid.attach (title_label, 1, 0, 1, 1); 54 | grid.attach (tempo_label, 1, 1, 1, 1); 55 | grid.attach (beat_label, 2, 1, 1, 1); 56 | grid.attach (new Gtk.Separator (Gtk.Orientation.HORIZONTAL), 0, 2, 3, 1); 57 | 58 | var event_box = new Gtk.EventBox (); 59 | event_box.add (grid); 60 | event_box.events |= Gdk.EventMask.ENTER_NOTIFY_MASK|Gdk.EventMask.LEAVE_NOTIFY_MASK; 61 | 62 | event_box.enter_notify_event.connect ((event) => { 63 | menu.set_reveal_child (true); 64 | return false; 65 | }); 66 | 67 | event_box.leave_notify_event.connect ((event) => { 68 | if (event.detail == Gdk.NotifyType.INFERIOR) 69 | return false; 70 | menu.set_reveal_child (false); 71 | return false; 72 | }); 73 | 74 | this.add (event_box); 75 | } 76 | } 77 | 78 | public class ActionMenu : Gtk.Revealer { 79 | 80 | public signal void delete_clicked (); 81 | public signal void save_clicked (); 82 | 83 | public ActionMenu () { 84 | var delete_button = new Gtk.Button.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.BUTTON); 85 | delete_button.tooltip_text = _("Delete Preset"); 86 | delete_button.relief = Gtk.ReliefStyle.NONE; 87 | delete_button.clicked.connect (() => { delete_clicked (); }); 88 | 89 | var save_button = new Gtk.Button.from_icon_name ("document-save-symbolic", Gtk.IconSize.BUTTON); 90 | save_button.tooltip_text = _("Save current Settings"); 91 | save_button.relief = Gtk.ReliefStyle.NONE; 92 | save_button.clicked.connect (() => { save_clicked (); }); 93 | 94 | var buttons = new Gtk.Grid (); 95 | buttons.orientation = Gtk.Orientation.VERTICAL; 96 | buttons.add (save_button); 97 | buttons.add (delete_button); 98 | buttons.opacity = 0.5; 99 | 100 | this.transition_type = Gtk.RevealerTransitionType.CROSSFADE; 101 | this.add (buttons); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/Widgets/Presets.vala: -------------------------------------------------------------------------------- 1 | namespace Metronome.Widgets { 2 | 3 | public class Presets : Gtk.Box { 4 | 5 | public signal void preset_selected (Metronome.Objects.Preset preset); 6 | 7 | Gtk.ListBox list_box; 8 | 9 | public Presets () { 10 | this.orientation = Gtk.Orientation.VERTICAL; 11 | this.width_request = 160; 12 | 13 | var list_scroll = new Gtk.ScrolledWindow (null, null); 14 | list_scroll.vexpand = true; 15 | list_scroll.get_style_context().set_junction_sides(Gtk.JunctionSides.BOTTOM); 16 | 17 | // LIST BOX 18 | list_box = new Gtk.ListBox (); 19 | list_box.expand = true; 20 | list_box.row_activated.connect ((row) => { 21 | var preset = (((Metronome.Widgets.PresetRow)row).preset); 22 | preset_selected (preset); 23 | }); 24 | 25 | list_scroll.add (list_box); 26 | 27 | var toolbar = new Gtk.Toolbar (); 28 | toolbar.expand = false; 29 | toolbar.set_style (Gtk.ToolbarStyle.ICONS); 30 | toolbar.set_icon_size (Gtk.IconSize.SMALL_TOOLBAR); 31 | toolbar.set_show_arrow (false); 32 | toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR); 33 | toolbar.get_style_context().set_junction_sides(Gtk.JunctionSides.TOP); 34 | 35 | var separator = new Gtk.SeparatorToolItem (); 36 | separator.set_draw (false); 37 | separator.set_expand (true); 38 | toolbar.insert (separator, -1); 39 | 40 | // ADD Button 41 | var add_button = new Gtk.ToolButton (null, null); 42 | add_button.icon_name = "list-add-symbolic"; 43 | add_button.tooltip_text = _("Add Preset"); 44 | toolbar.insert (add_button, -1); 45 | 46 | // ADD Popover 47 | var popover_grid = new Gtk.Grid (); 48 | popover_grid.margin = 6; 49 | 50 | var new_preset_popover = new Gtk.Popover (add_button); 51 | new_preset_popover.position = Gtk.PositionType.TOP; 52 | new_preset_popover.add (popover_grid); 53 | 54 | var new_preset_title = new Gtk.Entry (); 55 | new_preset_title.hexpand = true; 56 | new_preset_title.tooltip_text = _("Preset title"); 57 | new_preset_title.set_icon_from_icon_name (Gtk.EntryIconPosition.PRIMARY, "edit-symbolic"); 58 | new_preset_title.key_press_event.connect ((event) => { 59 | if (event.keyval == Gdk.Key.Return || event.keyval == Gdk.Key.KP_Enter) { 60 | string preset_title = new_preset_title.buffer.text; 61 | if (preset_title != "") { 62 | var new_preset = new Metronome.Objects.Preset (); 63 | new_preset.title = preset_title; 64 | Metronome.MetronomeApp.instance.push_current_settings_into_preset (new_preset); 65 | 66 | add_preset (new_preset); 67 | new_preset_popover.hide (); 68 | return true; 69 | } 70 | } 71 | return false; 72 | }); 73 | 74 | popover_grid.attach (new_preset_title, 1, 0, 1, 1); 75 | 76 | add_button.clicked.connect (() => { 77 | new_preset_title.text = ""; 78 | new_preset_popover.show_all (); 79 | new_preset_title.grab_focus (); 80 | }); 81 | 82 | this.pack_start (list_scroll, true, true); 83 | this.pack_start (toolbar, false, false); 84 | } 85 | 86 | // ADD new Preset into ListBox 87 | public void add_preset (Metronome.Objects.Preset preset) { 88 | var row = new Metronome.Widgets.PresetRow (preset, list_box); 89 | list_box.add(row); 90 | row.show_all (); 91 | row.get_style_context ().remove_class("button"); 92 | debug ("add custom setting %s", preset.title); 93 | } 94 | 95 | // LOAD Presets from SETTINGS 96 | public void set_presets (string[] presets) { 97 | foreach (string item in presets) { 98 | var preset = Metronome.Objects.Preset.parse (item); 99 | if (preset != null) 100 | this.add_preset (preset); 101 | } 102 | } 103 | 104 | // PARSE Presets for SETTINGS 105 | public string[] get_presets () { 106 | GLib.Array custom_settings = new GLib.Array (); 107 | foreach (Gtk.Widget row in list_box.get_children ()) { 108 | if (row is Metronome.Widgets.PresetRow) { 109 | debug ("save custom setting %s", (row as Metronome.Widgets.PresetRow).preset.get_setting_string ()); 110 | custom_settings.append_val((row as Metronome.Widgets.PresetRow).preset.get_setting_string ()); 111 | } 112 | } 113 | return custom_settings.data; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/Widgets/Volumes.vala: -------------------------------------------------------------------------------- 1 | namespace Metronome.Widgets { 2 | 3 | public class Volumes : Gtk.Grid { 4 | 5 | Gtk.Scale scale_semibreve; 6 | Gtk.Scale scale_minim; 7 | Gtk.Scale scale_crotchet; 8 | Gtk.Scale scale_quaver; 9 | 10 | double vol_semibreve = 0; 11 | double vol_minim = 0; 12 | double vol_crotchet = 0; 13 | double vol_quaver = 0; 14 | 15 | public Volumes () { 16 | hexpand = true; 17 | row_spacing = 6; 18 | column_spacing = 6; 19 | height_request = 180; 20 | 21 | scale_semibreve = new Gtk.Scale.with_range (Gtk.Orientation.VERTICAL, 0, 1, 0.01); 22 | scale_semibreve.expand = true; 23 | scale_semibreve.inverted = true; 24 | scale_semibreve.draw_value = false; 25 | scale_semibreve.set_value (0.5); 26 | scale_semibreve.value_changed.connect (() => { 27 | double result = ((double)((int) (scale_semibreve.get_value () * 100))) / 100; 28 | vol_semibreve = result; 29 | debug ("Volume semibreve %g", vol_semibreve); 30 | }); 31 | 32 | var icon_semibreve = new Gtk.Image.from_file (Constants.PKGDATADIR + "/icons/symbol_semibreve.png"); 33 | 34 | scale_minim = new Gtk.Scale.with_range (Gtk.Orientation.VERTICAL, 0, 1, 0.01); 35 | scale_minim.expand = true; 36 | scale_minim.inverted = true; 37 | scale_minim.draw_value = false; 38 | scale_minim.value_changed.connect (() => { 39 | double result = ((double)((int) (scale_minim.get_value () * 100))) / 100; 40 | vol_minim = result; 41 | debug ("Volume minim %g", vol_minim); 42 | }); 43 | 44 | var icon_minim = new Gtk.Image.from_file (Constants.PKGDATADIR + "/icons/symbol_minim.png"); 45 | 46 | scale_crotchet = new Gtk.Scale.with_range (Gtk.Orientation.VERTICAL, 0, 1, 0.01); 47 | scale_crotchet.expand = true; 48 | scale_crotchet.inverted = true; 49 | scale_crotchet.draw_value = false; 50 | scale_crotchet.value_changed.connect (() => { 51 | double result = ((double)((int) (scale_crotchet.get_value () * 100))) / 100; 52 | vol_crotchet = result; 53 | debug ("Volume crotchet %g", vol_crotchet); 54 | }); 55 | 56 | var icon_crotchet = new Gtk.Image.from_file (Constants.PKGDATADIR + "/icons/symbol_crotchet.png"); 57 | 58 | scale_quaver = new Gtk.Scale.with_range (Gtk.Orientation.VERTICAL, 0, 1, 0.01); 59 | scale_quaver.expand = true; 60 | scale_quaver.inverted = true; 61 | scale_quaver.draw_value = false; 62 | scale_quaver.value_changed.connect (() => { 63 | double result = ((double)((int) (scale_quaver.get_value () * 100))) / 100; 64 | vol_quaver = result; 65 | debug ("Volume quaver %g", vol_quaver); 66 | }); 67 | 68 | var icon_quaver = new Gtk.Image.from_file (Constants.PKGDATADIR + "/icons/symbol-quaver.png"); 69 | 70 | attach (scale_semibreve, 0, 0, 1, 1); 71 | attach (icon_semibreve, 0, 1, 1, 1); 72 | attach (scale_minim, 1, 0, 1, 1); 73 | attach (icon_minim, 1, 1, 1, 1); 74 | attach (scale_crotchet, 2, 0, 1, 1); 75 | attach (icon_crotchet, 2, 1, 1, 1); 76 | attach (scale_quaver, 3, 0, 1, 1); 77 | attach (icon_quaver, 3, 1, 1, 1); 78 | } 79 | 80 | public double volume_semibreve { 81 | get { return vol_semibreve; } 82 | set { scale_semibreve.set_value (value); } 83 | } 84 | 85 | public double volume_minim { 86 | get { return vol_minim; } 87 | set { scale_minim.set_value (value); } 88 | } 89 | 90 | public double volume_crotchet { 91 | get { return vol_crotchet; } 92 | set { scale_crotchet.set_value (value); } 93 | } 94 | 95 | public double volume_quaver { 96 | get { return vol_quaver; } 97 | set { scale_quaver.set_value (value); } 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | conf_data = configuration_data() 2 | conf_data.set_quoted('PKGDATADIR', join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())) 3 | config_header = configure_file( 4 | input: 'Config.vala.in', 5 | output: 'Config.vala', 6 | configuration: conf_data 7 | ) 8 | 9 | sources = files( 10 | 'Objects/Click.vala', 11 | 'Objects/Preset.vala', 12 | 'Widgets/Presets.vala', 13 | 'Widgets/PresetRow.vala', 14 | 'Widgets/Volumes.vala', 15 | 'Settings.vala', 16 | 'Metronome.vala', 17 | ) 18 | --------------------------------------------------------------------------------