Mercurial > libervia-desktop-kivy
comparison libervia/desktop_kivy/plugins/plugin_transfer_voice.kv @ 493:b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 02 Jun 2023 18:26:16 +0200 |
parents | cagou/plugins/plugin_transfer_voice.kv@203755bbe0fe |
children |
comparison
equal
deleted
inserted
replaced
492:5114bbb5daa3 | 493:b3cedbee561d |
---|---|
1 #Libervia Desktop-Kivy | |
2 # Copyright (C) 2016-2021 Jérôme Poisson (goffi@goffi.org) | |
3 | |
4 # This program is free software: you can redistribute it and/or modify | |
5 # it under the terms of the GNU Affero 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 Affero General Public License for more details. | |
13 | |
14 # You should have received a copy of the GNU Affero General Public License | |
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | |
17 #:import _ libervia.backend.core.i18n._ | |
18 #:import IconButton libervia.desktop_kivy.core.common.IconButton | |
19 | |
20 | |
21 <VoiceRecorder>: | |
22 orientation: "vertical" | |
23 counter: counter | |
24 Label: | |
25 size_hint: 1, 0.4 | |
26 text_size: self.size | |
27 halign: 'center' | |
28 valign: 'top' | |
29 text: _(u"Push the microphone button to start the record, then push it again to stop it.\nWhen you are satisfied, click on the transmit button") | |
30 Label: | |
31 id: counter | |
32 size_hint: 1, None | |
33 height: dp(60) | |
34 bold: True | |
35 font_size: sp(40) | |
36 text_size: self.size | |
37 text: u"{}:{:02}".format(root.time//60, root.time%60) | |
38 halign: 'center' | |
39 valign: 'middle' | |
40 BoxLayout: | |
41 size_hint: 1, None | |
42 height: dp(60) | |
43 spacing: dp(5) | |
44 Widget | |
45 IconButton: | |
46 source: app.expand("{media}/icons/muchoslava/png/") + ("micro_on_50.png" if root.recording else "micro_off_50.png") | |
47 allow_stretch: True | |
48 size_hint: None, None | |
49 size: dp(60), dp(60) | |
50 on_release: root.switch_recording() | |
51 IconButton: | |
52 opacity: 0 if root.recording or not root.time and not root.playing else 1 | |
53 source: app.expand("{media}/icons/muchoslava/png/") + ("stop_50.png" if root.playing else "play_50.png") | |
54 allow_stretch: True | |
55 size_hint: None, None | |
56 size: dp(60), dp(60) | |
57 on_release: root.play_record() | |
58 Widget | |
59 Widget: | |
60 size_hint: 1, None | |
61 height: dp(50) | |
62 Button: | |
63 text: _("transmit") | |
64 size_hint: 1, None | |
65 height: dp(50) | |
66 on_release: root.callback(root.audio.file_path) | |
67 Button: | |
68 text: _("cancel") | |
69 size_hint: 1, None | |
70 height: dp(50) | |
71 on_release: root.cancel_cb(root) | |
72 Widget |