New upstream version 1.3
Dennis Braun
3 years ago
23 | 23 | - libtool |
24 | 24 | - autopoint |
25 | 25 | - gettext |
26 | - zlib1g-dev | |
26 | 27 | |
27 | You can easily install them by running `sudo apt install automake libasound2-dev libgtk-3-dev libpulse-dev libsndfile1-dev libsamplerate0-dev libtool autopoint gettext`. | |
28 | You can easily install them by running `sudo apt install automake libasound2-dev libgtk-3-dev libpulse-dev libsndfile1-dev libsamplerate0-dev libtool autopoint gettext zlib1g-dev`. | |
28 | 29 | |
29 | 30 | ## CLI |
30 | 31 |
1 | 1 | # Process this file with autoconf to produce a configure script. |
2 | 2 | |
3 | 3 | AC_PREREQ([2.69]) |
4 | AC_INIT([elektroid],[1.2],[dagargo@gmail.com]) | |
4 | AC_INIT([elektroid],[1.3],[dagargo@gmail.com]) | |
5 | 5 | AC_CONFIG_SRCDIR([src]) |
6 | 6 | AC_CONFIG_HEADERS([config.h]) |
7 | 7 | AM_PROG_LIBTOOL |
34 | 34 | AM_GNU_GETTEXT_VERSION([0.19.8]) |
35 | 35 | |
36 | 36 | # Checks for header files. |
37 | AC_CHECK_HEADERS([unistd.h limits.h]) | |
37 | AC_CHECK_HEADERS([unistd.h limits.h zlib.h]) | |
38 | 38 | |
39 | 39 | # Checks for typedefs, structures, and compiler characteristics. |
40 | 40 |
0 | elektroid (0.1-0) unstable; urgency=medium | |
0 | elektroid (1.2-1) unstable; urgency=medium | |
1 | 1 | |
2 | * Initial upstream release. | |
2 | * New upstream version 1.2 | |
3 | * Fix cross building | |
4 | * Bump dh-compat to 13 | |
5 | * Drop patches, applied by upstream | |
6 | * Drop obsolete --as-needed build-flag | |
7 | * d/upstream/metadata: Add archive and remove obsolete name field | |
3 | 8 | |
4 | -- DNS <debian@88it.de> Mon, 14 Oct 2019 21:33:00 +0100 | |
9 | -- Dennis Braun <d_braun@kabelmail.de> Mon, 25 May 2020 17:09:24 +0200 | |
10 | ||
11 | elektroid (1.1-1) unstable; urgency=medium | |
12 | ||
13 | * Initial release (Closes: #953332) | |
14 | ||
15 | -- Dennis Braun <d_braun@kabelmail.de> Wed, 08 Apr 2020 21:46:46 +0200 |
0 | 0 | Source: elektroid |
1 | 1 | Section: sound |
2 | 2 | Priority: optional |
3 | Maintainer: DNS <debian@88it.de> | |
4 | Standards-Version: 4.1.2 | |
5 | Build-Depends: autotools-dev, | |
6 | debhelper (>= 11), | |
7 | dh-autoreconf, | |
8 | dpkg-dev (>= 1.16.1~), | |
3 | Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org> | |
4 | Uploaders: Dennis Braun <d_braun@kabelmail.de> | |
5 | Build-Depends: debhelper-compat (= 13), | |
9 | 6 | libasound2-dev (>= 1.1.8), |
10 | 7 | libgtk-3-dev, |
11 | 8 | libpulse-dev, |
12 | 9 | libsndfile1-dev (>= 1.0.2), |
13 | 10 | libsamplerate0-dev (>= 0.1.9), |
14 | libtool, | |
11 | zlib1g-dev, | |
15 | 12 | pkg-config |
16 | 13 | Homepage: https://github.com/dagargo/elektroid |
17 | Vcs-Browser: https://github.com/dagargo/elektroid | |
18 | Vcs-Git: https://github.com/dagargo/elektroid.git | |
14 | Vcs-Browser: https://salsa.debian.org/multimedia-team/elektroid | |
15 | Vcs-Git: https://salsa.debian.org/multimedia-team/elektroid.git | |
16 | Standards-Version: 4.5.0 | |
17 | Rules-Requires-Root: no | |
19 | 18 | |
20 | 19 | Package: elektroid |
21 | 20 | Architecture: any |
22 | 21 | Depends: ${misc:Depends}, |
23 | 22 | ${shlibs:Depends} |
24 | Description: Elektroid | |
25 | Elektroid is a GNU/Linux sample transfer GTK3 application for Elektron devices. | |
23 | Description: Sample transfer application | |
24 | Elektroid is an sample transfer application for Elektron devices. | |
25 | . | |
26 | With elektroid you can easily load audio files like flac or wav into your | |
27 | elektron sampler. You can also transfer audio samples from your elektroid | |
28 | device to your local hard disk. | |
29 | . | |
30 | It has been reported to work with Model:Samples, Digitakt | |
31 | and Analog Rytm mk1 and mk2. | |
32 | . | |
33 | This package provides both the GUI and CLI application of elektroid. |
0 | Elektroid is free software: you can redistribute it and/or modify | |
1 | it under the terms of the GNU General Public License as published by | |
2 | the Free Software Foundation, either version 3 of the License, or | |
3 | (at your option) any later version. | |
0 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | |
1 | Upstream-Name: elektroid | |
2 | Upstream-Contact: https://github.com/dagargo/elektroid | |
3 | Source: https://github.com/dagargo/elektroid/releases | |
4 | Comment: | |
5 | This package was debianized by Dennis Braun <d_braun@kabelmail.de> on | |
6 | Sun, 08 Mar 2020 01:05:20 +0100. | |
4 | 7 | |
5 | Copyright (C) 2019 David García Goñi | |
8 | Files: * | |
9 | Copyright: | |
10 | 2019-2020 David García Goñi <dagargo@gmail.com> | |
11 | 2019 Olivier Humbert <trebmuh@tuxfamily.org> | |
12 | 2020 Dennis Braun <d_braun@kabelmail.de> | |
13 | License: GPL-3+ | |
6 | 14 | |
7 | Elektroid is distributed in the hope that it will be useful, | |
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
10 | GNU General Public License for more details. | |
15 | Files: debian/* | |
16 | Copyright: 2020 Dennis Braun <d_braun@kabelmail.de> | |
17 | License: GPL-3+ | |
11 | 18 | |
12 | You should have received a copy of the GNU General Public License | |
13 | along with Elektroid. If not, see <http://www.gnu.org/licenses/>. | |
19 | Files: res/elektroid.svg | |
20 | Copyright: 2020 David García Goñi <dagargo@gmail.com> | |
21 | License: CC-BY-SA-4.0 | |
22 | ||
23 | License: GPL-3+ | |
24 | This program is free software: you can redistribute it and/or modify | |
25 | it under the terms of the GNU General Public License as published by | |
26 | the Free Software Foundation, either version 3 of the License, or | |
27 | (at your option) any later version. | |
28 | . | |
29 | This package is distributed in the hope that it will be useful, | |
30 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
31 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
32 | GNU General Public License for more details. | |
33 | Comment: | |
34 | On Debian systems, the complete text of the GNU General Public | |
35 | License version 3 can be found in `/usr/share/common-licenses/GPL-3'. | |
36 | . | |
37 | You should have received a copy of the GNU General Public License | |
38 | along with this program. If not, see <https://www.gnu.org/licenses/>. | |
39 | ||
40 | License: CC-BY-SA-4.0 | |
41 | Creative Commons Attribution-ShareAlike 4.0 International Public License | |
42 | . | |
43 | By exercising the Licensed Rights (defined below), You accept and agree | |
44 | to be bound by the terms and conditions of this Creative Commons | |
45 | Attribution-ShareAlike 4.0 International Public License ("Public | |
46 | License"). To the extent this Public License may be interpreted as a | |
47 | contract, You are granted the Licensed Rights in consideration of Your | |
48 | acceptance of these terms and conditions, and the Licensor grants You | |
49 | such rights in consideration of benefits the Licensor receives from | |
50 | making the Licensed Material available under these terms and | |
51 | conditions. | |
52 | . | |
53 | Section 1 -- Definitions. | |
54 | a. Adapted Material means material subject to Copyright and Similar | |
55 | Rights that is derived from or based upon the Licensed Material | |
56 | and in which the Licensed Material is translated, altered, | |
57 | arranged, transformed, or otherwise modified in a manner requiring | |
58 | permission under the Copyright and Similar Rights held by the | |
59 | Licensor. For purposes of this Public License, where the Licensed | |
60 | Material is a musical work, performance, or sound recording, | |
61 | Adapted Material is always produced where the Licensed Material is | |
62 | synched in timed relation with a moving image. | |
63 | b. Adapter's License means the license You apply to Your Copyright | |
64 | and Similar Rights in Your contributions to Adapted Material in | |
65 | accordance with the terms and conditions of this Public License. | |
66 | c. BY-SA Compatible License means a license listed at | |
67 | creativecommons.org/compatiblelicenses, approved by Creative | |
68 | Commons as essentially the equivalent of this Public License. | |
69 | d. Copyright and Similar Rights means copyright and/or similar rights | |
70 | closely related to copyright including, without limitation, | |
71 | performance, broadcast, sound recording, and Sui Generis Database | |
72 | Rights, without regard to how the rights are labeled or | |
73 | categorized. For purposes of this Public License, the rights | |
74 | specified in Section 2(b)(1)-(2) are not Copyright and Similar | |
75 | Rights. | |
76 | e. Effective Technological Measures means those measures that, in the | |
77 | absence of proper authority, may not be circumvented under laws | |
78 | fulfilling obligations under Article 11 of the WIPO Copyright | |
79 | Treaty adopted on December 20, 1996, and/or similar international | |
80 | agreements. | |
81 | f. Exceptions and Limitations means fair use, fair dealing, and/or | |
82 | any other exception or limitation to Copyright and Similar Rights | |
83 | that applies to Your use of the Licensed Material. | |
84 | g. License Elements means the license attributes listed in the name | |
85 | of a Creative Commons Public License. The License Elements of this | |
86 | Public License are Attribution and ShareAlike. | |
87 | h. Licensed Material means the artistic or literary work, database, | |
88 | or other material to which the Licensor applied this Public | |
89 | License. | |
90 | i. Licensed Rights means the rights granted to You subject to the | |
91 | terms and conditions of this Public License, which are limited to | |
92 | all Copyright and Similar Rights that apply to Your use of the | |
93 | Licensed Material and that the Licensor has authority to license. | |
94 | j. Licensor means the individual(s) or entity(ies) granting rights | |
95 | under this Public License. | |
96 | k. Share means to provide material to the public by any means or | |
97 | process that requires permission under the Licensed Rights, such | |
98 | as reproduction, public display, public performance, distribution, | |
99 | dissemination, communication, or importation, and to make material | |
100 | available to the public including in ways that members of the | |
101 | public may access the material from a place and at a time | |
102 | individually chosen by them. | |
103 | l. Sui Generis Database Rights means rights other than copyright | |
104 | resulting from Directive 96/9/EC of the European Parliament and of | |
105 | the Council of 11 March 1996 on the legal protection of databases, | |
106 | as amended and/or succeeded, as well as other essentially | |
107 | equivalent rights anywhere in the world. | |
108 | m. You means the individual or entity exercising the Licensed Rights | |
109 | under this Public License. Your has a corresponding meaning. | |
110 | . | |
111 | Section 2 -- Scope. | |
112 | a. License grant. | |
113 | 1. Subject to the terms and conditions of this Public License, | |
114 | the Licensor hereby grants You a worldwide, royalty-free, | |
115 | non-sublicensable, non-exclusive, irrevocable license to | |
116 | exercise the Licensed Rights in the Licensed Material to: | |
117 | a. reproduce and Share the Licensed Material, in whole or | |
118 | in part; and | |
119 | b. produce, reproduce, and Share Adapted Material. | |
120 | 2. Exceptions and Limitations. For the avoidance of doubt, where | |
121 | Exceptions and Limitations apply to Your use, this Public | |
122 | License does not apply, and You do not need to comply with | |
123 | its terms and conditions. | |
124 | 3. Term. The term of this Public License is specified in Section | |
125 | 6(a). | |
126 | 4. Media and formats; technical modifications allowed. The | |
127 | Licensor authorizes You to exercise the Licensed Rights in | |
128 | all media and formats whether now known or hereafter created, | |
129 | and to make technical modifications necessary to do so. The | |
130 | Licensor waives and/or agrees not to assert any right or | |
131 | authority to forbid You from making technical modifications | |
132 | necessary to exercise the Licensed Rights, including | |
133 | technical modifications necessary to circumvent Effective | |
134 | Technological Measures. For purposes of this Public License, | |
135 | simply making modifications authorized by this Section 2(a) | |
136 | (4) never produces Adapted Material. | |
137 | 5. Downstream recipients. | |
138 | a. Offer from the Licensor -- Licensed Material. Every | |
139 | recipient of the Licensed Material automatically | |
140 | receives an offer from the Licensor to exercise the | |
141 | Licensed Rights under the terms and conditions of this | |
142 | Public License. | |
143 | b. Additional offer from the Licensor -- Adapted Material. | |
144 | Every recipient of Adapted Material from You | |
145 | automatically receives an offer from the Licensor to | |
146 | exercise the Licensed Rights in the Adapted Material | |
147 | under the conditions of the Adapter's License You apply. | |
148 | c. No downstream restrictions. You may not offer or impose | |
149 | any additional or different terms or conditions on, or | |
150 | apply any Effective Technological Measures to, the | |
151 | Licensed Material if doing so restricts exercise of the | |
152 | Licensed Rights by any recipient of the Licensed | |
153 | Material. | |
154 | 6. No endorsement. Nothing in this Public License constitutes or | |
155 | may be construed as permission to assert or imply that You | |
156 | are, or that Your use of the Licensed Material is, connected | |
157 | with, or sponsored, endorsed, or granted official status by, | |
158 | the Licensor or others designated to receive attribution as | |
159 | provided in Section 3(a)(1)(A)(i). | |
160 | b. Other rights. | |
161 | 1. Moral rights, such as the right of integrity, are not | |
162 | licensed under this Public License, nor are publicity, | |
163 | privacy, and/or other similar personality rights; however, to | |
164 | the extent possible, the Licensor waives and/or agrees not to | |
165 | assert any such rights held by the Licensor to the limited | |
166 | extent necessary to allow You to exercise the Licensed | |
167 | Rights, but not otherwise. | |
168 | 2. Patent and trademark rights are not licensed under this | |
169 | Public License. | |
170 | 3. To the extent possible, the Licensor waives any right to | |
171 | collect royalties from You for the exercise of the Licensed | |
172 | Rights, whether directly or through a collecting society | |
173 | under any voluntary or waivable statutory or compulsory | |
174 | licensing scheme. In all other cases the Licensor expressly | |
175 | reserves any right to collect such royalties. | |
176 | . | |
177 | Section 3 -- License Conditions. | |
178 | Your exercise of the Licensed Rights is expressly made subject to the | |
179 | following conditions. | |
180 | a. Attribution. | |
181 | 1. If You Share the Licensed Material (including in modified | |
182 | form), You must: | |
183 | a. retain the following if it is supplied by the Licensor | |
184 | with the Licensed Material: | |
185 | i. identification of the creator(s) of the Licensed | |
186 | Material and any others designated to receive | |
187 | attribution, in any reasonable manner requested by | |
188 | the Licensor (including by pseudonym if | |
189 | designated); | |
190 | ii. a copyright notice; | |
191 | iii. a notice that refers to this Public License; | |
192 | iv. a notice that refers to the disclaimer of | |
193 | warranties; | |
194 | v. a URI or hyperlink to the Licensed Material to the | |
195 | extent reasonably practicable; | |
196 | b. indicate if You modified the Licensed Material and | |
197 | retain an indication of any previous modifications; and | |
198 | c. indicate the Licensed Material is licensed under this | |
199 | Public License, and include the text of, or the URI or | |
200 | hyperlink to, this Public License. | |
201 | 2. You may satisfy the conditions in Section 3(a)(1) in any | |
202 | reasonable manner based on the medium, means, and context in | |
203 | which You Share the Licensed Material. For example, it may be | |
204 | reasonable to satisfy the conditions by providing a URI or | |
205 | hyperlink to a resource that includes the required | |
206 | information. | |
207 | 3. If requested by the Licensor, You must remove any of the | |
208 | information required by Section 3(a)(1)(A) to the extent | |
209 | reasonably practicable. | |
210 | b. ShareAlike. | |
211 | In addition to the conditions in Section 3(a), if You Share | |
212 | Adapted Material You produce, the following conditions also apply. | |
213 | 1. The Adapter's License You apply must be a Creative Commons | |
214 | license with the same License Elements, this version or | |
215 | later, or a BY-SA Compatible License. | |
216 | 2. You must include the text of, or the URI or hyperlink to, the | |
217 | Adapter's License You apply. You may satisfy this condition | |
218 | in any reasonable manner based on the medium, means, and | |
219 | context in which You Share Adapted Material. | |
220 | 3. You may not offer or impose any additional or different terms | |
221 | or conditions on, or apply any Effective Technological | |
222 | Measures to, Adapted Material that restrict exercise of the | |
223 | rights granted under the Adapter's License You apply. | |
224 | . | |
225 | Section 4 -- Sui Generis Database Rights. | |
226 | Where the Licensed Rights include Sui Generis Database Rights that | |
227 | apply to Your use of the Licensed Material: | |
228 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right | |
229 | to extract, reuse, reproduce, and Share all or a substantial | |
230 | portion of the contents of the database; | |
231 | b. if You include all or a substantial portion of the database | |
232 | contents in a database in which You have Sui Generis Database | |
233 | Rights, then the database in which You have Sui Generis Database | |
234 | Rights (but not its individual contents) is Adapted Material, | |
235 | including for purposes of Section 3(b); and | |
236 | c. You must comply with the conditions in Section 3(a) if You Share | |
237 | all or a substantial portion of the contents of the database. | |
238 | For the avoidance of doubt, this Section 4 supplements and does not | |
239 | replace Your obligations under this Public License where the Licensed | |
240 | Rights include other Copyright and Similar Rights. | |
241 | . | |
242 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. | |
243 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE | |
244 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS | |
245 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF | |
246 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, | |
247 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, | |
248 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR | |
249 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, | |
250 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT | |
251 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT | |
252 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. | |
253 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE | |
254 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, | |
255 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, | |
256 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, | |
257 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR | |
258 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN | |
259 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR | |
260 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR | |
261 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. | |
262 | c. The disclaimer of warranties and limitation of liability provided | |
263 | above shall be interpreted in a manner that, to the extent | |
264 | possible, most closely approximates an absolute disclaimer and | |
265 | waiver of all liability. | |
266 | . | |
267 | Section 6 -- Term and Termination. | |
268 | a. This Public License applies for the term of the Copyright and | |
269 | Similar Rights licensed here. However, if You fail to comply with | |
270 | this Public License, then Your rights under this Public License | |
271 | terminate automatically. | |
272 | b. Where Your right to use the Licensed Material has terminated under | |
273 | Section 6(a), it reinstates: | |
274 | 1. automatically as of the date the violation is cured, provided | |
275 | it is cured within 30 days of Your discovery of the | |
276 | violation; or | |
277 | 2. upon express reinstatement by the Licensor. | |
278 | For the avoidance of doubt, this Section 6(b) does not affect any | |
279 | right the Licensor may have to seek remedies for Your violations | |
280 | of this Public License. | |
281 | c. For the avoidance of doubt, the Licensor may also offer the | |
282 | Licensed Material under separate terms or conditions or stop | |
283 | distributing the Licensed Material at any time; however, doing so | |
284 | will not terminate this Public License. | |
285 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public | |
286 | License. | |
287 | . | |
288 | Section 7 -- Other Terms and Conditions. | |
289 | a. The Licensor shall not be bound by any additional or different | |
290 | terms or conditions communicated by You unless expressly agreed. | |
291 | b. Any arrangements, understandings, or agreements regarding the | |
292 | Licensed Material not stated herein are separate from and | |
293 | independent of the terms and conditions of this Public License. | |
294 | . | |
295 | Section 8 -- Interpretation. | |
296 | a. For the avoidance of doubt, this Public License does not, and | |
297 | shall not be interpreted to, reduce, limit, restrict, or impose | |
298 | conditions on any use of the Licensed Material that could lawfully | |
299 | be made without permission under this Public License. | |
300 | b. To the extent possible, if any provision of this Public License is | |
301 | deemed unenforceable, it shall be automatically reformed to the | |
302 | minimum extent necessary to make it enforceable. If the provision | |
303 | cannot be reformed, it shall be severed from this Public License | |
304 | without affecting the enforceability of the remaining terms and | |
305 | conditions. | |
306 | c. No term or condition of this Public License will be waived and no | |
307 | failure to comply consented to unless expressly agreed to by the | |
308 | Licensor. | |
309 | d. Nothing in this Public License constitutes or may be interpreted | |
310 | as a limitation upon, or waiver of, any privileges and immunities | |
311 | that apply to the Licensor or You, including from the legal | |
312 | processes of any jurisdiction or authority. |
0 | --- a/res/elektroid.desktop | |
1 | +++ b/res/elektroid.desktop | |
2 | @@ -4,5 +4,5 @@ | |
3 | Name=Elektroid | |
4 | Comment=Sample transfer application for Elektron devices | |
5 | Exec=elektroid | |
6 | -Icon=elektroid | |
7 | +Icon=/usr/share/icons/hicolor/scalable/apps/elektroid.svg | |
8 | Terminal=false |
0 | 0 | #!/usr/bin/make -f |
1 | 1 | |
2 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all | |
3 | ||
4 | include /usr/share/dpkg/architecture.mk | |
5 | ||
6 | # Fix cross building | |
7 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | |
8 | export ac_cv_func_malloc_0_nonnull=yes | |
9 | endif | |
10 | ||
2 | 11 | %: |
3 | dh $@ --parallel --with autoreconf | |
12 | dh $@ --with autoreconf | |
4 | 13 | |
5 | override_dh_auto_install: | |
6 | dh_auto_install | |
14 | override_dh_auto_test: | |
15 | # Don't enable tests, if no elektron device is connected | |
16 | @echo "Tests disabled" |
0 | Archive: github | |
1 | Bug-Database: https://github.com/dagargo/elektroid/issues | |
2 | Bug-Submit: https://github.com/dagargo/elektroid/issues/new | |
3 | Repository: https://github.com/dagargo/elektroid.git | |
4 | Repository-Browse: https://github.com/dagargo/elektroid |
0 | version=4 | |
1 | opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/elektroid-$1\.tar\.gz/ \ | |
2 | https://github.com/dagargo/elektroid/releases .*/v?(\d[\d\.]+)\.tar\.gz |
3 | 3 | .SH SYNOPSIS |
4 | 4 | .B elektroid-cli |
5 | 5 | .RI [ options ] |
6 | .RI command | |
6 | 7 | .SH DESCRIPTION |
7 | 8 | .B elektroid-cli |
8 | 9 | provides the same funcionality than elektroid. See man elektroid for the GUI application. |
9 | 10 | .PP |
10 | 11 | Provided paths must always be prepended with the device id and a colon (':'), e.g. 0:/samples. |
11 | .SH OPTIONS | |
12 | .SH COMMANDS | |
12 | 13 | .TP |
13 | 14 | .B ld |
14 | 15 | List compatible devices |
36 | 37 | .TP |
37 | 38 | .B rm [device number]:[path to sample] |
38 | 39 | Delete a sample |
40 | .SH OPTIONS | |
41 | .TP | |
42 | \fB\-v\fR | |
43 | Show verbose output. Use it more than once for more verbosity. | |
39 | 44 | .PP |
40 | 45 | .SH "SEE ALSO" |
41 | 46 | The GitHub page provides some examples: <https://github.com/dagargo/elektroid> |
16 | 16 | Open the provided local directory |
17 | 17 | .TP |
18 | 18 | \fB\-v\fR |
19 | Show verbose output. Use it twice for more verbosity. | |
19 | Show verbose output. Use it more than once for more verbosity. | |
20 | 20 | .PP |
21 | 21 | .SH "AUTHOR" |
22 | 22 | elektroid was written by David García Goñi <dagargo@gmail.com>. |
0 | # Catalan translations for Elektroid package. | |
1 | # Copyright (C) 2019 David García Goñi | |
2 | # This file is distributed under the same license as the Elektroid package. | |
3 | # David García Goñi <dagargo@gmail.com>, 2020. | |
4 | # | |
5 | msgid "" | |
6 | msgstr "" | |
7 | "Project-Id-Version: elektroid 1.3\n" | |
8 | "Report-Msgid-Bugs-To: dagargo@gmail.com\n" | |
9 | "POT-Creation-Date: 2021-01-05 17:33+0100\n" | |
10 | "PO-Revision-Date: 2020-04-26 13:00+0100\n" | |
11 | "Last-Translator: David García Goñi <dagargo@gmail.com>\n" | |
12 | "Language-Team: Catalan\n" | |
13 | "Language: ca\n" | |
14 | "MIME-Version: 1.0\n" | |
15 | "Content-Type: text/plain; charset=UTF-8\n" | |
16 | "Content-Transfer-Encoding: 8bit\n" | |
17 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" | |
18 | ||
19 | #: src/elektroid.c:177 | |
20 | #, c-format | |
21 | msgid "Connected to %s" | |
22 | msgstr "Connectat a %s" | |
23 | ||
24 | #: src/elektroid.c:184 src/elektroid.c:2576 | |
25 | msgid "Not connected" | |
26 | msgstr "No connectat" | |
27 | ||
28 | #: src/elektroid.c:327 | |
29 | msgid "Waiting..." | |
30 | msgstr "Esperant..." | |
31 | ||
32 | #: src/elektroid.c:330 | |
33 | msgid "Sending..." | |
34 | msgstr "Enviant..." | |
35 | ||
36 | #: src/elektroid.c:334 | |
37 | msgid "Receiving..." | |
38 | msgstr "Rebent..." | |
39 | ||
40 | #: src/elektroid.c:402 | |
41 | msgid "Receive SysEx" | |
42 | msgstr "Rep SysEx" | |
43 | ||
44 | #: src/elektroid.c:424 | |
45 | msgid "Save SysEx" | |
46 | msgstr "Alça SysEx" | |
47 | ||
48 | #: src/elektroid.c:427 src/elektroid.c:532 src/elektroid.c:721 | |
49 | msgid "_Cancel" | |
50 | msgstr "_Cancel·la" | |
51 | ||
52 | #: src/elektroid.c:429 | |
53 | msgid "_Save" | |
54 | msgstr "_Alça" | |
55 | ||
56 | #: src/elektroid.c:433 | |
57 | msgid "Received SysEx" | |
58 | msgstr "SysEx rebut" | |
59 | ||
60 | #: src/elektroid.c:438 src/elektroid.c:538 | |
61 | msgid "SysEx Files" | |
62 | msgstr "Fitxers SysEx" | |
63 | ||
64 | #: src/elektroid.c:529 | |
65 | msgid "Open SysEx" | |
66 | msgstr "Obri SysEx" | |
67 | ||
68 | #: src/elektroid.c:534 | |
69 | msgid "_Open" | |
70 | msgstr "_Obri" | |
71 | ||
72 | #: src/elektroid.c:561 | |
73 | msgid "Send SysEx" | |
74 | msgstr "Envia SysEx" | |
75 | ||
76 | #: src/elektroid.c:686 | |
77 | #, c-format | |
78 | msgid "Error while deleting “%s”: %s." | |
79 | msgstr "Error al eliminar «%s»: %s." | |
80 | ||
81 | #: src/elektroid.c:720 | |
82 | msgid "Are you sure you want to delete the selected items?" | |
83 | msgstr "Està segur de que vol eliminar els elements seleccionats?" | |
84 | ||
85 | #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539 | |
86 | msgid "_Delete" | |
87 | msgstr "_Elimina" | |
88 | ||
89 | #: src/elektroid.c:777 | |
90 | msgid "Rename" | |
91 | msgstr "Reanomena" | |
92 | ||
93 | #: src/elektroid.c:802 | |
94 | #, c-format | |
95 | msgid "Error while renaming to “%s”: %s." | |
96 | msgstr "Error al reanomenar a «%s»: %s." | |
97 | ||
98 | #: src/elektroid.c:1389 res/gui.glade:441 res/gui.glade:680 | |
99 | msgid "Add Directory" | |
100 | msgstr "Afig directori" | |
101 | ||
102 | #: src/elektroid.c:1414 | |
103 | #, c-format | |
104 | msgid "Error while creating dir “%s”: %s." | |
105 | msgstr "Error al crear el directori «%s»: %s." | |
106 | ||
107 | #: src/elektroid.c:1576 | |
108 | msgid "Queued" | |
109 | msgstr "A la cua" | |
110 | ||
111 | #: src/elektroid.c:1578 | |
112 | msgid "Running" | |
113 | msgstr "Executant" | |
114 | ||
115 | #: src/elektroid.c:1580 | |
116 | msgid "Completed" | |
117 | msgstr "Completada" | |
118 | ||
119 | #: src/elektroid.c:1582 | |
120 | msgid "Completed with errors" | |
121 | msgstr "Completada amb errors" | |
122 | ||
123 | #: src/elektroid.c:1584 | |
124 | msgid "Canceled" | |
125 | msgstr "Cancel·lada" | |
126 | ||
127 | #: src/elektroid.c:1586 src/elektroid.c:1600 | |
128 | msgid "Undefined" | |
129 | msgstr "Indefinit" | |
130 | ||
131 | #: src/elektroid.c:1596 | |
132 | msgid "Upload" | |
133 | msgstr "Càrrega" | |
134 | ||
135 | #: src/elektroid.c:1598 | |
136 | msgid "Download" | |
137 | msgstr "Descàrrega" | |
138 | ||
139 | #: res/gui.glade:86 | |
140 | msgid "GNU/Linux sample transfer application for Elektron devices" | |
141 | msgstr "" | |
142 | "Aplicació GNU/Linux de transferència de mostres per a dispositius Elektron" | |
143 | ||
144 | #: res/gui.glade:89 | |
145 | msgid "translator-credits" | |
146 | msgstr "David García Goñi <dagargo@gmail.com>" | |
147 | ||
148 | #: res/gui.glade:141 | |
149 | msgid "_Play" | |
150 | msgstr "_Reproduïx" | |
151 | ||
152 | #: res/gui.glade:165 | |
153 | msgid "_Open With External Editor" | |
154 | msgstr "_Obri amb l'editor extern" | |
155 | ||
156 | #: res/gui.glade:178 | |
157 | msgid "_Show in File Manager" | |
158 | msgstr "_Mostra al navegador de fitxers" | |
159 | ||
160 | #: res/gui.glade:202 res/gui.glade:1526 | |
161 | msgid "_Rename" | |
162 | msgstr "Rea_nomena" | |
163 | ||
164 | #: res/gui.glade:246 | |
165 | msgid "_Receive SysEx" | |
166 | msgstr "_Rep SysEx" | |
167 | ||
168 | #: res/gui.glade:259 | |
169 | msgid "_Send SysEx" | |
170 | msgstr "_Envia SysEx" | |
171 | ||
172 | #: res/gui.glade:283 | |
173 | msgid "OS _Upgrade" | |
174 | msgstr "_Actualitza el SO" | |
175 | ||
176 | #: res/gui.glade:307 | |
177 | msgid "_About" | |
178 | msgstr "_Quant a" | |
179 | ||
180 | #: res/gui.glade:420 res/gui.glade:659 | |
181 | msgid "Go to Parent Directory" | |
182 | msgstr "Ves al directori pare" | |
183 | ||
184 | #: res/gui.glade:462 res/gui.glade:701 | |
185 | msgid "Refresh Directory" | |
186 | msgstr "Actualitza el directori" | |
187 | ||
188 | #: res/gui.glade:526 res/gui.glade:765 res/gui.glade:1391 | |
189 | msgid "Name" | |
190 | msgstr "Nom" | |
191 | ||
192 | #: res/gui.glade:540 res/gui.glade:779 | |
193 | msgid "Size" | |
194 | msgstr "Mida" | |
195 | ||
196 | #: res/gui.glade:577 | |
197 | msgid "Upload Selection" | |
198 | msgstr "Carrega la selecció" | |
199 | ||
200 | #: res/gui.glade:598 | |
201 | msgid "Download Selection" | |
202 | msgstr "Descarrega la selecció" | |
203 | ||
204 | #: res/gui.glade:832 | |
205 | msgid "Refresh Devices" | |
206 | msgstr "Actualitza els dispositius" | |
207 | ||
208 | #. It is recommended to split the text in two lines if it is too long | |
209 | #: res/gui.glade:915 | |
210 | msgid "Auto play" | |
211 | msgstr "" | |
212 | "Reproducció\n" | |
213 | "automàtica" | |
214 | ||
215 | #: res/gui.glade:1147 | |
216 | msgid "Status" | |
217 | msgstr "Estat" | |
218 | ||
219 | #: res/gui.glade:1158 | |
220 | msgid "Type" | |
221 | msgstr "Tipus" | |
222 | ||
223 | #: res/gui.glade:1169 | |
224 | msgid "Source" | |
225 | msgstr "Origen" | |
226 | ||
227 | #: res/gui.glade:1183 | |
228 | msgid "Destination" | |
229 | msgstr "Destinació" | |
230 | ||
231 | #: res/gui.glade:1198 | |
232 | msgid "Progress" | |
233 | msgstr "Progrés" | |
234 | ||
235 | #: res/gui.glade:1230 | |
236 | msgid "Cancel Running Task" | |
237 | msgstr "Cancel·la la tasca en execució" | |
238 | ||
239 | #: res/gui.glade:1251 | |
240 | msgid "Remove Queued Tasks" | |
241 | msgstr "Elimina les tasques de la cua" | |
242 | ||
243 | #: res/gui.glade:1272 | |
244 | msgid "Clear Finished Tasks" | |
245 | msgstr "Neteja les tasques terminadas" |
4 | 4 | # |
5 | 5 | msgid "" |
6 | 6 | msgstr "" |
7 | "Project-Id-Version: elektroid 1.2\n" | |
7 | "Project-Id-Version: elektroid 1.3\n" | |
8 | 8 | "Report-Msgid-Bugs-To: dagargo@gmail.com\n" |
9 | "POT-Creation-Date: 2020-05-10 12:40+0200\n" | |
10 | "PO-Revision-Date: 2020-02-21 11:45+0100\n" | |
9 | "POT-Creation-Date: 2021-01-05 17:33+0100\n" | |
10 | "PO-Revision-Date: 2021-01-11 22:00+0100\n" | |
11 | 11 | "Last-Translator: Dennis Braun <d_braun@kabelmail.de>\n" |
12 | 12 | "Language-Team: German\n" |
13 | 13 | "Language: de\n" |
16 | 16 | "Content-Transfer-Encoding: 8bit\n" |
17 | 17 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" |
18 | 18 | |
19 | #: src/elektroid.c:168 | |
19 | #: src/elektroid.c:177 | |
20 | 20 | #, c-format |
21 | 21 | msgid "Connected to %s" |
22 | 22 | msgstr "Verbunden mit %s" |
23 | 23 | |
24 | #: src/elektroid.c:175 src/elektroid.c:2184 | |
24 | #: src/elektroid.c:184 src/elektroid.c:2576 | |
25 | 25 | msgid "Not connected" |
26 | 26 | msgstr "Nicht verbunden" |
27 | 27 | |
28 | #: src/elektroid.c:305 | |
28 | #: src/elektroid.c:327 | |
29 | 29 | msgid "Waiting..." |
30 | 30 | msgstr "Warte..." |
31 | 31 | |
32 | #: src/elektroid.c:308 | |
32 | #: src/elektroid.c:330 | |
33 | 33 | msgid "Sending..." |
34 | 34 | msgstr "Sende..." |
35 | 35 | |
36 | #: src/elektroid.c:312 | |
36 | #: src/elektroid.c:334 | |
37 | 37 | msgid "Receiving..." |
38 | 38 | msgstr "Empfange..." |
39 | 39 | |
40 | #: src/elektroid.c:351 | |
40 | #: src/elektroid.c:402 | |
41 | 41 | msgid "Receive SysEx" |
42 | 42 | msgstr "Empfange SysEx" |
43 | 43 | |
44 | #: src/elektroid.c:374 | |
44 | #: src/elektroid.c:424 | |
45 | 45 | msgid "Save SysEx" |
46 | 46 | msgstr "Speichere SysEx" |
47 | 47 | |
48 | #: src/elektroid.c:377 src/elektroid.c:435 src/elektroid.c:577 | |
48 | #: src/elektroid.c:427 src/elektroid.c:532 src/elektroid.c:721 | |
49 | 49 | msgid "_Cancel" |
50 | 50 | msgstr "_Abbrechen" |
51 | 51 | |
52 | #: src/elektroid.c:379 | |
52 | #: src/elektroid.c:429 | |
53 | 53 | msgid "_Save" |
54 | 54 | msgstr "_Speichern" |
55 | 55 | |
56 | #: src/elektroid.c:383 | |
56 | #: src/elektroid.c:433 | |
57 | 57 | msgid "Received SysEx" |
58 | 58 | msgstr "SysEx empfangen" |
59 | 59 | |
60 | #: src/elektroid.c:386 src/elektroid.c:441 | |
60 | #: src/elektroid.c:438 src/elektroid.c:538 | |
61 | 61 | msgid "SysEx Files" |
62 | 62 | msgstr "SysEx Dateien" |
63 | 63 | |
64 | #: src/elektroid.c:432 | |
64 | #: src/elektroid.c:529 | |
65 | 65 | msgid "Open SysEx" |
66 | 66 | msgstr "Öffne SysEx" |
67 | 67 | |
68 | #: src/elektroid.c:437 | |
68 | #: src/elektroid.c:534 | |
69 | 69 | msgid "_Open" |
70 | 70 | msgstr "_Öffnen" |
71 | 71 | |
72 | #: src/elektroid.c:466 | |
72 | #: src/elektroid.c:561 | |
73 | 73 | msgid "Send SysEx" |
74 | 74 | msgstr "Sende SysEx" |
75 | 75 | |
76 | #: src/elektroid.c:543 | |
76 | #: src/elektroid.c:686 | |
77 | 77 | #, c-format |
78 | 78 | msgid "Error while deleting “%s”: %s." |
79 | 79 | msgstr "Fehler beim Löschen »%s«: %s." |
80 | 80 | |
81 | #: src/elektroid.c:576 | |
81 | #: src/elektroid.c:720 | |
82 | 82 | msgid "Are you sure you want to delete the selected items?" |
83 | 83 | msgstr "Bist du sicher das du die ausgewählten Elemente löschen möchtest?" |
84 | 84 | |
85 | #: src/elektroid.c:578 res/gui.glade:66 | |
85 | #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539 | |
86 | 86 | msgid "_Delete" |
87 | 87 | msgstr "_Löschen" |
88 | 88 | |
89 | #: src/elektroid.c:633 | |
89 | #: src/elektroid.c:777 | |
90 | 90 | msgid "Rename" |
91 | 91 | msgstr "Umbenennen" |
92 | 92 | |
93 | #: src/elektroid.c:659 | |
93 | #: src/elektroid.c:802 | |
94 | 94 | #, c-format |
95 | 95 | msgid "Error while renaming to “%s”: %s." |
96 | 96 | msgstr "Fehler beim Umbenennen von »%s«: %s." |
97 | 97 | |
98 | #: src/elektroid.c:1101 res/gui.glade:356 res/gui.glade:595 | |
99 | msgid "Add directory" | |
98 | #: src/elektroid.c:1389 res/gui.glade:441 res/gui.glade:680 | |
99 | msgid "Add Directory" | |
100 | 100 | msgstr "Verzeichnis hinzufügen" |
101 | 101 | |
102 | #: src/elektroid.c:1126 | |
102 | #: src/elektroid.c:1414 | |
103 | 103 | #, c-format |
104 | 104 | msgid "Error while creating dir “%s”: %s." |
105 | 105 | msgstr "Fehler beim Erstellen des Verzeichnisses »%s«: %s." |
106 | 106 | |
107 | #: src/elektroid.c:1290 | |
107 | #: src/elektroid.c:1576 | |
108 | 108 | msgid "Queued" |
109 | 109 | msgstr "In der Warteschlange" |
110 | 110 | |
111 | #: src/elektroid.c:1292 | |
111 | #: src/elektroid.c:1578 | |
112 | 112 | msgid "Running" |
113 | msgstr "Arbeitet" | |
114 | ||
115 | #: src/elektroid.c:1294 | |
113 | msgstr "Wird ausgeführt" | |
114 | ||
115 | #: src/elektroid.c:1580 | |
116 | 116 | msgid "Completed" |
117 | 117 | msgstr "Fertig" |
118 | 118 | |
119 | #: src/elektroid.c:1296 | |
119 | #: src/elektroid.c:1582 | |
120 | 120 | msgid "Completed with errors" |
121 | 121 | msgstr "Abgeschlossen mit Fehlern" |
122 | 122 | |
123 | #: src/elektroid.c:1298 | |
123 | #: src/elektroid.c:1584 | |
124 | 124 | msgid "Canceled" |
125 | 125 | msgstr "Abgebrochen" |
126 | 126 | |
127 | #: src/elektroid.c:1300 src/elektroid.c:1314 | |
127 | #: src/elektroid.c:1586 src/elektroid.c:1600 | |
128 | 128 | msgid "Undefined" |
129 | 129 | msgstr "Undefiniert" |
130 | 130 | |
131 | #: src/elektroid.c:1310 | |
131 | #: src/elektroid.c:1596 | |
132 | 132 | msgid "Upload" |
133 | 133 | msgstr "Hochladen" |
134 | 134 | |
135 | #: src/elektroid.c:1312 | |
135 | #: src/elektroid.c:1598 | |
136 | 136 | msgid "Download" |
137 | 137 | msgstr "Herunterladen" |
138 | 138 | |
139 | #: res/gui.glade:53 | |
139 | #: res/gui.glade:86 | |
140 | msgid "GNU/Linux sample transfer application for Elektron devices" | |
141 | msgstr "GNU/Linux Sample Transfer Anwendung für Elektron Instrumente" | |
142 | ||
143 | #: res/gui.glade:89 | |
144 | msgid "translator-credits" | |
145 | msgstr "Dennis Braun <d_braun@kabelmail.de>" | |
146 | ||
147 | #: res/gui.glade:141 | |
148 | msgid "_Play" | |
149 | msgstr "_Abspielen" | |
150 | ||
151 | #: res/gui.glade:165 | |
152 | msgid "_Open With External Editor" | |
153 | msgstr "_Öffnen mit externen Editor" | |
154 | ||
155 | #: res/gui.glade:178 | |
156 | msgid "_Show in File Manager" | |
157 | msgstr "Im Dateimanager _Anzeigen" | |
158 | ||
159 | #: res/gui.glade:202 res/gui.glade:1526 | |
140 | 160 | msgid "_Rename" |
141 | 161 | msgstr "_Umbenennen" |
142 | 162 | |
143 | #: res/gui.glade:131 | |
144 | msgid "GNU/Linux sample transfer application for Elektron devices" | |
145 | msgstr "GNU/Linux Sample Transfer Anwendung für Elektron Instrumente" | |
146 | ||
147 | #: res/gui.glade:134 | |
148 | msgid "translator-credits" | |
149 | msgstr "Dennis Braun <d_braun@kabelmail.de>" | |
150 | ||
151 | #: res/gui.glade:185 | |
163 | #: res/gui.glade:246 | |
152 | 164 | msgid "_Receive SysEx" |
153 | 165 | msgstr "_Empfange SysEx" |
154 | 166 | |
155 | #: res/gui.glade:198 | |
167 | #: res/gui.glade:259 | |
156 | 168 | msgid "_Send SysEx" |
157 | 169 | msgstr "_Sende SysEx" |
158 | 170 | |
159 | #: res/gui.glade:222 | |
171 | #: res/gui.glade:283 | |
172 | msgid "OS _Upgrade" | |
173 | msgstr "OS _Aktualisierung" | |
174 | ||
175 | #: res/gui.glade:307 | |
160 | 176 | msgid "_About" |
161 | 177 | msgstr "_Info" |
162 | 178 | |
163 | #: res/gui.glade:335 res/gui.glade:574 | |
164 | msgid "Go to parent directory" | |
179 | #: res/gui.glade:420 res/gui.glade:659 | |
180 | msgid "Go to Parent Directory" | |
165 | 181 | msgstr "Gehe zum Überverzeichnis" |
166 | 182 | |
167 | #: res/gui.glade:377 res/gui.glade:616 | |
168 | msgid "Refresh directory" | |
183 | #: res/gui.glade:462 res/gui.glade:701 | |
184 | msgid "Refresh Directory" | |
169 | 185 | msgstr "Aktualisiere Verzeichnis" |
170 | 186 | |
171 | #: res/gui.glade:441 res/gui.glade:680 res/gui.glade:1306 | |
187 | #: res/gui.glade:526 res/gui.glade:765 res/gui.glade:1391 | |
172 | 188 | msgid "Name" |
173 | 189 | msgstr "Name" |
174 | 190 | |
175 | #: res/gui.glade:455 res/gui.glade:694 | |
191 | #: res/gui.glade:540 res/gui.glade:779 | |
176 | 192 | msgid "Size" |
177 | 193 | msgstr "Größe" |
178 | 194 | |
179 | #: res/gui.glade:492 | |
180 | msgid "Upload selection" | |
195 | #: res/gui.glade:577 | |
196 | msgid "Upload Selection" | |
181 | 197 | msgstr "Upload Auswahl" |
182 | 198 | |
183 | #: res/gui.glade:513 | |
184 | msgid "Download selection" | |
199 | #: res/gui.glade:598 | |
200 | msgid "Download Selection" | |
185 | 201 | msgstr "Download Auswahl" |
186 | 202 | |
187 | #: res/gui.glade:747 | |
188 | msgid "Refresh devices" | |
203 | #: res/gui.glade:832 | |
204 | msgid "Refresh Devices" | |
189 | 205 | msgstr "Aktualisiere Geräte" |
190 | 206 | |
191 | #. It is recommended split the text in two lines if it is too long | |
192 | #: res/gui.glade:830 | |
207 | #. It is recommended to split the text in two lines if it is too long | |
208 | #: res/gui.glade:915 | |
193 | 209 | msgid "Auto play" |
194 | 210 | msgstr "Auto Play" |
195 | 211 | |
196 | #: res/gui.glade:1062 | |
212 | #: res/gui.glade:1147 | |
197 | 213 | msgid "Status" |
198 | 214 | msgstr "Status" |
199 | 215 | |
200 | #: res/gui.glade:1073 | |
216 | #: res/gui.glade:1158 | |
201 | 217 | msgid "Type" |
202 | 218 | msgstr "Typ" |
203 | 219 | |
204 | #: res/gui.glade:1084 | |
220 | #: res/gui.glade:1169 | |
205 | 221 | msgid "Source" |
206 | 222 | msgstr "Quelle" |
207 | 223 | |
208 | #: res/gui.glade:1098 | |
224 | #: res/gui.glade:1183 | |
209 | 225 | msgid "Destination" |
210 | 226 | msgstr "Ziel" |
211 | 227 | |
212 | #: res/gui.glade:1113 | |
228 | #: res/gui.glade:1198 | |
213 | 229 | msgid "Progress" |
214 | 230 | msgstr "Fortschritt" |
215 | 231 | |
216 | #: res/gui.glade:1145 | |
217 | msgid "Cancel running task" | |
232 | #: res/gui.glade:1230 | |
233 | msgid "Cancel Running Task" | |
218 | 234 | msgstr "Vorgang abbrechen" |
219 | 235 | |
220 | #: res/gui.glade:1166 | |
221 | msgid "Remove queued tasks" | |
236 | #: res/gui.glade:1251 | |
237 | msgid "Remove Queued Tasks" | |
222 | 238 | msgstr "Lösche Aufgaben in der Warteschlange" |
223 | 239 | |
224 | #: res/gui.glade:1187 | |
225 | msgid "Clear finished tasks" | |
240 | #: res/gui.glade:1272 | |
241 | msgid "Clear Finished Tasks" | |
226 | 242 | msgstr "Abgeschlossene Aufgaben aufräumen" |
5 | 5 | #, fuzzy |
6 | 6 | msgid "" |
7 | 7 | msgstr "" |
8 | "Project-Id-Version: elektroid 1.2\n" | |
8 | "Project-Id-Version: elektroid 1.3\n" | |
9 | 9 | "Report-Msgid-Bugs-To: dagargo@gmail.com\n" |
10 | "POT-Creation-Date: 2020-05-10 12:40+0200\n" | |
10 | "POT-Creation-Date: 2021-01-05 17:33+0100\n" | |
11 | 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
12 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | 13 | "Language-Team: LANGUAGE <LL@li.org>\n" |
16 | 16 | "Content-Type: text/plain; charset=UTF-8\n" |
17 | 17 | "Content-Transfer-Encoding: 8bit\n" |
18 | 18 | |
19 | #: src/elektroid.c:168 | |
19 | #: src/elektroid.c:177 | |
20 | 20 | #, c-format |
21 | 21 | msgid "Connected to %s" |
22 | 22 | msgstr "" |
23 | 23 | |
24 | #: src/elektroid.c:175 src/elektroid.c:2184 | |
24 | #: src/elektroid.c:184 src/elektroid.c:2576 | |
25 | 25 | msgid "Not connected" |
26 | 26 | msgstr "" |
27 | 27 | |
28 | #: src/elektroid.c:305 | |
28 | #: src/elektroid.c:327 | |
29 | 29 | msgid "Waiting..." |
30 | 30 | msgstr "" |
31 | 31 | |
32 | #: src/elektroid.c:308 | |
32 | #: src/elektroid.c:330 | |
33 | 33 | msgid "Sending..." |
34 | 34 | msgstr "" |
35 | 35 | |
36 | #: src/elektroid.c:312 | |
36 | #: src/elektroid.c:334 | |
37 | 37 | msgid "Receiving..." |
38 | 38 | msgstr "" |
39 | 39 | |
40 | #: src/elektroid.c:351 | |
40 | #: src/elektroid.c:402 | |
41 | 41 | msgid "Receive SysEx" |
42 | 42 | msgstr "" |
43 | 43 | |
44 | #: src/elektroid.c:374 | |
44 | #: src/elektroid.c:424 | |
45 | 45 | msgid "Save SysEx" |
46 | 46 | msgstr "" |
47 | 47 | |
48 | #: src/elektroid.c:377 src/elektroid.c:435 src/elektroid.c:577 | |
48 | #: src/elektroid.c:427 src/elektroid.c:532 src/elektroid.c:721 | |
49 | 49 | msgid "_Cancel" |
50 | 50 | msgstr "" |
51 | 51 | |
52 | #: src/elektroid.c:379 | |
52 | #: src/elektroid.c:429 | |
53 | 53 | msgid "_Save" |
54 | 54 | msgstr "" |
55 | 55 | |
56 | #: src/elektroid.c:383 | |
56 | #: src/elektroid.c:433 | |
57 | 57 | msgid "Received SysEx" |
58 | 58 | msgstr "" |
59 | 59 | |
60 | #: src/elektroid.c:386 src/elektroid.c:441 | |
60 | #: src/elektroid.c:438 src/elektroid.c:538 | |
61 | 61 | msgid "SysEx Files" |
62 | 62 | msgstr "" |
63 | 63 | |
64 | #: src/elektroid.c:432 | |
64 | #: src/elektroid.c:529 | |
65 | 65 | msgid "Open SysEx" |
66 | 66 | msgstr "" |
67 | 67 | |
68 | #: src/elektroid.c:437 | |
68 | #: src/elektroid.c:534 | |
69 | 69 | msgid "_Open" |
70 | 70 | msgstr "" |
71 | 71 | |
72 | #: src/elektroid.c:466 | |
72 | #: src/elektroid.c:561 | |
73 | 73 | msgid "Send SysEx" |
74 | 74 | msgstr "" |
75 | 75 | |
76 | #: src/elektroid.c:543 | |
76 | #: src/elektroid.c:686 | |
77 | 77 | #, c-format |
78 | 78 | msgid "Error while deleting “%s”: %s." |
79 | 79 | msgstr "" |
80 | 80 | |
81 | #: src/elektroid.c:576 | |
81 | #: src/elektroid.c:720 | |
82 | 82 | msgid "Are you sure you want to delete the selected items?" |
83 | 83 | msgstr "" |
84 | 84 | |
85 | #: src/elektroid.c:578 res/gui.glade:66 | |
85 | #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539 | |
86 | 86 | msgid "_Delete" |
87 | 87 | msgstr "" |
88 | 88 | |
89 | #: src/elektroid.c:633 | |
89 | #: src/elektroid.c:777 | |
90 | 90 | msgid "Rename" |
91 | 91 | msgstr "" |
92 | 92 | |
93 | #: src/elektroid.c:659 | |
93 | #: src/elektroid.c:802 | |
94 | 94 | #, c-format |
95 | 95 | msgid "Error while renaming to “%s”: %s." |
96 | 96 | msgstr "" |
97 | 97 | |
98 | #: src/elektroid.c:1101 res/gui.glade:356 res/gui.glade:595 | |
99 | msgid "Add directory" | |
100 | msgstr "" | |
101 | ||
102 | #: src/elektroid.c:1126 | |
98 | #: src/elektroid.c:1389 res/gui.glade:441 res/gui.glade:680 | |
99 | msgid "Add Directory" | |
100 | msgstr "" | |
101 | ||
102 | #: src/elektroid.c:1414 | |
103 | 103 | #, c-format |
104 | 104 | msgid "Error while creating dir “%s”: %s." |
105 | 105 | msgstr "" |
106 | 106 | |
107 | #: src/elektroid.c:1290 | |
107 | #: src/elektroid.c:1576 | |
108 | 108 | msgid "Queued" |
109 | 109 | msgstr "" |
110 | 110 | |
111 | #: src/elektroid.c:1292 | |
111 | #: src/elektroid.c:1578 | |
112 | 112 | msgid "Running" |
113 | 113 | msgstr "" |
114 | 114 | |
115 | #: src/elektroid.c:1294 | |
115 | #: src/elektroid.c:1580 | |
116 | 116 | msgid "Completed" |
117 | 117 | msgstr "" |
118 | 118 | |
119 | #: src/elektroid.c:1296 | |
119 | #: src/elektroid.c:1582 | |
120 | 120 | msgid "Completed with errors" |
121 | 121 | msgstr "" |
122 | 122 | |
123 | #: src/elektroid.c:1298 | |
123 | #: src/elektroid.c:1584 | |
124 | 124 | msgid "Canceled" |
125 | 125 | msgstr "" |
126 | 126 | |
127 | #: src/elektroid.c:1300 src/elektroid.c:1314 | |
127 | #: src/elektroid.c:1586 src/elektroid.c:1600 | |
128 | 128 | msgid "Undefined" |
129 | 129 | msgstr "" |
130 | 130 | |
131 | #: src/elektroid.c:1310 | |
131 | #: src/elektroid.c:1596 | |
132 | 132 | msgid "Upload" |
133 | 133 | msgstr "" |
134 | 134 | |
135 | #: src/elektroid.c:1312 | |
135 | #: src/elektroid.c:1598 | |
136 | 136 | msgid "Download" |
137 | 137 | msgstr "" |
138 | 138 | |
139 | #: res/gui.glade:53 | |
139 | #: res/gui.glade:86 | |
140 | msgid "GNU/Linux sample transfer application for Elektron devices" | |
141 | msgstr "" | |
142 | ||
143 | #: res/gui.glade:89 | |
144 | msgid "translator-credits" | |
145 | msgstr "" | |
146 | ||
147 | #: res/gui.glade:141 | |
148 | msgid "_Play" | |
149 | msgstr "" | |
150 | ||
151 | #: res/gui.glade:165 | |
152 | msgid "_Open With External Editor" | |
153 | msgstr "" | |
154 | ||
155 | #: res/gui.glade:178 | |
156 | msgid "_Show in File Manager" | |
157 | msgstr "" | |
158 | ||
159 | #: res/gui.glade:202 res/gui.glade:1526 | |
140 | 160 | msgid "_Rename" |
141 | 161 | msgstr "" |
142 | 162 | |
143 | #: res/gui.glade:131 | |
144 | msgid "GNU/Linux sample transfer application for Elektron devices" | |
145 | msgstr "" | |
146 | ||
147 | #: res/gui.glade:134 | |
148 | msgid "translator-credits" | |
149 | msgstr "" | |
150 | ||
151 | #: res/gui.glade:185 | |
163 | #: res/gui.glade:246 | |
152 | 164 | msgid "_Receive SysEx" |
153 | 165 | msgstr "" |
154 | 166 | |
155 | #: res/gui.glade:198 | |
167 | #: res/gui.glade:259 | |
156 | 168 | msgid "_Send SysEx" |
157 | 169 | msgstr "" |
158 | 170 | |
159 | #: res/gui.glade:222 | |
171 | #: res/gui.glade:283 | |
172 | msgid "OS _Upgrade" | |
173 | msgstr "" | |
174 | ||
175 | #: res/gui.glade:307 | |
160 | 176 | msgid "_About" |
161 | 177 | msgstr "" |
162 | 178 | |
163 | #: res/gui.glade:335 res/gui.glade:574 | |
164 | msgid "Go to parent directory" | |
165 | msgstr "" | |
166 | ||
167 | #: res/gui.glade:377 res/gui.glade:616 | |
168 | msgid "Refresh directory" | |
169 | msgstr "" | |
170 | ||
171 | #: res/gui.glade:441 res/gui.glade:680 res/gui.glade:1306 | |
179 | #: res/gui.glade:420 res/gui.glade:659 | |
180 | msgid "Go to Parent Directory" | |
181 | msgstr "" | |
182 | ||
183 | #: res/gui.glade:462 res/gui.glade:701 | |
184 | msgid "Refresh Directory" | |
185 | msgstr "" | |
186 | ||
187 | #: res/gui.glade:526 res/gui.glade:765 res/gui.glade:1391 | |
172 | 188 | msgid "Name" |
173 | 189 | msgstr "" |
174 | 190 | |
175 | #: res/gui.glade:455 res/gui.glade:694 | |
191 | #: res/gui.glade:540 res/gui.glade:779 | |
176 | 192 | msgid "Size" |
177 | 193 | msgstr "" |
178 | 194 | |
179 | #: res/gui.glade:492 | |
180 | msgid "Upload selection" | |
181 | msgstr "" | |
182 | ||
183 | #: res/gui.glade:513 | |
184 | msgid "Download selection" | |
185 | msgstr "" | |
186 | ||
187 | #: res/gui.glade:747 | |
188 | msgid "Refresh devices" | |
189 | msgstr "" | |
190 | ||
191 | #. It is recommended split the text in two lines if it is too long | |
192 | #: res/gui.glade:830 | |
195 | #: res/gui.glade:577 | |
196 | msgid "Upload Selection" | |
197 | msgstr "" | |
198 | ||
199 | #: res/gui.glade:598 | |
200 | msgid "Download Selection" | |
201 | msgstr "" | |
202 | ||
203 | #: res/gui.glade:832 | |
204 | msgid "Refresh Devices" | |
205 | msgstr "" | |
206 | ||
207 | #. It is recommended to split the text in two lines if it is too long | |
208 | #: res/gui.glade:915 | |
193 | 209 | msgid "Auto play" |
194 | 210 | msgstr "" |
195 | 211 | |
196 | #: res/gui.glade:1062 | |
212 | #: res/gui.glade:1147 | |
197 | 213 | msgid "Status" |
198 | 214 | msgstr "" |
199 | 215 | |
200 | #: res/gui.glade:1073 | |
216 | #: res/gui.glade:1158 | |
201 | 217 | msgid "Type" |
202 | 218 | msgstr "" |
203 | 219 | |
204 | #: res/gui.glade:1084 | |
220 | #: res/gui.glade:1169 | |
205 | 221 | msgid "Source" |
206 | 222 | msgstr "" |
207 | 223 | |
208 | #: res/gui.glade:1098 | |
224 | #: res/gui.glade:1183 | |
209 | 225 | msgid "Destination" |
210 | 226 | msgstr "" |
211 | 227 | |
212 | #: res/gui.glade:1113 | |
228 | #: res/gui.glade:1198 | |
213 | 229 | msgid "Progress" |
214 | 230 | msgstr "" |
215 | 231 | |
216 | #: res/gui.glade:1145 | |
217 | msgid "Cancel running task" | |
218 | msgstr "" | |
219 | ||
220 | #: res/gui.glade:1166 | |
221 | msgid "Remove queued tasks" | |
222 | msgstr "" | |
223 | ||
224 | #: res/gui.glade:1187 | |
225 | msgid "Clear finished tasks" | |
226 | msgstr "" | |
232 | #: res/gui.glade:1230 | |
233 | msgid "Cancel Running Task" | |
234 | msgstr "" | |
235 | ||
236 | #: res/gui.glade:1251 | |
237 | msgid "Remove Queued Tasks" | |
238 | msgstr "" | |
239 | ||
240 | #: res/gui.glade:1272 | |
241 | msgid "Clear Finished Tasks" | |
242 | msgstr "" |
4 | 4 | # |
5 | 5 | msgid "" |
6 | 6 | msgstr "" |
7 | "Project-Id-Version: elektroid 1.2\n" | |
7 | "Project-Id-Version: elektroid 1.3\n" | |
8 | 8 | "Report-Msgid-Bugs-To: dagargo@gmail.com\n" |
9 | "POT-Creation-Date: 2020-05-10 12:40+0200\n" | |
9 | "POT-Creation-Date: 2021-01-05 17:33+0100\n" | |
10 | 10 | "PO-Revision-Date: 2020-04-26 13:00+0100\n" |
11 | 11 | "Last-Translator: David García Goñi <dagargo@gmail.com>\n" |
12 | 12 | "Language-Team: English\n" |
16 | 16 | "Content-Transfer-Encoding: 8bit\n" |
17 | 17 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" |
18 | 18 | |
19 | #: src/elektroid.c:168 | |
19 | #: src/elektroid.c:177 | |
20 | 20 | #, c-format |
21 | 21 | msgid "Connected to %s" |
22 | 22 | msgstr "Connected to %s" |
23 | 23 | |
24 | #: src/elektroid.c:175 src/elektroid.c:2184 | |
24 | #: src/elektroid.c:184 src/elektroid.c:2576 | |
25 | 25 | msgid "Not connected" |
26 | 26 | msgstr "Not connected" |
27 | 27 | |
28 | #: src/elektroid.c:305 | |
28 | #: src/elektroid.c:327 | |
29 | 29 | msgid "Waiting..." |
30 | 30 | msgstr "Waiting..." |
31 | 31 | |
32 | #: src/elektroid.c:308 | |
32 | #: src/elektroid.c:330 | |
33 | 33 | msgid "Sending..." |
34 | 34 | msgstr "Sending..." |
35 | 35 | |
36 | #: src/elektroid.c:312 | |
36 | #: src/elektroid.c:334 | |
37 | 37 | msgid "Receiving..." |
38 | 38 | msgstr "Receiving..." |
39 | 39 | |
40 | #: src/elektroid.c:351 | |
40 | #: src/elektroid.c:402 | |
41 | 41 | msgid "Receive SysEx" |
42 | 42 | msgstr "Receive SysEx" |
43 | 43 | |
44 | #: src/elektroid.c:374 | |
44 | #: src/elektroid.c:424 | |
45 | 45 | msgid "Save SysEx" |
46 | 46 | msgstr "Save SysEx" |
47 | 47 | |
48 | #: src/elektroid.c:377 src/elektroid.c:435 src/elektroid.c:577 | |
48 | #: src/elektroid.c:427 src/elektroid.c:532 src/elektroid.c:721 | |
49 | 49 | msgid "_Cancel" |
50 | 50 | msgstr "_Cancel" |
51 | 51 | |
52 | #: src/elektroid.c:379 | |
52 | #: src/elektroid.c:429 | |
53 | 53 | msgid "_Save" |
54 | 54 | msgstr "_Save" |
55 | 55 | |
56 | #: src/elektroid.c:383 | |
56 | #: src/elektroid.c:433 | |
57 | 57 | msgid "Received SysEx" |
58 | 58 | msgstr "Received SysEx" |
59 | 59 | |
60 | #: src/elektroid.c:386 src/elektroid.c:441 | |
60 | #: src/elektroid.c:438 src/elektroid.c:538 | |
61 | 61 | msgid "SysEx Files" |
62 | 62 | msgstr "SysEx Files" |
63 | 63 | |
64 | #: src/elektroid.c:432 | |
64 | #: src/elektroid.c:529 | |
65 | 65 | msgid "Open SysEx" |
66 | 66 | msgstr "Open SysEx" |
67 | 67 | |
68 | #: src/elektroid.c:437 | |
68 | #: src/elektroid.c:534 | |
69 | 69 | msgid "_Open" |
70 | 70 | msgstr "_Open" |
71 | 71 | |
72 | #: src/elektroid.c:466 | |
72 | #: src/elektroid.c:561 | |
73 | 73 | msgid "Send SysEx" |
74 | 74 | msgstr "Send SysEx" |
75 | 75 | |
76 | #: src/elektroid.c:543 | |
76 | #: src/elektroid.c:686 | |
77 | 77 | #, c-format |
78 | 78 | msgid "Error while deleting “%s”: %s." |
79 | 79 | msgstr "Error while deleting “%s”: %s." |
80 | 80 | |
81 | #: src/elektroid.c:576 | |
81 | #: src/elektroid.c:720 | |
82 | 82 | msgid "Are you sure you want to delete the selected items?" |
83 | 83 | msgstr "Are you sure you want to delete the selected items?" |
84 | 84 | |
85 | #: src/elektroid.c:578 res/gui.glade:66 | |
85 | #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539 | |
86 | 86 | msgid "_Delete" |
87 | 87 | msgstr "_Delete" |
88 | 88 | |
89 | #: src/elektroid.c:633 | |
89 | #: src/elektroid.c:777 | |
90 | 90 | msgid "Rename" |
91 | 91 | msgstr "Rename" |
92 | 92 | |
93 | #: src/elektroid.c:659 | |
93 | #: src/elektroid.c:802 | |
94 | 94 | #, c-format |
95 | 95 | msgid "Error while renaming to “%s”: %s." |
96 | 96 | msgstr "Error while renaming to “%s”: %s." |
97 | 97 | |
98 | #: src/elektroid.c:1101 res/gui.glade:356 res/gui.glade:595 | |
99 | msgid "Add directory" | |
100 | msgstr "Add directory" | |
101 | ||
102 | #: src/elektroid.c:1126 | |
98 | #: src/elektroid.c:1389 res/gui.glade:441 res/gui.glade:680 | |
99 | msgid "Add Directory" | |
100 | msgstr "Add Directory" | |
101 | ||
102 | #: src/elektroid.c:1414 | |
103 | 103 | #, c-format |
104 | 104 | msgid "Error while creating dir “%s”: %s." |
105 | 105 | msgstr "Error while creating dir “%s”: %s." |
106 | 106 | |
107 | #: src/elektroid.c:1290 | |
107 | #: src/elektroid.c:1576 | |
108 | 108 | msgid "Queued" |
109 | 109 | msgstr "Queued" |
110 | 110 | |
111 | #: src/elektroid.c:1292 | |
111 | #: src/elektroid.c:1578 | |
112 | 112 | msgid "Running" |
113 | 113 | msgstr "Running" |
114 | 114 | |
115 | #: src/elektroid.c:1294 | |
115 | #: src/elektroid.c:1580 | |
116 | 116 | msgid "Completed" |
117 | 117 | msgstr "Completed" |
118 | 118 | |
119 | #: src/elektroid.c:1296 | |
119 | #: src/elektroid.c:1582 | |
120 | 120 | msgid "Completed with errors" |
121 | 121 | msgstr "Completed with errors" |
122 | 122 | |
123 | #: src/elektroid.c:1298 | |
123 | #: src/elektroid.c:1584 | |
124 | 124 | msgid "Canceled" |
125 | 125 | msgstr "Canceled" |
126 | 126 | |
127 | #: src/elektroid.c:1300 src/elektroid.c:1314 | |
127 | #: src/elektroid.c:1586 src/elektroid.c:1600 | |
128 | 128 | msgid "Undefined" |
129 | 129 | msgstr "Undefined" |
130 | 130 | |
131 | #: src/elektroid.c:1310 | |
131 | #: src/elektroid.c:1596 | |
132 | 132 | msgid "Upload" |
133 | 133 | msgstr "Upload" |
134 | 134 | |
135 | #: src/elektroid.c:1312 | |
135 | #: src/elektroid.c:1598 | |
136 | 136 | msgid "Download" |
137 | 137 | msgstr "Download" |
138 | 138 | |
139 | #: res/gui.glade:53 | |
139 | #: res/gui.glade:86 | |
140 | msgid "GNU/Linux sample transfer application for Elektron devices" | |
141 | msgstr "GNU/Linux sample transfer application for Elektron devices" | |
142 | ||
143 | #: res/gui.glade:89 | |
144 | msgid "translator-credits" | |
145 | msgstr "David García Goñi <dagargo@gmail.com>" | |
146 | ||
147 | #: res/gui.glade:141 | |
148 | msgid "_Play" | |
149 | msgstr "_Play" | |
150 | ||
151 | #: res/gui.glade:165 | |
152 | msgid "_Open With External Editor" | |
153 | msgstr "" | |
154 | ||
155 | #: res/gui.glade:178 | |
156 | msgid "_Show in File Manager" | |
157 | msgstr "_Show in File Manager" | |
158 | ||
159 | #: res/gui.glade:202 res/gui.glade:1526 | |
140 | 160 | msgid "_Rename" |
141 | 161 | msgstr "_Rename" |
142 | 162 | |
143 | #: res/gui.glade:131 | |
144 | msgid "GNU/Linux sample transfer application for Elektron devices" | |
145 | msgstr "GNU/Linux sample transfer application for Elektron devices" | |
146 | ||
147 | #: res/gui.glade:134 | |
148 | msgid "translator-credits" | |
149 | msgstr "David García Goñi <dagargo@gmail.com>" | |
150 | ||
151 | #: res/gui.glade:185 | |
163 | #: res/gui.glade:246 | |
152 | 164 | msgid "_Receive SysEx" |
153 | 165 | msgstr "_Receive SysEx" |
154 | 166 | |
155 | #: res/gui.glade:198 | |
167 | #: res/gui.glade:259 | |
156 | 168 | msgid "_Send SysEx" |
157 | 169 | msgstr "_Send SysEx" |
158 | 170 | |
159 | #: res/gui.glade:222 | |
171 | #: res/gui.glade:283 | |
172 | msgid "OS _Upgrade" | |
173 | msgstr "OS _Upgrade" | |
174 | ||
175 | #: res/gui.glade:307 | |
160 | 176 | msgid "_About" |
161 | 177 | msgstr "_About" |
162 | 178 | |
163 | #: res/gui.glade:335 res/gui.glade:574 | |
164 | msgid "Go to parent directory" | |
165 | msgstr "Go to parent directory" | |
166 | ||
167 | #: res/gui.glade:377 res/gui.glade:616 | |
168 | msgid "Refresh directory" | |
169 | msgstr "Refresh directory" | |
170 | ||
171 | #: res/gui.glade:441 res/gui.glade:680 res/gui.glade:1306 | |
179 | #: res/gui.glade:420 res/gui.glade:659 | |
180 | msgid "Go to Parent Directory" | |
181 | msgstr "Go to Parent Directory" | |
182 | ||
183 | #: res/gui.glade:462 res/gui.glade:701 | |
184 | msgid "Refresh Directory" | |
185 | msgstr "Refresh Directory" | |
186 | ||
187 | #: res/gui.glade:526 res/gui.glade:765 res/gui.glade:1391 | |
172 | 188 | msgid "Name" |
173 | 189 | msgstr "Name" |
174 | 190 | |
175 | #: res/gui.glade:455 res/gui.glade:694 | |
191 | #: res/gui.glade:540 res/gui.glade:779 | |
176 | 192 | msgid "Size" |
177 | 193 | msgstr "Size" |
178 | 194 | |
179 | #: res/gui.glade:492 | |
180 | msgid "Upload selection" | |
181 | msgstr "Upload selection" | |
182 | ||
183 | #: res/gui.glade:513 | |
184 | msgid "Download selection" | |
195 | #: res/gui.glade:577 | |
196 | msgid "Upload Selection" | |
197 | msgstr "Upload Selection" | |
198 | ||
199 | #: res/gui.glade:598 | |
200 | msgid "Download Selection" | |
185 | 201 | msgstr "Download selection" |
186 | 202 | |
187 | #: res/gui.glade:747 | |
188 | msgid "Refresh devices" | |
189 | msgstr "Refresh devices" | |
190 | ||
191 | #. It is recommended split the text in two lines if it is too long | |
192 | #: res/gui.glade:830 | |
203 | #: res/gui.glade:832 | |
204 | msgid "Refresh Devices" | |
205 | msgstr "Refresh Devices" | |
206 | ||
207 | #. It is recommended to split the text in two lines if it is too long | |
208 | #: res/gui.glade:915 | |
193 | 209 | msgid "Auto play" |
194 | 210 | msgstr "Auto play" |
195 | 211 | |
196 | #: res/gui.glade:1062 | |
212 | #: res/gui.glade:1147 | |
197 | 213 | msgid "Status" |
198 | 214 | msgstr "Status" |
199 | 215 | |
200 | #: res/gui.glade:1073 | |
216 | #: res/gui.glade:1158 | |
201 | 217 | msgid "Type" |
202 | 218 | msgstr "Type" |
203 | 219 | |
204 | #: res/gui.glade:1084 | |
220 | #: res/gui.glade:1169 | |
205 | 221 | msgid "Source" |
206 | 222 | msgstr "Source" |
207 | 223 | |
208 | #: res/gui.glade:1098 | |
224 | #: res/gui.glade:1183 | |
209 | 225 | msgid "Destination" |
210 | 226 | msgstr "Destination" |
211 | 227 | |
212 | #: res/gui.glade:1113 | |
228 | #: res/gui.glade:1198 | |
213 | 229 | msgid "Progress" |
214 | 230 | msgstr "Progress" |
215 | 231 | |
216 | #: res/gui.glade:1145 | |
217 | msgid "Cancel running task" | |
218 | msgstr "Cancel running task" | |
219 | ||
220 | #: res/gui.glade:1166 | |
221 | msgid "Remove queued tasks" | |
222 | msgstr "Remove queued tasks" | |
223 | ||
224 | #: res/gui.glade:1187 | |
225 | msgid "Clear finished tasks" | |
226 | msgstr "Clear finished tasks" | |
232 | #: res/gui.glade:1230 | |
233 | msgid "Cancel Running Task" | |
234 | msgstr "Cancel Running Task" | |
235 | ||
236 | #: res/gui.glade:1251 | |
237 | msgid "Remove Queued Tasks" | |
238 | msgstr "Remove Queued Tasks" | |
239 | ||
240 | #: res/gui.glade:1272 | |
241 | msgid "Clear Finished Tasks" | |
242 | msgstr "Clear Finished Tasks" |
4 | 4 | # |
5 | 5 | msgid "" |
6 | 6 | msgstr "" |
7 | "Project-Id-Version: elektroid 1.2\n" | |
7 | "Project-Id-Version: elektroid 1.3\n" | |
8 | 8 | "Report-Msgid-Bugs-To: dagargo@gmail.com\n" |
9 | "POT-Creation-Date: 2020-05-10 12:40+0200\n" | |
9 | "POT-Creation-Date: 2021-01-05 17:33+0100\n" | |
10 | 10 | "PO-Revision-Date: 2020-04-26 13:00+0100\n" |
11 | 11 | "Last-Translator: David García Goñi <dagargo@gmail.com>\n" |
12 | 12 | "Language-Team: Spanish\n" |
16 | 16 | "Content-Transfer-Encoding: 8bit\n" |
17 | 17 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" |
18 | 18 | |
19 | #: src/elektroid.c:168 | |
19 | #: src/elektroid.c:177 | |
20 | 20 | #, c-format |
21 | 21 | msgid "Connected to %s" |
22 | 22 | msgstr "Conectado a %s" |
23 | 23 | |
24 | #: src/elektroid.c:175 src/elektroid.c:2184 | |
24 | #: src/elektroid.c:184 src/elektroid.c:2576 | |
25 | 25 | msgid "Not connected" |
26 | 26 | msgstr "No conectado" |
27 | 27 | |
28 | #: src/elektroid.c:305 | |
28 | #: src/elektroid.c:327 | |
29 | 29 | msgid "Waiting..." |
30 | 30 | msgstr "Esperando..." |
31 | 31 | |
32 | #: src/elektroid.c:308 | |
32 | #: src/elektroid.c:330 | |
33 | 33 | msgid "Sending..." |
34 | 34 | msgstr "Enviando..." |
35 | 35 | |
36 | #: src/elektroid.c:312 | |
36 | #: src/elektroid.c:334 | |
37 | 37 | msgid "Receiving..." |
38 | 38 | msgstr "Recibiendo..." |
39 | 39 | |
40 | #: src/elektroid.c:351 | |
40 | #: src/elektroid.c:402 | |
41 | 41 | msgid "Receive SysEx" |
42 | 42 | msgstr "Recibir SysEx" |
43 | 43 | |
44 | #: src/elektroid.c:374 | |
44 | #: src/elektroid.c:424 | |
45 | 45 | msgid "Save SysEx" |
46 | 46 | msgstr "Guardar SysEx" |
47 | 47 | |
48 | #: src/elektroid.c:377 src/elektroid.c:435 src/elektroid.c:577 | |
48 | #: src/elektroid.c:427 src/elektroid.c:532 src/elektroid.c:721 | |
49 | 49 | msgid "_Cancel" |
50 | 50 | msgstr "_Cancelar" |
51 | 51 | |
52 | #: src/elektroid.c:379 | |
52 | #: src/elektroid.c:429 | |
53 | 53 | msgid "_Save" |
54 | 54 | msgstr "_Guardar" |
55 | 55 | |
56 | #: src/elektroid.c:383 | |
56 | #: src/elektroid.c:433 | |
57 | 57 | msgid "Received SysEx" |
58 | 58 | msgstr "SysEx recibido" |
59 | 59 | |
60 | #: src/elektroid.c:386 src/elektroid.c:441 | |
60 | #: src/elektroid.c:438 src/elektroid.c:538 | |
61 | 61 | msgid "SysEx Files" |
62 | 62 | msgstr "Archivos SysEx" |
63 | 63 | |
64 | #: src/elektroid.c:432 | |
64 | #: src/elektroid.c:529 | |
65 | 65 | msgid "Open SysEx" |
66 | 66 | msgstr "Abrir SysEx" |
67 | 67 | |
68 | #: src/elektroid.c:437 | |
68 | #: src/elektroid.c:534 | |
69 | 69 | msgid "_Open" |
70 | 70 | msgstr "_Abrir" |
71 | 71 | |
72 | #: src/elektroid.c:466 | |
72 | #: src/elektroid.c:561 | |
73 | 73 | msgid "Send SysEx" |
74 | 74 | msgstr "Enviar SysEx" |
75 | 75 | |
76 | #: src/elektroid.c:543 | |
76 | #: src/elektroid.c:686 | |
77 | 77 | #, c-format |
78 | 78 | msgid "Error while deleting “%s”: %s." |
79 | 79 | msgstr "Error al eliminar «%s»: %s." |
80 | 80 | |
81 | #: src/elektroid.c:576 | |
81 | #: src/elektroid.c:720 | |
82 | 82 | msgid "Are you sure you want to delete the selected items?" |
83 | 83 | msgstr "¿Está seguro de que quiere eliminar los elementos seleccionados?" |
84 | 84 | |
85 | #: src/elektroid.c:578 res/gui.glade:66 | |
85 | #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539 | |
86 | 86 | msgid "_Delete" |
87 | 87 | msgstr "_Eliminar" |
88 | 88 | |
89 | #: src/elektroid.c:633 | |
89 | #: src/elektroid.c:777 | |
90 | 90 | msgid "Rename" |
91 | 91 | msgstr "Renombrar" |
92 | 92 | |
93 | #: src/elektroid.c:659 | |
93 | #: src/elektroid.c:802 | |
94 | 94 | #, c-format |
95 | 95 | msgid "Error while renaming to “%s”: %s." |
96 | 96 | msgstr "Error al renombrar a «%s»: %s." |
97 | 97 | |
98 | #: src/elektroid.c:1101 res/gui.glade:356 res/gui.glade:595 | |
99 | msgid "Add directory" | |
98 | #: src/elektroid.c:1389 res/gui.glade:441 res/gui.glade:680 | |
99 | msgid "Add Directory" | |
100 | 100 | msgstr "Añadir directorio" |
101 | 101 | |
102 | #: src/elektroid.c:1126 | |
102 | #: src/elektroid.c:1414 | |
103 | 103 | #, c-format |
104 | 104 | msgid "Error while creating dir “%s”: %s." |
105 | 105 | msgstr "Error al crear el directorio «%s»: %s." |
106 | 106 | |
107 | #: src/elektroid.c:1290 | |
107 | #: src/elektroid.c:1576 | |
108 | 108 | msgid "Queued" |
109 | 109 | msgstr "Encolada" |
110 | 110 | |
111 | #: src/elektroid.c:1292 | |
111 | #: src/elektroid.c:1578 | |
112 | 112 | msgid "Running" |
113 | 113 | msgstr "Ejecutando" |
114 | 114 | |
115 | #: src/elektroid.c:1294 | |
115 | #: src/elektroid.c:1580 | |
116 | 116 | msgid "Completed" |
117 | 117 | msgstr "Completada" |
118 | 118 | |
119 | #: src/elektroid.c:1296 | |
119 | #: src/elektroid.c:1582 | |
120 | 120 | msgid "Completed with errors" |
121 | 121 | msgstr "Completada con errores" |
122 | 122 | |
123 | #: src/elektroid.c:1298 | |
123 | #: src/elektroid.c:1584 | |
124 | 124 | msgid "Canceled" |
125 | 125 | msgstr "Cancelada" |
126 | 126 | |
127 | #: src/elektroid.c:1300 src/elektroid.c:1314 | |
127 | #: src/elektroid.c:1586 src/elektroid.c:1600 | |
128 | 128 | msgid "Undefined" |
129 | 129 | msgstr "Indefinido" |
130 | 130 | |
131 | #: src/elektroid.c:1310 | |
131 | #: src/elektroid.c:1596 | |
132 | 132 | msgid "Upload" |
133 | 133 | msgstr "Carga" |
134 | 134 | |
135 | #: src/elektroid.c:1312 | |
135 | #: src/elektroid.c:1598 | |
136 | 136 | msgid "Download" |
137 | 137 | msgstr "Descarga" |
138 | 138 | |
139 | #: res/gui.glade:53 | |
140 | msgid "_Rename" | |
141 | msgstr "_Renombrar" | |
142 | ||
143 | #: res/gui.glade:131 | |
139 | #: res/gui.glade:86 | |
144 | 140 | msgid "GNU/Linux sample transfer application for Elektron devices" |
145 | 141 | msgstr "" |
146 | 142 | "Aplicación GNU/Linux de transferencia de muestras para dispositivos Elektron" |
147 | 143 | |
148 | #: res/gui.glade:134 | |
144 | #: res/gui.glade:89 | |
149 | 145 | msgid "translator-credits" |
150 | 146 | msgstr "David García Goñi <dagargo@gmail.com>" |
151 | 147 | |
152 | #: res/gui.glade:185 | |
148 | #: res/gui.glade:141 | |
149 | msgid "_Play" | |
150 | msgstr "_Reproducir" | |
151 | ||
152 | #: res/gui.glade:165 | |
153 | msgid "_Open With External Editor" | |
154 | msgstr "_Abrir con editor externo" | |
155 | ||
156 | #: res/gui.glade:178 | |
157 | msgid "_Show in File Manager" | |
158 | msgstr "_Mostrar en gestor de archivos" | |
159 | ||
160 | #: res/gui.glade:202 res/gui.glade:1526 | |
161 | msgid "_Rename" | |
162 | msgstr "Re_nombrar" | |
163 | ||
164 | #: res/gui.glade:246 | |
153 | 165 | msgid "_Receive SysEx" |
154 | 166 | msgstr "_Recibir SysEx" |
155 | 167 | |
156 | #: res/gui.glade:198 | |
168 | #: res/gui.glade:259 | |
157 | 169 | msgid "_Send SysEx" |
158 | 170 | msgstr "_Enviar SysEx" |
159 | 171 | |
160 | #: res/gui.glade:222 | |
172 | #: res/gui.glade:283 | |
173 | msgid "OS _Upgrade" | |
174 | msgstr "Actualizar _SO" | |
175 | ||
176 | #: res/gui.glade:307 | |
161 | 177 | msgid "_About" |
162 | 178 | msgstr "_Acerca de" |
163 | 179 | |
164 | #: res/gui.glade:335 res/gui.glade:574 | |
165 | msgid "Go to parent directory" | |
180 | #: res/gui.glade:420 res/gui.glade:659 | |
181 | msgid "Go to Parent Directory" | |
166 | 182 | msgstr "Ir al directorio padre" |
167 | 183 | |
168 | #: res/gui.glade:377 res/gui.glade:616 | |
169 | msgid "Refresh directory" | |
170 | msgstr "Refrescar directorio" | |
171 | ||
172 | #: res/gui.glade:441 res/gui.glade:680 res/gui.glade:1306 | |
184 | #: res/gui.glade:462 res/gui.glade:701 | |
185 | msgid "Refresh Directory" | |
186 | msgstr "Actualizar directorio" | |
187 | ||
188 | #: res/gui.glade:526 res/gui.glade:765 res/gui.glade:1391 | |
173 | 189 | msgid "Name" |
174 | 190 | msgstr "Nombre" |
175 | 191 | |
176 | #: res/gui.glade:455 res/gui.glade:694 | |
192 | #: res/gui.glade:540 res/gui.glade:779 | |
177 | 193 | msgid "Size" |
178 | 194 | msgstr "Tamaño" |
179 | 195 | |
180 | #: res/gui.glade:492 | |
181 | msgid "Upload selection" | |
196 | #: res/gui.glade:577 | |
197 | msgid "Upload Selection" | |
182 | 198 | msgstr "Cargar selección" |
183 | 199 | |
184 | #: res/gui.glade:513 | |
185 | msgid "Download selection" | |
200 | #: res/gui.glade:598 | |
201 | msgid "Download Selection" | |
186 | 202 | msgstr "Descargar selección" |
187 | 203 | |
188 | #: res/gui.glade:747 | |
189 | msgid "Refresh devices" | |
190 | msgstr "Refrescar dispositivos" | |
191 | ||
192 | #. It is recommended split the text in two lines if it is too long | |
193 | #: res/gui.glade:830 | |
204 | #: res/gui.glade:832 | |
205 | msgid "Refresh Devices" | |
206 | msgstr "Actualizar dispositivos" | |
207 | ||
208 | #. It is recommended to split the text in two lines if it is too long | |
209 | #: res/gui.glade:915 | |
194 | 210 | msgid "Auto play" |
195 | 211 | msgstr "" |
196 | 212 | "Reproducción\n" |
197 | 213 | "automática" |
198 | 214 | |
199 | #: res/gui.glade:1062 | |
215 | #: res/gui.glade:1147 | |
200 | 216 | msgid "Status" |
201 | 217 | msgstr "Estado" |
202 | 218 | |
203 | #: res/gui.glade:1073 | |
219 | #: res/gui.glade:1158 | |
204 | 220 | msgid "Type" |
205 | 221 | msgstr "Tipo" |
206 | 222 | |
207 | #: res/gui.glade:1084 | |
223 | #: res/gui.glade:1169 | |
208 | 224 | msgid "Source" |
209 | 225 | msgstr "Origen" |
210 | 226 | |
211 | #: res/gui.glade:1098 | |
227 | #: res/gui.glade:1183 | |
212 | 228 | msgid "Destination" |
213 | 229 | msgstr "Destino" |
214 | 230 | |
215 | #: res/gui.glade:1113 | |
231 | #: res/gui.glade:1198 | |
216 | 232 | msgid "Progress" |
217 | 233 | msgstr "Progreso" |
218 | 234 | |
219 | #: res/gui.glade:1145 | |
220 | msgid "Cancel running task" | |
235 | #: res/gui.glade:1230 | |
236 | msgid "Cancel Running Task" | |
221 | 237 | msgstr "Cancelar tarea en ejecución" |
222 | 238 | |
223 | #: res/gui.glade:1166 | |
224 | msgid "Remove queued tasks" | |
239 | #: res/gui.glade:1251 | |
240 | msgid "Remove Queued Tasks" | |
225 | 241 | msgstr "Eliminar tareas encoladas" |
226 | 242 | |
227 | #: res/gui.glade:1187 | |
228 | msgid "Clear finished tasks" | |
243 | #: res/gui.glade:1272 | |
244 | msgid "Clear Finished Tasks" | |
229 | 245 | msgstr "Limpiar tareas terminadas" |
4 | 4 | # |
5 | 5 | msgid "" |
6 | 6 | msgstr "" |
7 | "Project-Id-Version: elektroid 1.2\n" | |
7 | "Project-Id-Version: elektroid 1.3\n" | |
8 | 8 | "Report-Msgid-Bugs-To: dagargo@gmail.com\n" |
9 | "POT-Creation-Date: 2020-05-10 12:40+0200\n" | |
10 | "PO-Revision-Date: 2020-05-09 20:36+0100\n" | |
9 | "POT-Creation-Date: 2021-01-05 17:33+0100\n" | |
10 | "PO-Revision-Date: 2021-01-05 17:59+0100\n" | |
11 | 11 | "Last-Translator: Olivier Humbert <trebmuh@tuxfamily.org>\n" |
12 | 12 | "Language-Team: French\n" |
13 | 13 | "Language: fr\n" |
16 | 16 | "Content-Transfer-Encoding: 8bit\n" |
17 | 17 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" |
18 | 18 | |
19 | #: src/elektroid.c:168 | |
19 | #: src/elektroid.c:177 | |
20 | 20 | #, c-format |
21 | 21 | msgid "Connected to %s" |
22 | 22 | msgstr "Connecté à %s" |
23 | 23 | |
24 | #: src/elektroid.c:175 src/elektroid.c:2184 | |
24 | #: src/elektroid.c:184 src/elektroid.c:2576 | |
25 | 25 | msgid "Not connected" |
26 | 26 | msgstr "Non connecté" |
27 | 27 | |
28 | #: src/elektroid.c:305 | |
28 | #: src/elektroid.c:327 | |
29 | 29 | msgid "Waiting..." |
30 | 30 | msgstr "En attente..." |
31 | 31 | |
32 | #: src/elektroid.c:308 | |
32 | #: src/elektroid.c:330 | |
33 | 33 | msgid "Sending..." |
34 | 34 | msgstr "Envoi en cours..." |
35 | 35 | |
36 | #: src/elektroid.c:312 | |
36 | #: src/elektroid.c:334 | |
37 | 37 | msgid "Receiving..." |
38 | 38 | msgstr "Réception en cours..." |
39 | 39 | |
40 | #: src/elektroid.c:351 | |
40 | #: src/elektroid.c:402 | |
41 | 41 | msgid "Receive SysEx" |
42 | 42 | msgstr "Réception de SysEx" |
43 | 43 | |
44 | #: src/elektroid.c:374 | |
44 | #: src/elektroid.c:424 | |
45 | 45 | msgid "Save SysEx" |
46 | 46 | msgstr "Sauvegarde de SysEx" |
47 | 47 | |
48 | #: src/elektroid.c:377 src/elektroid.c:435 src/elektroid.c:577 | |
48 | #: src/elektroid.c:427 src/elektroid.c:532 src/elektroid.c:721 | |
49 | 49 | msgid "_Cancel" |
50 | 50 | msgstr "_Annuler" |
51 | 51 | |
52 | #: src/elektroid.c:379 | |
52 | #: src/elektroid.c:429 | |
53 | 53 | msgid "_Save" |
54 | 54 | msgstr "_Sauvegarder" |
55 | 55 | |
56 | #: src/elektroid.c:383 | |
56 | #: src/elektroid.c:433 | |
57 | 57 | msgid "Received SysEx" |
58 | 58 | msgstr "SysEx reçu" |
59 | 59 | |
60 | #: src/elektroid.c:386 src/elektroid.c:441 | |
60 | #: src/elektroid.c:438 src/elektroid.c:538 | |
61 | 61 | msgid "SysEx Files" |
62 | 62 | msgstr "Fichiers SysEx" |
63 | 63 | |
64 | #: src/elektroid.c:432 | |
64 | #: src/elektroid.c:529 | |
65 | 65 | msgid "Open SysEx" |
66 | 66 | msgstr "Ouvrir SysEx" |
67 | 67 | |
68 | #: src/elektroid.c:437 | |
68 | #: src/elektroid.c:534 | |
69 | 69 | msgid "_Open" |
70 | 70 | msgstr "_Ouvrir" |
71 | 71 | |
72 | #: src/elektroid.c:466 | |
72 | #: src/elektroid.c:561 | |
73 | 73 | msgid "Send SysEx" |
74 | 74 | msgstr "Envoyer SysEx" |
75 | 75 | |
76 | #: src/elektroid.c:543 | |
76 | #: src/elektroid.c:686 | |
77 | 77 | #, c-format |
78 | 78 | msgid "Error while deleting “%s”: %s." |
79 | 79 | msgstr "Erreur lors de la suppression de « %s » : %s." |
80 | 80 | |
81 | #: src/elektroid.c:576 | |
81 | #: src/elektroid.c:720 | |
82 | 82 | msgid "Are you sure you want to delete the selected items?" |
83 | 83 | msgstr "Souhaitez-vous vraiment supprimer les éléments sélectionnés ?" |
84 | 84 | |
85 | #: src/elektroid.c:578 res/gui.glade:66 | |
85 | #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539 | |
86 | 86 | msgid "_Delete" |
87 | 87 | msgstr "_Supprimer" |
88 | 88 | |
89 | #: src/elektroid.c:633 | |
89 | #: src/elektroid.c:777 | |
90 | 90 | msgid "Rename" |
91 | 91 | msgstr "Renommer" |
92 | 92 | |
93 | #: src/elektroid.c:659 | |
93 | #: src/elektroid.c:802 | |
94 | 94 | #, c-format |
95 | 95 | msgid "Error while renaming to “%s”: %s." |
96 | 96 | msgstr "Erreur lors du renommage de « %s » : %s." |
97 | 97 | |
98 | #: src/elektroid.c:1101 res/gui.glade:356 res/gui.glade:595 | |
99 | msgid "Add directory" | |
98 | #: src/elektroid.c:1389 res/gui.glade:441 res/gui.glade:680 | |
99 | msgid "Add Directory" | |
100 | 100 | msgstr "Ajout d'un répertoire" |
101 | 101 | |
102 | #: src/elektroid.c:1126 | |
102 | #: src/elektroid.c:1414 | |
103 | 103 | #, c-format |
104 | 104 | msgid "Error while creating dir “%s”: %s." |
105 | 105 | msgstr "Erreur lors de la création du répertoire « %s » : %s." |
106 | 106 | |
107 | #: src/elektroid.c:1290 | |
107 | #: src/elektroid.c:1576 | |
108 | 108 | msgid "Queued" |
109 | 109 | msgstr "Mise en fil d'attente" |
110 | 110 | |
111 | #: src/elektroid.c:1292 | |
111 | #: src/elektroid.c:1578 | |
112 | 112 | msgid "Running" |
113 | 113 | msgstr "En cours" |
114 | 114 | |
115 | #: src/elektroid.c:1294 | |
115 | #: src/elektroid.c:1580 | |
116 | 116 | msgid "Completed" |
117 | 117 | msgstr "Terminé" |
118 | 118 | |
119 | #: src/elektroid.c:1296 | |
119 | #: src/elektroid.c:1582 | |
120 | 120 | msgid "Completed with errors" |
121 | 121 | msgstr "Terminé avec des erreurs" |
122 | 122 | |
123 | #: src/elektroid.c:1298 | |
123 | #: src/elektroid.c:1584 | |
124 | 124 | msgid "Canceled" |
125 | 125 | msgstr "Annulé" |
126 | 126 | |
127 | #: src/elektroid.c:1300 src/elektroid.c:1314 | |
127 | #: src/elektroid.c:1586 src/elektroid.c:1600 | |
128 | 128 | msgid "Undefined" |
129 | 129 | msgstr "Indéfini" |
130 | 130 | |
131 | #: src/elektroid.c:1310 | |
131 | #: src/elektroid.c:1596 | |
132 | 132 | msgid "Upload" |
133 | 133 | msgstr "Téléversement" |
134 | 134 | |
135 | #: src/elektroid.c:1312 | |
135 | #: src/elektroid.c:1598 | |
136 | 136 | msgid "Download" |
137 | 137 | msgstr "Téléchargement" |
138 | 138 | |
139 | #: res/gui.glade:53 | |
140 | msgid "_Rename" | |
141 | msgstr "_Renommer" | |
142 | ||
143 | #: res/gui.glade:131 | |
139 | #: res/gui.glade:86 | |
144 | 140 | msgid "GNU/Linux sample transfer application for Elektron devices" |
145 | 141 | msgstr "" |
146 | 142 | "Application GNU/Linux de transfert d'échantillon pour les périphériques " |
147 | 143 | "Elektron" |
148 | 144 | |
149 | #: res/gui.glade:134 | |
145 | #: res/gui.glade:89 | |
150 | 146 | msgid "translator-credits" |
151 | 147 | msgstr "Olivier Humbert <trebmuh@tuxfamily.org>" |
152 | 148 | |
153 | #: res/gui.glade:185 | |
149 | #: res/gui.glade:141 | |
150 | msgid "_Play" | |
151 | msgstr "_Lecture" | |
152 | ||
153 | #: res/gui.glade:165 | |
154 | msgid "_Open With External Editor" | |
155 | msgstr "_Ouvrir avec un éditeur externe" | |
156 | ||
157 | #: res/gui.glade:178 | |
158 | msgid "_Show in File Manager" | |
159 | msgstr "Afficher dans un ge_stionnaire de fichier" | |
160 | ||
161 | #: res/gui.glade:202 res/gui.glade:1526 | |
162 | msgid "_Rename" | |
163 | msgstr "_Renommer" | |
164 | ||
165 | #: res/gui.glade:246 | |
154 | 166 | msgid "_Receive SysEx" |
155 | 167 | msgstr "_Réception de SysEx" |
156 | 168 | |
157 | #: res/gui.glade:198 | |
169 | #: res/gui.glade:259 | |
158 | 170 | msgid "_Send SysEx" |
159 | 171 | msgstr "Envoi de _Sysex" |
160 | 172 | |
161 | #: res/gui.glade:222 | |
173 | #: res/gui.glade:283 | |
174 | msgid "OS _Upgrade" | |
175 | msgstr "Mise à jo_ur SE" | |
176 | ||
177 | #: res/gui.glade:307 | |
162 | 178 | msgid "_About" |
163 | 179 | msgstr "À _propos" |
164 | 180 | |
165 | #: res/gui.glade:335 res/gui.glade:574 | |
166 | msgid "Go to parent directory" | |
181 | #: res/gui.glade:420 res/gui.glade:659 | |
182 | msgid "Go to Parent Directory" | |
167 | 183 | msgstr "Aller au répertoire parent" |
168 | 184 | |
169 | #: res/gui.glade:377 res/gui.glade:616 | |
170 | msgid "Refresh directory" | |
185 | #: res/gui.glade:462 res/gui.glade:701 | |
186 | msgid "Refresh Directory" | |
171 | 187 | msgstr "Rafraîchir le répertoire" |
172 | 188 | |
173 | #: res/gui.glade:441 res/gui.glade:680 res/gui.glade:1306 | |
189 | #: res/gui.glade:526 res/gui.glade:765 res/gui.glade:1391 | |
174 | 190 | msgid "Name" |
175 | 191 | msgstr "Nom" |
176 | 192 | |
177 | #: res/gui.glade:455 res/gui.glade:694 | |
193 | #: res/gui.glade:540 res/gui.glade:779 | |
178 | 194 | msgid "Size" |
179 | 195 | msgstr "Taille" |
180 | 196 | |
181 | #: res/gui.glade:492 | |
182 | msgid "Upload selection" | |
197 | #: res/gui.glade:577 | |
198 | msgid "Upload Selection" | |
183 | 199 | msgstr "Téléversement de la sélection" |
184 | 200 | |
185 | #: res/gui.glade:513 | |
186 | msgid "Download selection" | |
201 | #: res/gui.glade:598 | |
202 | msgid "Download Selection" | |
187 | 203 | msgstr "Téléchargement de la sélection" |
188 | 204 | |
189 | #: res/gui.glade:747 | |
190 | msgid "Refresh devices" | |
205 | #: res/gui.glade:832 | |
206 | msgid "Refresh Devices" | |
191 | 207 | msgstr "Rafraîchir les périphériques" |
192 | 208 | |
193 | #. It is recommended split the text in two lines if it is too long | |
194 | #: res/gui.glade:830 | |
209 | #. It is recommended to split the text in two lines if it is too long | |
210 | #: res/gui.glade:915 | |
195 | 211 | msgid "Auto play" |
196 | 212 | msgstr "" |
197 | 213 | "Lecture\n" |
198 | 214 | "automatique" |
199 | 215 | |
200 | #: res/gui.glade:1062 | |
216 | #: res/gui.glade:1147 | |
201 | 217 | msgid "Status" |
202 | 218 | msgstr "Statut" |
203 | 219 | |
204 | #: res/gui.glade:1073 | |
220 | #: res/gui.glade:1158 | |
205 | 221 | msgid "Type" |
206 | 222 | msgstr "Type" |
207 | 223 | |
208 | #: res/gui.glade:1084 | |
224 | #: res/gui.glade:1169 | |
209 | 225 | msgid "Source" |
210 | 226 | msgstr "Source" |
211 | 227 | |
212 | #: res/gui.glade:1098 | |
228 | #: res/gui.glade:1183 | |
213 | 229 | msgid "Destination" |
214 | 230 | msgstr "Destination" |
215 | 231 | |
216 | #: res/gui.glade:1113 | |
232 | #: res/gui.glade:1198 | |
217 | 233 | msgid "Progress" |
218 | 234 | msgstr "Progrès" |
219 | 235 | |
220 | #: res/gui.glade:1145 | |
221 | msgid "Cancel running task" | |
236 | #: res/gui.glade:1230 | |
237 | msgid "Cancel Running Task" | |
222 | 238 | msgstr "Annuler la tâche en cours" |
223 | 239 | |
224 | #: res/gui.glade:1166 | |
225 | msgid "Remove queued tasks" | |
240 | #: res/gui.glade:1251 | |
241 | msgid "Remove Queued Tasks" | |
226 | 242 | msgstr "Supprimer des tâches dans la file d'attente" |
227 | 243 | |
228 | #: res/gui.glade:1187 | |
229 | msgid "Clear finished tasks" | |
244 | #: res/gui.glade:1272 | |
245 | msgid "Clear Finished Tasks" | |
230 | 246 | msgstr "Nettoyer les tâches terminées" |
2 | 2 | |
3 | 3 | desktopdir = $(datadir)/applications |
4 | 4 | desktop_DATA = elektroid.desktop |
5 | ||
6 | metainfodir= $(datadir)/metainfo | |
7 | metainfo_DATA = elektroid.appdata.xml | |
5 | 8 | |
6 | 9 | svgicondir = $(datarootdir)/icons/hicolor/scalable/apps |
7 | 10 | svgicon_DATA = elektroid.svg |
20 | 23 | echo "*** Icon cache not updated. After (un)install, run this:"; \ |
21 | 24 | echo "*** $(gtk_update_icon_cache)"; \ |
22 | 25 | fi |
26 | ||
23 | 27 | EXTRA_DIST = \ |
24 | $(icon_DATA) \ | |
28 | $(res_DATA) \ | |
29 | $(desktop_DATA) \ | |
30 | $(metainfo_DATA) \ | |
25 | 31 | $(svgicon_DATA) |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | <!-- Copyright 2020 Dennis Braun <d_braun@kabelmail.de> --> | |
2 | <component type="desktop"> | |
3 | <id>elektroid.desktop</id> | |
4 | <metadata_license>FSFAP</metadata_license> | |
5 | <project_license>GPL-3.0+</project_license> | |
6 | <name>elektroid</name> | |
7 | <summary>Sample transfer application</summary> | |
8 | <description> | |
9 | <p>Elektroid is an sample transfer application for Elektron devices.</p> | |
10 | <p>With elektroid you can easily load audio files like flac or wav into your | |
11 | elektron sampler. You can also transfer audio samples from your elektroid | |
12 | device to your local hard disk.</p> | |
13 | </description> | |
14 | <launchable type="desktop-id">elektroid.desktop</launchable> | |
15 | <provides> | |
16 | <binary>elektroid</binary> | |
17 | </provides> | |
18 | <screenshots> | |
19 | <screenshot type="default"> | |
20 | <image>https://screenshots.debian.net/screenshots/000/019/315/large.png</image> | |
21 | <caption>The main window showing the application in action</caption> | |
22 | </screenshot> | |
23 | </screenshots> | |
24 | <keywords> | |
25 | <keyword>Audio</keyword> | |
26 | <keyword>MIDI</keyword> | |
27 | <keyword>ALSA</keyword> | |
28 | </keywords> | |
29 | <url type="homepage">https://github.com/dagargo/elektroid</url> | |
30 | <project_group>https://github.com/dagargo</project_group> | |
31 | <developer_name>David García Goñi</developer_name> | |
32 | <update_contact>dagargo@gmail.com</update_contact> | |
33 | </component> |
31 | 31 | <!-- column-name name --> |
32 | 32 | <column type="gchararray"/> |
33 | 33 | </columns> |
34 | </object> | |
35 | <object class="GtkPopoverMenu" id="item_popmenu"> | |
36 | <property name="can_focus">False</property> | |
37 | <property name="position">bottom</property> | |
38 | <child> | |
39 | <object class="GtkBox"> | |
40 | <property name="visible">True</property> | |
41 | <property name="can_focus">False</property> | |
42 | <property name="margin_left">9</property> | |
43 | <property name="margin_right">9</property> | |
44 | <property name="margin_top">9</property> | |
45 | <property name="margin_bottom">9</property> | |
46 | <property name="orientation">vertical</property> | |
47 | <child> | |
48 | <object class="GtkModelButton" id="rename_button"> | |
49 | <property name="visible">True</property> | |
50 | <property name="can_focus">True</property> | |
51 | <property name="receives_default">True</property> | |
52 | <property name="text" translatable="yes">_Rename</property> | |
53 | </object> | |
54 | <packing> | |
55 | <property name="expand">False</property> | |
56 | <property name="fill">True</property> | |
57 | <property name="position">0</property> | |
58 | </packing> | |
59 | </child> | |
60 | <child> | |
61 | <object class="GtkModelButton" id="delete_button"> | |
62 | <property name="visible">True</property> | |
63 | <property name="can_focus">True</property> | |
64 | <property name="receives_default">True</property> | |
65 | <property name="text" translatable="yes">_Delete</property> | |
66 | </object> | |
67 | <packing> | |
68 | <property name="expand">False</property> | |
69 | <property name="fill">True</property> | |
70 | <property name="position">1</property> | |
71 | </packing> | |
72 | </child> | |
73 | </object> | |
74 | <packing> | |
75 | <property name="submenu">main</property> | |
76 | <property name="position">1</property> | |
77 | </packing> | |
78 | </child> | |
79 | 34 | </object> |
80 | 35 | <object class="GtkListStore" id="local_list_store"> |
81 | 36 | <columns> |
164 | 119 | </object> |
165 | 120 | </child> |
166 | 121 | </object> |
167 | <object class="GtkPopoverMenu" id="elektroid_popmenu"> | |
122 | <object class="GtkPopoverMenu" id="local_popover"> | |
123 | <property name="can_focus">False</property> | |
124 | <property name="relative_to">local_tree_view</property> | |
125 | <property name="position">bottom</property> | |
126 | <child> | |
127 | <object class="GtkBox"> | |
128 | <property name="visible">True</property> | |
129 | <property name="can_focus">False</property> | |
130 | <property name="margin_left">9</property> | |
131 | <property name="margin_right">9</property> | |
132 | <property name="margin_top">9</property> | |
133 | <property name="margin_bottom">9</property> | |
134 | <property name="orientation">vertical</property> | |
135 | <child> | |
136 | <object class="GtkModelButton" id="local_play_button"> | |
137 | <property name="visible">True</property> | |
138 | <property name="can_focus">True</property> | |
139 | <property name="receives_default">True</property> | |
140 | <property name="text" translatable="yes">_Play</property> | |
141 | </object> | |
142 | <packing> | |
143 | <property name="expand">False</property> | |
144 | <property name="fill">True</property> | |
145 | <property name="position">0</property> | |
146 | </packing> | |
147 | </child> | |
148 | <child> | |
149 | <object class="GtkSeparator"> | |
150 | <property name="visible">True</property> | |
151 | <property name="can_focus">False</property> | |
152 | </object> | |
153 | <packing> | |
154 | <property name="expand">False</property> | |
155 | <property name="fill">True</property> | |
156 | <property name="position">1</property> | |
157 | </packing> | |
158 | </child> | |
159 | <child> | |
160 | <object class="GtkModelButton" id="local_open_button"> | |
161 | <property name="visible">True</property> | |
162 | <property name="can_focus">True</property> | |
163 | <property name="receives_default">True</property> | |
164 | <property name="text" translatable="yes">_Open With External Editor</property> | |
165 | </object> | |
166 | <packing> | |
167 | <property name="expand">False</property> | |
168 | <property name="fill">True</property> | |
169 | <property name="position">2</property> | |
170 | </packing> | |
171 | </child> | |
172 | <child> | |
173 | <object class="GtkModelButton" id="local_show_button"> | |
174 | <property name="visible">True</property> | |
175 | <property name="can_focus">True</property> | |
176 | <property name="receives_default">True</property> | |
177 | <property name="text" translatable="yes">_Show in File Manager</property> | |
178 | </object> | |
179 | <packing> | |
180 | <property name="expand">False</property> | |
181 | <property name="fill">True</property> | |
182 | <property name="position">3</property> | |
183 | </packing> | |
184 | </child> | |
185 | <child> | |
186 | <object class="GtkSeparator"> | |
187 | <property name="visible">True</property> | |
188 | <property name="can_focus">False</property> | |
189 | </object> | |
190 | <packing> | |
191 | <property name="expand">False</property> | |
192 | <property name="fill">True</property> | |
193 | <property name="position">4</property> | |
194 | </packing> | |
195 | </child> | |
196 | <child> | |
197 | <object class="GtkModelButton" id="local_rename_button"> | |
198 | <property name="visible">True</property> | |
199 | <property name="can_focus">True</property> | |
200 | <property name="receives_default">True</property> | |
201 | <property name="text" translatable="yes">_Rename</property> | |
202 | </object> | |
203 | <packing> | |
204 | <property name="expand">False</property> | |
205 | <property name="fill">True</property> | |
206 | <property name="position">5</property> | |
207 | </packing> | |
208 | </child> | |
209 | <child> | |
210 | <object class="GtkModelButton" id="local_delete_button"> | |
211 | <property name="visible">True</property> | |
212 | <property name="can_focus">True</property> | |
213 | <property name="receives_default">True</property> | |
214 | <property name="text" translatable="yes">_Delete</property> | |
215 | </object> | |
216 | <packing> | |
217 | <property name="expand">False</property> | |
218 | <property name="fill">True</property> | |
219 | <property name="position">6</property> | |
220 | </packing> | |
221 | </child> | |
222 | </object> | |
223 | <packing> | |
224 | <property name="submenu">main</property> | |
225 | </packing> | |
226 | </child> | |
227 | </object> | |
228 | <object class="GtkPopoverMenu" id="main_popover"> | |
168 | 229 | <property name="can_focus">False</property> |
169 | 230 | <property name="relative_to">menu_button</property> |
170 | 231 | <child> |
214 | 275 | </packing> |
215 | 276 | </child> |
216 | 277 | <child> |
278 | <object class="GtkModelButton" id="os_upgrade_button"> | |
279 | <property name="visible">True</property> | |
280 | <property name="can_focus">True</property> | |
281 | <property name="receives_default">True</property> | |
282 | <property name="text" translatable="yes">OS _Upgrade</property> | |
283 | </object> | |
284 | <packing> | |
285 | <property name="expand">False</property> | |
286 | <property name="fill">True</property> | |
287 | <property name="position">3</property> | |
288 | </packing> | |
289 | </child> | |
290 | <child> | |
291 | <object class="GtkSeparator"> | |
292 | <property name="visible">True</property> | |
293 | <property name="can_focus">False</property> | |
294 | </object> | |
295 | <packing> | |
296 | <property name="expand">False</property> | |
297 | <property name="fill">True</property> | |
298 | <property name="position">4</property> | |
299 | </packing> | |
300 | </child> | |
301 | <child> | |
217 | 302 | <object class="GtkModelButton" id="about_button"> |
218 | 303 | <property name="visible">True</property> |
219 | 304 | <property name="can_focus">True</property> |
223 | 308 | <packing> |
224 | 309 | <property name="expand">False</property> |
225 | 310 | <property name="fill">True</property> |
226 | <property name="position">3</property> | |
311 | <property name="position">5</property> | |
227 | 312 | </packing> |
228 | 313 | </child> |
229 | 314 | </object> |
249 | 334 | <property name="can_focus">True</property> |
250 | 335 | <property name="receives_default">True</property> |
251 | 336 | <property name="direction">none</property> |
252 | <property name="popover">elektroid_popmenu</property> | |
337 | <property name="popover">main_popover</property> | |
253 | 338 | <child> |
254 | 339 | <placeholder/> |
255 | 340 | </child> |
331 | 416 | <property name="visible">True</property> |
332 | 417 | <property name="can_focus">True</property> |
333 | 418 | <property name="receives_default">True</property> |
334 | <property name="tooltip_text" translatable="yes">Go to parent directory</property> | |
419 | <property name="tooltip_text" translatable="yes">Go to Parent Directory</property> | |
335 | 420 | <child> |
336 | 421 | <object class="GtkImage"> |
337 | 422 | <property name="visible">True</property> |
352 | 437 | <property name="visible">True</property> |
353 | 438 | <property name="can_focus">True</property> |
354 | 439 | <property name="receives_default">True</property> |
355 | <property name="tooltip_text" translatable="yes">Add directory</property> | |
440 | <property name="tooltip_text" translatable="yes">Add Directory</property> | |
356 | 441 | <child> |
357 | 442 | <object class="GtkImage"> |
358 | 443 | <property name="visible">True</property> |
373 | 458 | <property name="visible">True</property> |
374 | 459 | <property name="can_focus">True</property> |
375 | 460 | <property name="receives_default">True</property> |
376 | <property name="tooltip_text" translatable="yes">Refresh directory</property> | |
461 | <property name="tooltip_text" translatable="yes">Refresh Directory</property> | |
377 | 462 | <child> |
378 | 463 | <object class="GtkImage"> |
379 | 464 | <property name="visible">True</property> |
488 | 573 | <property name="visible">True</property> |
489 | 574 | <property name="can_focus">True</property> |
490 | 575 | <property name="receives_default">True</property> |
491 | <property name="tooltip_text" translatable="yes">Upload selection</property> | |
576 | <property name="tooltip_text" translatable="yes">Upload Selection</property> | |
492 | 577 | <child> |
493 | 578 | <object class="GtkImage"> |
494 | 579 | <property name="visible">True</property> |
509 | 594 | <property name="visible">True</property> |
510 | 595 | <property name="can_focus">True</property> |
511 | 596 | <property name="receives_default">True</property> |
512 | <property name="tooltip_text" translatable="yes">Download selection</property> | |
597 | <property name="tooltip_text" translatable="yes">Download Selection</property> | |
513 | 598 | <property name="always_show_image">True</property> |
514 | 599 | <child> |
515 | 600 | <object class="GtkImage"> |
570 | 655 | <property name="visible">True</property> |
571 | 656 | <property name="can_focus">True</property> |
572 | 657 | <property name="receives_default">True</property> |
573 | <property name="tooltip_text" translatable="yes">Go to parent directory</property> | |
658 | <property name="tooltip_text" translatable="yes">Go to Parent Directory</property> | |
574 | 659 | <child> |
575 | 660 | <object class="GtkImage"> |
576 | 661 | <property name="visible">True</property> |
591 | 676 | <property name="visible">True</property> |
592 | 677 | <property name="can_focus">True</property> |
593 | 678 | <property name="receives_default">True</property> |
594 | <property name="tooltip_text" translatable="yes">Add directory</property> | |
679 | <property name="tooltip_text" translatable="yes">Add Directory</property> | |
595 | 680 | <child> |
596 | 681 | <object class="GtkImage"> |
597 | 682 | <property name="visible">True</property> |
612 | 697 | <property name="visible">True</property> |
613 | 698 | <property name="can_focus">True</property> |
614 | 699 | <property name="receives_default">True</property> |
615 | <property name="tooltip_text" translatable="yes">Refresh directory</property> | |
700 | <property name="tooltip_text" translatable="yes">Refresh Directory</property> | |
616 | 701 | <child> |
617 | 702 | <object class="GtkImage"> |
618 | 703 | <property name="visible">True</property> |
743 | 828 | <property name="visible">True</property> |
744 | 829 | <property name="can_focus">True</property> |
745 | 830 | <property name="receives_default">True</property> |
746 | <property name="tooltip_text" translatable="yes">Refresh devices</property> | |
831 | <property name="tooltip_text" translatable="yes">Refresh Devices</property> | |
747 | 832 | <child> |
748 | 833 | <object class="GtkImage"> |
749 | 834 | <property name="visible">True</property> |
826 | 911 | <property name="visible">True</property> |
827 | 912 | <property name="can_focus">False</property> |
828 | 913 | <property name="valign">center</property> |
829 | <property name="label" translatable="yes" comments="It is recommended split the text in two lines if it is too long">Auto play</property> | |
914 | <property name="label" translatable="yes" comments="It is recommended to split the text in two lines if it is too long">Auto play</property> | |
830 | 915 | <property name="wrap">True</property> |
831 | 916 | </object> |
832 | 917 | <packing> |
1141 | 1226 | <property name="sensitive">False</property> |
1142 | 1227 | <property name="can_focus">True</property> |
1143 | 1228 | <property name="receives_default">True</property> |
1144 | <property name="tooltip_text" translatable="yes">Cancel running task</property> | |
1229 | <property name="tooltip_text" translatable="yes">Cancel Running Task</property> | |
1145 | 1230 | <child> |
1146 | 1231 | <object class="GtkImage"> |
1147 | 1232 | <property name="visible">True</property> |
1162 | 1247 | <property name="sensitive">False</property> |
1163 | 1248 | <property name="can_focus">True</property> |
1164 | 1249 | <property name="receives_default">True</property> |
1165 | <property name="tooltip_text" translatable="yes">Remove queued tasks</property> | |
1250 | <property name="tooltip_text" translatable="yes">Remove Queued Tasks</property> | |
1166 | 1251 | <child> |
1167 | 1252 | <object class="GtkImage"> |
1168 | 1253 | <property name="visible">True</property> |
1183 | 1268 | <property name="sensitive">False</property> |
1184 | 1269 | <property name="can_focus">True</property> |
1185 | 1270 | <property name="receives_default">True</property> |
1186 | <property name="tooltip_text" translatable="yes">Clear finished tasks</property> | |
1271 | <property name="tooltip_text" translatable="yes">Clear Finished Tasks</property> | |
1187 | 1272 | <child> |
1188 | 1273 | <object class="GtkImage"> |
1189 | 1274 | <property name="visible">True</property> |
1419 | 1504 | </object> |
1420 | 1505 | </child> |
1421 | 1506 | </object> |
1507 | <object class="GtkPopoverMenu" id="remote_popover"> | |
1508 | <property name="can_focus">False</property> | |
1509 | <property name="relative_to">remote_tree_view</property> | |
1510 | <property name="position">bottom</property> | |
1511 | <child> | |
1512 | <object class="GtkBox"> | |
1513 | <property name="visible">True</property> | |
1514 | <property name="can_focus">False</property> | |
1515 | <property name="margin_left">9</property> | |
1516 | <property name="margin_right">9</property> | |
1517 | <property name="margin_top">9</property> | |
1518 | <property name="margin_bottom">9</property> | |
1519 | <property name="orientation">vertical</property> | |
1520 | <child> | |
1521 | <object class="GtkModelButton" id="remote_rename_button"> | |
1522 | <property name="visible">True</property> | |
1523 | <property name="can_focus">True</property> | |
1524 | <property name="receives_default">True</property> | |
1525 | <property name="text" translatable="yes">_Rename</property> | |
1526 | </object> | |
1527 | <packing> | |
1528 | <property name="expand">False</property> | |
1529 | <property name="fill">True</property> | |
1530 | <property name="position">0</property> | |
1531 | </packing> | |
1532 | </child> | |
1533 | <child> | |
1534 | <object class="GtkModelButton" id="remote_delete_button"> | |
1535 | <property name="visible">True</property> | |
1536 | <property name="can_focus">True</property> | |
1537 | <property name="receives_default">True</property> | |
1538 | <property name="text" translatable="yes">_Delete</property> | |
1539 | </object> | |
1540 | <packing> | |
1541 | <property name="expand">False</property> | |
1542 | <property name="fill">True</property> | |
1543 | <property name="position">1</property> | |
1544 | </packing> | |
1545 | </child> | |
1546 | </object> | |
1547 | <packing> | |
1548 | <property name="submenu">main</property> | |
1549 | <property name="position">1</property> | |
1550 | </packing> | |
1551 | </child> | |
1552 | </object> | |
1422 | 1553 | </interface> |
0 | 0 | PKG_CONFIG ?= pkg-config |
1 | 1 | |
2 | AM_CFLAGS = -I$(top_srcdir)/src `$(PKG_CONFIG) --cflags alsa gtk+-3.0 libpulse libpulse-mainloop-glib` $(SNDFILE_CFLAGS) $(SAMPLERATE_CFLAGS) | |
3 | elektroid_LDFLAGS = `$(PKG_CONFIG) --libs alsa gtk+-3.0 libpulse libpulse-mainloop-glib` $(SNDFILE_LIBS) $(SAMPLERATE_LIBS) | |
4 | elektroid_cli_LDFLAGS = `$(PKG_CONFIG) --libs alsa glib-2.0` $(SNDFILE_LIBS) $(SAMPLERATE_LIBS) | |
2 | AM_CFLAGS = -I$(top_srcdir)/src `$(PKG_CONFIG) --cflags alsa gtk+-3.0 libpulse libpulse-mainloop-glib zlib` $(SNDFILE_CFLAGS) $(SAMPLERATE_CFLAGS) | |
3 | elektroid_LDFLAGS = `$(PKG_CONFIG) --libs alsa gtk+-3.0 libpulse libpulse-mainloop-glib zlib` $(SNDFILE_LIBS) $(SAMPLERATE_LIBS) | |
4 | elektroid_cli_LDFLAGS = `$(PKG_CONFIG) --libs alsa glib-2.0 zlib` $(SNDFILE_LIBS) $(SAMPLERATE_LIBS) | |
5 | 5 | |
6 | 6 | bin_PROGRAMS = elektroid elektroid-cli |
7 | 7 | elektroid_SOURCES = elektroid.c browser.c connector.c audio.c utils.c sample.c |
14 | 14 | SAMPLERATE_LIBS = @SAMPLERATE_LIBS@ |
15 | 15 | |
16 | 16 | AM_CPPFLAGS = -Wall -O3 -DDATADIR='"$(datadir)"' -DLOCALEDIR=\""$(localedir)"\" |
17 | ||
18 | include_HEADERS = audio.h browser.h connector.h sample.h utils.h |
46 | 46 | gshort *v; |
47 | 47 | gint i; |
48 | 48 | |
49 | if (!audio->sample->len) | |
50 | { | |
51 | return; | |
52 | } | |
53 | ||
54 | 49 | //XXX: Until a better solution is found this corks the stream without using neither drain nor empty buffers (CPU) |
55 | 50 | if (audio->release_frames > PA_BUFFER_LEN) |
56 | 51 | { |
62 | 57 | debug_print (2, "Writing %2d frames...\n", req_frames); |
63 | 58 | pa_stream_begin_write (stream, &buffer, &size); |
64 | 59 | |
60 | g_mutex_lock (&audio->mutex); | |
61 | ||
62 | if (!audio->sample->len) | |
63 | { | |
64 | g_mutex_unlock (&audio->mutex); | |
65 | pa_stream_cancel_write (stream); | |
66 | debug_print (2, "Canceled\n"); | |
67 | return; | |
68 | } | |
69 | ||
65 | 70 | if (audio->pos == audio->sample->len && !audio->loop) |
66 | 71 | { |
67 | v = buffer; | |
68 | for (i = 0; i < req_frames; i++) | |
69 | { | |
70 | *v = 0; | |
71 | v++; | |
72 | } | |
72 | g_mutex_unlock (&audio->mutex); | |
73 | memset (buffer, 0, size); | |
73 | 74 | pa_stream_write (stream, buffer, size, NULL, 0, PA_SEEK_RELATIVE); |
74 | 75 | audio->release_frames += req_frames; |
75 | 76 | return; |
98 | 99 | v++; |
99 | 100 | } |
100 | 101 | |
102 | g_mutex_unlock (&audio->mutex); | |
103 | ||
101 | 104 | pa_stream_write (stream, buffer, i * 2, NULL, 0, PA_SEEK_RELATIVE); |
102 | 105 | } |
103 | 106 | |
140 | 143 | } |
141 | 144 | |
142 | 145 | audio_stop (audio, TRUE); |
146 | ||
143 | 147 | debug_print (1, "Playing audio...\n"); |
148 | ||
149 | g_mutex_lock (&audio->mutex); | |
144 | 150 | audio->pos = 0; |
145 | 151 | audio->release_frames = 0; |
152 | g_mutex_unlock (&audio->mutex); | |
146 | 153 | |
147 | 154 | operation = pa_stream_cork (audio->stream, 0, NULL, NULL); |
148 | 155 | if (operation != NULL) |
238 | 245 | } |
239 | 246 | } |
240 | 247 | |
241 | int | |
248 | gint | |
242 | 249 | audio_init (struct audio *audio, void (*set_volume_gui_callback) (gdouble)) |
243 | 250 | { |
244 | 251 | pa_mainloop_api *api; |
245 | int err = 0; | |
252 | gint err = 0; | |
246 | 253 | |
247 | 254 | debug_print (1, "Initializing audio...\n"); |
248 | 255 | |
292 | 299 | } |
293 | 300 | } |
294 | 301 | |
295 | int | |
302 | gboolean | |
296 | 303 | audio_check (struct audio *audio) |
297 | 304 | { |
298 | return audio->mainloop ? 1 : 0; | |
305 | return audio->mainloop ? TRUE : FALSE; | |
299 | 306 | } |
300 | 307 | |
301 | 308 | void |
302 | 309 | audio_reset_sample (struct audio *audio) |
303 | 310 | { |
311 | g_mutex_lock (&audio->mutex); | |
304 | 312 | g_array_set_size (audio->sample, 0); |
305 | 313 | audio->pos = 0; |
314 | g_mutex_unlock (&audio->mutex); | |
306 | 315 | } |
307 | 316 | |
308 | 317 | void |
34 | 34 | uint32_t index; |
35 | 35 | void (*set_volume_gui_callback) (gdouble); |
36 | 36 | gint release_frames; |
37 | GMutex mutex; | |
38 | gboolean load_active; | |
37 | 39 | }; |
38 | 40 | |
39 | 41 | void audio_play (struct audio *); |
40 | 42 | |
41 | 43 | void audio_stop (struct audio *, gboolean); |
42 | 44 | |
43 | int audio_check (struct audio *); | |
45 | gboolean audio_check (struct audio *); | |
44 | 46 | |
45 | int audio_init (struct audio *, void (*)(gdouble)); | |
47 | gint audio_init (struct audio *, void (*)(gdouble)); | |
46 | 48 | |
47 | 49 | void audio_destroy (struct audio *); |
48 | 50 |
32 | 32 | gint (*delete) (const gchar *, const gchar); |
33 | 33 | gboolean (*load_dir) (gpointer); |
34 | 34 | gboolean (*check_selection) (gpointer); |
35 | void (*set_up_popover) (gint); | |
35 | 36 | GtkTreeView *view; |
36 | 37 | GtkWidget *up_button; |
37 | 38 | GtkWidget *add_dir_button; |
38 | 39 | GtkWidget *refresh_button; |
39 | 40 | GtkEntry *dir_entry; |
40 | 41 | gchar *dir; |
42 | GtkPopover *popover; | |
41 | 43 | }; |
42 | 44 | |
43 | 45 | gint browser_sort (GtkTreeModel *, GtkTreeIter *, GtkTreeIter *, gpointer); |
21 | 21 | #include <math.h> |
22 | 22 | #include <netinet/in.h> |
23 | 23 | #include <byteswap.h> |
24 | #include <time.h> | |
24 | #include <sys/poll.h> | |
25 | #include <zlib.h> | |
25 | 26 | #include "connector.h" |
26 | 27 | #include "utils.h" |
27 | 28 | |
28 | #define BUFF_SIZE 512 | |
29 | #define TRANSF_BLOCK_SIZE 0x2000 | |
29 | #define KB 1024 | |
30 | #define BUFF_SIZE (4 * KB) | |
31 | #define RING_BUFF_SIZE (256 * KB) | |
32 | #define TRANSF_BLOCK_SIZE_SAMPLE 0x2000 | |
33 | #define TRANSF_BLOCK_SIZE_OS 0x800 | |
34 | #define POLL_TIMEOUT 20 | |
35 | #define REST_TIME 50000 | |
30 | 36 | |
31 | 37 | static const guint8 MSG_HEADER[] = { 0xf0, 0, 0x20, 0x3c, 0x10, 0 }; |
32 | 38 | |
33 | 39 | static const guint8 INQ_DEVICE[] = { 0x1 }; |
34 | 40 | static const guint8 INQ_VERSION[] = { 0x2 }; |
41 | static const guint8 INQ_UID[] = { 0x3 }; | |
35 | 42 | static const guint8 INQ_LS_DIR_TEMPLATE[] = { 0x10 }; |
36 | 43 | static const guint8 INQ_NEW_DIR_TEMPLATE[] = { 0x11 }; |
37 | 44 | static const guint8 INQ_DELETE_DIR_TEMPLATE[] = { 0x12 }; |
54 | 61 | { 0x42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
55 | 62 | static const guint8 INQ_UPL_TEMPLATE_END[] = { 0x41, 0, 0, 0, 0, 0, 0, 0, 0 }; |
56 | 63 | |
57 | static gint | |
64 | static const guint8 INQ_OS_UPGRADE_START[] = | |
65 | { 0x50, 0, 0, 0, 0, 's', 'y', 's', 'e', 'x', '\0', 1 }; | |
66 | static const guint8 INQ_OS_UPGRADE_WRITE[] = | |
67 | { 0x51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; | |
68 | ||
69 | static guchar | |
58 | 70 | connector_get_msg_status (const GByteArray * msg) |
59 | 71 | { |
60 | 72 | return msg->data[5]; |
73 | } | |
74 | ||
75 | static gchar * | |
76 | connector_get_msg_string (const GByteArray * msg) | |
77 | { | |
78 | return (gchar *) & msg->data[6]; | |
61 | 79 | } |
62 | 80 | |
63 | 81 | void |
90 | 108 | connector_get_next_dentry (struct connector_dir_iterator *dir_iterator) |
91 | 109 | { |
92 | 110 | uint32_t *data; |
111 | gchar *dentry_cp1252; | |
112 | ||
113 | if (dir_iterator->dentry != NULL) | |
114 | { | |
115 | g_free (dir_iterator->dentry); | |
116 | } | |
93 | 117 | |
94 | 118 | if (dir_iterator->pos == dir_iterator->msg->len) |
95 | 119 | { |
109 | 133 | dir_iterator->type = dir_iterator->msg->data[dir_iterator->pos]; |
110 | 134 | |
111 | 135 | dir_iterator->pos++; |
136 | dentry_cp1252 = (gchar *) & dir_iterator->msg->data[dir_iterator->pos]; | |
112 | 137 | dir_iterator->dentry = |
113 | (gchar *) & dir_iterator->msg->data[dir_iterator->pos]; | |
138 | g_convert (dentry_cp1252, -1, "UTF8", "CP1252", NULL, NULL, NULL); | |
114 | 139 | |
115 | 140 | while (dir_iterator->pos < dir_iterator->msg->len |
116 | 141 | && dir_iterator->msg->data[dir_iterator->pos] != 0) |
392 | 417 | |
393 | 418 | if (!connector->outputp) |
394 | 419 | { |
395 | fprintf (stderr, __FILE__ ": Output port is NULL\n"); | |
420 | error_print ("Output port is NULL\n"); | |
396 | 421 | return -1; |
397 | 422 | } |
398 | 423 | |
399 | if ((tx_len = snd_rawmidi_write (connector->outputp, data, len)) < 0) | |
400 | { | |
401 | fprintf (stderr, __FILE__ ": Error while sending message. %s.\n", | |
402 | g_strerror (errno)); | |
424 | snd_rawmidi_read (connector->inputp, NULL, 0); // trigger reading | |
425 | ||
426 | tx_len = snd_rawmidi_write (connector->outputp, data, len); | |
427 | if (tx_len < 0) | |
428 | { | |
429 | error_print ("Error while sending message. %s.\n", g_strerror (errno)); | |
403 | 430 | connector_destroy (connector); |
404 | 431 | return tx_len; |
405 | 432 | } |
407 | 434 | } |
408 | 435 | |
409 | 436 | ssize_t |
410 | connector_tx_sysex (struct connector *connector, | |
437 | connector_tx_sysex (struct connector *connector, GByteArray * data, | |
411 | 438 | struct connector_sysex_transfer *transfer) |
412 | 439 | { |
413 | 440 | ssize_t tx_len; |
414 | 441 | guint total; |
415 | 442 | guint len; |
416 | guchar *data; | |
417 | ssize_t ret = transfer->data->len; | |
443 | guchar *b; | |
444 | ssize_t ret = data->len; | |
418 | 445 | |
419 | 446 | transfer->status = SENDING; |
420 | 447 | |
421 | data = transfer->data->data; | |
448 | b = data->data; | |
422 | 449 | total = 0; |
423 | while (total < transfer->data->len && transfer->active) | |
424 | { | |
425 | len = | |
426 | transfer->data->len - total > | |
427 | BUFF_SIZE ? BUFF_SIZE : transfer->data->len - total; | |
428 | if ((tx_len = connector_tx_raw (connector, data, len)) < 0) | |
450 | while (total < data->len && transfer->active) | |
451 | { | |
452 | len = data->len - total; | |
453 | if (len > BUFF_SIZE) | |
454 | { | |
455 | len = BUFF_SIZE; | |
456 | } | |
457 | ||
458 | tx_len = connector_tx_raw (connector, b, len); | |
459 | if (tx_len < 0) | |
429 | 460 | { |
430 | 461 | ret = tx_len; |
431 | goto cleanup; | |
432 | } | |
433 | data += len; | |
462 | break; | |
463 | } | |
464 | b += len; | |
434 | 465 | total += len; |
435 | 466 | } |
436 | 467 | |
437 | cleanup: | |
438 | debug_print (1, "Raw message sent: "); | |
439 | debug_print_hex_msg (transfer->data); | |
440 | 468 | transfer->active = FALSE; |
441 | 469 | transfer->status = FINISHED; |
442 | 470 | return ret; |
448 | 476 | ssize_t ret; |
449 | 477 | uint16_t aux; |
450 | 478 | GByteArray *sysex; |
479 | GByteArray *data; | |
451 | 480 | struct connector_sysex_transfer transfer; |
481 | gchar *text; | |
452 | 482 | |
453 | 483 | aux = htons (connector->seq); |
454 | 484 | memcpy (msg->data, &aux, sizeof (uint16_t)); |
461 | 491 | connector->seq++; |
462 | 492 | } |
463 | 493 | |
464 | transfer.data = g_byte_array_new (); | |
465 | g_byte_array_append (transfer.data, MSG_HEADER, sizeof (MSG_HEADER)); | |
494 | transfer.active = TRUE; | |
495 | data = g_byte_array_new (); | |
496 | g_byte_array_append (data, MSG_HEADER, sizeof (MSG_HEADER)); | |
466 | 497 | sysex = connector_msg_to_sysex (msg); |
467 | g_byte_array_append (transfer.data, sysex->data, sysex->len); | |
498 | g_byte_array_append (data, sysex->data, sysex->len); | |
468 | 499 | free_msg (sysex); |
469 | g_byte_array_append (transfer.data, (guint8 *) "\xf7", 1); | |
470 | ||
471 | ret = connector_tx_sysex (connector, &transfer); | |
500 | g_byte_array_append (data, (guint8 *) "\xf7", 1); | |
501 | ||
502 | ret = connector_tx_sysex (connector, data, &transfer); | |
472 | 503 | |
473 | 504 | if (ret >= 0) |
474 | 505 | { |
475 | debug_print (1, "Message sent: "); | |
476 | debug_print_hex_msg (msg); | |
477 | } | |
478 | ||
479 | free_msg (transfer.data); | |
506 | if (debug_level > 1) | |
507 | { | |
508 | text = debug_get_hex_msg (data); | |
509 | debug_print (2, "Raw message sent (%d): %s\n", data->len, text); | |
510 | free (text); | |
511 | } | |
512 | ||
513 | text = debug_get_hex_msg (msg); | |
514 | debug_print (1, "Message sent (%d): %s\n", msg->len, text); | |
515 | free (text); | |
516 | } | |
517 | ||
518 | free_msg (data); | |
480 | 519 | return ret; |
520 | } | |
521 | ||
522 | void | |
523 | connector_rx_drain (struct connector *connector) | |
524 | { | |
525 | debug_print (2, "Draining buffer...\n"); | |
526 | connector->rx_len = 0; | |
527 | snd_rawmidi_drain (connector->inputp); | |
528 | } | |
529 | ||
530 | static gboolean | |
531 | connector_is_rt_msg (guint8 * data, guint len) | |
532 | { | |
533 | guint i; | |
534 | guint8 *b; | |
535 | ||
536 | for (i = 0, b = data; i < len; i++, b++) | |
537 | { | |
538 | if (*b < 0xf8) //Not System Real-Time Messages | |
539 | { | |
540 | return FALSE; | |
541 | } | |
542 | } | |
543 | ||
544 | return TRUE; | |
481 | 545 | } |
482 | 546 | |
483 | 547 | static ssize_t |
485 | 549 | struct connector_sysex_transfer *transfer) |
486 | 550 | { |
487 | 551 | ssize_t rx_len; |
488 | time_t start; | |
552 | guint total_time; | |
553 | unsigned short revents; | |
554 | gint err; | |
555 | gchar *text; | |
489 | 556 | |
490 | 557 | if (!connector->inputp) |
491 | 558 | { |
492 | fprintf (stderr, __FILE__ ": Input port is NULL\n"); | |
559 | error_print ("Input port is NULL\n"); | |
493 | 560 | return -1; |
494 | 561 | } |
495 | 562 | |
496 | start = time (NULL); | |
497 | ||
498 | while ((rx_len = snd_rawmidi_read (connector->inputp, data, len)) < 0) | |
499 | { | |
500 | if (rx_len == -EAGAIN) | |
501 | { | |
502 | if (transfer->active) | |
563 | total_time = 0; | |
564 | ||
565 | while (1) | |
566 | { | |
567 | err = poll (connector->pfds, connector->npfds, POLL_TIMEOUT); | |
568 | ||
569 | if (!transfer->active) | |
570 | { | |
571 | return -ENODATA; | |
572 | } | |
573 | ||
574 | if (err == 0) | |
575 | { | |
576 | total_time += POLL_TIMEOUT; | |
577 | if (((transfer->batch && transfer->status == RECEIVING) | |
578 | || !transfer->batch) && transfer->timeout > -1 | |
579 | && total_time >= transfer->timeout) | |
503 | 580 | { |
504 | if (transfer->timeout && (time (NULL) - start > 5)) | |
505 | { | |
506 | return -ENODATA; | |
507 | } | |
581 | debug_print (1, "Timeout!\n"); | |
582 | return -ENODATA; | |
583 | } | |
584 | continue; | |
585 | } | |
586 | ||
587 | if (err < 0) | |
588 | { | |
589 | error_print ("Error while polling. %s.\n", g_strerror (errno)); | |
590 | connector_destroy (connector); | |
591 | return err; | |
592 | } | |
593 | ||
594 | if ((err = | |
595 | snd_rawmidi_poll_descriptors_revents (connector->inputp, | |
596 | connector->pfds, | |
597 | connector->npfds, | |
598 | &revents)) < 0) | |
599 | { | |
600 | error_print ("Error while getting poll events. %s.\n", | |
601 | g_strerror (errno)); | |
602 | connector_destroy (connector); | |
603 | return err; | |
604 | } | |
605 | ||
606 | if (revents & (POLLERR | POLLHUP)) | |
607 | { | |
608 | return -ENODATA; | |
609 | } | |
610 | ||
611 | if (!(revents & POLLIN)) | |
612 | { | |
613 | continue; | |
614 | } | |
615 | ||
616 | rx_len = snd_rawmidi_read (connector->inputp, data, len); | |
617 | ||
618 | if (rx_len == -EAGAIN || rx_len == 0) | |
619 | { | |
620 | continue; | |
621 | } | |
622 | ||
623 | if (rx_len > 0) | |
624 | { | |
625 | if (connector_is_rt_msg (data, rx_len)) | |
626 | { | |
508 | 627 | continue; |
509 | 628 | } |
510 | else | |
629 | break; | |
630 | } | |
631 | ||
632 | if (rx_len < 0) | |
633 | { | |
634 | error_print ("Error while receiving message. %s.\n", | |
635 | g_strerror (errno)); | |
636 | connector_destroy (connector); | |
637 | break; | |
638 | } | |
639 | ||
640 | } | |
641 | ||
642 | if (debug_level > 1) | |
643 | { | |
644 | text = debug_get_hex_data (3, data, rx_len); | |
645 | debug_print (1, "Buffer content (%zu): %s\n", rx_len, text); | |
646 | free (text); | |
647 | } | |
648 | ||
649 | return rx_len; | |
650 | } | |
651 | ||
652 | GByteArray * | |
653 | connector_rx_sysex (struct connector *connector, | |
654 | struct connector_sysex_transfer *transfer) | |
655 | { | |
656 | gint i; | |
657 | guint8 *b; | |
658 | GByteArray *sysex = g_byte_array_new (); | |
659 | ||
660 | transfer->status = WAITING; | |
661 | ||
662 | i = 0; | |
663 | if (connector->rx_len < 0) | |
664 | { | |
665 | connector->rx_len = 0; | |
666 | } | |
667 | b = connector->buffer; | |
668 | ||
669 | while (1) | |
670 | { | |
671 | if (i == connector->rx_len) | |
672 | { | |
673 | connector->rx_len = | |
674 | connector_rx_raw (connector, connector->buffer, BUFF_SIZE, | |
675 | transfer); | |
676 | ||
677 | if (connector->rx_len == -ENODATA) | |
678 | { | |
679 | goto error; | |
680 | } | |
681 | ||
682 | if (connector->rx_len < 0) | |
683 | { | |
684 | goto error; | |
685 | } | |
686 | ||
687 | b = connector->buffer; | |
688 | i = 0; | |
689 | } | |
690 | ||
691 | while (i < connector->rx_len && *b != 0xf0) | |
692 | { | |
693 | b++; | |
694 | i++; | |
695 | } | |
696 | ||
697 | if (i < connector->rx_len) | |
698 | { | |
699 | break; | |
700 | } | |
701 | } | |
702 | ||
703 | g_byte_array_append (sysex, b, 1); | |
704 | b++; | |
705 | i++; | |
706 | transfer->status = RECEIVING; | |
707 | ||
708 | while (1) | |
709 | { | |
710 | if (i == connector->rx_len) | |
711 | { | |
712 | connector->rx_len = | |
713 | connector_rx_raw (connector, connector->buffer, BUFF_SIZE, | |
714 | transfer); | |
715 | ||
716 | if (connector->rx_len == -ENODATA && transfer->batch) | |
511 | 717 | { |
512 | 718 | break; |
513 | 719 | } |
514 | } | |
515 | fprintf (stderr, __FILE__ ": Error while receiving message. %s.\n", | |
516 | g_strerror (errno)); | |
517 | connector_destroy (connector); | |
518 | break; | |
519 | } | |
520 | ||
521 | return rx_len; | |
522 | } | |
523 | ||
524 | GByteArray * | |
525 | connector_rx_sysex (struct connector *connector, | |
526 | struct connector_sysex_transfer *transfer) | |
527 | { | |
528 | ssize_t rx_len; | |
529 | guint8 buffer; | |
530 | GByteArray *sysex = g_byte_array_new (); | |
531 | ||
532 | transfer->status = WAITING; | |
533 | ||
534 | do | |
535 | { | |
536 | if ((rx_len = connector_rx_raw (connector, &buffer, 1, transfer)) < 0) | |
537 | { | |
538 | goto error; | |
539 | } | |
540 | } | |
541 | while (rx_len == 0 || (rx_len == 1 && buffer != 0xf0)); | |
542 | ||
543 | g_byte_array_append (sysex, &buffer, rx_len); | |
544 | transfer->status = RECEIVING; | |
545 | ||
546 | do | |
547 | { | |
548 | if ((rx_len = connector_rx_raw (connector, &buffer, 1, transfer)) < 0) | |
549 | { | |
550 | goto error; | |
551 | } | |
552 | g_byte_array_append (sysex, &buffer, rx_len); | |
553 | } | |
554 | while (rx_len == 0 || (rx_len > 0 && buffer != 0xf7)); | |
555 | ||
556 | debug_print (1, "Raw message received: "); | |
557 | debug_print_hex_msg (sysex); | |
720 | ||
721 | if (connector->rx_len < 0) | |
722 | { | |
723 | goto error; | |
724 | } | |
725 | ||
726 | b = connector->buffer; | |
727 | i = 0; | |
728 | } | |
729 | ||
730 | while (i < connector->rx_len && (*b != 0xf7 || transfer->batch)) | |
731 | { | |
732 | if (!connector_is_rt_msg (b, 1)) | |
733 | { | |
734 | g_byte_array_append (sysex, b, 1); | |
735 | } | |
736 | b++; | |
737 | i++; | |
738 | } | |
739 | ||
740 | if (i < connector->rx_len) | |
741 | { | |
742 | g_byte_array_append (sysex, b, 1); | |
743 | connector->rx_len = connector->rx_len - i - 1; | |
744 | if (connector->rx_len > 0) | |
745 | { | |
746 | memmove (connector->buffer, &connector->buffer[i + 1], | |
747 | connector->rx_len); | |
748 | } | |
749 | break; | |
750 | } | |
751 | ||
752 | } | |
753 | ||
558 | 754 | goto end; |
559 | 755 | |
560 | 756 | error: |
572 | 768 | GByteArray *msg; |
573 | 769 | GByteArray *sysex; |
574 | 770 | struct connector_sysex_transfer transfer; |
771 | gchar *text; | |
575 | 772 | |
576 | 773 | transfer.active = TRUE; |
577 | transfer.timeout = TRUE; | |
774 | transfer.timeout = SYSEX_TIMEOUT; | |
775 | transfer.batch = FALSE; | |
776 | ||
578 | 777 | sysex = connector_rx_sysex (connector, &transfer); |
579 | 778 | if (!sysex) |
580 | 779 | { |
581 | 780 | return NULL; |
582 | 781 | } |
583 | while (sysex->data[0] != MSG_HEADER[0] | |
584 | || sysex->data[1] != MSG_HEADER[1] | |
585 | || sysex->data[2] != MSG_HEADER[2] | |
586 | || sysex->data[3] != MSG_HEADER[3] | |
587 | || sysex->data[4] != MSG_HEADER[4] | |
588 | || sysex->data[5] != MSG_HEADER[5]) | |
589 | { | |
590 | debug_print (1, "Skipping message...\n"); | |
591 | debug_print (1, "Message skipped: "); | |
592 | debug_print_hex_msg (sysex); | |
782 | while (sysex->len < 12 | |
783 | || (sysex->len >= 12 | |
784 | && (sysex->data[0] != MSG_HEADER[0] | |
785 | || sysex->data[1] != MSG_HEADER[1] | |
786 | || sysex->data[2] != MSG_HEADER[2] | |
787 | || sysex->data[3] != MSG_HEADER[3] | |
788 | || sysex->data[4] != MSG_HEADER[4] | |
789 | || sysex->data[5] != MSG_HEADER[5]))) | |
790 | { | |
791 | if (debug_level > 1) | |
792 | { | |
793 | text = debug_get_hex_msg (sysex); | |
794 | debug_print (2, "Message skipped (%d): %s\n", sysex->len, text); | |
795 | free (text); | |
796 | } | |
593 | 797 | free_msg (sysex); |
594 | 798 | |
595 | 799 | transfer.active = TRUE; |
600 | 804 | } |
601 | 805 | } |
602 | 806 | |
807 | if (debug_level > 1) | |
808 | { | |
809 | text = debug_get_hex_msg (sysex); | |
810 | debug_print (2, "Raw message received (%d): %s\n", sysex->len, text); | |
811 | free (text); | |
812 | } | |
813 | ||
603 | 814 | msg = connector_get_msg_payload (sysex); |
604 | 815 | if (msg) |
605 | 816 | { |
606 | debug_print (1, "Message received: "); | |
607 | debug_print_hex_msg (msg); | |
817 | text = debug_get_hex_msg (msg); | |
818 | debug_print (1, "Message received (%d): %s\n", msg->len, text); | |
819 | free (text); | |
608 | 820 | } |
609 | 821 | |
610 | 822 | free_msg (sysex); |
618 | 830 | GByteArray *rx_msg; |
619 | 831 | |
620 | 832 | g_mutex_lock (&connector->mutex); |
833 | ||
834 | connector_rx_drain (connector); | |
621 | 835 | |
622 | 836 | len = connector_tx (connector, tx_msg); |
623 | 837 | if (len < 0) |
639 | 853 | { |
640 | 854 | GByteArray *tx_msg; |
641 | 855 | GByteArray *rx_msg; |
642 | ||
643 | tx_msg = connector_new_msg_dir_list (dir); | |
856 | gchar *dir_cp1252 = g_convert (dir, -1, "CP1252", "UTF8", NULL, NULL, NULL); | |
857 | ||
858 | if (!dir_cp1252) | |
859 | { | |
860 | return NULL; | |
861 | } | |
862 | ||
863 | tx_msg = connector_new_msg_dir_list (dir_cp1252); | |
864 | g_free (dir_cp1252); | |
865 | ||
644 | 866 | rx_msg = connector_tx_and_rx (connector, tx_msg); |
645 | 867 | if (!rx_msg) |
646 | 868 | { |
658 | 880 | GByteArray *rx_msg; |
659 | 881 | GByteArray *tx_msg = connector_new_msg_data (INQ_RENAME_TEMPLATE, |
660 | 882 | sizeof (INQ_RENAME_TEMPLATE)); |
661 | ||
662 | g_byte_array_append (tx_msg, (guchar *) old, strlen (old)); | |
883 | gchar *new_cp1252 = g_convert (new, -1, "CP1252", "UTF8", NULL, NULL, NULL); | |
884 | if (!new_cp1252) | |
885 | { | |
886 | errno = EINVAL; | |
887 | return -1; | |
888 | } | |
889 | ||
890 | gchar *old_cp1252 = g_convert (old, -1, "CP1252", "UTF8", NULL, NULL, NULL); | |
891 | if (!old_cp1252) | |
892 | { | |
893 | g_free (new_cp1252); | |
894 | errno = EINVAL; | |
895 | return -1; | |
896 | } | |
897 | ||
898 | g_byte_array_append (tx_msg, (guchar *) old_cp1252, strlen (old_cp1252)); | |
663 | 899 | g_byte_array_append (tx_msg, (guchar *) "\0", 1); |
664 | g_byte_array_append (tx_msg, (guchar *) new, strlen (new)); | |
900 | g_byte_array_append (tx_msg, (guchar *) new_cp1252, strlen (new_cp1252)); | |
665 | 901 | g_byte_array_append (tx_msg, (guchar *) "\0", 1); |
902 | ||
903 | g_free (old_cp1252); | |
904 | g_free (new_cp1252); | |
666 | 905 | |
667 | 906 | rx_msg = connector_tx_and_rx (connector, tx_msg); |
668 | 907 | if (!rx_msg) |
679 | 918 | { |
680 | 919 | res = -1; |
681 | 920 | errno = EPERM; |
682 | fprintf (stderr, "%s\n", g_strerror (errno)); | |
921 | error_print ("%s\n", g_strerror (errno)); | |
683 | 922 | } |
684 | 923 | free_msg (rx_msg); |
685 | 924 | |
692 | 931 | { |
693 | 932 | gint res; |
694 | 933 | GByteArray *rx_msg; |
695 | GByteArray *tx_msg = connector_new_msg_path (template, size, path); | |
934 | GByteArray *tx_msg; | |
935 | gchar *path_cp1252 = | |
936 | g_convert (path, -1, "CP1252", "UTF8", NULL, NULL, NULL); | |
937 | ||
938 | if (!path_cp1252) | |
939 | { | |
940 | errno = EINVAL; | |
941 | return -1; | |
942 | } | |
943 | ||
944 | tx_msg = connector_new_msg_path (template, size, path_cp1252); | |
945 | g_free (path_cp1252); | |
696 | 946 | |
697 | 947 | rx_msg = connector_tx_and_rx (connector, tx_msg); |
698 | 948 | if (!rx_msg) |
709 | 959 | { |
710 | 960 | res = -1; |
711 | 961 | errno = EPERM; |
712 | fprintf (stderr, "%s\n", g_strerror (errno)); | |
962 | error_print ("%s\n", g_strerror (errno)); | |
713 | 963 | } |
714 | 964 | free_msg (rx_msg); |
715 | 965 | |
737 | 987 | GByteArray *tx_msg; |
738 | 988 | GByteArray *rx_msg; |
739 | 989 | gint id; |
740 | ||
741 | tx_msg = connector_new_msg_new_upload (path, fsize); | |
990 | gchar *path_cp1252 = | |
991 | g_convert (path, -1, "CP1252", "UTF8", NULL, NULL, NULL); | |
992 | ||
993 | if (!path_cp1252) | |
994 | { | |
995 | errno = EINVAL; | |
996 | return -1; | |
997 | } | |
998 | ||
999 | tx_msg = connector_new_msg_new_upload (path_cp1252, fsize); | |
1000 | g_free (path_cp1252); | |
742 | 1001 | rx_msg = connector_tx_and_rx (connector, tx_msg); |
743 | 1002 | if (!rx_msg) |
744 | 1003 | { |
745 | 1004 | errno = EIO; |
746 | 1005 | return -1; |
747 | 1006 | } |
1007 | ||
748 | 1008 | //Response: x, x, x, x, 0xc0, [0 (error), 1 (success)], id, frames |
749 | 1009 | connector_get_sample_info_from_msg (rx_msg, &id, NULL); |
750 | 1010 | if (id < 0) |
751 | 1011 | { |
752 | 1012 | errno = EEXIST; |
753 | fprintf (stderr, "%s\n", g_strerror (errno)); | |
1013 | error_print ("%s\n", g_strerror (errno)); | |
754 | 1014 | } |
755 | 1015 | free_msg (rx_msg); |
756 | 1016 | |
759 | 1019 | |
760 | 1020 | ssize_t |
761 | 1021 | connector_upload (struct connector *connector, GArray * sample, |
762 | gchar * path, gint * running, void (*progress) (gdouble)) | |
1022 | gchar * path, struct connector_sample_transfer *transfer, | |
1023 | void (*progress) (gdouble)) | |
763 | 1024 | { |
764 | 1025 | GByteArray *tx_msg; |
765 | 1026 | GByteArray *rx_msg; |
767 | 1028 | gshort *data; |
768 | 1029 | gint id; |
769 | 1030 | int i; |
1031 | gboolean active; | |
770 | 1032 | |
771 | 1033 | //TODO: check if the file already exists? (Device makes no difference between creating a new file and creating an already existent file. The new file would be deleted if an upload is not sent, though.) |
772 | 1034 | //TODO: limit sample upload? |
780 | 1042 | data = (gshort *) sample->data; |
781 | 1043 | transferred = 0; |
782 | 1044 | i = 0; |
783 | while (transferred < sample->len && (!running || *running)) | |
1045 | g_mutex_lock (&transfer->mutex); | |
1046 | active = (!transfer || transfer->active); | |
1047 | g_mutex_unlock (&transfer->mutex); | |
1048 | while (transferred < sample->len && active) | |
784 | 1049 | { |
785 | 1050 | if (progress) |
786 | 1051 | { |
797 | 1062 | //Response: x, x, x, x, 0xc2, [0 (error), 1 (success)]... |
798 | 1063 | if (!connector_get_msg_status (rx_msg)) |
799 | 1064 | { |
800 | fprintf (stderr, "Unexpected status\n"); | |
1065 | error_print ("Unexpected status\n"); | |
801 | 1066 | } |
802 | 1067 | free_msg (rx_msg); |
803 | 1068 | i++; |
804 | } | |
805 | ||
806 | if (progress) | |
807 | { | |
808 | progress (transferred / (double) sample->len); | |
1069 | g_mutex_lock (&transfer->mutex); | |
1070 | active = (!transfer || transfer->active); | |
1071 | g_mutex_unlock (&transfer->mutex); | |
1072 | ||
1073 | usleep (REST_TIME); | |
809 | 1074 | } |
810 | 1075 | |
811 | 1076 | debug_print (2, "%zu frames sent\n", transferred); |
812 | 1077 | |
813 | if (!running || *running) | |
814 | { | |
1078 | if (active) | |
1079 | { | |
1080 | if (progress) | |
1081 | { | |
1082 | progress (transferred / (double) sample->len); | |
1083 | } | |
1084 | ||
815 | 1085 | tx_msg = connector_new_msg_upl_end (id, transferred); |
816 | 1086 | rx_msg = connector_tx_and_rx (connector, tx_msg); |
817 | 1087 | if (!rx_msg) |
821 | 1091 | //Response: x, x, x, x, 0xc1, [0 (error), 1 (success)]... |
822 | 1092 | if (!connector_get_msg_status (rx_msg)) |
823 | 1093 | { |
824 | fprintf (stderr, "Unexpected status\n"); | |
1094 | error_print ("Unexpected status\n"); | |
825 | 1095 | } |
826 | 1096 | free_msg (rx_msg); |
827 | 1097 | } |
828 | 1098 | |
829 | return transferred; | |
1099 | return active ? transferred : -1; | |
830 | 1100 | } |
831 | 1101 | |
832 | 1102 | GArray * |
833 | 1103 | connector_download (struct connector *connector, const gchar * path, |
834 | gint * running, void (*progress) (gdouble)) | |
1104 | struct connector_sample_transfer *transfer, | |
1105 | void (*progress) (gdouble)) | |
835 | 1106 | { |
836 | 1107 | GByteArray *tx_msg; |
837 | 1108 | GByteArray *rx_msg; |
844 | 1115 | int16_t v; |
845 | 1116 | int16_t *frame; |
846 | 1117 | int i; |
847 | GArray *result = NULL; | |
848 | ||
849 | tx_msg = connector_new_msg_info_file (path); | |
1118 | gboolean active; | |
1119 | GArray *result; | |
1120 | gchar *path_cp1252 = | |
1121 | g_convert (path, -1, "CP1252", "UTF8", NULL, NULL, NULL); | |
1122 | ||
1123 | if (!path_cp1252) | |
1124 | { | |
1125 | return NULL; | |
1126 | } | |
1127 | ||
1128 | tx_msg = connector_new_msg_info_file (path_cp1252); | |
1129 | g_free (path_cp1252); | |
850 | 1130 | rx_msg = connector_tx_and_rx (connector, tx_msg); |
851 | 1131 | if (!rx_msg) |
852 | 1132 | { |
856 | 1136 | free_msg (rx_msg); |
857 | 1137 | if (id < 0) |
858 | 1138 | { |
859 | fprintf (stderr, "File %s not found\n", path); | |
1139 | error_print ("File %s not found\n", path); | |
860 | 1140 | return NULL; |
861 | 1141 | } |
862 | 1142 | |
866 | 1146 | |
867 | 1147 | next_block_start = 0; |
868 | 1148 | offset = 64; |
869 | while (next_block_start < frames && (!running || *running)) | |
1149 | g_mutex_lock (&transfer->mutex); | |
1150 | active = (!transfer || transfer->active); | |
1151 | g_mutex_unlock (&transfer->mutex); | |
1152 | while (next_block_start < frames && active) | |
870 | 1153 | { |
871 | 1154 | if (progress) |
872 | 1155 | { |
875 | 1158 | |
876 | 1159 | req_size = |
877 | 1160 | frames - next_block_start > |
878 | TRANSF_BLOCK_SIZE ? TRANSF_BLOCK_SIZE : frames - next_block_start; | |
1161 | TRANSF_BLOCK_SIZE_SAMPLE ? TRANSF_BLOCK_SIZE_SAMPLE : frames - | |
1162 | next_block_start; | |
879 | 1163 | tx_msg = connector_new_msg_dwnl_blck (id, next_block_start, req_size); |
880 | 1164 | rx_msg = connector_tx_and_rx (connector, tx_msg); |
881 | 1165 | if (!rx_msg) |
889 | 1173 | |
890 | 1174 | next_block_start += req_size; |
891 | 1175 | offset = 0; |
892 | } | |
893 | ||
894 | if (progress) | |
895 | { | |
896 | progress (next_block_start / (double) frames); | |
1176 | g_mutex_lock (&transfer->mutex); | |
1177 | active = (!transfer || transfer->active); | |
1178 | g_mutex_unlock (&transfer->mutex); | |
1179 | ||
1180 | usleep (REST_TIME); | |
897 | 1181 | } |
898 | 1182 | |
899 | 1183 | debug_print (2, "%d bytes received\n", next_block_start); |
900 | 1184 | |
901 | if (!running || *running) | |
902 | { | |
1185 | if (active) | |
1186 | { | |
1187 | if (progress) | |
1188 | { | |
1189 | progress (next_block_start / (double) frames); | |
1190 | } | |
1191 | ||
903 | 1192 | result = g_array_new (FALSE, FALSE, sizeof (short)); |
904 | 1193 | frame = (gshort *) data->data; |
905 | 1194 | for (i = 0; i < data->len; i += 2) |
939 | 1228 | GByteArray *tx_msg; |
940 | 1229 | GByteArray *rx_msg; |
941 | 1230 | gint res; |
942 | ||
943 | tx_msg = connector_new_msg_new_dir (path); | |
1231 | gchar *path_cp1252 = | |
1232 | g_convert (path, -1, "CP1252", "UTF8", NULL, NULL, NULL); | |
1233 | ||
1234 | if (!path_cp1252) | |
1235 | { | |
1236 | errno = EINVAL; | |
1237 | return -1; | |
1238 | } | |
1239 | ||
1240 | tx_msg = connector_new_msg_new_dir (path_cp1252); | |
1241 | g_free (path_cp1252); | |
944 | 1242 | rx_msg = connector_tx_and_rx (connector, tx_msg); |
945 | 1243 | if (!rx_msg) |
946 | 1244 | { |
956 | 1254 | { |
957 | 1255 | res = -1; |
958 | 1256 | errno = EEXIST; |
959 | fprintf (stderr, "%s\n", g_strerror (errno)); | |
1257 | error_print ("%s\n", g_strerror (errno)); | |
960 | 1258 | } |
961 | 1259 | free_msg (rx_msg); |
962 | 1260 | |
1261 | return res; | |
1262 | } | |
1263 | ||
1264 | static GByteArray * | |
1265 | connector_new_msg_upgrade_os_start (guint size) | |
1266 | { | |
1267 | GByteArray *msg = connector_new_msg_data (INQ_OS_UPGRADE_START, | |
1268 | sizeof (INQ_OS_UPGRADE_START)); | |
1269 | ||
1270 | memcpy (&msg->data[5], &size, sizeof (uint32_t)); | |
1271 | ||
1272 | return msg; | |
1273 | } | |
1274 | ||
1275 | static GByteArray * | |
1276 | connector_new_msg_upgrade_os_write (GByteArray * os_data, gint * offset) | |
1277 | { | |
1278 | GByteArray *msg = connector_new_msg_data (INQ_OS_UPGRADE_WRITE, | |
1279 | sizeof (INQ_OS_UPGRADE_WRITE)); | |
1280 | guint len; | |
1281 | uint32_t crc; | |
1282 | uint32_t aux32; | |
1283 | ||
1284 | if (*offset + TRANSF_BLOCK_SIZE_OS < os_data->len) | |
1285 | { | |
1286 | len = TRANSF_BLOCK_SIZE_OS; | |
1287 | } | |
1288 | else | |
1289 | { | |
1290 | len = os_data->len - *offset; | |
1291 | } | |
1292 | ||
1293 | crc = crc32 (0xffffffff, &os_data->data[*offset], len); | |
1294 | ||
1295 | printf ("%0x\n", crc); | |
1296 | ||
1297 | aux32 = htonl (crc); | |
1298 | memcpy (&msg->data[5], &aux32, sizeof (uint32_t)); | |
1299 | aux32 = htonl (len); | |
1300 | memcpy (&msg->data[9], &aux32, sizeof (uint32_t)); | |
1301 | aux32 = htonl (*offset); | |
1302 | memcpy (&msg->data[13], &aux32, sizeof (uint32_t)); | |
1303 | ||
1304 | g_byte_array_append (msg, &os_data->data[*offset], len); | |
1305 | ||
1306 | *offset = *offset + len; | |
1307 | ||
1308 | return msg; | |
1309 | } | |
1310 | ||
1311 | gint | |
1312 | connector_upgrade_os (struct connector *connector, GByteArray * data, | |
1313 | struct connector_sysex_transfer *transfer) | |
1314 | { | |
1315 | GByteArray *tx_msg; | |
1316 | GByteArray *rx_msg; | |
1317 | gint8 op; | |
1318 | gint offset; | |
1319 | gint res = 0; | |
1320 | ||
1321 | transfer->status = SENDING; | |
1322 | ||
1323 | tx_msg = connector_new_msg_upgrade_os_start (data->len); | |
1324 | rx_msg = connector_tx_and_rx (connector, tx_msg); | |
1325 | ||
1326 | if (!rx_msg) | |
1327 | { | |
1328 | errno = EIO; | |
1329 | res = -1; | |
1330 | goto end; | |
1331 | } | |
1332 | //Response: x, x, x, x, 0xd1, [0 (ok), 1 (error)]... | |
1333 | op = connector_get_msg_status (rx_msg); | |
1334 | if (op) | |
1335 | { | |
1336 | res = -1; | |
1337 | errno = EIO; | |
1338 | error_print ("%s (%s)\n", g_strerror (errno), | |
1339 | connector_get_msg_string (rx_msg)); | |
1340 | goto cleanup; | |
1341 | } | |
1342 | ||
1343 | free_msg (rx_msg); | |
1344 | ||
1345 | offset = 0; | |
1346 | while (offset < data->len) | |
1347 | { | |
1348 | tx_msg = connector_new_msg_upgrade_os_write (data, &offset); | |
1349 | rx_msg = connector_tx_and_rx (connector, tx_msg); | |
1350 | ||
1351 | if (!rx_msg) | |
1352 | { | |
1353 | errno = EIO; | |
1354 | res = -1; | |
1355 | goto end; | |
1356 | } | |
1357 | //Response: x, x, x, x, 0xd1, int32, [0..3]... | |
1358 | op = rx_msg->data[9]; | |
1359 | if (op == 1) | |
1360 | { | |
1361 | break; | |
1362 | } | |
1363 | else if (op > 1) | |
1364 | { | |
1365 | res = -1; | |
1366 | errno = EIO; | |
1367 | error_print ("%s (%s)\n", g_strerror (errno), | |
1368 | connector_get_msg_string (rx_msg)); | |
1369 | goto cleanup; | |
1370 | } | |
1371 | ||
1372 | free_msg (rx_msg); | |
1373 | ||
1374 | usleep (REST_TIME); | |
1375 | } | |
1376 | ||
1377 | cleanup: | |
1378 | free_msg (rx_msg); | |
1379 | end: | |
1380 | transfer->active = FALSE; | |
1381 | transfer->status = FINISHED; | |
963 | 1382 | return res; |
964 | 1383 | } |
965 | 1384 | |
975 | 1394 | err = snd_rawmidi_close (connector->inputp); |
976 | 1395 | if (err) |
977 | 1396 | { |
978 | fprintf (stderr, __FILE__ ": Error while closing MIDI port: %s\n", | |
979 | g_strerror (errno)); | |
1397 | error_print ("Error while closing MIDI port: %s\n", | |
1398 | g_strerror (errno)); | |
980 | 1399 | } |
981 | 1400 | connector->inputp = NULL; |
982 | 1401 | } |
986 | 1405 | err = snd_rawmidi_close (connector->outputp); |
987 | 1406 | if (err) |
988 | 1407 | { |
989 | fprintf (stderr, __FILE__ ": Error while closing MIDI port: %s\n", | |
990 | g_strerror (errno)); | |
1408 | error_print ("Error while closing MIDI port: %s\n", | |
1409 | g_strerror (errno)); | |
991 | 1410 | } |
992 | 1411 | connector->outputp = NULL; |
993 | 1412 | } |
994 | 1413 | |
995 | free (connector->device_name); | |
1414 | if (connector->device_name) | |
1415 | { | |
1416 | free (connector->device_name); | |
1417 | connector->device_name = NULL; | |
1418 | } | |
1419 | ||
1420 | if (connector->buffer) | |
1421 | { | |
1422 | free (connector->buffer); | |
1423 | connector->buffer = NULL; | |
1424 | } | |
1425 | ||
1426 | if (connector->pfds) | |
1427 | { | |
1428 | free (connector->pfds); | |
1429 | connector->pfds = NULL; | |
1430 | } | |
1431 | } | |
1432 | ||
1433 | static const gchar * | |
1434 | connector_get_device_name (gint device_id) | |
1435 | { | |
1436 | switch (device_id) | |
1437 | { | |
1438 | case 0x8: | |
1439 | return "Analog Rytm"; | |
1440 | case 0xc: | |
1441 | return "Digitakt"; | |
1442 | case 0x10: | |
1443 | return "Analog Rytm MKII"; | |
1444 | case 0x19: | |
1445 | return "Model:Samples"; | |
1446 | default: | |
1447 | return "-"; | |
1448 | } | |
996 | 1449 | } |
997 | 1450 | |
998 | 1451 | gint |
1002 | 1455 | GByteArray *tx_msg; |
1003 | 1456 | GByteArray *rx_msg_device; |
1004 | 1457 | GByteArray *rx_msg_fw_ver; |
1458 | GByteArray *rx_msg_uid; | |
1459 | snd_rawmidi_params_t *params; | |
1005 | 1460 | gchar name[32]; |
1006 | 1461 | sprintf (name, "hw:%d", card); |
1007 | 1462 | |
1008 | 1463 | connector->inputp = NULL; |
1009 | 1464 | connector->outputp = NULL; |
1010 | 1465 | connector->device_name = NULL; |
1466 | connector->buffer = NULL; | |
1467 | connector->rx_len = 0; | |
1468 | connector->pfds = NULL; | |
1011 | 1469 | |
1012 | 1470 | if (card < 0) |
1013 | 1471 | { |
1022 | 1480 | snd_rawmidi_open (&connector->inputp, &connector->outputp, |
1023 | 1481 | name, SND_RAWMIDI_NONBLOCK | SND_RAWMIDI_SYNC)) < 0) |
1024 | 1482 | { |
1025 | fprintf (stderr, __FILE__ ": Error while opening MIDI port: %s\n", | |
1026 | g_strerror (errno)); | |
1483 | error_print ("Error while opening MIDI port: %s\n", g_strerror (errno)); | |
1027 | 1484 | goto cleanup; |
1028 | 1485 | } |
1029 | 1486 | |
1030 | 1487 | debug_print (1, "Setting blocking mode...\n"); |
1031 | 1488 | if ((err = snd_rawmidi_nonblock (connector->outputp, 0)) < 0) |
1032 | 1489 | { |
1033 | fprintf (stderr, __FILE__ ": Error while setting blocking mode\n"); | |
1490 | error_print ("Error while setting blocking mode\n"); | |
1034 | 1491 | goto cleanup; |
1035 | 1492 | } |
1036 | 1493 | if ((err = snd_rawmidi_nonblock (connector->inputp, 1)) < 0) |
1037 | 1494 | { |
1038 | fprintf (stderr, __FILE__ ": Error while setting blocking mode\n"); | |
1495 | error_print ("Error while setting blocking mode\n"); | |
1039 | 1496 | goto cleanup; |
1040 | 1497 | } |
1041 | 1498 | |
1042 | 1499 | debug_print (1, "Stopping device...\n"); |
1043 | 1500 | if (snd_rawmidi_write (connector->outputp, "\xfc", 1) < 0) |
1044 | 1501 | { |
1045 | fprintf (stderr, __FILE__ ": Error while stopping device\n"); | |
1502 | error_print ("Error while stopping device\n"); | |
1046 | 1503 | } |
1047 | 1504 | |
1048 | 1505 | connector->seq = 0; |
1049 | 1506 | connector->device_name = malloc (LABEL_MAX); |
1507 | if (!connector->device_name) | |
1508 | { | |
1509 | goto cleanup; | |
1510 | } | |
1511 | ||
1512 | connector->buffer = malloc (sizeof (guint8) * BUFF_SIZE); | |
1513 | if (!connector->buffer) | |
1514 | { | |
1515 | goto cleanup; | |
1516 | } | |
1517 | ||
1518 | connector->npfds = snd_rawmidi_poll_descriptors_count (connector->inputp); | |
1519 | connector->pfds = malloc (connector->npfds * sizeof (struct pollfd)); | |
1520 | if (!connector->buffer) | |
1521 | { | |
1522 | goto cleanup; | |
1523 | } | |
1524 | snd_rawmidi_poll_descriptors (connector->inputp, connector->pfds, | |
1525 | connector->npfds); | |
1526 | ||
1527 | err = snd_rawmidi_params_malloc (¶ms); | |
1528 | if (err) | |
1529 | { | |
1530 | goto cleanup; | |
1531 | } | |
1532 | ||
1533 | err = snd_rawmidi_params_current (connector->inputp, params); | |
1534 | if (err) | |
1535 | { | |
1536 | goto cleanup_params; | |
1537 | } | |
1538 | ||
1539 | err = | |
1540 | snd_rawmidi_params_set_buffer_size (connector->inputp, params, | |
1541 | RING_BUFF_SIZE); | |
1542 | if (err) | |
1543 | { | |
1544 | goto cleanup_params; | |
1545 | } | |
1546 | ||
1547 | err = snd_rawmidi_params (connector->inputp, params); | |
1548 | if (err) | |
1549 | { | |
1550 | goto cleanup_params; | |
1551 | } | |
1050 | 1552 | |
1051 | 1553 | tx_msg = connector_new_msg_data (INQ_DEVICE, sizeof (INQ_DEVICE)); |
1052 | 1554 | rx_msg_device = connector_tx_and_rx (connector, tx_msg); |
1060 | 1562 | rx_msg_fw_ver = connector_tx_and_rx (connector, tx_msg); |
1061 | 1563 | if (!rx_msg_fw_ver) |
1062 | 1564 | { |
1063 | free_msg (rx_msg_device); | |
1064 | 1565 | err = -1; |
1065 | goto cleanup; | |
1066 | } | |
1067 | ||
1068 | snprintf (connector->device_name, LABEL_MAX, "%s %s", | |
1069 | &rx_msg_device->data[23], &rx_msg_fw_ver->data[10]); | |
1566 | goto cleanup_device; | |
1567 | } | |
1568 | ||
1569 | if (debug_level) | |
1570 | { | |
1571 | tx_msg = connector_new_msg_data (INQ_UID, sizeof (INQ_UID)); | |
1572 | rx_msg_uid = connector_tx_and_rx (connector, tx_msg); | |
1573 | if (rx_msg_uid) | |
1574 | { | |
1575 | debug_print (1, "UID: %x\n", *((guint32 *) & rx_msg_uid->data[5])); | |
1576 | free_msg (rx_msg_uid); | |
1577 | } | |
1578 | } | |
1579 | ||
1580 | snprintf (connector->device_name, LABEL_MAX, "%s %s (%s)", | |
1581 | connector_get_device_name (rx_msg_device->data[5]), | |
1582 | &rx_msg_fw_ver->data[10], | |
1583 | &rx_msg_device->data[7 + rx_msg_device->data[6]]); | |
1584 | ||
1585 | debug_print (1, "Connected to %s\n", connector->device_name); | |
1586 | ||
1587 | err = 0; | |
1588 | ||
1589 | free_msg (rx_msg_fw_ver); | |
1590 | cleanup_device: | |
1070 | 1591 | free_msg (rx_msg_device); |
1071 | free_msg (rx_msg_fw_ver); | |
1072 | debug_print (1, "Connected to %s\n", connector->device_name); | |
1073 | ||
1074 | return 0; | |
1075 | ||
1592 | cleanup_params: | |
1593 | snd_rawmidi_params_free (params); | |
1076 | 1594 | cleanup: |
1077 | connector_destroy (connector); | |
1595 | if (err) | |
1596 | { | |
1597 | connector_destroy (connector); | |
1598 | } | |
1078 | 1599 | return err; |
1079 | 1600 | } |
1080 | 1601 | |
1139 | 1660 | err = snd_ctl_rawmidi_info (ctl, info); |
1140 | 1661 | if (err < 0) |
1141 | 1662 | { |
1142 | fprintf (stderr, | |
1143 | __FILE__ ": cannot get rawmidi information %d:%d:%d: %s\n", | |
1144 | card, device, sub, snd_strerror (err)); | |
1663 | error_print ("Cannot get rawmidi information %d:%d:%d: %s\n", | |
1664 | card, device, sub, snd_strerror (err)); | |
1145 | 1665 | return NULL; |
1146 | 1666 | } |
1147 | 1667 | |
1173 | 1693 | sprintf (name, "hw:%d", card); |
1174 | 1694 | if ((err = snd_ctl_open (&ctl, name, 0)) < 0) |
1175 | 1695 | { |
1176 | fprintf (stderr, __FILE__ ": cannot open control for card %d: %s\n", | |
1177 | card, snd_strerror (err)); | |
1696 | error_print ("Cannot open control for card %d: %s\n", | |
1697 | card, snd_strerror (err)); | |
1178 | 1698 | return; |
1179 | 1699 | } |
1180 | 1700 | device = -1; |
1189 | 1709 | } |
1190 | 1710 | if (err < 0) |
1191 | 1711 | { |
1192 | fprintf (stderr, __FILE__ ": cannot determine device number: %s\n", | |
1193 | snd_strerror (err)); | |
1712 | error_print ("Cannot determine device number: %s\n", | |
1713 | snd_strerror (err)); | |
1194 | 1714 | } |
1195 | 1715 | snd_ctl_close (ctl); |
1196 | 1716 | } |
1209 | 1729 | } |
1210 | 1730 | if (err < 0) |
1211 | 1731 | { |
1212 | fprintf (stderr, __FILE__ ": cannot determine card number: %s\n", | |
1213 | snd_strerror (err)); | |
1732 | error_print ("Cannot determine card number: %s\n", snd_strerror (err)); | |
1214 | 1733 | } |
1215 | 1734 | |
1216 | 1735 | return devices; |
20 | 20 | #include <glib.h> |
21 | 21 | #include <alsa/asoundlib.h> |
22 | 22 | |
23 | #define SYSEX_TIMEOUT 5000 | |
24 | ||
23 | 25 | struct connector |
24 | 26 | { |
25 | 27 | snd_rawmidi_t *inputp; |
27 | 29 | gchar *device_name; |
28 | 30 | gushort seq; |
29 | 31 | GMutex mutex; |
32 | ssize_t rx_len; | |
33 | guint8 *buffer; | |
34 | gint npfds; | |
35 | struct pollfd *pfds; | |
30 | 36 | }; |
31 | 37 | |
32 | 38 | struct connector_dir_iterator |
57 | 63 | { |
58 | 64 | gboolean active; |
59 | 65 | enum connector_sysex_transfer_status status; |
60 | GByteArray *data; | |
61 | gboolean timeout; | |
66 | gint timeout; //Measured in ms. -1 is infinite. | |
67 | gboolean batch; | |
68 | GMutex mutex; | |
69 | }; | |
70 | ||
71 | struct connector_sample_transfer | |
72 | { | |
73 | gboolean active; | |
74 | GMutex mutex; | |
62 | 75 | }; |
63 | 76 | |
64 | 77 | gint connector_init (struct connector *, gint); |
80 | 93 | |
81 | 94 | gint connector_delete_dir (struct connector *, const gchar *); |
82 | 95 | |
83 | GArray *connector_download (struct connector *, const gchar *, gint *, | |
96 | GArray *connector_download (struct connector *, const gchar *, | |
97 | struct connector_sample_transfer *, | |
84 | 98 | void (*)(gdouble)); |
85 | 99 | |
86 | 100 | ssize_t |
87 | connector_upload (struct connector *, GArray *, gchar *, gint *, | |
88 | void (*)(gdouble)); | |
101 | connector_upload (struct connector *, GArray *, gchar *, | |
102 | struct connector_sample_transfer *, void (*)(gdouble)); | |
89 | 103 | |
90 | 104 | void connector_get_sample_info_from_msg (GByteArray *, gint *, guint *); |
91 | 105 | |
93 | 107 | |
94 | 108 | GArray *connector_get_elektron_devices (); |
95 | 109 | |
96 | ssize_t connector_tx_sysex (struct connector *, | |
110 | ssize_t connector_tx_sysex (struct connector *, GByteArray *, | |
97 | 111 | struct connector_sysex_transfer *); |
98 | 112 | |
99 | 113 | GByteArray *connector_rx_sysex (struct connector *, |
100 | 114 | struct connector_sysex_transfer *); |
101 | 115 | |
116 | ||
117 | void connector_rx_drain (struct connector *); | |
118 | ||
119 | gint connector_upgrade_os (struct connector *, GByteArray *, | |
120 | struct connector_sysex_transfer *); | |
121 | ||
102 | 122 | void free_msg (gpointer); |
28 | 28 | #include "utils.h" |
29 | 29 | |
30 | 30 | static struct connector connector; |
31 | static int running; | |
31 | static struct connector_sample_transfer sample_transfer; | |
32 | 32 | |
33 | 33 | static gchar * |
34 | 34 | cli_get_path (gchar * device_path) |
80 | 80 | |
81 | 81 | if (optind == argc) |
82 | 82 | { |
83 | fprintf (stderr, "Remote path missing\n"); | |
83 | error_print ("Remote path missing\n"); | |
84 | 84 | return EXIT_FAILURE; |
85 | 85 | } |
86 | 86 | else |
123 | 123 | |
124 | 124 | if (optind == argc) |
125 | 125 | { |
126 | fprintf (stderr, "Remote path missing\n"); | |
126 | error_print ("Remote path missing\n"); | |
127 | 127 | return EXIT_FAILURE; |
128 | 128 | } |
129 | 129 | else |
153 | 153 | |
154 | 154 | if (optind == argc) |
155 | 155 | { |
156 | fprintf (stderr, "Remote path source missing\n"); | |
156 | error_print ("Remote path source missing\n"); | |
157 | 157 | return EXIT_FAILURE; |
158 | 158 | } |
159 | 159 | else |
164 | 164 | |
165 | 165 | if (optind == argc) |
166 | 166 | { |
167 | fprintf (stderr, "Remote path destination missing\n"); | |
167 | error_print ("Remote path destination missing\n"); | |
168 | 168 | return EXIT_FAILURE; |
169 | 169 | } |
170 | 170 | else |
176 | 176 | card_dst = atoi (device_path_dst); |
177 | 177 | if (card_src != card_dst) |
178 | 178 | { |
179 | fprintf (stderr, "Source and destination device must be the same\n"); | |
179 | error_print ("Source and destination device must be the same\n"); | |
180 | 180 | return EXIT_FAILURE; |
181 | 181 | } |
182 | 182 | |
201 | 201 | |
202 | 202 | if (optind == argc) |
203 | 203 | { |
204 | fprintf (stderr, "Remote path missing\n"); | |
204 | error_print ("Remote path missing\n"); | |
205 | 205 | return EXIT_FAILURE; |
206 | 206 | } |
207 | 207 | else |
245 | 245 | |
246 | 246 | if (optind == argc) |
247 | 247 | { |
248 | fprintf (stderr, "Remote path missing\n"); | |
248 | error_print ("Remote path missing\n"); | |
249 | 249 | return EXIT_FAILURE; |
250 | 250 | } |
251 | 251 | else |
262 | 262 | |
263 | 263 | path_src = cli_get_path (device_path_src); |
264 | 264 | |
265 | running = 1; | |
266 | data = connector_download (&connector, path_src, &running, NULL); | |
265 | sample_transfer.active = TRUE; | |
266 | data = connector_download (&connector, path_src, &sample_transfer, NULL); | |
267 | 267 | if (data == NULL) |
268 | 268 | { |
269 | 269 | return EXIT_FAILURE; |
294 | 294 | |
295 | 295 | if (optind == argc) |
296 | 296 | { |
297 | fprintf (stderr, "Local path missing\n"); | |
297 | error_print ("Local path missing\n"); | |
298 | 298 | return EXIT_FAILURE; |
299 | 299 | } |
300 | 300 | else |
305 | 305 | |
306 | 306 | if (optind == argc) |
307 | 307 | { |
308 | fprintf (stderr, "Remote path missing\n"); | |
308 | error_print ("Remote path missing\n"); | |
309 | 309 | return EXIT_FAILURE; |
310 | 310 | } |
311 | 311 | else |
334 | 334 | goto cleanup; |
335 | 335 | } |
336 | 336 | |
337 | running = 1; | |
338 | frames = connector_upload (&connector, sample, path_dst, &running, NULL); | |
337 | sample_transfer.active = TRUE; | |
338 | frames = | |
339 | connector_upload (&connector, sample, path_dst, &sample_transfer, NULL); | |
339 | 340 | |
340 | 341 | res = frames < 0 ? EXIT_FAILURE : EXIT_SUCCESS; |
341 | 342 | |
354 | 355 | |
355 | 356 | if (optind == argc) |
356 | 357 | { |
357 | fprintf (stderr, "Device missing\n"); | |
358 | error_print ("Device missing\n"); | |
358 | 359 | return EXIT_FAILURE; |
359 | 360 | } |
360 | 361 | else |
377 | 378 | static void |
378 | 379 | cli_end (int sig) |
379 | 380 | { |
380 | running = 0; | |
381 | sample_transfer.active = FALSE; | |
381 | 382 | } |
382 | 383 | |
383 | 384 | int |
448 | 449 | { |
449 | 450 | fprintf (stderr, "%s\n", PACKAGE_STRING); |
450 | 451 | char *exec_name = basename (argv[0]); |
451 | fprintf (stderr, "Usage: %s [-v] command [options]\n", exec_name); | |
452 | fprintf (stderr, "Usage: %s [options] command\n", exec_name); | |
452 | 453 | exit (EXIT_FAILURE); |
453 | 454 | } |
454 | 455 | |
490 | 491 | } |
491 | 492 | else |
492 | 493 | { |
493 | fprintf (stderr, "Command %s not recognized\n", command); | |
494 | error_print ("Command %s not recognized\n", command); | |
494 | 495 | res = EXIT_FAILURE; |
495 | 496 | } |
496 | 497 |
45 | 45 | #define TASK_LIST_STORE_STATUS_HUMAN_FIELD 5 |
46 | 46 | #define TASK_LIST_STORE_TYPE_HUMAN_FIELD 6 |
47 | 47 | |
48 | #define DUMP_TIMEOUT 2000 | |
49 | ||
48 | 50 | static gpointer elektroid_upload_task (gpointer); |
49 | 51 | static gpointer elektroid_download_task (gpointer); |
50 | 52 | static void elektroid_update_progress (gdouble); |
64 | 66 | CANCELED |
65 | 67 | }; |
66 | 68 | |
67 | struct elektroid_active_task | |
68 | { | |
69 | gint running; | |
69 | struct elektroid_sample_transfer | |
70 | { | |
71 | struct connector_sample_transfer transfer; | |
70 | 72 | gchar *src; //Contains a path to a file |
71 | 73 | gchar *dst; //Contains a path to a dir |
72 | 74 | enum elektroid_task_status status; //Contains the final status |
73 | gdouble progress; | |
75 | }; | |
76 | ||
77 | struct elektroid_sysex_transfer | |
78 | { | |
79 | struct connector_sysex_transfer transfer; | |
80 | GByteArray *data; | |
74 | 81 | }; |
75 | 82 | |
76 | 83 | static struct browser remote_browser; |
77 | 84 | static struct browser local_browser; |
78 | static struct browser *popup_browser; | |
79 | 85 | |
80 | 86 | static struct audio audio; |
81 | 87 | static struct connector connector; |
84 | 90 | static GThread *load_thread = NULL; |
85 | 91 | static GThread *task_thread = NULL; |
86 | 92 | static GThread *sysex_thread = NULL; |
87 | static gboolean load_thread_running; | |
88 | static GMutex load_mutex; | |
89 | static struct elektroid_active_task active_task; | |
90 | static struct connector_sysex_transfer transfer; | |
93 | static struct elektroid_sample_transfer sample_transfer; | |
94 | static struct elektroid_sysex_transfer sysex_transfer; | |
91 | 95 | |
92 | 96 | static GtkWidget *main_window; |
93 | 97 | static GtkAboutDialog *about_dialog; |
100 | 104 | static GtkWidget *progress_label; |
101 | 105 | static GtkWidget *rx_sysex_button; |
102 | 106 | static GtkWidget *tx_sysex_button; |
107 | static GtkWidget *os_upgrade_button; | |
103 | 108 | static GtkWidget *about_button; |
104 | 109 | static GtkWidget *remote_box; |
105 | 110 | static GtkWidget *waveform_draw_area; |
108 | 113 | static GtkStatusbar *status_bar; |
109 | 114 | static GtkListStore *devices_list_store; |
110 | 115 | static GtkComboBox *devices_combo; |
111 | static GtkWidget *item_popmenu; | |
112 | static GtkWidget *rename_button; | |
113 | static GtkWidget *delete_button; | |
116 | static GtkWidget *local_play_button; | |
117 | static GtkWidget *local_open_button; | |
118 | static GtkWidget *local_show_button; | |
119 | static GtkWidget *local_rename_button; | |
120 | static GtkWidget *local_delete_button; | |
121 | static GtkWidget *remote_rename_button; | |
122 | static GtkWidget *remote_delete_button; | |
114 | 123 | static GtkWidget *play_button; |
115 | 124 | static GtkWidget *stop_button; |
116 | 125 | static GtkWidget *volume_button; |
121 | 130 | static GtkWidget *clear_tasks_button; |
122 | 131 | |
123 | 132 | static void |
124 | elektroid_load_devices (int auto_select) | |
133 | elektroid_load_devices (gboolean auto_select) | |
125 | 134 | { |
126 | 135 | int i; |
127 | 136 | GArray *devices = connector_get_elektron_devices (); |
213 | 222 | return found; |
214 | 223 | } |
215 | 224 | |
216 | ||
217 | static gint | |
225 | static gboolean | |
218 | 226 | elektroid_check_connector () |
219 | 227 | { |
220 | 228 | GtkListStore *list_store; |
225 | 233 | gtk_widget_set_sensitive (remote_box, connected); |
226 | 234 | gtk_widget_set_sensitive (rx_sysex_button, connected && !queued); |
227 | 235 | gtk_widget_set_sensitive (tx_sysex_button, connected && !queued); |
236 | gtk_widget_set_sensitive (os_upgrade_button, connected && !queued); | |
228 | 237 | |
229 | 238 | if (!connected) |
230 | 239 | { |
235 | 244 | gtk_widget_set_sensitive (download_button, FALSE); |
236 | 245 | gtk_widget_set_sensitive (upload_button, FALSE); |
237 | 246 | |
238 | elektroid_load_devices (0); | |
247 | elektroid_load_devices (FALSE); | |
239 | 248 | } |
240 | 249 | |
241 | 250 | elektroid_update_statusbar (); |
242 | 251 | |
243 | 252 | return connected; |
253 | } | |
254 | ||
255 | static gboolean | |
256 | elektroid_check_connector_bg (gpointer data) | |
257 | { | |
258 | elektroid_check_connector (); | |
259 | ||
260 | return FALSE; | |
244 | 261 | } |
245 | 262 | |
246 | 263 | static void |
251 | 268 | connector_destroy (&connector); |
252 | 269 | elektroid_check_connector (); |
253 | 270 | } |
254 | elektroid_load_devices (0); | |
271 | elektroid_load_devices (FALSE); | |
255 | 272 | } |
256 | 273 | |
257 | 274 | static gpointer |
263 | 280 | if (sysex_thread) |
264 | 281 | { |
265 | 282 | output = g_thread_join (sysex_thread); |
266 | g_thread_unref (sysex_thread); | |
267 | 283 | } |
268 | 284 | sysex_thread = NULL; |
269 | 285 | |
271 | 287 | } |
272 | 288 | |
273 | 289 | static void |
290 | elektroid_cancel_running_sysex (GtkDialog * dialog, gint response_id, | |
291 | gpointer data) | |
292 | { | |
293 | g_mutex_lock (&sysex_transfer.transfer.mutex); | |
294 | sysex_transfer.transfer.active = FALSE; | |
295 | g_mutex_unlock (&sysex_transfer.transfer.mutex); | |
296 | } | |
297 | ||
298 | static void | |
274 | 299 | elektroid_stop_sysex_thread () |
275 | 300 | { |
276 | transfer.active = FALSE; | |
301 | elektroid_cancel_running_sysex (NULL, 0, NULL); | |
277 | 302 | elektroid_join_sysex_thread (); |
278 | 303 | } |
279 | 304 | |
280 | 305 | static void |
281 | 306 | elektroid_progress_dialog_end (gpointer data) |
282 | 307 | { |
283 | transfer.active = FALSE; | |
308 | elektroid_cancel_running_sysex (NULL, 0, NULL); | |
284 | 309 | gtk_dialog_response (GTK_DIALOG (progress_dialog), GTK_RESPONSE_CANCEL); |
285 | } | |
286 | ||
287 | static void | |
288 | elektroid_progress_dialog_response (GtkDialog * dialog, gint response_id, | |
289 | gpointer data) | |
290 | { | |
291 | transfer.active = FALSE; | |
292 | 310 | } |
293 | 311 | |
294 | 312 | static gboolean |
295 | 313 | elektroid_update_sysex_progress (gpointer data) |
296 | 314 | { |
297 | 315 | gchar *text; |
298 | struct connector_sysex_transfer *transfer = | |
299 | (struct connector_sysex_transfer *) data; | |
300 | ||
301 | switch (transfer->status) | |
316 | gboolean active; | |
317 | enum connector_sysex_transfer_status status; | |
318 | ||
319 | g_mutex_lock (&sysex_transfer.transfer.mutex); | |
320 | status = sysex_transfer.transfer.status; | |
321 | g_mutex_unlock (&sysex_transfer.transfer.mutex); | |
322 | ||
323 | switch (status) | |
302 | 324 | { |
303 | 325 | case WAITING: |
304 | 326 | text = _("Waiting..."); |
316 | 338 | } |
317 | 339 | gtk_label_set_text (GTK_LABEL (progress_label), text); |
318 | 340 | |
319 | return transfer->active; | |
341 | g_mutex_lock (&sysex_transfer.transfer.mutex); | |
342 | active = sysex_transfer.transfer.active; | |
343 | g_mutex_unlock (&sysex_transfer.transfer.mutex); | |
344 | ||
345 | return active; | |
320 | 346 | } |
321 | 347 | |
322 | 348 | static gpointer |
323 | 349 | elektroid_rx_sysex_thread (gpointer data) |
324 | 350 | { |
325 | gpointer value; | |
326 | g_timeout_add (100, elektroid_update_sysex_progress, &transfer); | |
327 | transfer.status = WAITING; | |
328 | transfer.active = TRUE; | |
329 | transfer.timeout = FALSE; | |
330 | value = connector_rx_sysex (&connector, &transfer); | |
351 | gchar *text; | |
352 | GByteArray *msg; | |
353 | ||
354 | sysex_transfer.transfer.status = WAITING; | |
355 | sysex_transfer.transfer.active = TRUE; | |
356 | sysex_transfer.transfer.timeout = DUMP_TIMEOUT; | |
357 | sysex_transfer.transfer.batch = TRUE; | |
358 | ||
359 | g_timeout_add (100, elektroid_update_sysex_progress, NULL); | |
360 | ||
361 | connector_rx_drain (&connector); | |
362 | msg = connector_rx_sysex (&connector, &sysex_transfer.transfer); | |
363 | if (msg) | |
364 | { | |
365 | text = debug_get_hex_msg (msg); | |
366 | debug_print (1, "SysEx message received (%d): %s\n", msg->len, text); | |
367 | free (text); | |
368 | } | |
369 | ||
331 | 370 | gtk_dialog_response (GTK_DIALOG (progress_dialog), GTK_RESPONSE_ACCEPT); |
332 | return value; | |
371 | ||
372 | return msg; | |
373 | } | |
374 | ||
375 | static gboolean | |
376 | elektroid_start_rx_thread (gpointer data) | |
377 | { | |
378 | debug_print (1, "Creating rx SysEx thread...\n"); | |
379 | sysex_thread = | |
380 | g_thread_new ("sysex_thread", elektroid_rx_sysex_thread, NULL); | |
381 | ||
382 | return FALSE; | |
333 | 383 | } |
334 | 384 | |
335 | 385 | static void |
346 | 396 | GByteArray *sysex_data; |
347 | 397 | GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; |
348 | 398 | |
349 | debug_print (1, "Creating rx SysEx thread...\n"); | |
350 | sysex_thread = | |
351 | g_thread_new ("sysex_thread", elektroid_rx_sysex_thread, &transfer); | |
399 | g_idle_add (elektroid_start_rx_thread, NULL); | |
400 | ||
352 | 401 | gtk_window_set_title (GTK_WINDOW (progress_dialog), _("Receive SysEx")); |
353 | ||
354 | 402 | res = gtk_dialog_run (GTK_DIALOG (progress_dialog)); |
355 | transfer.active = FALSE; | |
403 | sysex_transfer.transfer.active = FALSE; | |
356 | 404 | gtk_widget_hide (GTK_WIDGET (progress_dialog)); |
357 | 405 | |
358 | 406 | sysex_data = elektroid_join_sysex_thread (); |
431 | 479 | static gpointer |
432 | 480 | elektroid_tx_sysex_thread (gpointer data) |
433 | 481 | { |
434 | gint *v = malloc (sizeof (gint)); | |
435 | g_timeout_add (100, elektroid_update_sysex_progress, &transfer); | |
436 | transfer.status = SENDING; | |
437 | transfer.active = TRUE; | |
438 | transfer.timeout = FALSE; | |
439 | *v = connector_tx_sysex (&connector, &transfer); | |
482 | gchar *text; | |
483 | gint *response = malloc (sizeof (gint)); | |
484 | ||
485 | sysex_transfer.transfer.active = TRUE; | |
486 | sysex_transfer.transfer.timeout = SYSEX_TIMEOUT; | |
487 | ||
488 | g_timeout_add (100, elektroid_update_sysex_progress, NULL); | |
489 | ||
490 | *response = | |
491 | connector_tx_sysex (&connector, sysex_transfer.data, | |
492 | &sysex_transfer.transfer); | |
493 | if (*response >= 0) | |
494 | { | |
495 | text = debug_get_hex_msg (sysex_transfer.data); | |
496 | debug_print (1, "SysEx message sent (%d): %s\n", | |
497 | sysex_transfer.data->len, text); | |
498 | free (text); | |
499 | } | |
500 | ||
440 | 501 | gtk_dialog_response (GTK_DIALOG (progress_dialog), GTK_RESPONSE_CANCEL); |
441 | return v; | |
442 | } | |
443 | ||
444 | static void | |
445 | elektroid_tx_sysex (GtkWidget * object, gpointer data) | |
502 | ||
503 | return response; | |
504 | } | |
505 | ||
506 | static gboolean | |
507 | elektroid_start_tx_thread (gpointer data) | |
508 | { | |
509 | debug_print (1, "Creating tx SysEx thread...\n"); | |
510 | sysex_thread = g_thread_new ("sysex_thread", data, NULL); | |
511 | ||
512 | return FALSE; | |
513 | } | |
514 | ||
515 | static void | |
516 | elektroid_tx_sysex_common (GThreadFunc tx_function) | |
446 | 517 | { |
447 | 518 | GtkWidget *dialog; |
448 | 519 | GtkFileChooser *chooser; |
451 | 522 | char *filename; |
452 | 523 | FILE *file; |
453 | 524 | long size; |
454 | gint *copied; | |
525 | gint *response; | |
455 | 526 | GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; |
456 | 527 | |
457 | 528 | dialog = gtk_file_chooser_dialog_new (_("Open SysEx"), |
479 | 550 | size = ftell (file); |
480 | 551 | rewind (file); |
481 | 552 | |
482 | transfer.data = g_byte_array_new (); | |
483 | g_byte_array_set_size (transfer.data, size); | |
484 | fread (transfer.data->data, size, 1, file); | |
553 | sysex_transfer.data = g_byte_array_new (); | |
554 | g_byte_array_set_size (sysex_transfer.data, size); | |
555 | fread (sysex_transfer.data->data, size, 1, file); | |
485 | 556 | fclose (file); |
486 | 557 | |
487 | debug_print (1, "Creating tx SysEx thread...\n"); | |
488 | sysex_thread = | |
489 | g_thread_new ("sysex_thread", elektroid_tx_sysex_thread, &transfer); | |
558 | g_idle_add (elektroid_start_tx_thread, tx_function); | |
490 | 559 | |
491 | 560 | gtk_window_set_title (GTK_WINDOW (progress_dialog), _("Send SysEx")); |
492 | 561 | res = gtk_dialog_run (GTK_DIALOG (progress_dialog)); |
493 | transfer.active = FALSE; | |
562 | ||
563 | g_mutex_lock (&sysex_transfer.transfer.mutex); | |
564 | sysex_transfer.transfer.active = FALSE; | |
565 | g_mutex_unlock (&sysex_transfer.transfer.mutex); | |
566 | ||
494 | 567 | gtk_widget_hide (GTK_WIDGET (progress_dialog)); |
495 | 568 | |
496 | copied = elektroid_join_sysex_thread (); | |
497 | g_byte_array_free (transfer.data, TRUE); | |
498 | ||
499 | if (*copied < 0) | |
569 | response = elektroid_join_sysex_thread (); | |
570 | g_byte_array_free (sysex_transfer.data, TRUE); | |
571 | ||
572 | if (*response < 0) | |
500 | 573 | { |
501 | 574 | elektroid_check_connector (); |
502 | 575 | } |
503 | 576 | |
504 | free (copied); | |
577 | free (response); | |
505 | 578 | } |
506 | 579 | |
507 | 580 | gtk_widget_destroy (dialog); |
581 | } | |
582 | ||
583 | static void | |
584 | elektroid_tx_sysex (GtkWidget * object, gpointer data) | |
585 | { | |
586 | elektroid_tx_sysex_common (elektroid_tx_sysex_thread); | |
587 | } | |
588 | ||
589 | static gpointer | |
590 | elektroid_os_upgrade_thread (gpointer data) | |
591 | { | |
592 | gint *response = malloc (sizeof (gint)); | |
593 | ||
594 | sysex_transfer.transfer.active = TRUE; | |
595 | sysex_transfer.transfer.timeout = SYSEX_TIMEOUT; | |
596 | ||
597 | g_timeout_add (100, elektroid_update_sysex_progress, NULL); | |
598 | ||
599 | *response = | |
600 | connector_upgrade_os (&connector, sysex_transfer.data, | |
601 | &sysex_transfer.transfer); | |
602 | ||
603 | gtk_dialog_response (GTK_DIALOG (progress_dialog), GTK_RESPONSE_CANCEL); | |
604 | ||
605 | return response; | |
606 | } | |
607 | ||
608 | static void | |
609 | elektroid_upgrade_os (GtkWidget * object, gpointer data) | |
610 | { | |
611 | elektroid_tx_sysex_common (elektroid_os_upgrade_thread); | |
612 | connector_destroy (&connector); | |
613 | elektroid_check_connector (); | |
508 | 614 | } |
509 | 615 | |
510 | 616 | static void |
517 | 623 | static void |
518 | 624 | elektroid_controls_set_sensitive (gboolean sensitive) |
519 | 625 | { |
626 | gtk_widget_set_sensitive (local_play_button, sensitive); | |
520 | 627 | gtk_widget_set_sensitive (play_button, sensitive); |
521 | 628 | gtk_widget_set_sensitive (stop_button, sensitive); |
522 | 629 | } |
523 | 630 | |
524 | 631 | static gboolean |
525 | elektroid_update_ui_after_load (gpointer data) | |
526 | { | |
527 | if (audio.sample->len > 0) | |
632 | elektroid_update_ui_on_load (gpointer data) | |
633 | { | |
634 | gboolean ready_to_play; | |
635 | ||
636 | g_mutex_lock (&audio.mutex); | |
637 | ready_to_play = audio.sample->len >= LOAD_BUFFER_LEN | |
638 | || (!audio.load_active && audio.sample->len > 0); | |
639 | g_mutex_unlock (&audio.mutex); | |
640 | ||
641 | if (ready_to_play) | |
528 | 642 | { |
529 | 643 | if (audio_check (&audio)) |
530 | 644 | { |
534 | 648 | { |
535 | 649 | audio_play (&audio); |
536 | 650 | } |
537 | } | |
538 | return FALSE; | |
539 | } | |
540 | ||
541 | static void | |
542 | elektroid_delete_file (GtkTreeModel * model, GtkTreePath * tree_path) | |
651 | return FALSE; | |
652 | } | |
653 | ||
654 | return TRUE; | |
655 | } | |
656 | ||
657 | static void | |
658 | elektroid_delete_file (GtkTreeModel * model, GtkTreePath * tree_path, | |
659 | struct browser *browser) | |
543 | 660 | { |
544 | 661 | GtkTreeIter iter; |
545 | 662 | gchar *name; |
553 | 670 | browser_get_item_info (model, &iter, &icon, &name, NULL); |
554 | 671 | type = get_type_from_inventory_icon (icon); |
555 | 672 | |
556 | path = chain_path (popup_browser->dir, name); | |
673 | path = chain_path (browser->dir, name); | |
557 | 674 | debug_print (1, "Deleting %s...\n", path); |
558 | 675 | |
559 | err = popup_browser->delete (path, type); | |
676 | err = browser->delete (path, type); | |
560 | 677 | if (err < 0) |
561 | 678 | { |
562 | 679 | dialog = |
576 | 693 | } |
577 | 694 | |
578 | 695 | free (path); |
579 | free (icon); | |
580 | free (name); | |
696 | g_free (icon); | |
697 | g_free (name); | |
581 | 698 | } |
582 | 699 | |
583 | 700 | static void |
592 | 709 | GList *tree_path_list; |
593 | 710 | GList *ref_list; |
594 | 711 | gint confirmation; |
712 | struct browser *browser = data; | |
595 | 713 | |
596 | 714 | dialog = |
597 | 715 | gtk_message_dialog_new (GTK_WINDOW (main_window), |
610 | 728 | return; |
611 | 729 | } |
612 | 730 | |
613 | selection = | |
614 | gtk_tree_view_get_selection (GTK_TREE_VIEW (popup_browser->view)); | |
615 | model = GTK_TREE_MODEL (gtk_tree_view_get_model (popup_browser->view)); | |
731 | selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser->view)); | |
732 | model = GTK_TREE_MODEL (gtk_tree_view_get_model (browser->view)); | |
616 | 733 | tree_path_list = gtk_tree_selection_get_selected_rows (selection, &model); |
617 | 734 | ref_list = NULL; |
618 | 735 | |
626 | 743 | for (item = ref_list; item != NULL; item = g_list_next (item)) |
627 | 744 | { |
628 | 745 | tree_path = gtk_tree_row_reference_get_path (item->data); |
629 | elektroid_delete_file (model, tree_path); | |
746 | elektroid_delete_file (model, tree_path, browser); | |
630 | 747 | } |
631 | 748 | g_list_free_full (ref_list, (GDestroyNotify) gtk_tree_row_reference_free); |
632 | 749 | |
633 | popup_browser->load_dir (NULL); | |
750 | browser->load_dir (NULL); | |
634 | 751 | } |
635 | 752 | |
636 | 753 | static void |
643 | 760 | gint err; |
644 | 761 | GtkWidget *dialog; |
645 | 762 | GtkTreeIter iter; |
646 | GtkTreeModel *model = GTK_TREE_MODEL | |
647 | (gtk_tree_view_get_model (popup_browser->view)); | |
648 | ||
649 | browser_set_selected_row_iter (popup_browser, &iter); | |
763 | struct browser *browser = data; | |
764 | GtkTreeModel *model = | |
765 | GTK_TREE_MODEL (gtk_tree_view_get_model (browser->view)); | |
766 | ||
767 | browser_set_selected_row_iter (browser, &iter); | |
650 | 768 | browser_get_item_info (model, &iter, NULL, &old_name, NULL); |
651 | 769 | |
652 | old_path = chain_path (popup_browser->dir, old_name); | |
770 | old_path = chain_path (browser->dir, old_name); | |
653 | 771 | |
654 | 772 | gtk_entry_set_text (name_dialog_entry, old_name); |
655 | 773 | gtk_widget_grab_focus (GTK_WIDGET (name_dialog_entry)); |
667 | 785 | if (result == GTK_RESPONSE_ACCEPT) |
668 | 786 | { |
669 | 787 | new_path = |
670 | chain_path (popup_browser->dir, | |
671 | gtk_entry_get_text (name_dialog_entry)); | |
672 | ||
673 | err = popup_browser->rename (old_path, new_path); | |
788 | chain_path (browser->dir, gtk_entry_get_text (name_dialog_entry)); | |
789 | ||
790 | err = browser->rename (old_path, new_path); | |
674 | 791 | |
675 | 792 | if (err < 0) |
676 | 793 | { |
688 | 805 | } |
689 | 806 | else |
690 | 807 | { |
691 | popup_browser->load_dir (NULL); | |
808 | browser->load_dir (NULL); | |
692 | 809 | } |
693 | 810 | |
694 | 811 | free (new_path); |
700 | 817 | gtk_widget_hide (GTK_WIDGET (name_dialog)); |
701 | 818 | } |
702 | 819 | |
820 | void | |
821 | elektroid_local_popover_set_up (gint count) | |
822 | { | |
823 | gtk_widget_set_sensitive (local_show_button, count <= 1 ? TRUE : FALSE); | |
824 | gtk_widget_set_sensitive (local_rename_button, count == 1 ? TRUE : FALSE); | |
825 | gtk_widget_set_sensitive (local_delete_button, count > 0 ? TRUE : FALSE); | |
826 | } | |
827 | ||
828 | void | |
829 | elektroid_remote_popover_set_up (gint count) | |
830 | { | |
831 | gtk_widget_set_sensitive (remote_rename_button, count == 1 ? TRUE : FALSE); | |
832 | gtk_widget_set_sensitive (remote_delete_button, count > 0 ? TRUE : FALSE); | |
833 | } | |
834 | ||
835 | static void | |
836 | elektroid_show_popover (struct browser *browser) | |
837 | { | |
838 | gint count; | |
839 | ||
840 | count = browser_get_selected_items_count (browser); | |
841 | browser->set_up_popover (count); | |
842 | gtk_popover_popup (browser->popover); | |
843 | } | |
844 | ||
703 | 845 | static gboolean |
704 | elektroid_show_item_popup (GtkWidget * treeview, GdkEventButton * event, | |
705 | gpointer data) | |
846 | elektroid_button_press (GtkWidget * treeview, GdkEventButton * event, | |
847 | gpointer data) | |
706 | 848 | { |
707 | 849 | GdkRectangle rect; |
708 | 850 | GtkTreePath *path; |
709 | gint count; | |
710 | 851 | gboolean selected; |
711 | 852 | GtkTreeSelection *selection; |
712 | 853 | struct browser *browser = data; |
713 | 854 | |
714 | popup_browser = browser; | |
715 | ||
716 | if (event->type == GDK_BUTTON_PRESS && event->button == 3) | |
855 | if (event->type == GDK_BUTTON_PRESS | |
856 | && event->button == GDK_BUTTON_SECONDARY) | |
717 | 857 | { |
718 | 858 | selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser->view)); |
719 | 859 | gtk_tree_view_get_path_at_pos (browser->view, |
720 | 860 | event->x, event->y, &path, NULL, NULL, |
721 | 861 | NULL); |
722 | 862 | |
863 | if (!path) | |
864 | { | |
865 | gtk_tree_selection_unselect_all (selection); | |
866 | return FALSE; | |
867 | } | |
868 | ||
723 | 869 | selected = gtk_tree_selection_path_is_selected (selection, path); |
870 | ||
724 | 871 | if (!selected) |
725 | 872 | { |
726 | 873 | if ((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK |
728 | 875 | { |
729 | 876 | gtk_tree_selection_unselect_all (selection); |
730 | 877 | } |
878 | ||
731 | 879 | gtk_tree_selection_select_path (selection, path); |
732 | 880 | } |
733 | ||
734 | count = browser_get_selected_items_count (browser); | |
735 | gtk_widget_set_sensitive (rename_button, count == 1 ? TRUE : FALSE); | |
736 | 881 | |
737 | 882 | gtk_tree_view_get_background_area (browser->view, path, NULL, &rect); |
738 | 883 | gtk_tree_path_free (path); |
739 | 884 | |
740 | 885 | rect.x = event->x; |
741 | 886 | rect.y = rect.y + rect.height; |
742 | gtk_popover_set_pointing_to (GTK_POPOVER (item_popmenu), &rect); | |
743 | gtk_popover_set_relative_to (GTK_POPOVER (item_popmenu), treeview); | |
744 | gtk_popover_popup (GTK_POPOVER (item_popmenu)); | |
887 | ||
888 | gtk_popover_set_pointing_to (browser->popover, &rect); | |
889 | ||
890 | elektroid_show_popover (browser); | |
745 | 891 | |
746 | 892 | return TRUE; |
747 | 893 | } |
765 | 911 | static gpointer |
766 | 912 | elektroid_load_sample (gpointer path) |
767 | 913 | { |
768 | sample_load (audio.sample, &load_mutex, &audio.frames, path, | |
769 | &load_thread_running, elektroid_redraw_sample); | |
914 | g_mutex_lock (&audio.mutex); | |
915 | audio.load_active = TRUE; | |
916 | g_mutex_unlock (&audio.mutex); | |
917 | ||
918 | sample_load (audio.sample, &audio.mutex, &audio.frames, path, | |
919 | &audio.load_active, elektroid_redraw_sample); | |
920 | ||
921 | g_mutex_lock (&audio.mutex); | |
922 | audio.load_active = FALSE; | |
923 | g_mutex_unlock (&audio.mutex); | |
924 | ||
770 | 925 | free (path); |
771 | g_idle_add (elektroid_update_ui_after_load, NULL); | |
926 | ||
772 | 927 | return NULL; |
773 | 928 | } |
774 | 929 | |
776 | 931 | elektroid_start_load_thread (gchar * path) |
777 | 932 | { |
778 | 933 | debug_print (1, "Creating load thread...\n"); |
779 | load_thread_running = TRUE; | |
934 | ||
780 | 935 | load_thread = g_thread_new ("load_sample", elektroid_load_sample, path); |
936 | ||
937 | g_timeout_add (100, elektroid_update_ui_on_load, NULL); | |
781 | 938 | } |
782 | 939 | |
783 | 940 | static void |
784 | 941 | elektroid_stop_load_thread () |
785 | 942 | { |
786 | 943 | debug_print (1, "Stopping load thread...\n"); |
787 | load_thread_running = FALSE; | |
944 | ||
945 | g_mutex_lock (&audio.mutex); | |
946 | audio.load_active = FALSE; | |
947 | g_mutex_unlock (&audio.mutex); | |
948 | ||
788 | 949 | if (load_thread) |
789 | 950 | { |
790 | 951 | g_thread_join (load_thread); |
791 | g_thread_unref (load_thread); | |
792 | } | |
793 | load_thread = NULL; | |
952 | load_thread = NULL; | |
953 | } | |
794 | 954 | } |
795 | 955 | |
796 | 956 | static void |
800 | 960 | if (task_thread) |
801 | 961 | { |
802 | 962 | g_thread_join (task_thread); |
803 | g_thread_unref (task_thread); | |
804 | } | |
805 | task_thread = NULL; | |
963 | task_thread = NULL; | |
964 | } | |
806 | 965 | } |
807 | 966 | |
808 | 967 | static void |
809 | 968 | elektroid_stop_task_thread () |
810 | 969 | { |
811 | 970 | debug_print (1, "Stopping task thread...\n"); |
812 | active_task.running = 0; | |
971 | ||
972 | g_mutex_lock (&sample_transfer.transfer.mutex); | |
973 | sample_transfer.transfer.active = FALSE; | |
974 | g_mutex_unlock (&sample_transfer.transfer.mutex); | |
975 | ||
813 | 976 | elektroid_join_task_thread (); |
814 | 977 | } |
815 | 978 | |
848 | 1011 | type = get_type_from_inventory_icon (icon); |
849 | 1012 | if (type == ELEKTROID_FILE) |
850 | 1013 | { |
1014 | gtk_widget_set_sensitive (local_open_button, TRUE); | |
851 | 1015 | sample_path = chain_path (local_browser.dir, name); |
852 | 1016 | elektroid_start_load_thread (sample_path); |
853 | 1017 | } |
854 | free (icon); | |
855 | free (name); | |
1018 | else | |
1019 | { | |
1020 | gtk_widget_set_sensitive (local_open_button, FALSE); | |
1021 | } | |
1022 | g_free (icon); | |
1023 | g_free (name); | |
856 | 1024 | } |
857 | 1025 | |
858 | 1026 | return FALSE; |
868 | 1036 | double x_ratio, mid_y, value; |
869 | 1037 | short *sample; |
870 | 1038 | |
871 | g_mutex_lock (&load_mutex); | |
1039 | g_mutex_lock (&audio.mutex); | |
872 | 1040 | |
873 | 1041 | if (audio.sample->len <= 0) |
874 | 1042 | { |
875 | goto cleanup; | |
1043 | g_mutex_unlock (&audio.mutex); | |
1044 | return FALSE; | |
876 | 1045 | } |
877 | 1046 | |
878 | 1047 | context = gtk_widget_get_style_context (widget); |
899 | 1068 | } |
900 | 1069 | } |
901 | 1070 | |
902 | cleanup: | |
903 | g_mutex_unlock (&load_mutex); | |
1071 | g_mutex_unlock (&audio.mutex); | |
1072 | ||
904 | 1073 | return FALSE; |
1074 | } | |
1075 | ||
1076 | static void | |
1077 | elektroid_show_clicked (GtkWidget * object, gpointer data) | |
1078 | { | |
1079 | GtkTreeIter iter; | |
1080 | GtkTreeModel *model; | |
1081 | gchar *name; | |
1082 | gchar *uri; | |
1083 | GVariant *params, *result; | |
1084 | GVariantBuilder builder; | |
1085 | GFile *file; | |
1086 | GDBusProxy *proxy; | |
1087 | gchar *path = NULL; | |
1088 | gboolean done = FALSE; | |
1089 | gint count = browser_get_selected_items_count (&local_browser); | |
1090 | ||
1091 | if (count == 0) | |
1092 | { | |
1093 | path = chain_path (local_browser.dir, NULL); | |
1094 | } | |
1095 | else if (count == 1) | |
1096 | { | |
1097 | browser_set_selected_row_iter (&local_browser, &iter); | |
1098 | model = GTK_TREE_MODEL (gtk_tree_view_get_model (local_browser.view)); | |
1099 | browser_get_item_info (model, &iter, NULL, &name, NULL); | |
1100 | path = chain_path (local_browser.dir, name); | |
1101 | g_free (name); | |
1102 | } | |
1103 | else | |
1104 | { | |
1105 | return; | |
1106 | } | |
1107 | ||
1108 | file = g_file_new_for_path (path); | |
1109 | g_free (path); | |
1110 | uri = g_file_get_uri (file); | |
1111 | g_object_unref (file); | |
1112 | ||
1113 | proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, | |
1114 | G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | |
1115 | | | |
1116 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, | |
1117 | NULL, | |
1118 | "org.freedesktop.FileManager1", | |
1119 | "/org/freedesktop/FileManager1", | |
1120 | "org.freedesktop.FileManager1", | |
1121 | NULL, NULL); | |
1122 | if (proxy) | |
1123 | { | |
1124 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("as")); | |
1125 | g_variant_builder_add (&builder, "s", uri); | |
1126 | ||
1127 | params = g_variant_new ("(ass)", &builder, ""); | |
1128 | ||
1129 | result = g_dbus_proxy_call_sync (proxy, "ShowItems", | |
1130 | params, G_DBUS_CALL_FLAGS_NONE, | |
1131 | -1, NULL, NULL); | |
1132 | ||
1133 | if (result != NULL) | |
1134 | { | |
1135 | done = TRUE; | |
1136 | g_variant_unref (result); | |
1137 | } | |
1138 | ||
1139 | g_object_unref (proxy); | |
1140 | } | |
1141 | ||
1142 | if (!done) | |
1143 | { | |
1144 | g_app_info_launch_default_for_uri (uri, NULL, NULL); | |
1145 | } | |
1146 | ||
1147 | g_free (uri); | |
1148 | } | |
1149 | ||
1150 | static void | |
1151 | elektroid_open_clicked (GtkWidget * object, gpointer data) | |
1152 | { | |
1153 | GtkTreeIter iter; | |
1154 | GtkTreeModel *model; | |
1155 | gchar *name; | |
1156 | gchar *path; | |
1157 | gchar *uri; | |
1158 | GFile *file; | |
1159 | ||
1160 | browser_set_selected_row_iter (&local_browser, &iter); | |
1161 | model = GTK_TREE_MODEL (gtk_tree_view_get_model (local_browser.view)); | |
1162 | browser_get_item_info (model, &iter, NULL, &name, NULL); | |
1163 | path = chain_path (local_browser.dir, name); | |
1164 | g_free (name); | |
1165 | ||
1166 | file = g_file_new_for_path (path); | |
1167 | g_free (path); | |
1168 | uri = g_file_get_uri (file); | |
1169 | g_object_unref (file); | |
1170 | ||
1171 | g_app_info_launch_default_for_uri_async (uri, NULL, NULL, NULL, NULL); | |
1172 | free (uri); | |
905 | 1173 | } |
906 | 1174 | |
907 | 1175 | static void |
982 | 1250 | elektroid_check_connector (); |
983 | 1251 | if (d_iter == NULL) |
984 | 1252 | { |
985 | fprintf (stderr, __FILE__ ": Error while opening remote %s dir\n", | |
986 | remote_browser.dir); | |
1253 | error_print ("Error while opening remote %s dir\n", remote_browser.dir); | |
987 | 1254 | goto end; |
988 | 1255 | } |
989 | 1256 | |
1025 | 1292 | |
1026 | 1293 | if (!(dir = opendir (local_browser.dir))) |
1027 | 1294 | { |
1028 | fprintf (stderr, __FILE__ ": Error while opening local %s dir\n", | |
1029 | local_browser.dir); | |
1295 | error_print ("Error while opening local %s dir\n", local_browser.dir); | |
1030 | 1296 | goto end; |
1031 | 1297 | } |
1032 | 1298 | |
1097 | 1363 | } |
1098 | 1364 | else |
1099 | 1365 | { |
1100 | fprintf (stderr, | |
1101 | __FILE__ ": Error while opening local %s dir\n", name); | |
1366 | error_print ("Error while opening local %s dir\n", name); | |
1102 | 1367 | error = errno; |
1103 | 1368 | } |
1104 | 1369 | } |
1123 | 1388 | gtk_widget_grab_focus (GTK_WIDGET (name_dialog_entry)); |
1124 | 1389 | gtk_widget_set_sensitive (name_dialog_accept_button, FALSE); |
1125 | 1390 | |
1126 | gtk_window_set_title (GTK_WINDOW (name_dialog), _("Add directory")); | |
1391 | gtk_window_set_title (GTK_WINDOW (name_dialog), _("Add Directory")); | |
1127 | 1392 | |
1128 | 1393 | result = GTK_RESPONSE_ACCEPT; |
1129 | 1394 | |
1225 | 1490 | } |
1226 | 1491 | else |
1227 | 1492 | { |
1228 | fprintf (stderr, __FILE__ ": Error while opening remote %s dir\n", | |
1229 | path); | |
1493 | error_print ("Error while opening remote %s dir\n", path); | |
1230 | 1494 | } |
1231 | 1495 | return connector_delete_dir (&connector, path); |
1232 | 1496 | } |
1268 | 1532 | } |
1269 | 1533 | else |
1270 | 1534 | { |
1271 | fprintf (stderr, __FILE__ ": Error while opening local %s dir\n", | |
1272 | path); | |
1535 | error_print ("Error while opening local %s dir\n", path); | |
1273 | 1536 | } |
1274 | 1537 | return rmdir (path); |
1275 | 1538 | } |
1343 | 1606 | static void |
1344 | 1607 | elektroid_cancel_running_task (GtkWidget * object, gpointer data) |
1345 | 1608 | { |
1346 | active_task.running = 0; | |
1609 | g_mutex_lock (&sample_transfer.transfer.mutex); | |
1610 | sample_transfer.transfer.active = FALSE; | |
1611 | g_mutex_unlock (&sample_transfer.transfer.mutex); | |
1347 | 1612 | } |
1348 | 1613 | |
1349 | 1614 | static gboolean |
1350 | elektroid_select_queued_task (enum elektroid_task_status status) | |
1615 | elektroid_task_is_queued (enum elektroid_task_status status) | |
1351 | 1616 | { |
1352 | 1617 | return (status == QUEUED); |
1353 | 1618 | } |
1354 | 1619 | |
1355 | 1620 | static gboolean |
1356 | elektroid_select_finished_task (enum elektroid_task_status status) | |
1621 | elektroid_task_is_finished (enum elektroid_task_status status) | |
1357 | 1622 | { |
1358 | 1623 | return (status == COMPLETED_OK || |
1359 | 1624 | status == COMPLETED_ERROR || status == CANCELED); |
1374 | 1639 | gtk_tree_model_get (GTK_TREE_MODEL (task_list_store), &iter, |
1375 | 1640 | TASK_LIST_STORE_STATUS_FIELD, &status, -1); |
1376 | 1641 | |
1377 | if (elektroid_select_queued_task (status)) | |
1642 | if (elektroid_task_is_queued (status)) | |
1378 | 1643 | { |
1379 | 1644 | queued = TRUE; |
1380 | 1645 | } |
1381 | 1646 | |
1382 | if (elektroid_select_finished_task (status)) | |
1647 | if (elektroid_task_is_finished (status)) | |
1383 | 1648 | { |
1384 | 1649 | finished = TRUE; |
1385 | 1650 | } |
1427 | 1692 | static void |
1428 | 1693 | elektroid_remove_queued_tasks (GtkWidget * object, gpointer data) |
1429 | 1694 | { |
1430 | elektroid_remove_tasks_on_cond (elektroid_select_queued_task); | |
1695 | elektroid_remove_tasks_on_cond (elektroid_task_is_queued); | |
1431 | 1696 | } |
1432 | 1697 | |
1433 | 1698 | static void |
1434 | 1699 | elektroid_clear_finished_tasks (GtkWidget * object, gpointer data) |
1435 | 1700 | { |
1436 | elektroid_remove_tasks_on_cond (elektroid_select_finished_task); | |
1437 | } | |
1438 | ||
1701 | elektroid_remove_tasks_on_cond (elektroid_task_is_finished); | |
1702 | } | |
1439 | 1703 | |
1440 | 1704 | static gboolean |
1441 | 1705 | elektroid_complete_running_task (gpointer data) |
1442 | 1706 | { |
1443 | 1707 | GtkTreeIter iter; |
1444 | const gchar *status = elektroid_get_human_task_status (active_task.status); | |
1708 | const gchar *status = | |
1709 | elektroid_get_human_task_status (sample_transfer.status); | |
1445 | 1710 | |
1446 | 1711 | if (elektroid_get_running_task (&iter)) |
1447 | 1712 | { |
1448 | 1713 | gtk_list_store_set (task_list_store, &iter, |
1449 | TASK_LIST_STORE_STATUS_FIELD, active_task.status, | |
1714 | TASK_LIST_STORE_STATUS_FIELD, | |
1715 | sample_transfer.status, | |
1450 | 1716 | TASK_LIST_STORE_STATUS_HUMAN_FIELD, status, -1); |
1451 | active_task.running = 0; | |
1452 | free (active_task.src); | |
1453 | free (active_task.dst); | |
1717 | elektroid_cancel_running_task (NULL, NULL); | |
1718 | g_free (sample_transfer.src); | |
1719 | g_free (sample_transfer.dst); | |
1720 | ||
1721 | gtk_widget_set_sensitive (cancel_task_button, FALSE); | |
1454 | 1722 | } |
1455 | 1723 | else |
1456 | 1724 | { |
1468 | 1736 | gchar *src; |
1469 | 1737 | gchar *dst; |
1470 | 1738 | GtkTreePath *path; |
1739 | gboolean sample_transfer_active; | |
1471 | 1740 | gboolean found = elektroid_get_next_queued_task (&iter, &type, &src, &dst); |
1472 | ||
1473 | if (found) | |
1741 | const gchar *status_human = elektroid_get_human_task_status (RUNNING); | |
1742 | ||
1743 | g_mutex_lock (&sample_transfer.transfer.mutex); | |
1744 | sample_transfer_active = sample_transfer.transfer.active; | |
1745 | g_mutex_unlock (&sample_transfer.transfer.mutex); | |
1746 | ||
1747 | if (!sample_transfer_active && found) | |
1474 | 1748 | { |
1475 | 1749 | gtk_list_store_set (task_list_store, &iter, |
1476 | TASK_LIST_STORE_STATUS_FIELD, RUNNING, -1); | |
1750 | TASK_LIST_STORE_STATUS_FIELD, RUNNING, | |
1751 | TASK_LIST_STORE_STATUS_HUMAN_FIELD, status_human, | |
1752 | -1); | |
1477 | 1753 | path = |
1478 | 1754 | gtk_tree_model_get_path (GTK_TREE_MODEL (task_list_store), &iter); |
1479 | 1755 | gtk_tree_view_set_cursor (GTK_TREE_VIEW (task_tree_view), path, NULL, |
1480 | 1756 | FALSE); |
1481 | 1757 | gtk_tree_path_free (path); |
1482 | active_task.running = 1; | |
1483 | active_task.src = src; | |
1484 | active_task.dst = dst; | |
1485 | active_task.progress = 0.0; | |
1758 | sample_transfer.transfer.active = TRUE; | |
1759 | sample_transfer.src = src; | |
1760 | sample_transfer.dst = dst; | |
1486 | 1761 | debug_print (1, "Running task type %d from %s to %s...\n", type, |
1487 | active_task.src, active_task.dst); | |
1762 | sample_transfer.src, sample_transfer.dst); | |
1488 | 1763 | if (type == UPLOAD) |
1489 | 1764 | { |
1490 | 1765 | task_thread = |
1500 | 1775 | } |
1501 | 1776 | else |
1502 | 1777 | { |
1503 | gtk_widget_set_sensitive (cancel_task_button, FALSE); | |
1504 | 1778 | gtk_widget_set_sensitive (rx_sysex_button, TRUE); |
1505 | 1779 | gtk_widget_set_sensitive (tx_sysex_button, TRUE); |
1506 | } | |
1780 | gtk_widget_set_sensitive (os_upgrade_button, TRUE); | |
1781 | } | |
1782 | ||
1783 | elektroid_check_task_buttons (NULL); | |
1507 | 1784 | |
1508 | 1785 | return FALSE; |
1509 | 1786 | } |
1517 | 1794 | ssize_t frames; |
1518 | 1795 | GArray *sample; |
1519 | 1796 | |
1520 | debug_print (1, "Local path: %s\n", active_task.src); | |
1521 | ||
1522 | basec = strdup (active_task.src); | |
1797 | debug_print (1, "Local path: %s\n", sample_transfer.src); | |
1798 | ||
1799 | basec = strdup (sample_transfer.src); | |
1523 | 1800 | bname = basename (basec); |
1524 | 1801 | remove_ext (bname); |
1525 | remote_path = chain_path (active_task.dst, bname); | |
1802 | remote_path = chain_path (sample_transfer.dst, bname); | |
1526 | 1803 | free (basec); |
1527 | 1804 | |
1528 | 1805 | debug_print (1, "Remote path: %s\n", remote_path); |
1529 | 1806 | |
1530 | 1807 | sample = g_array_new (FALSE, FALSE, sizeof (gshort)); |
1531 | 1808 | |
1532 | sample_load (sample, NULL, NULL, active_task.src, &active_task.running, | |
1533 | NULL); | |
1809 | frames = sample_load (sample, &sample_transfer.transfer.mutex, NULL, | |
1810 | sample_transfer.src, &sample_transfer.transfer.active, | |
1811 | NULL); | |
1812 | ||
1813 | if (frames < 0) | |
1814 | { | |
1815 | error_print ("Error while reading sample\n"); | |
1816 | sample_transfer.status = COMPLETED_ERROR; | |
1817 | goto complete_task; | |
1818 | } | |
1534 | 1819 | |
1535 | 1820 | frames = connector_upload (&connector, sample, remote_path, |
1536 | &active_task.running, elektroid_update_progress); | |
1821 | &sample_transfer.transfer, | |
1822 | elektroid_update_progress); | |
1823 | g_idle_add (elektroid_check_connector_bg, NULL); | |
1537 | 1824 | free (remote_path); |
1538 | 1825 | |
1539 | if (frames < 0) | |
1540 | { | |
1541 | fprintf (stderr, __FILE__ ": Error while uploading\n"); | |
1542 | active_task.status = COMPLETED_ERROR; | |
1826 | if (frames < 0 && sample_transfer.transfer.active) | |
1827 | { | |
1828 | error_print ("Error while uploading\n"); | |
1829 | sample_transfer.status = COMPLETED_ERROR; | |
1543 | 1830 | } |
1544 | 1831 | else |
1545 | 1832 | { |
1546 | if (active_task.running) | |
1547 | { | |
1548 | active_task.status = COMPLETED_OK; | |
1833 | g_mutex_lock (&sample_transfer.transfer.mutex); | |
1834 | if (sample_transfer.transfer.active) | |
1835 | { | |
1836 | sample_transfer.status = COMPLETED_OK; | |
1549 | 1837 | } |
1550 | 1838 | else |
1551 | 1839 | { |
1552 | active_task.status = CANCELED; | |
1553 | } | |
1554 | } | |
1555 | ||
1556 | elektroid_check_connector (); | |
1840 | sample_transfer.status = CANCELED; | |
1841 | } | |
1842 | g_mutex_unlock (&sample_transfer.transfer.mutex); | |
1843 | } | |
1557 | 1844 | |
1558 | 1845 | g_array_free (sample, TRUE); |
1559 | 1846 | |
1560 | if (strcmp (active_task.dst, remote_browser.dir) == 0) | |
1561 | { | |
1562 | g_idle_add (remote_browser.load_dir, NULL); | |
1563 | } | |
1847 | if (frames > 0) | |
1848 | { | |
1849 | if (strcmp (sample_transfer.dst, remote_browser.dir) == 0) | |
1850 | { | |
1851 | g_idle_add (remote_browser.load_dir, NULL); | |
1852 | } | |
1853 | } | |
1854 | ||
1855 | complete_task: | |
1564 | 1856 | g_idle_add (elektroid_complete_running_task, NULL); |
1565 | ||
1566 | if (frames >= 0) | |
1567 | { | |
1568 | g_idle_add (elektroid_run_next_task, NULL); | |
1569 | g_idle_add (elektroid_check_task_buttons, NULL); | |
1570 | } | |
1571 | else | |
1572 | { | |
1573 | gtk_widget_set_sensitive (cancel_task_button, FALSE); | |
1574 | } | |
1857 | g_idle_add (elektroid_run_next_task, NULL); | |
1575 | 1858 | |
1576 | 1859 | return NULL; |
1577 | 1860 | } |
1595 | 1878 | type_human, -1); |
1596 | 1879 | |
1597 | 1880 | gtk_widget_set_sensitive (remove_tasks_button, TRUE); |
1598 | gtk_widget_set_sensitive (clear_tasks_button, TRUE); | |
1599 | 1881 | } |
1600 | 1882 | |
1601 | 1883 | static void |
1609 | 1891 | |
1610 | 1892 | if (!dir) |
1611 | 1893 | { |
1612 | fprintf (stderr, __FILE__ ": Error while opening local %s dir\n", | |
1613 | local_abs_dir); | |
1894 | error_print ("Error while opening local %s dir\n", local_abs_dir); | |
1614 | 1895 | goto cleanup_not_dir; |
1615 | 1896 | } |
1616 | 1897 | |
1617 | 1898 | remote_abs_dir = chain_path (remote_browser.dir, rel_dir); |
1618 | 1899 | if (elektroid_remote_mkdir (remote_abs_dir)) |
1619 | 1900 | { |
1620 | fprintf (stderr, __FILE__ ": Error while creating remote %s dir\n", | |
1621 | remote_abs_dir); | |
1901 | error_print ("Error while creating remote %s dir\n", remote_abs_dir); | |
1622 | 1902 | goto cleanup; |
1623 | 1903 | } |
1624 | 1904 | |
1686 | 1966 | free (dst); |
1687 | 1967 | free (src); |
1688 | 1968 | } |
1689 | free (name); | |
1690 | free (icon); | |
1969 | g_free (name); | |
1970 | g_free (icon); | |
1691 | 1971 | } |
1692 | 1972 | |
1693 | 1973 | static void |
1705 | 1985 | |
1706 | 1986 | gtk_widget_set_sensitive (rx_sysex_button, FALSE); |
1707 | 1987 | gtk_widget_set_sensitive (tx_sysex_button, FALSE); |
1988 | gtk_widget_set_sensitive (os_upgrade_button, FALSE); | |
1708 | 1989 | |
1709 | 1990 | if (!queued) |
1710 | 1991 | { |
1722 | 2003 | gchar *bname; |
1723 | 2004 | gchar *new_filename; |
1724 | 2005 | |
1725 | debug_print (1, "Remote path: %s\n", active_task.src); | |
1726 | ||
1727 | basec = strdup (active_task.src); | |
2006 | debug_print (1, "Remote path: %s\n", sample_transfer.src); | |
2007 | ||
2008 | basec = strdup (sample_transfer.src); | |
1728 | 2009 | bname = basename (basec); |
1729 | 2010 | new_filename = malloc (PATH_MAX); |
1730 | 2011 | snprintf (new_filename, PATH_MAX, "%s.wav", bname); |
1731 | 2012 | free (basec); |
1732 | local_path = chain_path (active_task.dst, new_filename); | |
2013 | local_path = chain_path (sample_transfer.dst, new_filename); | |
1733 | 2014 | free (new_filename); |
1734 | 2015 | |
1735 | 2016 | debug_print (1, "Local path: %s\n", local_path); |
1736 | 2017 | |
1737 | 2018 | sample = |
1738 | connector_download (&connector, active_task.src, &active_task.running, | |
1739 | elektroid_update_progress); | |
1740 | elektroid_check_connector (); | |
1741 | ||
1742 | if (sample == NULL) | |
1743 | { | |
1744 | fprintf (stderr, __FILE__ ": Error while downloading\n"); | |
1745 | active_task.status = COMPLETED_ERROR; | |
2019 | connector_download (&connector, sample_transfer.src, | |
2020 | &sample_transfer.transfer, elektroid_update_progress); | |
2021 | g_idle_add (elektroid_check_connector_bg, NULL); | |
2022 | ||
2023 | if (sample == NULL && sample_transfer.transfer.active) | |
2024 | { | |
2025 | error_print ("Error while downloading\n"); | |
2026 | sample_transfer.status = COMPLETED_ERROR; | |
1746 | 2027 | } |
1747 | 2028 | else |
1748 | 2029 | { |
1749 | if (active_task.running) | |
2030 | g_mutex_lock (&sample_transfer.transfer.mutex); | |
2031 | if (sample_transfer.transfer.active) | |
1750 | 2032 | { |
1751 | 2033 | debug_print (1, "Writing to file '%s'...\n", local_path); |
1752 | 2034 | frames = sample_save (sample, local_path); |
1753 | 2035 | debug_print (1, "%zu frames written\n", frames); |
1754 | 2036 | free (local_path); |
1755 | 2037 | |
1756 | active_task.status = COMPLETED_OK; | |
2038 | sample_transfer.status = COMPLETED_OK; | |
1757 | 2039 | } |
1758 | 2040 | else |
1759 | 2041 | { |
1760 | active_task.status = CANCELED; | |
1761 | } | |
2042 | sample_transfer.status = CANCELED; | |
2043 | } | |
2044 | g_mutex_unlock (&sample_transfer.transfer.mutex); | |
2045 | } | |
2046 | ||
2047 | if (sample) | |
2048 | { | |
1762 | 2049 | g_array_free (sample, TRUE); |
1763 | if (strcmp (active_task.dst, local_browser.dir) == 0) | |
2050 | if (strcmp (sample_transfer.dst, local_browser.dir) == 0) | |
1764 | 2051 | { |
1765 | 2052 | g_idle_add (local_browser.load_dir, NULL); |
1766 | 2053 | } |
1768 | 2055 | |
1769 | 2056 | g_idle_add (elektroid_complete_running_task, NULL); |
1770 | 2057 | g_idle_add (elektroid_run_next_task, NULL); |
1771 | g_idle_add (elektroid_check_task_buttons, NULL); | |
1772 | 2058 | |
1773 | 2059 | return NULL; |
1774 | 2060 | } |
1785 | 2071 | elektroid_check_connector (); |
1786 | 2072 | if (d_iter == NULL) |
1787 | 2073 | { |
1788 | fprintf (stderr, __FILE__ ": Error while opening remote %s dir\n", | |
1789 | remote_abs_dir); | |
2074 | error_print ("Error while opening remote %s dir\n", remote_abs_dir); | |
1790 | 2075 | goto cleanup_not_dir; |
1791 | 2076 | } |
1792 | 2077 | |
1793 | 2078 | local_abs_dir = chain_path (local_browser.dir, rel_dir); |
1794 | 2079 | if (elektroid_local_mkdir (local_abs_dir)) |
1795 | 2080 | { |
1796 | fprintf (stderr, __FILE__ ": Error while creating local %s dir\n", | |
1797 | local_abs_dir); | |
2081 | error_print ("Error while creating local %s dir\n", local_abs_dir); | |
1798 | 2082 | goto cleanup; |
1799 | 2083 | } |
1800 | 2084 | |
1852 | 2136 | free (dst); |
1853 | 2137 | free (src); |
1854 | 2138 | } |
1855 | free (name); | |
1856 | free (icon); | |
2139 | g_free (name); | |
2140 | g_free (icon); | |
1857 | 2141 | } |
1858 | 2142 | |
1859 | 2143 | static void |
1871 | 2155 | |
1872 | 2156 | gtk_widget_set_sensitive (rx_sysex_button, FALSE); |
1873 | 2157 | gtk_widget_set_sensitive (tx_sysex_button, FALSE); |
2158 | gtk_widget_set_sensitive (os_upgrade_button, FALSE); | |
1874 | 2159 | |
1875 | 2160 | if (!queued) |
1876 | 2161 | { |
1882 | 2167 | elektroid_set_progress_value (gpointer data) |
1883 | 2168 | { |
1884 | 2169 | GtkTreeIter iter; |
2170 | gdouble *value = data; | |
1885 | 2171 | |
1886 | 2172 | if (elektroid_get_running_task (&iter)) |
1887 | 2173 | { |
1888 | 2174 | gtk_list_store_set (task_list_store, &iter, |
1889 | 2175 | TASK_LIST_STORE_PROGRESS_FIELD, |
1890 | 100.0 * active_task.progress, -1); | |
1891 | } | |
2176 | 100.0 * (*value), -1); | |
2177 | } | |
2178 | ||
2179 | free (data); | |
1892 | 2180 | |
1893 | 2181 | return FALSE; |
1894 | 2182 | } |
1896 | 2184 | static void |
1897 | 2185 | elektroid_update_progress (gdouble progress) |
1898 | 2186 | { |
1899 | active_task.progress = progress; | |
1900 | g_idle_add (elektroid_set_progress_value, NULL); | |
2187 | gdouble *value = malloc (sizeof (gdouble)); | |
2188 | *value = progress; | |
2189 | g_idle_add (elektroid_set_progress_value, value); | |
2190 | } | |
2191 | ||
2192 | static gboolean | |
2193 | elektroid_key_press (GtkWidget * widget, GdkEventKey * event, gpointer data) | |
2194 | { | |
2195 | gint count; | |
2196 | struct browser *browser = data; | |
2197 | ||
2198 | if (event->type == GDK_KEY_PRESS) | |
2199 | { | |
2200 | if (event->keyval == GDK_KEY_Delete) | |
2201 | { | |
2202 | count = browser_get_selected_items_count (browser); | |
2203 | if (count) | |
2204 | { | |
2205 | elektroid_delete_files (NULL, browser); | |
2206 | } | |
2207 | return TRUE; | |
2208 | } | |
2209 | else if (event->state & GDK_CONTROL_MASK && event->keyval == GDK_KEY_r) | |
2210 | { | |
2211 | browser->load_dir (NULL); | |
2212 | return TRUE; | |
2213 | } | |
2214 | else if (event->state & GDK_CONTROL_MASK | |
2215 | && (event->keyval == GDK_KEY_U || event->keyval == GDK_KEY_u)) | |
2216 | { | |
2217 | browser_go_up (NULL, browser); | |
2218 | return TRUE; | |
2219 | } | |
2220 | else if (event->state & GDK_CONTROL_MASK | |
2221 | && event->state & GDK_SHIFT_MASK && (event->keyval == GDK_KEY_N | |
2222 | || event->keyval == | |
2223 | GDK_KEY_n)) | |
2224 | { | |
2225 | elektroid_add_dir (NULL, browser); | |
2226 | return TRUE; | |
2227 | } | |
2228 | else if (event->state & GDK_CONTROL_MASK | |
2229 | && event->state & GDK_SHIFT_MASK && (event->keyval == GDK_KEY_R | |
2230 | || event->keyval == | |
2231 | GDK_KEY_r)) | |
2232 | { | |
2233 | count = browser_get_selected_items_count (browser); | |
2234 | if (count == 1) | |
2235 | { | |
2236 | elektroid_rename_item (NULL, browser); | |
2237 | } | |
2238 | return TRUE; | |
2239 | } | |
2240 | else if (event->keyval == GDK_KEY_Menu) | |
2241 | { | |
2242 | elektroid_show_popover (browser); | |
2243 | return TRUE; | |
2244 | } | |
2245 | } | |
2246 | ||
2247 | return FALSE; | |
1901 | 2248 | } |
1902 | 2249 | |
1903 | 2250 | static void |
1906 | 2253 | GtkTreeIter iter; |
1907 | 2254 | GValue cardv = G_VALUE_INIT; |
1908 | 2255 | guint card; |
2256 | gint count; | |
1909 | 2257 | |
1910 | 2258 | if (gtk_combo_box_get_active_iter (devices_combo, &iter) == TRUE) |
1911 | 2259 | { |
2260 | if (connector_check (&connector)) | |
2261 | { | |
2262 | connector_destroy (&connector); | |
2263 | } | |
2264 | ||
1912 | 2265 | gtk_tree_model_get_value (GTK_TREE_MODEL (devices_list_store), |
1913 | 2266 | &iter, 0, &cardv); |
1914 | 2267 | |
1916 | 2269 | |
1917 | 2270 | if (connector_init (&connector, card) < 0) |
1918 | 2271 | { |
1919 | fprintf (stderr, __FILE__ ": Error while connecting\n"); | |
2272 | error_print ("Error while connecting\n"); | |
1920 | 2273 | } |
1921 | 2274 | |
1922 | 2275 | if (elektroid_check_connector ()) |
1923 | 2276 | { |
1924 | 2277 | strcpy (remote_browser.dir, "/"); |
1925 | 2278 | remote_browser.load_dir (NULL); |
2279 | ||
2280 | count = browser_get_selected_items_count (&local_browser); | |
2281 | gtk_widget_set_sensitive (upload_button, count > 0); | |
1926 | 2282 | } |
1927 | 2283 | } |
1928 | 2284 | } |
1963 | 2319 | (glade_file, PATH_MAX, "%s/%s/res/gui.glade", DATADIR, |
1964 | 2320 | PACKAGE) >= PATH_MAX) |
1965 | 2321 | { |
1966 | fprintf (stderr, __FILE__ ": Path too long\n"); | |
2322 | error_print ("Path too long\n"); | |
1967 | 2323 | return -1; |
1968 | 2324 | } |
1969 | 2325 | |
1970 | 2326 | if (snprintf |
1971 | 2327 | (css_file, PATH_MAX, "%s/%s/res/gui.css", DATADIR, PACKAGE) >= PATH_MAX) |
1972 | 2328 | { |
1973 | fprintf (stderr, __FILE__ ": Path too long\n"); | |
2329 | error_print ("Path too long\n"); | |
1974 | 2330 | return -1; |
1975 | 2331 | } |
1976 | 2332 | |
2018 | 2374 | GTK_WIDGET (gtk_builder_get_object (builder, "rx_sysex_button")); |
2019 | 2375 | tx_sysex_button = |
2020 | 2376 | GTK_WIDGET (gtk_builder_get_object (builder, "tx_sysex_button")); |
2377 | os_upgrade_button = | |
2378 | GTK_WIDGET (gtk_builder_get_object (builder, "os_upgrade_button")); | |
2021 | 2379 | about_button = |
2022 | 2380 | GTK_WIDGET (gtk_builder_get_object (builder, "about_button")); |
2023 | 2381 | |
2040 | 2398 | GTK_WIDGET (gtk_builder_get_object (builder, "download_button")); |
2041 | 2399 | status_bar = GTK_STATUSBAR (gtk_builder_get_object (builder, "status_bar")); |
2042 | 2400 | |
2043 | item_popmenu = | |
2044 | GTK_WIDGET (gtk_builder_get_object (builder, "item_popmenu")); | |
2045 | rename_button = | |
2046 | GTK_WIDGET (gtk_builder_get_object (builder, "rename_button")); | |
2047 | delete_button = | |
2048 | GTK_WIDGET (gtk_builder_get_object (builder, "delete_button")); | |
2049 | ||
2050 | 2401 | g_signal_connect (main_window, "delete-event", |
2051 | 2402 | G_CALLBACK (elektroid_delete_window), NULL); |
2052 | 2403 | |
2053 | 2404 | g_signal_connect (progress_dialog_cancel_button, "clicked", |
2054 | 2405 | G_CALLBACK (elektroid_progress_dialog_end), NULL); |
2055 | 2406 | g_signal_connect (progress_dialog, "response", |
2056 | G_CALLBACK (elektroid_progress_dialog_response), NULL); | |
2407 | G_CALLBACK (elektroid_cancel_running_sysex), NULL); | |
2057 | 2408 | |
2058 | 2409 | g_signal_connect (rx_sysex_button, "clicked", |
2059 | 2410 | G_CALLBACK (elektroid_rx_sysex), NULL); |
2060 | 2411 | g_signal_connect (tx_sysex_button, "clicked", |
2061 | 2412 | G_CALLBACK (elektroid_tx_sysex), NULL); |
2413 | g_signal_connect (os_upgrade_button, "clicked", | |
2414 | G_CALLBACK (elektroid_upgrade_os), NULL); | |
2062 | 2415 | g_signal_connect (about_button, "clicked", |
2063 | 2416 | G_CALLBACK (elektroid_show_about), NULL); |
2064 | 2417 | |
2087 | 2440 | g_signal_connect (upload_button, "clicked", |
2088 | 2441 | G_CALLBACK (elektroid_add_upload_tasks), NULL); |
2089 | 2442 | |
2090 | g_signal_connect (rename_button, "clicked", | |
2091 | G_CALLBACK (elektroid_rename_item), NULL); | |
2092 | g_signal_connect (delete_button, "clicked", | |
2093 | G_CALLBACK (elektroid_delete_files), NULL); | |
2443 | remote_rename_button = | |
2444 | GTK_WIDGET (gtk_builder_get_object (builder, "remote_rename_button")); | |
2445 | remote_delete_button = | |
2446 | GTK_WIDGET (gtk_builder_get_object (builder, "remote_delete_button")); | |
2447 | g_signal_connect (remote_rename_button, "clicked", | |
2448 | G_CALLBACK (elektroid_rename_item), &remote_browser); | |
2449 | g_signal_connect (remote_delete_button, "clicked", | |
2450 | G_CALLBACK (elektroid_delete_files), &remote_browser); | |
2451 | ||
2452 | local_play_button = | |
2453 | GTK_WIDGET (gtk_builder_get_object (builder, "local_play_button")); | |
2454 | local_open_button = | |
2455 | GTK_WIDGET (gtk_builder_get_object (builder, "local_open_button")); | |
2456 | local_show_button = | |
2457 | GTK_WIDGET (gtk_builder_get_object (builder, "local_show_button")); | |
2458 | local_rename_button = | |
2459 | GTK_WIDGET (gtk_builder_get_object (builder, "local_rename_button")); | |
2460 | local_delete_button = | |
2461 | GTK_WIDGET (gtk_builder_get_object (builder, "local_delete_button")); | |
2462 | g_signal_connect (local_play_button, "clicked", | |
2463 | G_CALLBACK (elektroid_play_clicked), NULL); | |
2464 | g_signal_connect (local_open_button, "clicked", | |
2465 | G_CALLBACK (elektroid_open_clicked), NULL); | |
2466 | g_signal_connect (local_show_button, "clicked", | |
2467 | G_CALLBACK (elektroid_show_clicked), NULL); | |
2468 | g_signal_connect (local_rename_button, "clicked", | |
2469 | G_CALLBACK (elektroid_rename_item), &local_browser); | |
2470 | g_signal_connect (local_delete_button, "clicked", | |
2471 | G_CALLBACK (elektroid_delete_files), &local_browser); | |
2094 | 2472 | |
2095 | 2473 | remote_browser = (struct browser) |
2096 | 2474 | { |
2104 | 2482 | GTK_WIDGET (gtk_builder_get_object (builder, "remote_refresh_button")), |
2105 | 2483 | .dir_entry = |
2106 | 2484 | GTK_ENTRY (gtk_builder_get_object (builder, "remote_dir_entry")), |
2485 | .popover = | |
2486 | GTK_POPOVER (gtk_builder_get_object (builder, "remote_popover")), | |
2107 | 2487 | .dir = malloc (PATH_MAX), |
2108 | 2488 | .load_dir = elektroid_load_remote_dir, |
2109 | 2489 | .check_selection = elektroid_remote_check_selection, |
2110 | 2490 | .rename = elektroid_remote_rename, |
2111 | 2491 | .delete = elektroid_remote_delete, |
2112 | .mkdir = elektroid_remote_mkdir | |
2492 | .mkdir = elektroid_remote_mkdir, | |
2493 | .set_up_popover = elektroid_remote_popover_set_up | |
2113 | 2494 | }; |
2114 | 2495 | |
2115 | 2496 | g_signal_connect (gtk_tree_view_get_selection (remote_browser.view), |
2124 | 2505 | g_signal_connect (remote_browser.refresh_button, "clicked", |
2125 | 2506 | G_CALLBACK (browser_refresh), &remote_browser); |
2126 | 2507 | g_signal_connect (remote_browser.view, "button-press-event", |
2127 | G_CALLBACK (elektroid_show_item_popup), &remote_browser); | |
2508 | G_CALLBACK (elektroid_button_press), &remote_browser); | |
2509 | g_signal_connect (remote_browser.view, "key_press_event", | |
2510 | G_CALLBACK (elektroid_key_press), &remote_browser); | |
2128 | 2511 | |
2129 | 2512 | local_browser = (struct browser) |
2130 | 2513 | { |
2138 | 2521 | GTK_WIDGET (gtk_builder_get_object (builder, "local_refresh_button")), |
2139 | 2522 | .dir_entry = |
2140 | 2523 | GTK_ENTRY (gtk_builder_get_object (builder, "local_dir_entry")), |
2524 | .popover = | |
2525 | GTK_POPOVER (gtk_builder_get_object (builder, "local_popover")), | |
2141 | 2526 | .dir = malloc (PATH_MAX), |
2142 | 2527 | .load_dir = elektroid_load_local_dir, |
2143 | 2528 | .check_selection = elektroid_local_check_selection, |
2144 | 2529 | .rename = elektroid_local_rename, |
2145 | 2530 | .delete = elektroid_local_delete, |
2146 | .mkdir = elektroid_local_mkdir | |
2531 | .mkdir = elektroid_local_mkdir, | |
2532 | .set_up_popover = elektroid_local_popover_set_up | |
2147 | 2533 | }; |
2148 | 2534 | |
2149 | 2535 | g_signal_connect (gtk_tree_view_get_selection (local_browser.view), |
2158 | 2544 | g_signal_connect (local_browser.refresh_button, "clicked", |
2159 | 2545 | G_CALLBACK (browser_refresh), &local_browser); |
2160 | 2546 | g_signal_connect (local_browser.view, "button-press-event", |
2161 | G_CALLBACK (elektroid_show_item_popup), &local_browser); | |
2547 | G_CALLBACK (elektroid_button_press), &local_browser); | |
2548 | g_signal_connect (local_browser.view, "key_press_event", | |
2549 | G_CALLBACK (elektroid_key_press), &local_browser); | |
2162 | 2550 | |
2163 | 2551 | sortable = GTK_TREE_SORTABLE (gtk_tree_view_get_model (local_browser.view)); |
2164 | 2552 | gtk_tree_sortable_set_sort_func (sortable, BROWSER_LIST_STORE_NAME_FIELD, |
2215 | 2603 | gtk_widget_set_sensitive (upload_button, FALSE); |
2216 | 2604 | gtk_widget_set_sensitive (rx_sysex_button, FALSE); |
2217 | 2605 | gtk_widget_set_sensitive (tx_sysex_button, FALSE); |
2218 | ||
2219 | elektroid_load_devices (1); | |
2606 | gtk_widget_set_sensitive (os_upgrade_button, FALSE); | |
2607 | ||
2608 | elektroid_load_devices (TRUE); | |
2220 | 2609 | |
2221 | 2610 | gethostname (hostname, LABEL_MAX); |
2222 | 2611 | gtk_label_set_text (GTK_LABEL (hostname_label), hostname); |
2293 | 2682 | { |
2294 | 2683 | fprintf (stderr, "%s\n", PACKAGE_STRING); |
2295 | 2684 | exec_name = basename (argv[0]); |
2296 | fprintf (stderr, "Usage: %s [-l local-dir] [-v]\n", exec_name); | |
2685 | fprintf (stderr, "Usage: %s [options]\n", exec_name); | |
2297 | 2686 | exit (EXIT_FAILURE); |
2298 | 2687 | } |
2299 | 2688 |
24 | 24 | #include "sample.h" |
25 | 25 | #include "utils.h" |
26 | 26 | |
27 | #define LOAD_BUFFER_LEN 10000 | |
28 | ||
29 | 27 | size_t |
30 | 28 | sample_save (GArray * sample, gchar * path) |
31 | 29 | { |
42 | 40 | sndfile = sf_open (path, SFM_WRITE, &sf_info); |
43 | 41 | if (!sndfile) |
44 | 42 | { |
45 | fprintf (stderr, "%s\n", sf_strerror (sndfile)); | |
43 | error_print ("%s\n", sf_strerror (sndfile)); | |
46 | 44 | return -1; |
47 | 45 | } |
48 | 46 | |
75 | 73 | |
76 | 74 | size_t |
77 | 75 | sample_load (GArray * sample, GMutex * mutex, gint * frames, gchar * path, |
78 | gboolean * running, void (*progress) (gdouble)) | |
76 | gboolean * active, void (*progress) (gdouble)) | |
79 | 77 | { |
80 | 78 | SF_INFO sf_info; |
81 | 79 | SNDFILE *sndfile; |
89 | 87 | int err; |
90 | 88 | int resampled_buffer_len; |
91 | 89 | int f, frames_read; |
90 | gboolean load_active; | |
92 | 91 | |
93 | 92 | debug_print (1, "Loading file %s...\n", path); |
94 | 93 | |
106 | 105 | sndfile = sf_open (path, SFM_READ, &sf_info); |
107 | 106 | if (!sndfile) |
108 | 107 | { |
109 | fprintf (stderr, "%s\n", sf_strerror (sndfile)); | |
108 | error_print ("%s\n", sf_strerror (sndfile)); | |
110 | 109 | return -1; |
111 | 110 | } |
112 | 111 | |
145 | 144 | debug_print (2, "Loading sample (%" PRId64 ")...\n", sf_info.frames); |
146 | 145 | |
147 | 146 | f = 0; |
148 | while (f < sf_info.frames && (!running || *running)) | |
147 | if (mutex) | |
148 | { | |
149 | g_mutex_lock (mutex); | |
150 | } | |
151 | load_active = (!active || *active); | |
152 | if (mutex) | |
153 | { | |
154 | g_mutex_unlock (mutex); | |
155 | } | |
156 | while (f < sf_info.frames && load_active) | |
149 | 157 | { |
150 | 158 | debug_print (2, "Loading buffer...\n"); |
151 | 159 | |
215 | 223 | progress (f * 1.0 / sf_info.frames); |
216 | 224 | } |
217 | 225 | |
226 | if (mutex) | |
227 | { | |
228 | g_mutex_lock (mutex); | |
229 | } | |
230 | load_active = (!active || *active); | |
231 | if (mutex) | |
232 | { | |
233 | g_mutex_unlock (mutex); | |
234 | } | |
218 | 235 | } |
219 | 236 | |
220 | 237 | src_delete (src_state); |
221 | 238 | |
222 | 239 | if (err) |
223 | 240 | { |
224 | fprintf (stderr, __FILE__ ": src_process() failed: %s\n", | |
225 | src_strerror (err)); | |
226 | } | |
227 | ||
228 | if (running && !*running) | |
229 | { | |
230 | if (mutex) | |
231 | { | |
232 | g_mutex_lock (mutex); | |
233 | } | |
241 | error_print ("Error while preparing resampling: %s\n", | |
242 | src_strerror (err)); | |
243 | } | |
244 | ||
245 | if (mutex) | |
246 | { | |
247 | g_mutex_lock (mutex); | |
248 | } | |
249 | if (!active || *active) | |
250 | { | |
251 | if (progress) | |
252 | { | |
253 | progress (1.0); | |
254 | } | |
255 | } | |
256 | else | |
257 | { | |
234 | 258 | g_array_set_size (sample, 0); |
235 | if (mutex) | |
236 | { | |
237 | g_mutex_unlock (mutex); | |
238 | } | |
239 | } | |
240 | ||
241 | if (running && *running && progress) | |
242 | { | |
243 | progress (1.0); | |
259 | } | |
260 | if (mutex) | |
261 | { | |
262 | g_mutex_unlock (mutex); | |
244 | 263 | } |
245 | 264 | |
246 | 265 | cleanup: |
21 | 21 | #include <sys/types.h> |
22 | 22 | #include <sys/stat.h> |
23 | 23 | |
24 | #define LOAD_BUFFER_LEN 4800 | |
25 | ||
24 | 26 | size_t sample_save (GArray *, gchar *); |
25 | 27 | |
26 | 28 | size_t sample_load (GArray *, GMutex *, gboolean *, gchar *, gint *, |
22 | 22 | #include <wordexp.h> |
23 | 23 | #include "utils.h" |
24 | 24 | |
25 | #define DEBUG_LEVEL1_LEN 16 | |
25 | #define DEBUG_SHORT_HEX_LEN 64 | |
26 | #define DEBUG_FULL_HEX_THRES 3 | |
26 | 27 | |
27 | 28 | #define REG_TYPE "emblem-music-symbolic" |
28 | 29 | #define DIR_TYPE "folder-visiting-symbolic" |
29 | 30 | |
30 | static gchar | |
31 | connector_get_printable_char (gchar c) | |
32 | { | |
33 | return c >= 0x20 && c < 0x80 ? c : '.'; | |
34 | } | |
31 | gint debug_level; | |
35 | 32 | |
36 | 33 | static guint |
37 | 34 | get_max_message_length (guint msg_len) |
38 | 35 | { |
39 | 36 | guint len; |
40 | 37 | |
41 | if (debug_level > 1) | |
38 | if (debug_level >= DEBUG_FULL_HEX_THRES) | |
42 | 39 | { |
43 | 40 | len = msg_len; |
44 | 41 | } |
45 | 42 | else |
46 | 43 | { |
47 | len = msg_len > DEBUG_LEVEL1_LEN ? DEBUG_LEVEL1_LEN : msg_len; | |
44 | len = msg_len > DEBUG_SHORT_HEX_LEN ? DEBUG_SHORT_HEX_LEN : msg_len; | |
48 | 45 | } |
49 | 46 | |
50 | 47 | return len; |
51 | 48 | } |
52 | 49 | |
53 | static void | |
54 | print_dots_if_needed (guint msg_len) | |
55 | { | |
56 | if (debug_level == 1 && msg_len > DEBUG_LEVEL1_LEN) | |
57 | { | |
58 | debug_print (1, "..."); | |
59 | } | |
60 | } | |
61 | ||
62 | void | |
63 | debug_print_ascii_msg (const GByteArray * msg) | |
64 | { | |
65 | gint i = 0; | |
66 | guint8 *data = msg->data; | |
67 | ||
68 | while (i < get_max_message_length (msg->len)) | |
69 | { | |
70 | debug_print (1, "%c", connector_get_printable_char (*data)); | |
71 | data++; | |
50 | gchar * | |
51 | debug_get_hex_data (gint level, guint8 * data, guint len) | |
52 | { | |
53 | gint i; | |
54 | guint8 *b; | |
55 | guint size; | |
56 | guint bytes_shown; | |
57 | guint extra; | |
58 | gchar *str; | |
59 | gchar *next; | |
60 | ||
61 | if (level >= DEBUG_FULL_HEX_THRES) | |
62 | { | |
63 | bytes_shown = len; | |
64 | extra = 0; | |
65 | } | |
66 | else | |
67 | { | |
68 | if (len > DEBUG_SHORT_HEX_LEN) | |
69 | { | |
70 | bytes_shown = DEBUG_SHORT_HEX_LEN; | |
71 | extra = 3; | |
72 | } | |
73 | else | |
74 | { | |
75 | bytes_shown = len; | |
76 | extra = 0; | |
77 | } | |
78 | } | |
79 | size = bytes_shown * 3 + extra; | |
80 | str = malloc (sizeof (char) * size); | |
81 | ||
82 | b = data; | |
83 | next = str; | |
84 | ||
85 | sprintf (next, "%02x", *b); | |
86 | next += 2; | |
87 | b++; | |
88 | ||
89 | i = 1; | |
90 | while (i < get_max_message_length (len)) | |
91 | { | |
92 | sprintf (next, " %02x", *b); | |
93 | next += 3; | |
94 | b++; | |
72 | 95 | i++; |
73 | 96 | } |
74 | print_dots_if_needed (msg->len); | |
75 | debug_print (1, "\n"); | |
76 | } | |
77 | ||
78 | void | |
79 | debug_print_hex_msg (const GByteArray * msg) | |
80 | { | |
81 | gint i = 0; | |
82 | guint8 *data = msg->data; | |
83 | ||
84 | while (i < get_max_message_length (msg->len)) | |
85 | { | |
86 | if (i > 0) | |
87 | { | |
88 | debug_print (1, " "); | |
89 | } | |
90 | debug_print (1, "%02x", *data); | |
91 | data++; | |
92 | i++; | |
93 | } | |
94 | print_dots_if_needed (msg->len); | |
95 | debug_print (1, "\n"); | |
97 | ||
98 | if (level < DEBUG_FULL_HEX_THRES && len > DEBUG_SHORT_HEX_LEN) | |
99 | { | |
100 | sprintf (next, "..."); | |
101 | next += 3; | |
102 | } | |
103 | ||
104 | return str; | |
105 | } | |
106 | ||
107 | gchar * | |
108 | debug_get_hex_msg (const GByteArray * msg) | |
109 | { | |
110 | return debug_get_hex_data (debug_level, msg->data, msg->len); | |
96 | 111 | } |
97 | 112 | |
98 | 113 | gchar * |
126 | 141 | *dot = 0; |
127 | 142 | } |
128 | 143 | |
129 | const char * | |
130 | get_ext (const char *name) | |
144 | const gchar * | |
145 | get_ext (const gchar * name) | |
131 | 146 | { |
132 | 147 | int namelen = strlen (name) - 1; |
133 | 148 | int i = namelen; |
134 | const char *ext = &name[namelen]; | |
149 | const gchar *ext = &name[namelen]; | |
135 | 150 | |
136 | 151 | while (*(ext - 1) != '.' && i > 0) |
137 | 152 | { |
150 | 165 | } |
151 | 166 | |
152 | 167 | char |
153 | get_type_from_inventory_icon (const char *icon) | |
154 | { | |
155 | char type; | |
168 | get_type_from_inventory_icon (const gchar * icon) | |
169 | { | |
170 | gchar type; | |
156 | 171 | |
157 | 172 | if (strcmp (icon, REG_TYPE) == 0) |
158 | 173 | { |
165 | 180 | return type; |
166 | 181 | } |
167 | 182 | |
168 | const char * | |
183 | const gchar * | |
169 | 184 | get_inventory_icon_from_type (char type) |
170 | 185 | { |
171 | const char *icon; | |
186 | const gchar *icon; | |
172 | 187 | |
173 | 188 | if (type == ELEKTROID_FILE) |
174 | 189 | { |
182 | 197 | } |
183 | 198 | |
184 | 199 | char * |
185 | get_local_startup_path (const char *local_dir) | |
200 | get_local_startup_path (const gchar * local_dir) | |
186 | 201 | { |
187 | 202 | DIR *dir; |
188 | char *startup_path = NULL; | |
203 | gchar *startup_path = NULL; | |
189 | 204 | wordexp_t exp_result; |
190 | 205 | |
191 | 206 | if (local_dir) |
198 | 213 | } |
199 | 214 | else |
200 | 215 | { |
201 | fprintf (stderr, __FILE__ ": Unable to open dir %s\n", local_dir); | |
216 | error_print ("Unable to open dir %s\n", local_dir); | |
202 | 217 | } |
203 | 218 | closedir (dir); |
204 | 219 | } |
24 | 24 | #define ELEKTROID_FILE 'F' |
25 | 25 | #define ELEKTROID_DIR 'D' |
26 | 26 | |
27 | #define debug_print(level, ...) if (level <= debug_level) fprintf(stderr, __VA_ARGS__) | |
27 | #define debug_print(level, format, ...) if (level <= debug_level) fprintf(stderr, "DEBUG:" __FILE__ ":%d:(%s): " format, __LINE__, __FUNCTION__, ## __VA_ARGS__) | |
28 | #define error_print(format, ...) fprintf(stderr, "\x1b[31mERROR:" __FILE__ ":%d:(%s): " format "\x1b[m", __LINE__, __FUNCTION__, ## __VA_ARGS__) | |
28 | 29 | |
29 | int debug_level; | |
30 | extern int debug_level; | |
30 | 31 | |
31 | void print_ascii_msg (const GByteArray *); | |
32 | gchar *debug_get_hex_data (gint, guint8 *, guint); | |
32 | 33 | |
33 | void debug_print_hex_msg (const GByteArray *); | |
34 | gchar *debug_get_hex_msg (const GByteArray *); | |
34 | 35 | |
35 | char *chain_path (const char *, const char *); | |
36 | gchar *chain_path (const gchar *, const gchar *); | |
36 | 37 | |
37 | void remove_ext (char *); | |
38 | void remove_ext (gchar *); | |
38 | 39 | |
39 | const char *get_ext (const char *); | |
40 | const gchar *get_ext (const gchar *); | |
40 | 41 | |
41 | char get_type_from_inventory_icon (const char *); | |
42 | gchar get_type_from_inventory_icon (const gchar *); | |
42 | 43 | |
43 | const char *get_inventory_icon_from_type (char); | |
44 | const gchar *get_inventory_icon_from_type (gchar); | |
44 | 45 | |
45 | char *get_local_startup_path (const char *); | |
46 | gchar *get_local_startup_path (const gchar *); |
8 | 8 | [ -z "$DEVICE" ] && echo "No device found" && exit 1 |
9 | 9 | echo "Using device $DEVICE..." |
10 | 10 | |
11 | sleep 1 | |
12 | ||
11 | 13 | echo "Testing ls..." |
12 | 14 | $ecli ls $DEVICE:/ |
13 | 15 | [ $? -ne 0 ] && exit 1 |
14 | 16 | |
17 | sleep 1 | |
18 | ||
15 | 19 | echo "Testing mkdir..." |
16 | 20 | $ecli mkdir $DEVICE:/$TEST_NAME |
17 | 21 | [ $? -ne 0 ] && exit 1 |
22 | ||
23 | sleep 1 | |
24 | ||
18 | 25 | $ecli ls $DEVICE:/$TEST_NAME |
19 | 26 | [ $? -ne 0 ] && exit 1 |
27 | ||
28 | sleep 1 | |
20 | 29 | |
21 | 30 | echo "Testing upload..." |
22 | 31 | $ecli upload $srcdir/res/square.wav $DEVICE:/$TEST_NAME |
23 | 32 | [ $? -ne 0 ] && exit 1 |
33 | ||
34 | sleep 1 | |
24 | 35 | |
25 | 36 | output=$($ecli ls $DEVICE:/$TEST_NAME) |
26 | 37 | echo $output |
29 | 40 | name=$(echo $output | awk '{print $4}') |
30 | 41 | [ "$type" != "F" ] || [ "$size" != "0.09" ] || [ "$name" != "square" ] && exit 1 |
31 | 42 | |
43 | sleep 1 | |
44 | ||
32 | 45 | echo "Testing download..." |
33 | 46 | $ecli download $DEVICE:/$TEST_NAME/square |
34 | 47 | [ $? -ne 0 ] && exit 1 |
36 | 49 | rm $srcdir/square.wav |
37 | 50 | [ "$actual_cksum" != "$(cksum $srcdir/res/square.wav | awk '{print $1}')" ] && exit 1 |
38 | 51 | |
52 | sleep 1 | |
53 | ||
39 | 54 | echo "Testing mv..." |
40 | 55 | $ecli mv $DEVICE:/$TEST_NAME/square $DEVICE:/$TEST_NAME/sample |
41 | 56 | [ $? -ne 0 ] && exit 1 |
42 | 57 | |
58 | sleep 1 | |
59 | ||
43 | 60 | echo "Testing rm..." |
44 | 61 | $ecli rm $DEVICE:/$TEST_NAME/sample |
45 | 62 | [ $? -ne 0 ] && exit 1 |
63 | ||
64 | sleep 1 | |
46 | 65 | |
47 | 66 | echo "Testing rmdir..." |
48 | 67 | $ecli rmdir $DEVICE:/$TEST_NAME |