Skip to content

Commit 31cae54

Browse files
committed
Merge branch 'release/v0.0.8'
Conflicts: library/build.gradle library/repository/jp/kshoji/ble-midi/maven-metadata.xml library/repository/jp/kshoji/ble-midi/maven-metadata.xml.md5 library/repository/jp/kshoji/ble-midi/maven-metadata.xml.sha1
2 parents c473c5f + 9c92df8 commit 31cae54

12 files changed

+58
-22
lines changed

library/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ group = 'jp.kshoji'
4242
uploadArchives {
4343
repositories.mavenDeployer {
4444
repository url: 'file://' + file('repository').absolutePath
45-
pom.version = '0.0.7'
45+
pom.version = '0.0.8'
4646
pom.artifactId = 'ble-midi'
4747
}
4848
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
048aa6a9f4a15b9db0a4575aba633cf5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6d2eed4880ae4600d9f610851132fc05c0cd2203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>jp.kshoji</groupId>
6+
<artifactId>ble-midi</artifactId>
7+
<version>0.0.8</version>
8+
<packaging>aar</packaging>
9+
<dependencies>
10+
<dependency>
11+
<groupId>jp.kshoji</groupId>
12+
<artifactId>javax-sound-midi</artifactId>
13+
<version>0.0.2</version>
14+
<type>aar</type>
15+
<scope>compile</scope>
16+
</dependency>
17+
<dependency>
18+
<groupId>com.android.support</groupId>
19+
<artifactId>support-annotations</artifactId>
20+
<version>21.0.3</version>
21+
<scope>compile</scope>
22+
</dependency>
23+
</dependencies>
24+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d2d07ca790e6f470690454e028d640ff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2f6c3bbd88badd8d3f4402d01c96c73fbbc57d79

library/repository/jp/kshoji/ble-midi/maven-metadata.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
<version>0.0.6-SNAPSHOT</version>
1818
<version>0.0.6</version>
1919
<version>0.0.7</version>
20+
<version>0.0.8</version>
2021
</versions>
21-
<lastUpdated>20150331030008</lastUpdated>
22+
<lastUpdated>20150430030503</lastUpdated>
2223
</versioning>
2324
</metadata>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
04d16e77c877fa8e88460604ba735e40
1+
026f2e59aa250d3ab9a576185506d04c
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4231f69f67134ee0ecf6411f76f79fc284fc373c
1+
243689f724241aba812ecf9ca614adfe6d78f71c

library/src/main/java/jp/kshoji/blemidi/central/BleMidiCallback.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ private void disconnectByDeviceAddress(@NonNull String deviceAddress) {
282282
synchronized (midiInputDevicesMap) {
283283
Set<MidiInputDevice> midiInputDevices = midiInputDevicesMap.get(deviceAddress);
284284
if (midiInputDevices != null) {
285+
midiInputDevicesMap.remove(deviceAddress);
286+
285287
for (MidiInputDevice midiInputDevice : midiInputDevices) {
286288
midiInputDevice.setOnMidiInputEventListener(null);
287289

@@ -291,20 +293,20 @@ private void disconnectByDeviceAddress(@NonNull String deviceAddress) {
291293

292294
}
293295
midiInputDevices.clear();
294-
midiInputDevicesMap.remove(deviceAddress);
295296
}
296297
}
297298

298299
synchronized (midiOutputDevicesMap) {
299300
Set<MidiOutputDevice> midiOutputDevices = midiOutputDevicesMap.get(deviceAddress);
300301
if (midiOutputDevices != null) {
302+
midiOutputDevicesMap.remove(deviceAddress);
303+
301304
for (MidiOutputDevice midiOutputDevice : midiOutputDevices) {
302305
if (midiDeviceDetachedListener != null) {
303306
midiDeviceDetachedListener.onMidiOutputDeviceDetached(midiOutputDevice);
304307
}
305308
}
306309
midiOutputDevices.clear();
307-
midiOutputDevicesMap.remove(deviceAddress);
308310
}
309311
}
310312
}

library/src/main/java/jp/kshoji/blemidi/peripheral/BleMidiPeripheralProvider.java

+21-16
Original file line numberDiff line numberDiff line change
@@ -262,23 +262,25 @@ private void disconnectByDeviceAddress(@NonNull String deviceAddress) {
262262
synchronized (midiInputDevicesMap) {
263263
MidiInputDevice midiInputDevice = midiInputDevicesMap.get(deviceAddress);
264264
if (midiInputDevice != null) {
265+
midiInputDevicesMap.remove(deviceAddress);
266+
265267
midiInputDevice.setOnMidiInputEventListener(null);
266268

267269
if (midiDeviceDetachedListener != null) {
268270
midiDeviceDetachedListener.onMidiInputDeviceDetached(midiInputDevice);
269271
}
270272
}
271-
midiInputDevicesMap.remove(deviceAddress);
272273
}
273274

274275
synchronized (midiOutputDevicesMap) {
275276
MidiOutputDevice midiOutputDevice = midiOutputDevicesMap.get(deviceAddress);
276277
if (midiOutputDevice != null) {
278+
midiOutputDevicesMap.remove(deviceAddress);
279+
277280
if (midiDeviceDetachedListener != null) {
278281
midiDeviceDetachedListener.onMidiOutputDeviceDetached(midiOutputDevice);
279282
}
280283
}
281-
midiOutputDevicesMap.remove(deviceAddress);
282284
}
283285
}
284286

@@ -359,30 +361,33 @@ public void onReceive(Context context, Intent intent) {
359361
break;
360362

361363
case BluetoothProfile.STATE_DISCONNECTED:
362-
if (midiDeviceAttachedListener != null) {
364+
String deviceAddress = device.getAddress();
363365

364-
String deviceAddress = device.getAddress();
366+
synchronized (midiInputDevicesMap) {
367+
MidiInputDevice midiInputDevice = midiInputDevicesMap.get(deviceAddress);
368+
if (midiInputDevice != null) {
369+
midiInputDevicesMap.remove(deviceAddress);
365370

366-
synchronized (midiInputDevicesMap) {
367-
MidiInputDevice midiInputDevice = midiInputDevicesMap.get(deviceAddress);
368-
if (midiInputDevice != null) {
369-
midiInputDevice.setOnMidiInputEventListener(null);
371+
midiInputDevice.setOnMidiInputEventListener(null);
372+
if (midiDeviceDetachedListener != null) {
370373
midiDeviceDetachedListener.onMidiInputDeviceDetached(midiInputDevice);
371-
midiInputDevicesMap.remove(deviceAddress);
372374
}
373375
}
376+
}
374377

375-
synchronized (midiOutputDevicesMap) {
376-
MidiOutputDevice midiOutputDevice = midiOutputDevicesMap.get(deviceAddress);
377-
if (midiOutputDevice != null) {
378+
synchronized (midiOutputDevicesMap) {
379+
MidiOutputDevice midiOutputDevice = midiOutputDevicesMap.get(deviceAddress);
380+
if (midiOutputDevice != null) {
381+
midiOutputDevicesMap.remove(deviceAddress);
382+
383+
if (midiDeviceDetachedListener != null) {
378384
midiDeviceDetachedListener.onMidiOutputDeviceDetached(midiOutputDevice);
379-
midiOutputDevicesMap.remove(deviceAddress);
380385
}
381386
}
387+
}
382388

383-
synchronized (bluetoothDevicesMap) {
384-
bluetoothDevicesMap.remove(deviceAddress);
385-
}
389+
synchronized (bluetoothDevicesMap) {
390+
bluetoothDevicesMap.remove(deviceAddress);
386391
}
387392
break;
388393
}

0 commit comments

Comments
 (0)