Codebase list elektroid / 0a6d547
New upstream version 1.3 Dennis Braun 3 years ago
40 changed file(s) with 2888 addition(s) and 1058 deletion(s). Raw diff Collapse all Expand all
2323 - libtool
2424 - autopoint
2525 - gettext
26 - zlib1g-dev
2627
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`.
2829
2930 ## CLI
3031
11 # Process this file with autoconf to produce a configure script.
22
33 AC_PREREQ([2.69])
4 AC_INIT([elektroid],[1.2],[dagargo@gmail.com])
4 AC_INIT([elektroid],[1.3],[dagargo@gmail.com])
55 AC_CONFIG_SRCDIR([src])
66 AC_CONFIG_HEADERS([config.h])
77 AM_PROG_LIBTOOL
3434 AM_GNU_GETTEXT_VERSION([0.19.8])
3535
3636 # Checks for header files.
37 AC_CHECK_HEADERS([unistd.h limits.h])
37 AC_CHECK_HEADERS([unistd.h limits.h zlib.h])
3838
3939 # Checks for typedefs, structures, and compiler characteristics.
4040
0 elektroid (0.1-0) unstable; urgency=medium
0 elektroid (1.2-1) unstable; urgency=medium
11
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
38
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
-1
debian/compat less more
0 11
00 Source: elektroid
11 Section: sound
22 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),
96 libasound2-dev (>= 1.1.8),
107 libgtk-3-dev,
118 libpulse-dev,
129 libsndfile1-dev (>= 1.0.2),
1310 libsamplerate0-dev (>= 0.1.9),
14 libtool,
11 zlib1g-dev,
1512 pkg-config
1613 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
1918
2019 Package: elektroid
2120 Architecture: any
2221 Depends: ${misc:Depends},
2322 ${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.
47
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+
614
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+
1118
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
-9
debian/patches/fix-desktop-icon.diff less more
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
-1
debian/patches/series less more
0 fix-desktop-icon.diff
00 #!/usr/bin/make -f
11
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
211 %:
3 dh $@ --parallel --with autoreconf
12 dh $@ --with autoreconf
413
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
-1
debian/source/lintian-overrides less more
0 package-needs-versioned-debhelper-build-depends 9
+0
-2
debian/source/options less more
0 compression = "xz"
1 compression-level = 9
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
0 man1_MANS = elektroid.1 elektroid-cli.1
0 dist_man1_MANS = elektroid.1 elektroid-cli.1
33 .SH SYNOPSIS
44 .B elektroid-cli
55 .RI [ options ]
6 .RI command
67 .SH DESCRIPTION
78 .B elektroid-cli
89 provides the same funcionality than elektroid. See man elektroid for the GUI application.
910 .PP
1011 Provided paths must always be prepended with the device id and a colon (':'), e.g. 0:/samples.
11 .SH OPTIONS
12 .SH COMMANDS
1213 .TP
1314 .B ld
1415 List compatible devices
3637 .TP
3738 .B rm [device number]:[path to sample]
3839 Delete a sample
40 .SH OPTIONS
41 .TP
42 \fB\-v\fR
43 Show verbose output. Use it more than once for more verbosity.
3944 .PP
4045 .SH "SEE ALSO"
4146 The GitHub page provides some examples: <https://github.com/dagargo/elektroid>
1616 Open the provided local directory
1717 .TP
1818 \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.
2020 .PP
2121 .SH "AUTHOR"
2222 elektroid was written by David García Goñi <dagargo@gmail.com>.
0 ca
01 de
12 en
23 es
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"
44 #
55 msgid ""
66 msgstr ""
7 "Project-Id-Version: elektroid 1.2\n"
7 "Project-Id-Version: elektroid 1.3\n"
88 "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"
1111 "Last-Translator: Dennis Braun <d_braun@kabelmail.de>\n"
1212 "Language-Team: German\n"
1313 "Language: de\n"
1616 "Content-Transfer-Encoding: 8bit\n"
1717 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
1818
19 #: src/elektroid.c:168
19 #: src/elektroid.c:177
2020 #, c-format
2121 msgid "Connected to %s"
2222 msgstr "Verbunden mit %s"
2323
24 #: src/elektroid.c:175 src/elektroid.c:2184
24 #: src/elektroid.c:184 src/elektroid.c:2576
2525 msgid "Not connected"
2626 msgstr "Nicht verbunden"
2727
28 #: src/elektroid.c:305
28 #: src/elektroid.c:327
2929 msgid "Waiting..."
3030 msgstr "Warte..."
3131
32 #: src/elektroid.c:308
32 #: src/elektroid.c:330
3333 msgid "Sending..."
3434 msgstr "Sende..."
3535
36 #: src/elektroid.c:312
36 #: src/elektroid.c:334
3737 msgid "Receiving..."
3838 msgstr "Empfange..."
3939
40 #: src/elektroid.c:351
40 #: src/elektroid.c:402
4141 msgid "Receive SysEx"
4242 msgstr "Empfange SysEx"
4343
44 #: src/elektroid.c:374
44 #: src/elektroid.c:424
4545 msgid "Save SysEx"
4646 msgstr "Speichere SysEx"
4747
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
4949 msgid "_Cancel"
5050 msgstr "_Abbrechen"
5151
52 #: src/elektroid.c:379
52 #: src/elektroid.c:429
5353 msgid "_Save"
5454 msgstr "_Speichern"
5555
56 #: src/elektroid.c:383
56 #: src/elektroid.c:433
5757 msgid "Received SysEx"
5858 msgstr "SysEx empfangen"
5959
60 #: src/elektroid.c:386 src/elektroid.c:441
60 #: src/elektroid.c:438 src/elektroid.c:538
6161 msgid "SysEx Files"
6262 msgstr "SysEx Dateien"
6363
64 #: src/elektroid.c:432
64 #: src/elektroid.c:529
6565 msgid "Open SysEx"
6666 msgstr "Öffne SysEx"
6767
68 #: src/elektroid.c:437
68 #: src/elektroid.c:534
6969 msgid "_Open"
7070 msgstr "_Öffnen"
7171
72 #: src/elektroid.c:466
72 #: src/elektroid.c:561
7373 msgid "Send SysEx"
7474 msgstr "Sende SysEx"
7575
76 #: src/elektroid.c:543
76 #: src/elektroid.c:686
7777 #, c-format
7878 msgid "Error while deleting “%s”: %s."
7979 msgstr "Fehler beim Löschen »%s«: %s."
8080
81 #: src/elektroid.c:576
81 #: src/elektroid.c:720
8282 msgid "Are you sure you want to delete the selected items?"
8383 msgstr "Bist du sicher das du die ausgewählten Elemente löschen möchtest?"
8484
85 #: src/elektroid.c:578 res/gui.glade:66
85 #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539
8686 msgid "_Delete"
8787 msgstr "_Löschen"
8888
89 #: src/elektroid.c:633
89 #: src/elektroid.c:777
9090 msgid "Rename"
9191 msgstr "Umbenennen"
9292
93 #: src/elektroid.c:659
93 #: src/elektroid.c:802
9494 #, c-format
9595 msgid "Error while renaming to “%s”: %s."
9696 msgstr "Fehler beim Umbenennen von »%s«: %s."
9797
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"
100100 msgstr "Verzeichnis hinzufügen"
101101
102 #: src/elektroid.c:1126
102 #: src/elektroid.c:1414
103103 #, c-format
104104 msgid "Error while creating dir “%s”: %s."
105105 msgstr "Fehler beim Erstellen des Verzeichnisses »%s«: %s."
106106
107 #: src/elektroid.c:1290
107 #: src/elektroid.c:1576
108108 msgid "Queued"
109109 msgstr "In der Warteschlange"
110110
111 #: src/elektroid.c:1292
111 #: src/elektroid.c:1578
112112 msgid "Running"
113 msgstr "Arbeitet"
114
115 #: src/elektroid.c:1294
113 msgstr "Wird ausgeführt"
114
115 #: src/elektroid.c:1580
116116 msgid "Completed"
117117 msgstr "Fertig"
118118
119 #: src/elektroid.c:1296
119 #: src/elektroid.c:1582
120120 msgid "Completed with errors"
121121 msgstr "Abgeschlossen mit Fehlern"
122122
123 #: src/elektroid.c:1298
123 #: src/elektroid.c:1584
124124 msgid "Canceled"
125125 msgstr "Abgebrochen"
126126
127 #: src/elektroid.c:1300 src/elektroid.c:1314
127 #: src/elektroid.c:1586 src/elektroid.c:1600
128128 msgid "Undefined"
129129 msgstr "Undefiniert"
130130
131 #: src/elektroid.c:1310
131 #: src/elektroid.c:1596
132132 msgid "Upload"
133133 msgstr "Hochladen"
134134
135 #: src/elektroid.c:1312
135 #: src/elektroid.c:1598
136136 msgid "Download"
137137 msgstr "Herunterladen"
138138
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
140160 msgid "_Rename"
141161 msgstr "_Umbenennen"
142162
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
152164 msgid "_Receive SysEx"
153165 msgstr "_Empfange SysEx"
154166
155 #: res/gui.glade:198
167 #: res/gui.glade:259
156168 msgid "_Send SysEx"
157169 msgstr "_Sende SysEx"
158170
159 #: res/gui.glade:222
171 #: res/gui.glade:283
172 msgid "OS _Upgrade"
173 msgstr "OS _Aktualisierung"
174
175 #: res/gui.glade:307
160176 msgid "_About"
161177 msgstr "_Info"
162178
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"
165181 msgstr "Gehe zum Überverzeichnis"
166182
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"
169185 msgstr "Aktualisiere Verzeichnis"
170186
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
172188 msgid "Name"
173189 msgstr "Name"
174190
175 #: res/gui.glade:455 res/gui.glade:694
191 #: res/gui.glade:540 res/gui.glade:779
176192 msgid "Size"
177193 msgstr "Größe"
178194
179 #: res/gui.glade:492
180 msgid "Upload selection"
195 #: res/gui.glade:577
196 msgid "Upload Selection"
181197 msgstr "Upload Auswahl"
182198
183 #: res/gui.glade:513
184 msgid "Download selection"
199 #: res/gui.glade:598
200 msgid "Download Selection"
185201 msgstr "Download Auswahl"
186202
187 #: res/gui.glade:747
188 msgid "Refresh devices"
203 #: res/gui.glade:832
204 msgid "Refresh Devices"
189205 msgstr "Aktualisiere Geräte"
190206
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
193209 msgid "Auto play"
194210 msgstr "Auto Play"
195211
196 #: res/gui.glade:1062
212 #: res/gui.glade:1147
197213 msgid "Status"
198214 msgstr "Status"
199215
200 #: res/gui.glade:1073
216 #: res/gui.glade:1158
201217 msgid "Type"
202218 msgstr "Typ"
203219
204 #: res/gui.glade:1084
220 #: res/gui.glade:1169
205221 msgid "Source"
206222 msgstr "Quelle"
207223
208 #: res/gui.glade:1098
224 #: res/gui.glade:1183
209225 msgid "Destination"
210226 msgstr "Ziel"
211227
212 #: res/gui.glade:1113
228 #: res/gui.glade:1198
213229 msgid "Progress"
214230 msgstr "Fortschritt"
215231
216 #: res/gui.glade:1145
217 msgid "Cancel running task"
232 #: res/gui.glade:1230
233 msgid "Cancel Running Task"
218234 msgstr "Vorgang abbrechen"
219235
220 #: res/gui.glade:1166
221 msgid "Remove queued tasks"
236 #: res/gui.glade:1251
237 msgid "Remove Queued Tasks"
222238 msgstr "Lösche Aufgaben in der Warteschlange"
223239
224 #: res/gui.glade:1187
225 msgid "Clear finished tasks"
240 #: res/gui.glade:1272
241 msgid "Clear Finished Tasks"
226242 msgstr "Abgeschlossene Aufgaben aufräumen"
55 #, fuzzy
66 msgid ""
77 msgstr ""
8 "Project-Id-Version: elektroid 1.2\n"
8 "Project-Id-Version: elektroid 1.3\n"
99 "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"
1111 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313 "Language-Team: LANGUAGE <LL@li.org>\n"
1616 "Content-Type: text/plain; charset=UTF-8\n"
1717 "Content-Transfer-Encoding: 8bit\n"
1818
19 #: src/elektroid.c:168
19 #: src/elektroid.c:177
2020 #, c-format
2121 msgid "Connected to %s"
2222 msgstr ""
2323
24 #: src/elektroid.c:175 src/elektroid.c:2184
24 #: src/elektroid.c:184 src/elektroid.c:2576
2525 msgid "Not connected"
2626 msgstr ""
2727
28 #: src/elektroid.c:305
28 #: src/elektroid.c:327
2929 msgid "Waiting..."
3030 msgstr ""
3131
32 #: src/elektroid.c:308
32 #: src/elektroid.c:330
3333 msgid "Sending..."
3434 msgstr ""
3535
36 #: src/elektroid.c:312
36 #: src/elektroid.c:334
3737 msgid "Receiving..."
3838 msgstr ""
3939
40 #: src/elektroid.c:351
40 #: src/elektroid.c:402
4141 msgid "Receive SysEx"
4242 msgstr ""
4343
44 #: src/elektroid.c:374
44 #: src/elektroid.c:424
4545 msgid "Save SysEx"
4646 msgstr ""
4747
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
4949 msgid "_Cancel"
5050 msgstr ""
5151
52 #: src/elektroid.c:379
52 #: src/elektroid.c:429
5353 msgid "_Save"
5454 msgstr ""
5555
56 #: src/elektroid.c:383
56 #: src/elektroid.c:433
5757 msgid "Received SysEx"
5858 msgstr ""
5959
60 #: src/elektroid.c:386 src/elektroid.c:441
60 #: src/elektroid.c:438 src/elektroid.c:538
6161 msgid "SysEx Files"
6262 msgstr ""
6363
64 #: src/elektroid.c:432
64 #: src/elektroid.c:529
6565 msgid "Open SysEx"
6666 msgstr ""
6767
68 #: src/elektroid.c:437
68 #: src/elektroid.c:534
6969 msgid "_Open"
7070 msgstr ""
7171
72 #: src/elektroid.c:466
72 #: src/elektroid.c:561
7373 msgid "Send SysEx"
7474 msgstr ""
7575
76 #: src/elektroid.c:543
76 #: src/elektroid.c:686
7777 #, c-format
7878 msgid "Error while deleting “%s”: %s."
7979 msgstr ""
8080
81 #: src/elektroid.c:576
81 #: src/elektroid.c:720
8282 msgid "Are you sure you want to delete the selected items?"
8383 msgstr ""
8484
85 #: src/elektroid.c:578 res/gui.glade:66
85 #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539
8686 msgid "_Delete"
8787 msgstr ""
8888
89 #: src/elektroid.c:633
89 #: src/elektroid.c:777
9090 msgid "Rename"
9191 msgstr ""
9292
93 #: src/elektroid.c:659
93 #: src/elektroid.c:802
9494 #, c-format
9595 msgid "Error while renaming to “%s”: %s."
9696 msgstr ""
9797
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
103103 #, c-format
104104 msgid "Error while creating dir “%s”: %s."
105105 msgstr ""
106106
107 #: src/elektroid.c:1290
107 #: src/elektroid.c:1576
108108 msgid "Queued"
109109 msgstr ""
110110
111 #: src/elektroid.c:1292
111 #: src/elektroid.c:1578
112112 msgid "Running"
113113 msgstr ""
114114
115 #: src/elektroid.c:1294
115 #: src/elektroid.c:1580
116116 msgid "Completed"
117117 msgstr ""
118118
119 #: src/elektroid.c:1296
119 #: src/elektroid.c:1582
120120 msgid "Completed with errors"
121121 msgstr ""
122122
123 #: src/elektroid.c:1298
123 #: src/elektroid.c:1584
124124 msgid "Canceled"
125125 msgstr ""
126126
127 #: src/elektroid.c:1300 src/elektroid.c:1314
127 #: src/elektroid.c:1586 src/elektroid.c:1600
128128 msgid "Undefined"
129129 msgstr ""
130130
131 #: src/elektroid.c:1310
131 #: src/elektroid.c:1596
132132 msgid "Upload"
133133 msgstr ""
134134
135 #: src/elektroid.c:1312
135 #: src/elektroid.c:1598
136136 msgid "Download"
137137 msgstr ""
138138
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
140160 msgid "_Rename"
141161 msgstr ""
142162
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
152164 msgid "_Receive SysEx"
153165 msgstr ""
154166
155 #: res/gui.glade:198
167 #: res/gui.glade:259
156168 msgid "_Send SysEx"
157169 msgstr ""
158170
159 #: res/gui.glade:222
171 #: res/gui.glade:283
172 msgid "OS _Upgrade"
173 msgstr ""
174
175 #: res/gui.glade:307
160176 msgid "_About"
161177 msgstr ""
162178
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
172188 msgid "Name"
173189 msgstr ""
174190
175 #: res/gui.glade:455 res/gui.glade:694
191 #: res/gui.glade:540 res/gui.glade:779
176192 msgid "Size"
177193 msgstr ""
178194
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
193209 msgid "Auto play"
194210 msgstr ""
195211
196 #: res/gui.glade:1062
212 #: res/gui.glade:1147
197213 msgid "Status"
198214 msgstr ""
199215
200 #: res/gui.glade:1073
216 #: res/gui.glade:1158
201217 msgid "Type"
202218 msgstr ""
203219
204 #: res/gui.glade:1084
220 #: res/gui.glade:1169
205221 msgid "Source"
206222 msgstr ""
207223
208 #: res/gui.glade:1098
224 #: res/gui.glade:1183
209225 msgid "Destination"
210226 msgstr ""
211227
212 #: res/gui.glade:1113
228 #: res/gui.glade:1198
213229 msgid "Progress"
214230 msgstr ""
215231
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 ""
44 #
55 msgid ""
66 msgstr ""
7 "Project-Id-Version: elektroid 1.2\n"
7 "Project-Id-Version: elektroid 1.3\n"
88 "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"
1010 "PO-Revision-Date: 2020-04-26 13:00+0100\n"
1111 "Last-Translator: David García Goñi <dagargo@gmail.com>\n"
1212 "Language-Team: English\n"
1616 "Content-Transfer-Encoding: 8bit\n"
1717 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
1818
19 #: src/elektroid.c:168
19 #: src/elektroid.c:177
2020 #, c-format
2121 msgid "Connected to %s"
2222 msgstr "Connected to %s"
2323
24 #: src/elektroid.c:175 src/elektroid.c:2184
24 #: src/elektroid.c:184 src/elektroid.c:2576
2525 msgid "Not connected"
2626 msgstr "Not connected"
2727
28 #: src/elektroid.c:305
28 #: src/elektroid.c:327
2929 msgid "Waiting..."
3030 msgstr "Waiting..."
3131
32 #: src/elektroid.c:308
32 #: src/elektroid.c:330
3333 msgid "Sending..."
3434 msgstr "Sending..."
3535
36 #: src/elektroid.c:312
36 #: src/elektroid.c:334
3737 msgid "Receiving..."
3838 msgstr "Receiving..."
3939
40 #: src/elektroid.c:351
40 #: src/elektroid.c:402
4141 msgid "Receive SysEx"
4242 msgstr "Receive SysEx"
4343
44 #: src/elektroid.c:374
44 #: src/elektroid.c:424
4545 msgid "Save SysEx"
4646 msgstr "Save SysEx"
4747
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
4949 msgid "_Cancel"
5050 msgstr "_Cancel"
5151
52 #: src/elektroid.c:379
52 #: src/elektroid.c:429
5353 msgid "_Save"
5454 msgstr "_Save"
5555
56 #: src/elektroid.c:383
56 #: src/elektroid.c:433
5757 msgid "Received SysEx"
5858 msgstr "Received SysEx"
5959
60 #: src/elektroid.c:386 src/elektroid.c:441
60 #: src/elektroid.c:438 src/elektroid.c:538
6161 msgid "SysEx Files"
6262 msgstr "SysEx Files"
6363
64 #: src/elektroid.c:432
64 #: src/elektroid.c:529
6565 msgid "Open SysEx"
6666 msgstr "Open SysEx"
6767
68 #: src/elektroid.c:437
68 #: src/elektroid.c:534
6969 msgid "_Open"
7070 msgstr "_Open"
7171
72 #: src/elektroid.c:466
72 #: src/elektroid.c:561
7373 msgid "Send SysEx"
7474 msgstr "Send SysEx"
7575
76 #: src/elektroid.c:543
76 #: src/elektroid.c:686
7777 #, c-format
7878 msgid "Error while deleting “%s”: %s."
7979 msgstr "Error while deleting “%s”: %s."
8080
81 #: src/elektroid.c:576
81 #: src/elektroid.c:720
8282 msgid "Are you sure you want to delete the selected items?"
8383 msgstr "Are you sure you want to delete the selected items?"
8484
85 #: src/elektroid.c:578 res/gui.glade:66
85 #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539
8686 msgid "_Delete"
8787 msgstr "_Delete"
8888
89 #: src/elektroid.c:633
89 #: src/elektroid.c:777
9090 msgid "Rename"
9191 msgstr "Rename"
9292
93 #: src/elektroid.c:659
93 #: src/elektroid.c:802
9494 #, c-format
9595 msgid "Error while renaming to “%s”: %s."
9696 msgstr "Error while renaming to “%s”: %s."
9797
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
103103 #, c-format
104104 msgid "Error while creating dir “%s”: %s."
105105 msgstr "Error while creating dir “%s”: %s."
106106
107 #: src/elektroid.c:1290
107 #: src/elektroid.c:1576
108108 msgid "Queued"
109109 msgstr "Queued"
110110
111 #: src/elektroid.c:1292
111 #: src/elektroid.c:1578
112112 msgid "Running"
113113 msgstr "Running"
114114
115 #: src/elektroid.c:1294
115 #: src/elektroid.c:1580
116116 msgid "Completed"
117117 msgstr "Completed"
118118
119 #: src/elektroid.c:1296
119 #: src/elektroid.c:1582
120120 msgid "Completed with errors"
121121 msgstr "Completed with errors"
122122
123 #: src/elektroid.c:1298
123 #: src/elektroid.c:1584
124124 msgid "Canceled"
125125 msgstr "Canceled"
126126
127 #: src/elektroid.c:1300 src/elektroid.c:1314
127 #: src/elektroid.c:1586 src/elektroid.c:1600
128128 msgid "Undefined"
129129 msgstr "Undefined"
130130
131 #: src/elektroid.c:1310
131 #: src/elektroid.c:1596
132132 msgid "Upload"
133133 msgstr "Upload"
134134
135 #: src/elektroid.c:1312
135 #: src/elektroid.c:1598
136136 msgid "Download"
137137 msgstr "Download"
138138
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
140160 msgid "_Rename"
141161 msgstr "_Rename"
142162
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
152164 msgid "_Receive SysEx"
153165 msgstr "_Receive SysEx"
154166
155 #: res/gui.glade:198
167 #: res/gui.glade:259
156168 msgid "_Send SysEx"
157169 msgstr "_Send SysEx"
158170
159 #: res/gui.glade:222
171 #: res/gui.glade:283
172 msgid "OS _Upgrade"
173 msgstr "OS _Upgrade"
174
175 #: res/gui.glade:307
160176 msgid "_About"
161177 msgstr "_About"
162178
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
172188 msgid "Name"
173189 msgstr "Name"
174190
175 #: res/gui.glade:455 res/gui.glade:694
191 #: res/gui.glade:540 res/gui.glade:779
176192 msgid "Size"
177193 msgstr "Size"
178194
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"
185201 msgstr "Download selection"
186202
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
193209 msgid "Auto play"
194210 msgstr "Auto play"
195211
196 #: res/gui.glade:1062
212 #: res/gui.glade:1147
197213 msgid "Status"
198214 msgstr "Status"
199215
200 #: res/gui.glade:1073
216 #: res/gui.glade:1158
201217 msgid "Type"
202218 msgstr "Type"
203219
204 #: res/gui.glade:1084
220 #: res/gui.glade:1169
205221 msgid "Source"
206222 msgstr "Source"
207223
208 #: res/gui.glade:1098
224 #: res/gui.glade:1183
209225 msgid "Destination"
210226 msgstr "Destination"
211227
212 #: res/gui.glade:1113
228 #: res/gui.glade:1198
213229 msgid "Progress"
214230 msgstr "Progress"
215231
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"
44 #
55 msgid ""
66 msgstr ""
7 "Project-Id-Version: elektroid 1.2\n"
7 "Project-Id-Version: elektroid 1.3\n"
88 "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"
1010 "PO-Revision-Date: 2020-04-26 13:00+0100\n"
1111 "Last-Translator: David García Goñi <dagargo@gmail.com>\n"
1212 "Language-Team: Spanish\n"
1616 "Content-Transfer-Encoding: 8bit\n"
1717 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
1818
19 #: src/elektroid.c:168
19 #: src/elektroid.c:177
2020 #, c-format
2121 msgid "Connected to %s"
2222 msgstr "Conectado a %s"
2323
24 #: src/elektroid.c:175 src/elektroid.c:2184
24 #: src/elektroid.c:184 src/elektroid.c:2576
2525 msgid "Not connected"
2626 msgstr "No conectado"
2727
28 #: src/elektroid.c:305
28 #: src/elektroid.c:327
2929 msgid "Waiting..."
3030 msgstr "Esperando..."
3131
32 #: src/elektroid.c:308
32 #: src/elektroid.c:330
3333 msgid "Sending..."
3434 msgstr "Enviando..."
3535
36 #: src/elektroid.c:312
36 #: src/elektroid.c:334
3737 msgid "Receiving..."
3838 msgstr "Recibiendo..."
3939
40 #: src/elektroid.c:351
40 #: src/elektroid.c:402
4141 msgid "Receive SysEx"
4242 msgstr "Recibir SysEx"
4343
44 #: src/elektroid.c:374
44 #: src/elektroid.c:424
4545 msgid "Save SysEx"
4646 msgstr "Guardar SysEx"
4747
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
4949 msgid "_Cancel"
5050 msgstr "_Cancelar"
5151
52 #: src/elektroid.c:379
52 #: src/elektroid.c:429
5353 msgid "_Save"
5454 msgstr "_Guardar"
5555
56 #: src/elektroid.c:383
56 #: src/elektroid.c:433
5757 msgid "Received SysEx"
5858 msgstr "SysEx recibido"
5959
60 #: src/elektroid.c:386 src/elektroid.c:441
60 #: src/elektroid.c:438 src/elektroid.c:538
6161 msgid "SysEx Files"
6262 msgstr "Archivos SysEx"
6363
64 #: src/elektroid.c:432
64 #: src/elektroid.c:529
6565 msgid "Open SysEx"
6666 msgstr "Abrir SysEx"
6767
68 #: src/elektroid.c:437
68 #: src/elektroid.c:534
6969 msgid "_Open"
7070 msgstr "_Abrir"
7171
72 #: src/elektroid.c:466
72 #: src/elektroid.c:561
7373 msgid "Send SysEx"
7474 msgstr "Enviar SysEx"
7575
76 #: src/elektroid.c:543
76 #: src/elektroid.c:686
7777 #, c-format
7878 msgid "Error while deleting “%s”: %s."
7979 msgstr "Error al eliminar «%s»: %s."
8080
81 #: src/elektroid.c:576
81 #: src/elektroid.c:720
8282 msgid "Are you sure you want to delete the selected items?"
8383 msgstr "¿Está seguro de que quiere eliminar los elementos seleccionados?"
8484
85 #: src/elektroid.c:578 res/gui.glade:66
85 #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539
8686 msgid "_Delete"
8787 msgstr "_Eliminar"
8888
89 #: src/elektroid.c:633
89 #: src/elektroid.c:777
9090 msgid "Rename"
9191 msgstr "Renombrar"
9292
93 #: src/elektroid.c:659
93 #: src/elektroid.c:802
9494 #, c-format
9595 msgid "Error while renaming to “%s”: %s."
9696 msgstr "Error al renombrar a «%s»: %s."
9797
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"
100100 msgstr "Añadir directorio"
101101
102 #: src/elektroid.c:1126
102 #: src/elektroid.c:1414
103103 #, c-format
104104 msgid "Error while creating dir “%s”: %s."
105105 msgstr "Error al crear el directorio «%s»: %s."
106106
107 #: src/elektroid.c:1290
107 #: src/elektroid.c:1576
108108 msgid "Queued"
109109 msgstr "Encolada"
110110
111 #: src/elektroid.c:1292
111 #: src/elektroid.c:1578
112112 msgid "Running"
113113 msgstr "Ejecutando"
114114
115 #: src/elektroid.c:1294
115 #: src/elektroid.c:1580
116116 msgid "Completed"
117117 msgstr "Completada"
118118
119 #: src/elektroid.c:1296
119 #: src/elektroid.c:1582
120120 msgid "Completed with errors"
121121 msgstr "Completada con errores"
122122
123 #: src/elektroid.c:1298
123 #: src/elektroid.c:1584
124124 msgid "Canceled"
125125 msgstr "Cancelada"
126126
127 #: src/elektroid.c:1300 src/elektroid.c:1314
127 #: src/elektroid.c:1586 src/elektroid.c:1600
128128 msgid "Undefined"
129129 msgstr "Indefinido"
130130
131 #: src/elektroid.c:1310
131 #: src/elektroid.c:1596
132132 msgid "Upload"
133133 msgstr "Carga"
134134
135 #: src/elektroid.c:1312
135 #: src/elektroid.c:1598
136136 msgid "Download"
137137 msgstr "Descarga"
138138
139 #: res/gui.glade:53
140 msgid "_Rename"
141 msgstr "_Renombrar"
142
143 #: res/gui.glade:131
139 #: res/gui.glade:86
144140 msgid "GNU/Linux sample transfer application for Elektron devices"
145141 msgstr ""
146142 "Aplicación GNU/Linux de transferencia de muestras para dispositivos Elektron"
147143
148 #: res/gui.glade:134
144 #: res/gui.glade:89
149145 msgid "translator-credits"
150146 msgstr "David García Goñi <dagargo@gmail.com>"
151147
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
153165 msgid "_Receive SysEx"
154166 msgstr "_Recibir SysEx"
155167
156 #: res/gui.glade:198
168 #: res/gui.glade:259
157169 msgid "_Send SysEx"
158170 msgstr "_Enviar SysEx"
159171
160 #: res/gui.glade:222
172 #: res/gui.glade:283
173 msgid "OS _Upgrade"
174 msgstr "Actualizar _SO"
175
176 #: res/gui.glade:307
161177 msgid "_About"
162178 msgstr "_Acerca de"
163179
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"
166182 msgstr "Ir al directorio padre"
167183
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
173189 msgid "Name"
174190 msgstr "Nombre"
175191
176 #: res/gui.glade:455 res/gui.glade:694
192 #: res/gui.glade:540 res/gui.glade:779
177193 msgid "Size"
178194 msgstr "Tamaño"
179195
180 #: res/gui.glade:492
181 msgid "Upload selection"
196 #: res/gui.glade:577
197 msgid "Upload Selection"
182198 msgstr "Cargar selección"
183199
184 #: res/gui.glade:513
185 msgid "Download selection"
200 #: res/gui.glade:598
201 msgid "Download Selection"
186202 msgstr "Descargar selección"
187203
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
194210 msgid "Auto play"
195211 msgstr ""
196212 "Reproducción\n"
197213 "automática"
198214
199 #: res/gui.glade:1062
215 #: res/gui.glade:1147
200216 msgid "Status"
201217 msgstr "Estado"
202218
203 #: res/gui.glade:1073
219 #: res/gui.glade:1158
204220 msgid "Type"
205221 msgstr "Tipo"
206222
207 #: res/gui.glade:1084
223 #: res/gui.glade:1169
208224 msgid "Source"
209225 msgstr "Origen"
210226
211 #: res/gui.glade:1098
227 #: res/gui.glade:1183
212228 msgid "Destination"
213229 msgstr "Destino"
214230
215 #: res/gui.glade:1113
231 #: res/gui.glade:1198
216232 msgid "Progress"
217233 msgstr "Progreso"
218234
219 #: res/gui.glade:1145
220 msgid "Cancel running task"
235 #: res/gui.glade:1230
236 msgid "Cancel Running Task"
221237 msgstr "Cancelar tarea en ejecución"
222238
223 #: res/gui.glade:1166
224 msgid "Remove queued tasks"
239 #: res/gui.glade:1251
240 msgid "Remove Queued Tasks"
225241 msgstr "Eliminar tareas encoladas"
226242
227 #: res/gui.glade:1187
228 msgid "Clear finished tasks"
243 #: res/gui.glade:1272
244 msgid "Clear Finished Tasks"
229245 msgstr "Limpiar tareas terminadas"
44 #
55 msgid ""
66 msgstr ""
7 "Project-Id-Version: elektroid 1.2\n"
7 "Project-Id-Version: elektroid 1.3\n"
88 "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"
1111 "Last-Translator: Olivier Humbert <trebmuh@tuxfamily.org>\n"
1212 "Language-Team: French\n"
1313 "Language: fr\n"
1616 "Content-Transfer-Encoding: 8bit\n"
1717 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
1818
19 #: src/elektroid.c:168
19 #: src/elektroid.c:177
2020 #, c-format
2121 msgid "Connected to %s"
2222 msgstr "Connecté à %s"
2323
24 #: src/elektroid.c:175 src/elektroid.c:2184
24 #: src/elektroid.c:184 src/elektroid.c:2576
2525 msgid "Not connected"
2626 msgstr "Non connecté"
2727
28 #: src/elektroid.c:305
28 #: src/elektroid.c:327
2929 msgid "Waiting..."
3030 msgstr "En attente..."
3131
32 #: src/elektroid.c:308
32 #: src/elektroid.c:330
3333 msgid "Sending..."
3434 msgstr "Envoi en cours..."
3535
36 #: src/elektroid.c:312
36 #: src/elektroid.c:334
3737 msgid "Receiving..."
3838 msgstr "Réception en cours..."
3939
40 #: src/elektroid.c:351
40 #: src/elektroid.c:402
4141 msgid "Receive SysEx"
4242 msgstr "Réception de SysEx"
4343
44 #: src/elektroid.c:374
44 #: src/elektroid.c:424
4545 msgid "Save SysEx"
4646 msgstr "Sauvegarde de SysEx"
4747
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
4949 msgid "_Cancel"
5050 msgstr "_Annuler"
5151
52 #: src/elektroid.c:379
52 #: src/elektroid.c:429
5353 msgid "_Save"
5454 msgstr "_Sauvegarder"
5555
56 #: src/elektroid.c:383
56 #: src/elektroid.c:433
5757 msgid "Received SysEx"
5858 msgstr "SysEx reçu"
5959
60 #: src/elektroid.c:386 src/elektroid.c:441
60 #: src/elektroid.c:438 src/elektroid.c:538
6161 msgid "SysEx Files"
6262 msgstr "Fichiers SysEx"
6363
64 #: src/elektroid.c:432
64 #: src/elektroid.c:529
6565 msgid "Open SysEx"
6666 msgstr "Ouvrir SysEx"
6767
68 #: src/elektroid.c:437
68 #: src/elektroid.c:534
6969 msgid "_Open"
7070 msgstr "_Ouvrir"
7171
72 #: src/elektroid.c:466
72 #: src/elektroid.c:561
7373 msgid "Send SysEx"
7474 msgstr "Envoyer SysEx"
7575
76 #: src/elektroid.c:543
76 #: src/elektroid.c:686
7777 #, c-format
7878 msgid "Error while deleting “%s”: %s."
7979 msgstr "Erreur lors de la suppression de « %s » : %s."
8080
81 #: src/elektroid.c:576
81 #: src/elektroid.c:720
8282 msgid "Are you sure you want to delete the selected items?"
8383 msgstr "Souhaitez-vous vraiment supprimer les éléments sélectionnés ?"
8484
85 #: src/elektroid.c:578 res/gui.glade:66
85 #: src/elektroid.c:722 res/gui.glade:215 res/gui.glade:1539
8686 msgid "_Delete"
8787 msgstr "_Supprimer"
8888
89 #: src/elektroid.c:633
89 #: src/elektroid.c:777
9090 msgid "Rename"
9191 msgstr "Renommer"
9292
93 #: src/elektroid.c:659
93 #: src/elektroid.c:802
9494 #, c-format
9595 msgid "Error while renaming to “%s”: %s."
9696 msgstr "Erreur lors du renommage de « %s » : %s."
9797
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"
100100 msgstr "Ajout d'un répertoire"
101101
102 #: src/elektroid.c:1126
102 #: src/elektroid.c:1414
103103 #, c-format
104104 msgid "Error while creating dir “%s”: %s."
105105 msgstr "Erreur lors de la création du répertoire « %s » : %s."
106106
107 #: src/elektroid.c:1290
107 #: src/elektroid.c:1576
108108 msgid "Queued"
109109 msgstr "Mise en fil d'attente"
110110
111 #: src/elektroid.c:1292
111 #: src/elektroid.c:1578
112112 msgid "Running"
113113 msgstr "En cours"
114114
115 #: src/elektroid.c:1294
115 #: src/elektroid.c:1580
116116 msgid "Completed"
117117 msgstr "Terminé"
118118
119 #: src/elektroid.c:1296
119 #: src/elektroid.c:1582
120120 msgid "Completed with errors"
121121 msgstr "Terminé avec des erreurs"
122122
123 #: src/elektroid.c:1298
123 #: src/elektroid.c:1584
124124 msgid "Canceled"
125125 msgstr "Annulé"
126126
127 #: src/elektroid.c:1300 src/elektroid.c:1314
127 #: src/elektroid.c:1586 src/elektroid.c:1600
128128 msgid "Undefined"
129129 msgstr "Indéfini"
130130
131 #: src/elektroid.c:1310
131 #: src/elektroid.c:1596
132132 msgid "Upload"
133133 msgstr "Téléversement"
134134
135 #: src/elektroid.c:1312
135 #: src/elektroid.c:1598
136136 msgid "Download"
137137 msgstr "Téléchargement"
138138
139 #: res/gui.glade:53
140 msgid "_Rename"
141 msgstr "_Renommer"
142
143 #: res/gui.glade:131
139 #: res/gui.glade:86
144140 msgid "GNU/Linux sample transfer application for Elektron devices"
145141 msgstr ""
146142 "Application GNU/Linux de transfert d'échantillon pour les périphériques "
147143 "Elektron"
148144
149 #: res/gui.glade:134
145 #: res/gui.glade:89
150146 msgid "translator-credits"
151147 msgstr "Olivier Humbert <trebmuh@tuxfamily.org>"
152148
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
154166 msgid "_Receive SysEx"
155167 msgstr "_Réception de SysEx"
156168
157 #: res/gui.glade:198
169 #: res/gui.glade:259
158170 msgid "_Send SysEx"
159171 msgstr "Envoi de _Sysex"
160172
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
162178 msgid "_About"
163179 msgstr "À _propos"
164180
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"
167183 msgstr "Aller au répertoire parent"
168184
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"
171187 msgstr "Rafraîchir le répertoire"
172188
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
174190 msgid "Name"
175191 msgstr "Nom"
176192
177 #: res/gui.glade:455 res/gui.glade:694
193 #: res/gui.glade:540 res/gui.glade:779
178194 msgid "Size"
179195 msgstr "Taille"
180196
181 #: res/gui.glade:492
182 msgid "Upload selection"
197 #: res/gui.glade:577
198 msgid "Upload Selection"
183199 msgstr "Téléversement de la sélection"
184200
185 #: res/gui.glade:513
186 msgid "Download selection"
201 #: res/gui.glade:598
202 msgid "Download Selection"
187203 msgstr "Téléchargement de la sélection"
188204
189 #: res/gui.glade:747
190 msgid "Refresh devices"
205 #: res/gui.glade:832
206 msgid "Refresh Devices"
191207 msgstr "Rafraîchir les périphériques"
192208
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
195211 msgid "Auto play"
196212 msgstr ""
197213 "Lecture\n"
198214 "automatique"
199215
200 #: res/gui.glade:1062
216 #: res/gui.glade:1147
201217 msgid "Status"
202218 msgstr "Statut"
203219
204 #: res/gui.glade:1073
220 #: res/gui.glade:1158
205221 msgid "Type"
206222 msgstr "Type"
207223
208 #: res/gui.glade:1084
224 #: res/gui.glade:1169
209225 msgid "Source"
210226 msgstr "Source"
211227
212 #: res/gui.glade:1098
228 #: res/gui.glade:1183
213229 msgid "Destination"
214230 msgstr "Destination"
215231
216 #: res/gui.glade:1113
232 #: res/gui.glade:1198
217233 msgid "Progress"
218234 msgstr "Progrès"
219235
220 #: res/gui.glade:1145
221 msgid "Cancel running task"
236 #: res/gui.glade:1230
237 msgid "Cancel Running Task"
222238 msgstr "Annuler la tâche en cours"
223239
224 #: res/gui.glade:1166
225 msgid "Remove queued tasks"
240 #: res/gui.glade:1251
241 msgid "Remove Queued Tasks"
226242 msgstr "Supprimer des tâches dans la file d'attente"
227243
228 #: res/gui.glade:1187
229 msgid "Clear finished tasks"
244 #: res/gui.glade:1272
245 msgid "Clear Finished Tasks"
230246 msgstr "Nettoyer les tâches terminées"
22
33 desktopdir = $(datadir)/applications
44 desktop_DATA = elektroid.desktop
5
6 metainfodir= $(datadir)/metainfo
7 metainfo_DATA = elektroid.appdata.xml
58
69 svgicondir = $(datarootdir)/icons/hicolor/scalable/apps
710 svgicon_DATA = elektroid.svg
2023 echo "*** Icon cache not updated. After (un)install, run this:"; \
2124 echo "*** $(gtk_update_icon_cache)"; \
2225 fi
26
2327 EXTRA_DIST = \
24 $(icon_DATA) \
28 $(res_DATA) \
29 $(desktop_DATA) \
30 $(metainfo_DATA) \
2531 $(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>
3131 <!-- column-name name -->
3232 <column type="gchararray"/>
3333 </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>
7934 </object>
8035 <object class="GtkListStore" id="local_list_store">
8136 <columns>
164119 </object>
165120 </child>
166121 </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">
168229 <property name="can_focus">False</property>
169230 <property name="relative_to">menu_button</property>
170231 <child>
214275 </packing>
215276 </child>
216277 <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>
217302 <object class="GtkModelButton" id="about_button">
218303 <property name="visible">True</property>
219304 <property name="can_focus">True</property>
223308 <packing>
224309 <property name="expand">False</property>
225310 <property name="fill">True</property>
226 <property name="position">3</property>
311 <property name="position">5</property>
227312 </packing>
228313 </child>
229314 </object>
249334 <property name="can_focus">True</property>
250335 <property name="receives_default">True</property>
251336 <property name="direction">none</property>
252 <property name="popover">elektroid_popmenu</property>
337 <property name="popover">main_popover</property>
253338 <child>
254339 <placeholder/>
255340 </child>
331416 <property name="visible">True</property>
332417 <property name="can_focus">True</property>
333418 <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>
335420 <child>
336421 <object class="GtkImage">
337422 <property name="visible">True</property>
352437 <property name="visible">True</property>
353438 <property name="can_focus">True</property>
354439 <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>
356441 <child>
357442 <object class="GtkImage">
358443 <property name="visible">True</property>
373458 <property name="visible">True</property>
374459 <property name="can_focus">True</property>
375460 <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>
377462 <child>
378463 <object class="GtkImage">
379464 <property name="visible">True</property>
488573 <property name="visible">True</property>
489574 <property name="can_focus">True</property>
490575 <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>
492577 <child>
493578 <object class="GtkImage">
494579 <property name="visible">True</property>
509594 <property name="visible">True</property>
510595 <property name="can_focus">True</property>
511596 <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>
513598 <property name="always_show_image">True</property>
514599 <child>
515600 <object class="GtkImage">
570655 <property name="visible">True</property>
571656 <property name="can_focus">True</property>
572657 <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>
574659 <child>
575660 <object class="GtkImage">
576661 <property name="visible">True</property>
591676 <property name="visible">True</property>
592677 <property name="can_focus">True</property>
593678 <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>
595680 <child>
596681 <object class="GtkImage">
597682 <property name="visible">True</property>
612697 <property name="visible">True</property>
613698 <property name="can_focus">True</property>
614699 <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>
616701 <child>
617702 <object class="GtkImage">
618703 <property name="visible">True</property>
743828 <property name="visible">True</property>
744829 <property name="can_focus">True</property>
745830 <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>
747832 <child>
748833 <object class="GtkImage">
749834 <property name="visible">True</property>
826911 <property name="visible">True</property>
827912 <property name="can_focus">False</property>
828913 <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>
830915 <property name="wrap">True</property>
831916 </object>
832917 <packing>
11411226 <property name="sensitive">False</property>
11421227 <property name="can_focus">True</property>
11431228 <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>
11451230 <child>
11461231 <object class="GtkImage">
11471232 <property name="visible">True</property>
11621247 <property name="sensitive">False</property>
11631248 <property name="can_focus">True</property>
11641249 <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>
11661251 <child>
11671252 <object class="GtkImage">
11681253 <property name="visible">True</property>
11831268 <property name="sensitive">False</property>
11841269 <property name="can_focus">True</property>
11851270 <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>
11871272 <child>
11881273 <object class="GtkImage">
11891274 <property name="visible">True</property>
14191504 </object>
14201505 </child>
14211506 </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>
14221553 </interface>
00 PKG_CONFIG ?= pkg-config
11
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)
55
66 bin_PROGRAMS = elektroid elektroid-cli
77 elektroid_SOURCES = elektroid.c browser.c connector.c audio.c utils.c sample.c
1414 SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
1515
1616 AM_CPPFLAGS = -Wall -O3 -DDATADIR='"$(datadir)"' -DLOCALEDIR=\""$(localedir)"\"
17
18 include_HEADERS = audio.h browser.h connector.h sample.h utils.h
4646 gshort *v;
4747 gint i;
4848
49 if (!audio->sample->len)
50 {
51 return;
52 }
53
5449 //XXX: Until a better solution is found this corks the stream without using neither drain nor empty buffers (CPU)
5550 if (audio->release_frames > PA_BUFFER_LEN)
5651 {
6257 debug_print (2, "Writing %2d frames...\n", req_frames);
6358 pa_stream_begin_write (stream, &buffer, &size);
6459
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
6570 if (audio->pos == audio->sample->len && !audio->loop)
6671 {
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);
7374 pa_stream_write (stream, buffer, size, NULL, 0, PA_SEEK_RELATIVE);
7475 audio->release_frames += req_frames;
7576 return;
9899 v++;
99100 }
100101
102 g_mutex_unlock (&audio->mutex);
103
101104 pa_stream_write (stream, buffer, i * 2, NULL, 0, PA_SEEK_RELATIVE);
102105 }
103106
140143 }
141144
142145 audio_stop (audio, TRUE);
146
143147 debug_print (1, "Playing audio...\n");
148
149 g_mutex_lock (&audio->mutex);
144150 audio->pos = 0;
145151 audio->release_frames = 0;
152 g_mutex_unlock (&audio->mutex);
146153
147154 operation = pa_stream_cork (audio->stream, 0, NULL, NULL);
148155 if (operation != NULL)
238245 }
239246 }
240247
241 int
248 gint
242249 audio_init (struct audio *audio, void (*set_volume_gui_callback) (gdouble))
243250 {
244251 pa_mainloop_api *api;
245 int err = 0;
252 gint err = 0;
246253
247254 debug_print (1, "Initializing audio...\n");
248255
292299 }
293300 }
294301
295 int
302 gboolean
296303 audio_check (struct audio *audio)
297304 {
298 return audio->mainloop ? 1 : 0;
305 return audio->mainloop ? TRUE : FALSE;
299306 }
300307
301308 void
302309 audio_reset_sample (struct audio *audio)
303310 {
311 g_mutex_lock (&audio->mutex);
304312 g_array_set_size (audio->sample, 0);
305313 audio->pos = 0;
314 g_mutex_unlock (&audio->mutex);
306315 }
307316
308317 void
3434 uint32_t index;
3535 void (*set_volume_gui_callback) (gdouble);
3636 gint release_frames;
37 GMutex mutex;
38 gboolean load_active;
3739 };
3840
3941 void audio_play (struct audio *);
4042
4143 void audio_stop (struct audio *, gboolean);
4244
43 int audio_check (struct audio *);
45 gboolean audio_check (struct audio *);
4446
45 int audio_init (struct audio *, void (*)(gdouble));
47 gint audio_init (struct audio *, void (*)(gdouble));
4648
4749 void audio_destroy (struct audio *);
4850
3232 gint (*delete) (const gchar *, const gchar);
3333 gboolean (*load_dir) (gpointer);
3434 gboolean (*check_selection) (gpointer);
35 void (*set_up_popover) (gint);
3536 GtkTreeView *view;
3637 GtkWidget *up_button;
3738 GtkWidget *add_dir_button;
3839 GtkWidget *refresh_button;
3940 GtkEntry *dir_entry;
4041 gchar *dir;
42 GtkPopover *popover;
4143 };
4244
4345 gint browser_sort (GtkTreeModel *, GtkTreeIter *, GtkTreeIter *, gpointer);
2121 #include <math.h>
2222 #include <netinet/in.h>
2323 #include <byteswap.h>
24 #include <time.h>
24 #include <sys/poll.h>
25 #include <zlib.h>
2526 #include "connector.h"
2627 #include "utils.h"
2728
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
3036
3137 static const guint8 MSG_HEADER[] = { 0xf0, 0, 0x20, 0x3c, 0x10, 0 };
3238
3339 static const guint8 INQ_DEVICE[] = { 0x1 };
3440 static const guint8 INQ_VERSION[] = { 0x2 };
41 static const guint8 INQ_UID[] = { 0x3 };
3542 static const guint8 INQ_LS_DIR_TEMPLATE[] = { 0x10 };
3643 static const guint8 INQ_NEW_DIR_TEMPLATE[] = { 0x11 };
3744 static const guint8 INQ_DELETE_DIR_TEMPLATE[] = { 0x12 };
5461 { 0x42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
5562 static const guint8 INQ_UPL_TEMPLATE_END[] = { 0x41, 0, 0, 0, 0, 0, 0, 0, 0 };
5663
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
5870 connector_get_msg_status (const GByteArray * msg)
5971 {
6072 return msg->data[5];
73 }
74
75 static gchar *
76 connector_get_msg_string (const GByteArray * msg)
77 {
78 return (gchar *) & msg->data[6];
6179 }
6280
6381 void
90108 connector_get_next_dentry (struct connector_dir_iterator *dir_iterator)
91109 {
92110 uint32_t *data;
111 gchar *dentry_cp1252;
112
113 if (dir_iterator->dentry != NULL)
114 {
115 g_free (dir_iterator->dentry);
116 }
93117
94118 if (dir_iterator->pos == dir_iterator->msg->len)
95119 {
109133 dir_iterator->type = dir_iterator->msg->data[dir_iterator->pos];
110134
111135 dir_iterator->pos++;
136 dentry_cp1252 = (gchar *) & dir_iterator->msg->data[dir_iterator->pos];
112137 dir_iterator->dentry =
113 (gchar *) & dir_iterator->msg->data[dir_iterator->pos];
138 g_convert (dentry_cp1252, -1, "UTF8", "CP1252", NULL, NULL, NULL);
114139
115140 while (dir_iterator->pos < dir_iterator->msg->len
116141 && dir_iterator->msg->data[dir_iterator->pos] != 0)
392417
393418 if (!connector->outputp)
394419 {
395 fprintf (stderr, __FILE__ ": Output port is NULL\n");
420 error_print ("Output port is NULL\n");
396421 return -1;
397422 }
398423
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));
403430 connector_destroy (connector);
404431 return tx_len;
405432 }
407434 }
408435
409436 ssize_t
410 connector_tx_sysex (struct connector *connector,
437 connector_tx_sysex (struct connector *connector, GByteArray * data,
411438 struct connector_sysex_transfer *transfer)
412439 {
413440 ssize_t tx_len;
414441 guint total;
415442 guint len;
416 guchar *data;
417 ssize_t ret = transfer->data->len;
443 guchar *b;
444 ssize_t ret = data->len;
418445
419446 transfer->status = SENDING;
420447
421 data = transfer->data->data;
448 b = data->data;
422449 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)
429460 {
430461 ret = tx_len;
431 goto cleanup;
432 }
433 data += len;
462 break;
463 }
464 b += len;
434465 total += len;
435466 }
436467
437 cleanup:
438 debug_print (1, "Raw message sent: ");
439 debug_print_hex_msg (transfer->data);
440468 transfer->active = FALSE;
441469 transfer->status = FINISHED;
442470 return ret;
448476 ssize_t ret;
449477 uint16_t aux;
450478 GByteArray *sysex;
479 GByteArray *data;
451480 struct connector_sysex_transfer transfer;
481 gchar *text;
452482
453483 aux = htons (connector->seq);
454484 memcpy (msg->data, &aux, sizeof (uint16_t));
461491 connector->seq++;
462492 }
463493
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));
466497 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);
468499 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);
472503
473504 if (ret >= 0)
474505 {
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);
480519 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;
481545 }
482546
483547 static ssize_t
485549 struct connector_sysex_transfer *transfer)
486550 {
487551 ssize_t rx_len;
488 time_t start;
552 guint total_time;
553 unsigned short revents;
554 gint err;
555 gchar *text;
489556
490557 if (!connector->inputp)
491558 {
492 fprintf (stderr, __FILE__ ": Input port is NULL\n");
559 error_print ("Input port is NULL\n");
493560 return -1;
494561 }
495562
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)
503580 {
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 {
508627 continue;
509628 }
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)
511717 {
512718 break;
513719 }
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
558754 goto end;
559755
560756 error:
572768 GByteArray *msg;
573769 GByteArray *sysex;
574770 struct connector_sysex_transfer transfer;
771 gchar *text;
575772
576773 transfer.active = TRUE;
577 transfer.timeout = TRUE;
774 transfer.timeout = SYSEX_TIMEOUT;
775 transfer.batch = FALSE;
776
578777 sysex = connector_rx_sysex (connector, &transfer);
579778 if (!sysex)
580779 {
581780 return NULL;
582781 }
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 }
593797 free_msg (sysex);
594798
595799 transfer.active = TRUE;
600804 }
601805 }
602806
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
603814 msg = connector_get_msg_payload (sysex);
604815 if (msg)
605816 {
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);
608820 }
609821
610822 free_msg (sysex);
618830 GByteArray *rx_msg;
619831
620832 g_mutex_lock (&connector->mutex);
833
834 connector_rx_drain (connector);
621835
622836 len = connector_tx (connector, tx_msg);
623837 if (len < 0)
639853 {
640854 GByteArray *tx_msg;
641855 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
644866 rx_msg = connector_tx_and_rx (connector, tx_msg);
645867 if (!rx_msg)
646868 {
658880 GByteArray *rx_msg;
659881 GByteArray *tx_msg = connector_new_msg_data (INQ_RENAME_TEMPLATE,
660882 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));
663899 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));
665901 g_byte_array_append (tx_msg, (guchar *) "\0", 1);
902
903 g_free (old_cp1252);
904 g_free (new_cp1252);
666905
667906 rx_msg = connector_tx_and_rx (connector, tx_msg);
668907 if (!rx_msg)
679918 {
680919 res = -1;
681920 errno = EPERM;
682 fprintf (stderr, "%s\n", g_strerror (errno));
921 error_print ("%s\n", g_strerror (errno));
683922 }
684923 free_msg (rx_msg);
685924
692931 {
693932 gint res;
694933 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);
696946
697947 rx_msg = connector_tx_and_rx (connector, tx_msg);
698948 if (!rx_msg)
709959 {
710960 res = -1;
711961 errno = EPERM;
712 fprintf (stderr, "%s\n", g_strerror (errno));
962 error_print ("%s\n", g_strerror (errno));
713963 }
714964 free_msg (rx_msg);
715965
737987 GByteArray *tx_msg;
738988 GByteArray *rx_msg;
739989 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);
7421001 rx_msg = connector_tx_and_rx (connector, tx_msg);
7431002 if (!rx_msg)
7441003 {
7451004 errno = EIO;
7461005 return -1;
7471006 }
1007
7481008 //Response: x, x, x, x, 0xc0, [0 (error), 1 (success)], id, frames
7491009 connector_get_sample_info_from_msg (rx_msg, &id, NULL);
7501010 if (id < 0)
7511011 {
7521012 errno = EEXIST;
753 fprintf (stderr, "%s\n", g_strerror (errno));
1013 error_print ("%s\n", g_strerror (errno));
7541014 }
7551015 free_msg (rx_msg);
7561016
7591019
7601020 ssize_t
7611021 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))
7631024 {
7641025 GByteArray *tx_msg;
7651026 GByteArray *rx_msg;
7671028 gshort *data;
7681029 gint id;
7691030 int i;
1031 gboolean active;
7701032
7711033 //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.)
7721034 //TODO: limit sample upload?
7801042 data = (gshort *) sample->data;
7811043 transferred = 0;
7821044 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)
7841049 {
7851050 if (progress)
7861051 {
7971062 //Response: x, x, x, x, 0xc2, [0 (error), 1 (success)]...
7981063 if (!connector_get_msg_status (rx_msg))
7991064 {
800 fprintf (stderr, "Unexpected status\n");
1065 error_print ("Unexpected status\n");
8011066 }
8021067 free_msg (rx_msg);
8031068 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);
8091074 }
8101075
8111076 debug_print (2, "%zu frames sent\n", transferred);
8121077
813 if (!running || *running)
814 {
1078 if (active)
1079 {
1080 if (progress)
1081 {
1082 progress (transferred / (double) sample->len);
1083 }
1084
8151085 tx_msg = connector_new_msg_upl_end (id, transferred);
8161086 rx_msg = connector_tx_and_rx (connector, tx_msg);
8171087 if (!rx_msg)
8211091 //Response: x, x, x, x, 0xc1, [0 (error), 1 (success)]...
8221092 if (!connector_get_msg_status (rx_msg))
8231093 {
824 fprintf (stderr, "Unexpected status\n");
1094 error_print ("Unexpected status\n");
8251095 }
8261096 free_msg (rx_msg);
8271097 }
8281098
829 return transferred;
1099 return active ? transferred : -1;
8301100 }
8311101
8321102 GArray *
8331103 connector_download (struct connector *connector, const gchar * path,
834 gint * running, void (*progress) (gdouble))
1104 struct connector_sample_transfer *transfer,
1105 void (*progress) (gdouble))
8351106 {
8361107 GByteArray *tx_msg;
8371108 GByteArray *rx_msg;
8441115 int16_t v;
8451116 int16_t *frame;
8461117 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);
8501130 rx_msg = connector_tx_and_rx (connector, tx_msg);
8511131 if (!rx_msg)
8521132 {
8561136 free_msg (rx_msg);
8571137 if (id < 0)
8581138 {
859 fprintf (stderr, "File %s not found\n", path);
1139 error_print ("File %s not found\n", path);
8601140 return NULL;
8611141 }
8621142
8661146
8671147 next_block_start = 0;
8681148 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)
8701153 {
8711154 if (progress)
8721155 {
8751158
8761159 req_size =
8771160 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;
8791163 tx_msg = connector_new_msg_dwnl_blck (id, next_block_start, req_size);
8801164 rx_msg = connector_tx_and_rx (connector, tx_msg);
8811165 if (!rx_msg)
8891173
8901174 next_block_start += req_size;
8911175 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);
8971181 }
8981182
8991183 debug_print (2, "%d bytes received\n", next_block_start);
9001184
901 if (!running || *running)
902 {
1185 if (active)
1186 {
1187 if (progress)
1188 {
1189 progress (next_block_start / (double) frames);
1190 }
1191
9031192 result = g_array_new (FALSE, FALSE, sizeof (short));
9041193 frame = (gshort *) data->data;
9051194 for (i = 0; i < data->len; i += 2)
9391228 GByteArray *tx_msg;
9401229 GByteArray *rx_msg;
9411230 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);
9441242 rx_msg = connector_tx_and_rx (connector, tx_msg);
9451243 if (!rx_msg)
9461244 {
9561254 {
9571255 res = -1;
9581256 errno = EEXIST;
959 fprintf (stderr, "%s\n", g_strerror (errno));
1257 error_print ("%s\n", g_strerror (errno));
9601258 }
9611259 free_msg (rx_msg);
9621260
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;
9631382 return res;
9641383 }
9651384
9751394 err = snd_rawmidi_close (connector->inputp);
9761395 if (err)
9771396 {
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));
9801399 }
9811400 connector->inputp = NULL;
9821401 }
9861405 err = snd_rawmidi_close (connector->outputp);
9871406 if (err)
9881407 {
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));
9911410 }
9921411 connector->outputp = NULL;
9931412 }
9941413
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 }
9961449 }
9971450
9981451 gint
10021455 GByteArray *tx_msg;
10031456 GByteArray *rx_msg_device;
10041457 GByteArray *rx_msg_fw_ver;
1458 GByteArray *rx_msg_uid;
1459 snd_rawmidi_params_t *params;
10051460 gchar name[32];
10061461 sprintf (name, "hw:%d", card);
10071462
10081463 connector->inputp = NULL;
10091464 connector->outputp = NULL;
10101465 connector->device_name = NULL;
1466 connector->buffer = NULL;
1467 connector->rx_len = 0;
1468 connector->pfds = NULL;
10111469
10121470 if (card < 0)
10131471 {
10221480 snd_rawmidi_open (&connector->inputp, &connector->outputp,
10231481 name, SND_RAWMIDI_NONBLOCK | SND_RAWMIDI_SYNC)) < 0)
10241482 {
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));
10271484 goto cleanup;
10281485 }
10291486
10301487 debug_print (1, "Setting blocking mode...\n");
10311488 if ((err = snd_rawmidi_nonblock (connector->outputp, 0)) < 0)
10321489 {
1033 fprintf (stderr, __FILE__ ": Error while setting blocking mode\n");
1490 error_print ("Error while setting blocking mode\n");
10341491 goto cleanup;
10351492 }
10361493 if ((err = snd_rawmidi_nonblock (connector->inputp, 1)) < 0)
10371494 {
1038 fprintf (stderr, __FILE__ ": Error while setting blocking mode\n");
1495 error_print ("Error while setting blocking mode\n");
10391496 goto cleanup;
10401497 }
10411498
10421499 debug_print (1, "Stopping device...\n");
10431500 if (snd_rawmidi_write (connector->outputp, "\xfc", 1) < 0)
10441501 {
1045 fprintf (stderr, __FILE__ ": Error while stopping device\n");
1502 error_print ("Error while stopping device\n");
10461503 }
10471504
10481505 connector->seq = 0;
10491506 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 (&params);
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 }
10501552
10511553 tx_msg = connector_new_msg_data (INQ_DEVICE, sizeof (INQ_DEVICE));
10521554 rx_msg_device = connector_tx_and_rx (connector, tx_msg);
10601562 rx_msg_fw_ver = connector_tx_and_rx (connector, tx_msg);
10611563 if (!rx_msg_fw_ver)
10621564 {
1063 free_msg (rx_msg_device);
10641565 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:
10701591 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);
10761594 cleanup:
1077 connector_destroy (connector);
1595 if (err)
1596 {
1597 connector_destroy (connector);
1598 }
10781599 return err;
10791600 }
10801601
11391660 err = snd_ctl_rawmidi_info (ctl, info);
11401661 if (err < 0)
11411662 {
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));
11451665 return NULL;
11461666 }
11471667
11731693 sprintf (name, "hw:%d", card);
11741694 if ((err = snd_ctl_open (&ctl, name, 0)) < 0)
11751695 {
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));
11781698 return;
11791699 }
11801700 device = -1;
11891709 }
11901710 if (err < 0)
11911711 {
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));
11941714 }
11951715 snd_ctl_close (ctl);
11961716 }
12091729 }
12101730 if (err < 0)
12111731 {
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));
12141733 }
12151734
12161735 return devices;
2020 #include <glib.h>
2121 #include <alsa/asoundlib.h>
2222
23 #define SYSEX_TIMEOUT 5000
24
2325 struct connector
2426 {
2527 snd_rawmidi_t *inputp;
2729 gchar *device_name;
2830 gushort seq;
2931 GMutex mutex;
32 ssize_t rx_len;
33 guint8 *buffer;
34 gint npfds;
35 struct pollfd *pfds;
3036 };
3137
3238 struct connector_dir_iterator
5763 {
5864 gboolean active;
5965 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;
6275 };
6376
6477 gint connector_init (struct connector *, gint);
8093
8194 gint connector_delete_dir (struct connector *, const gchar *);
8295
83 GArray *connector_download (struct connector *, const gchar *, gint *,
96 GArray *connector_download (struct connector *, const gchar *,
97 struct connector_sample_transfer *,
8498 void (*)(gdouble));
8599
86100 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));
89103
90104 void connector_get_sample_info_from_msg (GByteArray *, gint *, guint *);
91105
93107
94108 GArray *connector_get_elektron_devices ();
95109
96 ssize_t connector_tx_sysex (struct connector *,
110 ssize_t connector_tx_sysex (struct connector *, GByteArray *,
97111 struct connector_sysex_transfer *);
98112
99113 GByteArray *connector_rx_sysex (struct connector *,
100114 struct connector_sysex_transfer *);
101115
116
117 void connector_rx_drain (struct connector *);
118
119 gint connector_upgrade_os (struct connector *, GByteArray *,
120 struct connector_sysex_transfer *);
121
102122 void free_msg (gpointer);
2828 #include "utils.h"
2929
3030 static struct connector connector;
31 static int running;
31 static struct connector_sample_transfer sample_transfer;
3232
3333 static gchar *
3434 cli_get_path (gchar * device_path)
8080
8181 if (optind == argc)
8282 {
83 fprintf (stderr, "Remote path missing\n");
83 error_print ("Remote path missing\n");
8484 return EXIT_FAILURE;
8585 }
8686 else
123123
124124 if (optind == argc)
125125 {
126 fprintf (stderr, "Remote path missing\n");
126 error_print ("Remote path missing\n");
127127 return EXIT_FAILURE;
128128 }
129129 else
153153
154154 if (optind == argc)
155155 {
156 fprintf (stderr, "Remote path source missing\n");
156 error_print ("Remote path source missing\n");
157157 return EXIT_FAILURE;
158158 }
159159 else
164164
165165 if (optind == argc)
166166 {
167 fprintf (stderr, "Remote path destination missing\n");
167 error_print ("Remote path destination missing\n");
168168 return EXIT_FAILURE;
169169 }
170170 else
176176 card_dst = atoi (device_path_dst);
177177 if (card_src != card_dst)
178178 {
179 fprintf (stderr, "Source and destination device must be the same\n");
179 error_print ("Source and destination device must be the same\n");
180180 return EXIT_FAILURE;
181181 }
182182
201201
202202 if (optind == argc)
203203 {
204 fprintf (stderr, "Remote path missing\n");
204 error_print ("Remote path missing\n");
205205 return EXIT_FAILURE;
206206 }
207207 else
245245
246246 if (optind == argc)
247247 {
248 fprintf (stderr, "Remote path missing\n");
248 error_print ("Remote path missing\n");
249249 return EXIT_FAILURE;
250250 }
251251 else
262262
263263 path_src = cli_get_path (device_path_src);
264264
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);
267267 if (data == NULL)
268268 {
269269 return EXIT_FAILURE;
294294
295295 if (optind == argc)
296296 {
297 fprintf (stderr, "Local path missing\n");
297 error_print ("Local path missing\n");
298298 return EXIT_FAILURE;
299299 }
300300 else
305305
306306 if (optind == argc)
307307 {
308 fprintf (stderr, "Remote path missing\n");
308 error_print ("Remote path missing\n");
309309 return EXIT_FAILURE;
310310 }
311311 else
334334 goto cleanup;
335335 }
336336
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);
339340
340341 res = frames < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
341342
354355
355356 if (optind == argc)
356357 {
357 fprintf (stderr, "Device missing\n");
358 error_print ("Device missing\n");
358359 return EXIT_FAILURE;
359360 }
360361 else
377378 static void
378379 cli_end (int sig)
379380 {
380 running = 0;
381 sample_transfer.active = FALSE;
381382 }
382383
383384 int
448449 {
449450 fprintf (stderr, "%s\n", PACKAGE_STRING);
450451 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);
452453 exit (EXIT_FAILURE);
453454 }
454455
490491 }
491492 else
492493 {
493 fprintf (stderr, "Command %s not recognized\n", command);
494 error_print ("Command %s not recognized\n", command);
494495 res = EXIT_FAILURE;
495496 }
496497
4545 #define TASK_LIST_STORE_STATUS_HUMAN_FIELD 5
4646 #define TASK_LIST_STORE_TYPE_HUMAN_FIELD 6
4747
48 #define DUMP_TIMEOUT 2000
49
4850 static gpointer elektroid_upload_task (gpointer);
4951 static gpointer elektroid_download_task (gpointer);
5052 static void elektroid_update_progress (gdouble);
6466 CANCELED
6567 };
6668
67 struct elektroid_active_task
68 {
69 gint running;
69 struct elektroid_sample_transfer
70 {
71 struct connector_sample_transfer transfer;
7072 gchar *src; //Contains a path to a file
7173 gchar *dst; //Contains a path to a dir
7274 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;
7481 };
7582
7683 static struct browser remote_browser;
7784 static struct browser local_browser;
78 static struct browser *popup_browser;
7985
8086 static struct audio audio;
8187 static struct connector connector;
8490 static GThread *load_thread = NULL;
8591 static GThread *task_thread = NULL;
8692 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;
9195
9296 static GtkWidget *main_window;
9397 static GtkAboutDialog *about_dialog;
100104 static GtkWidget *progress_label;
101105 static GtkWidget *rx_sysex_button;
102106 static GtkWidget *tx_sysex_button;
107 static GtkWidget *os_upgrade_button;
103108 static GtkWidget *about_button;
104109 static GtkWidget *remote_box;
105110 static GtkWidget *waveform_draw_area;
108113 static GtkStatusbar *status_bar;
109114 static GtkListStore *devices_list_store;
110115 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;
114123 static GtkWidget *play_button;
115124 static GtkWidget *stop_button;
116125 static GtkWidget *volume_button;
121130 static GtkWidget *clear_tasks_button;
122131
123132 static void
124 elektroid_load_devices (int auto_select)
133 elektroid_load_devices (gboolean auto_select)
125134 {
126135 int i;
127136 GArray *devices = connector_get_elektron_devices ();
213222 return found;
214223 }
215224
216
217 static gint
225 static gboolean
218226 elektroid_check_connector ()
219227 {
220228 GtkListStore *list_store;
225233 gtk_widget_set_sensitive (remote_box, connected);
226234 gtk_widget_set_sensitive (rx_sysex_button, connected && !queued);
227235 gtk_widget_set_sensitive (tx_sysex_button, connected && !queued);
236 gtk_widget_set_sensitive (os_upgrade_button, connected && !queued);
228237
229238 if (!connected)
230239 {
235244 gtk_widget_set_sensitive (download_button, FALSE);
236245 gtk_widget_set_sensitive (upload_button, FALSE);
237246
238 elektroid_load_devices (0);
247 elektroid_load_devices (FALSE);
239248 }
240249
241250 elektroid_update_statusbar ();
242251
243252 return connected;
253 }
254
255 static gboolean
256 elektroid_check_connector_bg (gpointer data)
257 {
258 elektroid_check_connector ();
259
260 return FALSE;
244261 }
245262
246263 static void
251268 connector_destroy (&connector);
252269 elektroid_check_connector ();
253270 }
254 elektroid_load_devices (0);
271 elektroid_load_devices (FALSE);
255272 }
256273
257274 static gpointer
263280 if (sysex_thread)
264281 {
265282 output = g_thread_join (sysex_thread);
266 g_thread_unref (sysex_thread);
267283 }
268284 sysex_thread = NULL;
269285
271287 }
272288
273289 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
274299 elektroid_stop_sysex_thread ()
275300 {
276 transfer.active = FALSE;
301 elektroid_cancel_running_sysex (NULL, 0, NULL);
277302 elektroid_join_sysex_thread ();
278303 }
279304
280305 static void
281306 elektroid_progress_dialog_end (gpointer data)
282307 {
283 transfer.active = FALSE;
308 elektroid_cancel_running_sysex (NULL, 0, NULL);
284309 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;
292310 }
293311
294312 static gboolean
295313 elektroid_update_sysex_progress (gpointer data)
296314 {
297315 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)
302324 {
303325 case WAITING:
304326 text = _("Waiting...");
316338 }
317339 gtk_label_set_text (GTK_LABEL (progress_label), text);
318340
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;
320346 }
321347
322348 static gpointer
323349 elektroid_rx_sysex_thread (gpointer data)
324350 {
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
331370 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;
333383 }
334384
335385 static void
346396 GByteArray *sysex_data;
347397 GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE;
348398
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
352401 gtk_window_set_title (GTK_WINDOW (progress_dialog), _("Receive SysEx"));
353
354402 res = gtk_dialog_run (GTK_DIALOG (progress_dialog));
355 transfer.active = FALSE;
403 sysex_transfer.transfer.active = FALSE;
356404 gtk_widget_hide (GTK_WIDGET (progress_dialog));
357405
358406 sysex_data = elektroid_join_sysex_thread ();
431479 static gpointer
432480 elektroid_tx_sysex_thread (gpointer data)
433481 {
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
440501 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)
446517 {
447518 GtkWidget *dialog;
448519 GtkFileChooser *chooser;
451522 char *filename;
452523 FILE *file;
453524 long size;
454 gint *copied;
525 gint *response;
455526 GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
456527
457528 dialog = gtk_file_chooser_dialog_new (_("Open SysEx"),
479550 size = ftell (file);
480551 rewind (file);
481552
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);
485556 fclose (file);
486557
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);
490559
491560 gtk_window_set_title (GTK_WINDOW (progress_dialog), _("Send SysEx"));
492561 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
494567 gtk_widget_hide (GTK_WIDGET (progress_dialog));
495568
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)
500573 {
501574 elektroid_check_connector ();
502575 }
503576
504 free (copied);
577 free (response);
505578 }
506579
507580 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 ();
508614 }
509615
510616 static void
517623 static void
518624 elektroid_controls_set_sensitive (gboolean sensitive)
519625 {
626 gtk_widget_set_sensitive (local_play_button, sensitive);
520627 gtk_widget_set_sensitive (play_button, sensitive);
521628 gtk_widget_set_sensitive (stop_button, sensitive);
522629 }
523630
524631 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)
528642 {
529643 if (audio_check (&audio))
530644 {
534648 {
535649 audio_play (&audio);
536650 }
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)
543660 {
544661 GtkTreeIter iter;
545662 gchar *name;
553670 browser_get_item_info (model, &iter, &icon, &name, NULL);
554671 type = get_type_from_inventory_icon (icon);
555672
556 path = chain_path (popup_browser->dir, name);
673 path = chain_path (browser->dir, name);
557674 debug_print (1, "Deleting %s...\n", path);
558675
559 err = popup_browser->delete (path, type);
676 err = browser->delete (path, type);
560677 if (err < 0)
561678 {
562679 dialog =
576693 }
577694
578695 free (path);
579 free (icon);
580 free (name);
696 g_free (icon);
697 g_free (name);
581698 }
582699
583700 static void
592709 GList *tree_path_list;
593710 GList *ref_list;
594711 gint confirmation;
712 struct browser *browser = data;
595713
596714 dialog =
597715 gtk_message_dialog_new (GTK_WINDOW (main_window),
610728 return;
611729 }
612730
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));
616733 tree_path_list = gtk_tree_selection_get_selected_rows (selection, &model);
617734 ref_list = NULL;
618735
626743 for (item = ref_list; item != NULL; item = g_list_next (item))
627744 {
628745 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);
630747 }
631748 g_list_free_full (ref_list, (GDestroyNotify) gtk_tree_row_reference_free);
632749
633 popup_browser->load_dir (NULL);
750 browser->load_dir (NULL);
634751 }
635752
636753 static void
643760 gint err;
644761 GtkWidget *dialog;
645762 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);
650768 browser_get_item_info (model, &iter, NULL, &old_name, NULL);
651769
652 old_path = chain_path (popup_browser->dir, old_name);
770 old_path = chain_path (browser->dir, old_name);
653771
654772 gtk_entry_set_text (name_dialog_entry, old_name);
655773 gtk_widget_grab_focus (GTK_WIDGET (name_dialog_entry));
667785 if (result == GTK_RESPONSE_ACCEPT)
668786 {
669787 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);
674791
675792 if (err < 0)
676793 {
688805 }
689806 else
690807 {
691 popup_browser->load_dir (NULL);
808 browser->load_dir (NULL);
692809 }
693810
694811 free (new_path);
700817 gtk_widget_hide (GTK_WIDGET (name_dialog));
701818 }
702819
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
703845 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)
706848 {
707849 GdkRectangle rect;
708850 GtkTreePath *path;
709 gint count;
710851 gboolean selected;
711852 GtkTreeSelection *selection;
712853 struct browser *browser = data;
713854
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)
717857 {
718858 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser->view));
719859 gtk_tree_view_get_path_at_pos (browser->view,
720860 event->x, event->y, &path, NULL, NULL,
721861 NULL);
722862
863 if (!path)
864 {
865 gtk_tree_selection_unselect_all (selection);
866 return FALSE;
867 }
868
723869 selected = gtk_tree_selection_path_is_selected (selection, path);
870
724871 if (!selected)
725872 {
726873 if ((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK
728875 {
729876 gtk_tree_selection_unselect_all (selection);
730877 }
878
731879 gtk_tree_selection_select_path (selection, path);
732880 }
733
734 count = browser_get_selected_items_count (browser);
735 gtk_widget_set_sensitive (rename_button, count == 1 ? TRUE : FALSE);
736881
737882 gtk_tree_view_get_background_area (browser->view, path, NULL, &rect);
738883 gtk_tree_path_free (path);
739884
740885 rect.x = event->x;
741886 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);
745891
746892 return TRUE;
747893 }
765911 static gpointer
766912 elektroid_load_sample (gpointer path)
767913 {
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
770925 free (path);
771 g_idle_add (elektroid_update_ui_after_load, NULL);
926
772927 return NULL;
773928 }
774929
776931 elektroid_start_load_thread (gchar * path)
777932 {
778933 debug_print (1, "Creating load thread...\n");
779 load_thread_running = TRUE;
934
780935 load_thread = g_thread_new ("load_sample", elektroid_load_sample, path);
936
937 g_timeout_add (100, elektroid_update_ui_on_load, NULL);
781938 }
782939
783940 static void
784941 elektroid_stop_load_thread ()
785942 {
786943 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
788949 if (load_thread)
789950 {
790951 g_thread_join (load_thread);
791 g_thread_unref (load_thread);
792 }
793 load_thread = NULL;
952 load_thread = NULL;
953 }
794954 }
795955
796956 static void
800960 if (task_thread)
801961 {
802962 g_thread_join (task_thread);
803 g_thread_unref (task_thread);
804 }
805 task_thread = NULL;
963 task_thread = NULL;
964 }
806965 }
807966
808967 static void
809968 elektroid_stop_task_thread ()
810969 {
811970 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
813976 elektroid_join_task_thread ();
814977 }
815978
8481011 type = get_type_from_inventory_icon (icon);
8491012 if (type == ELEKTROID_FILE)
8501013 {
1014 gtk_widget_set_sensitive (local_open_button, TRUE);
8511015 sample_path = chain_path (local_browser.dir, name);
8521016 elektroid_start_load_thread (sample_path);
8531017 }
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);
8561024 }
8571025
8581026 return FALSE;
8681036 double x_ratio, mid_y, value;
8691037 short *sample;
8701038
871 g_mutex_lock (&load_mutex);
1039 g_mutex_lock (&audio.mutex);
8721040
8731041 if (audio.sample->len <= 0)
8741042 {
875 goto cleanup;
1043 g_mutex_unlock (&audio.mutex);
1044 return FALSE;
8761045 }
8771046
8781047 context = gtk_widget_get_style_context (widget);
8991068 }
9001069 }
9011070
902 cleanup:
903 g_mutex_unlock (&load_mutex);
1071 g_mutex_unlock (&audio.mutex);
1072
9041073 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);
9051173 }
9061174
9071175 static void
9821250 elektroid_check_connector ();
9831251 if (d_iter == NULL)
9841252 {
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);
9871254 goto end;
9881255 }
9891256
10251292
10261293 if (!(dir = opendir (local_browser.dir)))
10271294 {
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);
10301296 goto end;
10311297 }
10321298
10971363 }
10981364 else
10991365 {
1100 fprintf (stderr,
1101 __FILE__ ": Error while opening local %s dir\n", name);
1366 error_print ("Error while opening local %s dir\n", name);
11021367 error = errno;
11031368 }
11041369 }
11231388 gtk_widget_grab_focus (GTK_WIDGET (name_dialog_entry));
11241389 gtk_widget_set_sensitive (name_dialog_accept_button, FALSE);
11251390
1126 gtk_window_set_title (GTK_WINDOW (name_dialog), _("Add directory"));
1391 gtk_window_set_title (GTK_WINDOW (name_dialog), _("Add Directory"));
11271392
11281393 result = GTK_RESPONSE_ACCEPT;
11291394
12251490 }
12261491 else
12271492 {
1228 fprintf (stderr, __FILE__ ": Error while opening remote %s dir\n",
1229 path);
1493 error_print ("Error while opening remote %s dir\n", path);
12301494 }
12311495 return connector_delete_dir (&connector, path);
12321496 }
12681532 }
12691533 else
12701534 {
1271 fprintf (stderr, __FILE__ ": Error while opening local %s dir\n",
1272 path);
1535 error_print ("Error while opening local %s dir\n", path);
12731536 }
12741537 return rmdir (path);
12751538 }
13431606 static void
13441607 elektroid_cancel_running_task (GtkWidget * object, gpointer data)
13451608 {
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);
13471612 }
13481613
13491614 static gboolean
1350 elektroid_select_queued_task (enum elektroid_task_status status)
1615 elektroid_task_is_queued (enum elektroid_task_status status)
13511616 {
13521617 return (status == QUEUED);
13531618 }
13541619
13551620 static gboolean
1356 elektroid_select_finished_task (enum elektroid_task_status status)
1621 elektroid_task_is_finished (enum elektroid_task_status status)
13571622 {
13581623 return (status == COMPLETED_OK ||
13591624 status == COMPLETED_ERROR || status == CANCELED);
13741639 gtk_tree_model_get (GTK_TREE_MODEL (task_list_store), &iter,
13751640 TASK_LIST_STORE_STATUS_FIELD, &status, -1);
13761641
1377 if (elektroid_select_queued_task (status))
1642 if (elektroid_task_is_queued (status))
13781643 {
13791644 queued = TRUE;
13801645 }
13811646
1382 if (elektroid_select_finished_task (status))
1647 if (elektroid_task_is_finished (status))
13831648 {
13841649 finished = TRUE;
13851650 }
14271692 static void
14281693 elektroid_remove_queued_tasks (GtkWidget * object, gpointer data)
14291694 {
1430 elektroid_remove_tasks_on_cond (elektroid_select_queued_task);
1695 elektroid_remove_tasks_on_cond (elektroid_task_is_queued);
14311696 }
14321697
14331698 static void
14341699 elektroid_clear_finished_tasks (GtkWidget * object, gpointer data)
14351700 {
1436 elektroid_remove_tasks_on_cond (elektroid_select_finished_task);
1437 }
1438
1701 elektroid_remove_tasks_on_cond (elektroid_task_is_finished);
1702 }
14391703
14401704 static gboolean
14411705 elektroid_complete_running_task (gpointer data)
14421706 {
14431707 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);
14451710
14461711 if (elektroid_get_running_task (&iter))
14471712 {
14481713 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,
14501716 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);
14541722 }
14551723 else
14561724 {
14681736 gchar *src;
14691737 gchar *dst;
14701738 GtkTreePath *path;
1739 gboolean sample_transfer_active;
14711740 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)
14741748 {
14751749 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);
14771753 path =
14781754 gtk_tree_model_get_path (GTK_TREE_MODEL (task_list_store), &iter);
14791755 gtk_tree_view_set_cursor (GTK_TREE_VIEW (task_tree_view), path, NULL,
14801756 FALSE);
14811757 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;
14861761 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);
14881763 if (type == UPLOAD)
14891764 {
14901765 task_thread =
15001775 }
15011776 else
15021777 {
1503 gtk_widget_set_sensitive (cancel_task_button, FALSE);
15041778 gtk_widget_set_sensitive (rx_sysex_button, TRUE);
15051779 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);
15071784
15081785 return FALSE;
15091786 }
15171794 ssize_t frames;
15181795 GArray *sample;
15191796
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);
15231800 bname = basename (basec);
15241801 remove_ext (bname);
1525 remote_path = chain_path (active_task.dst, bname);
1802 remote_path = chain_path (sample_transfer.dst, bname);
15261803 free (basec);
15271804
15281805 debug_print (1, "Remote path: %s\n", remote_path);
15291806
15301807 sample = g_array_new (FALSE, FALSE, sizeof (gshort));
15311808
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 }
15341819
15351820 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);
15371824 free (remote_path);
15381825
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;
15431830 }
15441831 else
15451832 {
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;
15491837 }
15501838 else
15511839 {
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 }
15571844
15581845 g_array_free (sample, TRUE);
15591846
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:
15641856 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);
15751858
15761859 return NULL;
15771860 }
15951878 type_human, -1);
15961879
15971880 gtk_widget_set_sensitive (remove_tasks_button, TRUE);
1598 gtk_widget_set_sensitive (clear_tasks_button, TRUE);
15991881 }
16001882
16011883 static void
16091891
16101892 if (!dir)
16111893 {
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);
16141895 goto cleanup_not_dir;
16151896 }
16161897
16171898 remote_abs_dir = chain_path (remote_browser.dir, rel_dir);
16181899 if (elektroid_remote_mkdir (remote_abs_dir))
16191900 {
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);
16221902 goto cleanup;
16231903 }
16241904
16861966 free (dst);
16871967 free (src);
16881968 }
1689 free (name);
1690 free (icon);
1969 g_free (name);
1970 g_free (icon);
16911971 }
16921972
16931973 static void
17051985
17061986 gtk_widget_set_sensitive (rx_sysex_button, FALSE);
17071987 gtk_widget_set_sensitive (tx_sysex_button, FALSE);
1988 gtk_widget_set_sensitive (os_upgrade_button, FALSE);
17081989
17091990 if (!queued)
17101991 {
17222003 gchar *bname;
17232004 gchar *new_filename;
17242005
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);
17282009 bname = basename (basec);
17292010 new_filename = malloc (PATH_MAX);
17302011 snprintf (new_filename, PATH_MAX, "%s.wav", bname);
17312012 free (basec);
1732 local_path = chain_path (active_task.dst, new_filename);
2013 local_path = chain_path (sample_transfer.dst, new_filename);
17332014 free (new_filename);
17342015
17352016 debug_print (1, "Local path: %s\n", local_path);
17362017
17372018 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;
17462027 }
17472028 else
17482029 {
1749 if (active_task.running)
2030 g_mutex_lock (&sample_transfer.transfer.mutex);
2031 if (sample_transfer.transfer.active)
17502032 {
17512033 debug_print (1, "Writing to file '%s'...\n", local_path);
17522034 frames = sample_save (sample, local_path);
17532035 debug_print (1, "%zu frames written\n", frames);
17542036 free (local_path);
17552037
1756 active_task.status = COMPLETED_OK;
2038 sample_transfer.status = COMPLETED_OK;
17572039 }
17582040 else
17592041 {
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 {
17622049 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)
17642051 {
17652052 g_idle_add (local_browser.load_dir, NULL);
17662053 }
17682055
17692056 g_idle_add (elektroid_complete_running_task, NULL);
17702057 g_idle_add (elektroid_run_next_task, NULL);
1771 g_idle_add (elektroid_check_task_buttons, NULL);
17722058
17732059 return NULL;
17742060 }
17852071 elektroid_check_connector ();
17862072 if (d_iter == NULL)
17872073 {
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);
17902075 goto cleanup_not_dir;
17912076 }
17922077
17932078 local_abs_dir = chain_path (local_browser.dir, rel_dir);
17942079 if (elektroid_local_mkdir (local_abs_dir))
17952080 {
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);
17982082 goto cleanup;
17992083 }
18002084
18522136 free (dst);
18532137 free (src);
18542138 }
1855 free (name);
1856 free (icon);
2139 g_free (name);
2140 g_free (icon);
18572141 }
18582142
18592143 static void
18712155
18722156 gtk_widget_set_sensitive (rx_sysex_button, FALSE);
18732157 gtk_widget_set_sensitive (tx_sysex_button, FALSE);
2158 gtk_widget_set_sensitive (os_upgrade_button, FALSE);
18742159
18752160 if (!queued)
18762161 {
18822167 elektroid_set_progress_value (gpointer data)
18832168 {
18842169 GtkTreeIter iter;
2170 gdouble *value = data;
18852171
18862172 if (elektroid_get_running_task (&iter))
18872173 {
18882174 gtk_list_store_set (task_list_store, &iter,
18892175 TASK_LIST_STORE_PROGRESS_FIELD,
1890 100.0 * active_task.progress, -1);
1891 }
2176 100.0 * (*value), -1);
2177 }
2178
2179 free (data);
18922180
18932181 return FALSE;
18942182 }
18962184 static void
18972185 elektroid_update_progress (gdouble progress)
18982186 {
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;
19012248 }
19022249
19032250 static void
19062253 GtkTreeIter iter;
19072254 GValue cardv = G_VALUE_INIT;
19082255 guint card;
2256 gint count;
19092257
19102258 if (gtk_combo_box_get_active_iter (devices_combo, &iter) == TRUE)
19112259 {
2260 if (connector_check (&connector))
2261 {
2262 connector_destroy (&connector);
2263 }
2264
19122265 gtk_tree_model_get_value (GTK_TREE_MODEL (devices_list_store),
19132266 &iter, 0, &cardv);
19142267
19162269
19172270 if (connector_init (&connector, card) < 0)
19182271 {
1919 fprintf (stderr, __FILE__ ": Error while connecting\n");
2272 error_print ("Error while connecting\n");
19202273 }
19212274
19222275 if (elektroid_check_connector ())
19232276 {
19242277 strcpy (remote_browser.dir, "/");
19252278 remote_browser.load_dir (NULL);
2279
2280 count = browser_get_selected_items_count (&local_browser);
2281 gtk_widget_set_sensitive (upload_button, count > 0);
19262282 }
19272283 }
19282284 }
19632319 (glade_file, PATH_MAX, "%s/%s/res/gui.glade", DATADIR,
19642320 PACKAGE) >= PATH_MAX)
19652321 {
1966 fprintf (stderr, __FILE__ ": Path too long\n");
2322 error_print ("Path too long\n");
19672323 return -1;
19682324 }
19692325
19702326 if (snprintf
19712327 (css_file, PATH_MAX, "%s/%s/res/gui.css", DATADIR, PACKAGE) >= PATH_MAX)
19722328 {
1973 fprintf (stderr, __FILE__ ": Path too long\n");
2329 error_print ("Path too long\n");
19742330 return -1;
19752331 }
19762332
20182374 GTK_WIDGET (gtk_builder_get_object (builder, "rx_sysex_button"));
20192375 tx_sysex_button =
20202376 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"));
20212379 about_button =
20222380 GTK_WIDGET (gtk_builder_get_object (builder, "about_button"));
20232381
20402398 GTK_WIDGET (gtk_builder_get_object (builder, "download_button"));
20412399 status_bar = GTK_STATUSBAR (gtk_builder_get_object (builder, "status_bar"));
20422400
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
20502401 g_signal_connect (main_window, "delete-event",
20512402 G_CALLBACK (elektroid_delete_window), NULL);
20522403
20532404 g_signal_connect (progress_dialog_cancel_button, "clicked",
20542405 G_CALLBACK (elektroid_progress_dialog_end), NULL);
20552406 g_signal_connect (progress_dialog, "response",
2056 G_CALLBACK (elektroid_progress_dialog_response), NULL);
2407 G_CALLBACK (elektroid_cancel_running_sysex), NULL);
20572408
20582409 g_signal_connect (rx_sysex_button, "clicked",
20592410 G_CALLBACK (elektroid_rx_sysex), NULL);
20602411 g_signal_connect (tx_sysex_button, "clicked",
20612412 G_CALLBACK (elektroid_tx_sysex), NULL);
2413 g_signal_connect (os_upgrade_button, "clicked",
2414 G_CALLBACK (elektroid_upgrade_os), NULL);
20622415 g_signal_connect (about_button, "clicked",
20632416 G_CALLBACK (elektroid_show_about), NULL);
20642417
20872440 g_signal_connect (upload_button, "clicked",
20882441 G_CALLBACK (elektroid_add_upload_tasks), NULL);
20892442
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);
20942472
20952473 remote_browser = (struct browser)
20962474 {
21042482 GTK_WIDGET (gtk_builder_get_object (builder, "remote_refresh_button")),
21052483 .dir_entry =
21062484 GTK_ENTRY (gtk_builder_get_object (builder, "remote_dir_entry")),
2485 .popover =
2486 GTK_POPOVER (gtk_builder_get_object (builder, "remote_popover")),
21072487 .dir = malloc (PATH_MAX),
21082488 .load_dir = elektroid_load_remote_dir,
21092489 .check_selection = elektroid_remote_check_selection,
21102490 .rename = elektroid_remote_rename,
21112491 .delete = elektroid_remote_delete,
2112 .mkdir = elektroid_remote_mkdir
2492 .mkdir = elektroid_remote_mkdir,
2493 .set_up_popover = elektroid_remote_popover_set_up
21132494 };
21142495
21152496 g_signal_connect (gtk_tree_view_get_selection (remote_browser.view),
21242505 g_signal_connect (remote_browser.refresh_button, "clicked",
21252506 G_CALLBACK (browser_refresh), &remote_browser);
21262507 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);
21282511
21292512 local_browser = (struct browser)
21302513 {
21382521 GTK_WIDGET (gtk_builder_get_object (builder, "local_refresh_button")),
21392522 .dir_entry =
21402523 GTK_ENTRY (gtk_builder_get_object (builder, "local_dir_entry")),
2524 .popover =
2525 GTK_POPOVER (gtk_builder_get_object (builder, "local_popover")),
21412526 .dir = malloc (PATH_MAX),
21422527 .load_dir = elektroid_load_local_dir,
21432528 .check_selection = elektroid_local_check_selection,
21442529 .rename = elektroid_local_rename,
21452530 .delete = elektroid_local_delete,
2146 .mkdir = elektroid_local_mkdir
2531 .mkdir = elektroid_local_mkdir,
2532 .set_up_popover = elektroid_local_popover_set_up
21472533 };
21482534
21492535 g_signal_connect (gtk_tree_view_get_selection (local_browser.view),
21582544 g_signal_connect (local_browser.refresh_button, "clicked",
21592545 G_CALLBACK (browser_refresh), &local_browser);
21602546 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);
21622550
21632551 sortable = GTK_TREE_SORTABLE (gtk_tree_view_get_model (local_browser.view));
21642552 gtk_tree_sortable_set_sort_func (sortable, BROWSER_LIST_STORE_NAME_FIELD,
22152603 gtk_widget_set_sensitive (upload_button, FALSE);
22162604 gtk_widget_set_sensitive (rx_sysex_button, FALSE);
22172605 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);
22202609
22212610 gethostname (hostname, LABEL_MAX);
22222611 gtk_label_set_text (GTK_LABEL (hostname_label), hostname);
22932682 {
22942683 fprintf (stderr, "%s\n", PACKAGE_STRING);
22952684 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);
22972686 exit (EXIT_FAILURE);
22982687 }
22992688
2424 #include "sample.h"
2525 #include "utils.h"
2626
27 #define LOAD_BUFFER_LEN 10000
28
2927 size_t
3028 sample_save (GArray * sample, gchar * path)
3129 {
4240 sndfile = sf_open (path, SFM_WRITE, &sf_info);
4341 if (!sndfile)
4442 {
45 fprintf (stderr, "%s\n", sf_strerror (sndfile));
43 error_print ("%s\n", sf_strerror (sndfile));
4644 return -1;
4745 }
4846
7573
7674 size_t
7775 sample_load (GArray * sample, GMutex * mutex, gint * frames, gchar * path,
78 gboolean * running, void (*progress) (gdouble))
76 gboolean * active, void (*progress) (gdouble))
7977 {
8078 SF_INFO sf_info;
8179 SNDFILE *sndfile;
8987 int err;
9088 int resampled_buffer_len;
9189 int f, frames_read;
90 gboolean load_active;
9291
9392 debug_print (1, "Loading file %s...\n", path);
9493
106105 sndfile = sf_open (path, SFM_READ, &sf_info);
107106 if (!sndfile)
108107 {
109 fprintf (stderr, "%s\n", sf_strerror (sndfile));
108 error_print ("%s\n", sf_strerror (sndfile));
110109 return -1;
111110 }
112111
145144 debug_print (2, "Loading sample (%" PRId64 ")...\n", sf_info.frames);
146145
147146 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)
149157 {
150158 debug_print (2, "Loading buffer...\n");
151159
215223 progress (f * 1.0 / sf_info.frames);
216224 }
217225
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 }
218235 }
219236
220237 src_delete (src_state);
221238
222239 if (err)
223240 {
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 {
234258 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);
244263 }
245264
246265 cleanup:
2121 #include <sys/types.h>
2222 #include <sys/stat.h>
2323
24 #define LOAD_BUFFER_LEN 4800
25
2426 size_t sample_save (GArray *, gchar *);
2527
2628 size_t sample_load (GArray *, GMutex *, gboolean *, gchar *, gint *,
2222 #include <wordexp.h>
2323 #include "utils.h"
2424
25 #define DEBUG_LEVEL1_LEN 16
25 #define DEBUG_SHORT_HEX_LEN 64
26 #define DEBUG_FULL_HEX_THRES 3
2627
2728 #define REG_TYPE "emblem-music-symbolic"
2829 #define DIR_TYPE "folder-visiting-symbolic"
2930
30 static gchar
31 connector_get_printable_char (gchar c)
32 {
33 return c >= 0x20 && c < 0x80 ? c : '.';
34 }
31 gint debug_level;
3532
3633 static guint
3734 get_max_message_length (guint msg_len)
3835 {
3936 guint len;
4037
41 if (debug_level > 1)
38 if (debug_level >= DEBUG_FULL_HEX_THRES)
4239 {
4340 len = msg_len;
4441 }
4542 else
4643 {
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;
4845 }
4946
5047 return len;
5148 }
5249
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++;
7295 i++;
7396 }
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);
96111 }
97112
98113 gchar *
126141 *dot = 0;
127142 }
128143
129 const char *
130 get_ext (const char *name)
144 const gchar *
145 get_ext (const gchar * name)
131146 {
132147 int namelen = strlen (name) - 1;
133148 int i = namelen;
134 const char *ext = &name[namelen];
149 const gchar *ext = &name[namelen];
135150
136151 while (*(ext - 1) != '.' && i > 0)
137152 {
150165 }
151166
152167 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;
156171
157172 if (strcmp (icon, REG_TYPE) == 0)
158173 {
165180 return type;
166181 }
167182
168 const char *
183 const gchar *
169184 get_inventory_icon_from_type (char type)
170185 {
171 const char *icon;
186 const gchar *icon;
172187
173188 if (type == ELEKTROID_FILE)
174189 {
182197 }
183198
184199 char *
185 get_local_startup_path (const char *local_dir)
200 get_local_startup_path (const gchar * local_dir)
186201 {
187202 DIR *dir;
188 char *startup_path = NULL;
203 gchar *startup_path = NULL;
189204 wordexp_t exp_result;
190205
191206 if (local_dir)
198213 }
199214 else
200215 {
201 fprintf (stderr, __FILE__ ": Unable to open dir %s\n", local_dir);
216 error_print ("Unable to open dir %s\n", local_dir);
202217 }
203218 closedir (dir);
204219 }
2424 #define ELEKTROID_FILE 'F'
2525 #define ELEKTROID_DIR 'D'
2626
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__)
2829
29 int debug_level;
30 extern int debug_level;
3031
31 void print_ascii_msg (const GByteArray *);
32 gchar *debug_get_hex_data (gint, guint8 *, guint);
3233
33 void debug_print_hex_msg (const GByteArray *);
34 gchar *debug_get_hex_msg (const GByteArray *);
3435
35 char *chain_path (const char *, const char *);
36 gchar *chain_path (const gchar *, const gchar *);
3637
37 void remove_ext (char *);
38 void remove_ext (gchar *);
3839
39 const char *get_ext (const char *);
40 const gchar *get_ext (const gchar *);
4041
41 char get_type_from_inventory_icon (const char *);
42 gchar get_type_from_inventory_icon (const gchar *);
4243
43 const char *get_inventory_icon_from_type (char);
44 const gchar *get_inventory_icon_from_type (gchar);
4445
45 char *get_local_startup_path (const char *);
46 gchar *get_local_startup_path (const gchar *);
00 TESTS=full_test.sh
1
2 EXTRA_DIST = \
3 $(TESTS) \
4 res/square.wav
88 [ -z "$DEVICE" ] && echo "No device found" && exit 1
99 echo "Using device $DEVICE..."
1010
11 sleep 1
12
1113 echo "Testing ls..."
1214 $ecli ls $DEVICE:/
1315 [ $? -ne 0 ] && exit 1
1416
17 sleep 1
18
1519 echo "Testing mkdir..."
1620 $ecli mkdir $DEVICE:/$TEST_NAME
1721 [ $? -ne 0 ] && exit 1
22
23 sleep 1
24
1825 $ecli ls $DEVICE:/$TEST_NAME
1926 [ $? -ne 0 ] && exit 1
27
28 sleep 1
2029
2130 echo "Testing upload..."
2231 $ecli upload $srcdir/res/square.wav $DEVICE:/$TEST_NAME
2332 [ $? -ne 0 ] && exit 1
33
34 sleep 1
2435
2536 output=$($ecli ls $DEVICE:/$TEST_NAME)
2637 echo $output
2940 name=$(echo $output | awk '{print $4}')
3041 [ "$type" != "F" ] || [ "$size" != "0.09" ] || [ "$name" != "square" ] && exit 1
3142
43 sleep 1
44
3245 echo "Testing download..."
3346 $ecli download $DEVICE:/$TEST_NAME/square
3447 [ $? -ne 0 ] && exit 1
3649 rm $srcdir/square.wav
3750 [ "$actual_cksum" != "$(cksum $srcdir/res/square.wav | awk '{print $1}')" ] && exit 1
3851
52 sleep 1
53
3954 echo "Testing mv..."
4055 $ecli mv $DEVICE:/$TEST_NAME/square $DEVICE:/$TEST_NAME/sample
4156 [ $? -ne 0 ] && exit 1
4257
58 sleep 1
59
4360 echo "Testing rm..."
4461 $ecli rm $DEVICE:/$TEST_NAME/sample
4562 [ $? -ne 0 ] && exit 1
63
64 sleep 1
4665
4766 echo "Testing rmdir..."
4867 $ecli rmdir $DEVICE:/$TEST_NAME