Skip to content

Commit 318dd13

Browse files
committed
fixed NativeSound configuration can be opened on Mac OS [fixes #35]
- the xt-audio library supports only Windows and Linux
1 parent bf23004 commit 318dd13

File tree

10 files changed

+32
-8
lines changed

10 files changed

+32
-8
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>de.lars</groupId>
88
<artifactId>remotelight</artifactId>
9-
<version>0.2.5</version>
9+
<version>0.2.5.1</version>
1010
<packaging>pom</packaging>
1111

1212
<name>RemoteLight</name>

remotelight-client/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>de.lars</groupId>
99
<artifactId>remotelight</artifactId>
10-
<version>0.2.5</version>
10+
<version>0.2.5.1</version>
1111
</parent>
1212

1313
<artifactId>remotelight-client</artifactId>

remotelight-client/src/main/java/de/lars/remotelightclient/ui/panels/musicsync/MusicSyncOptionsPanel.java

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public MusicSyncOptionsPanel() {
168168
panelNativeSoundConfig.setBackground(null);
169169
panelNativeSoundConfig.setLayout(new BoxLayout(panelNativeSoundConfig, BoxLayout.X_AXIS));
170170
panelNativeSoundConfig.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0));
171+
panelNativeSoundConfig.setVisible(!RemoteLightCore.isMacOS());
171172
bgrOptions.add(panelNativeSoundConfig);
172173

173174
JButton btnTest = new JButton(i18n.getString("MusicSync.ConfigureNativeSound"));

remotelight-client/src/main/java/de/lars/remotelightclient/ui/panels/musicsync/nativesound/NativeSoundConfigPanel.java

+7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
import de.lars.remotelightcore.RemoteLightCore;
6060
import de.lars.remotelightcore.musicsync.sound.nativesound.NativeSound;
6161
import de.lars.remotelightcore.musicsync.sound.nativesound.NativeSoundFormat;
62+
import de.lars.remotelightcore.notification.Notification;
63+
import de.lars.remotelightcore.notification.NotificationType;
6264
import de.lars.remotelightcore.settings.SettingsManager;
6365
import de.lars.remotelightcore.settings.types.SettingObject;
6466

@@ -351,6 +353,11 @@ private void initLayout() {
351353

352354

353355
public static NativeSoundConfigPanel showDialog() {
356+
if(RemoteLightCore.isMacOS()) {
357+
Main.getInstance().showNotification(new Notification(NotificationType.ERROR, "Unsupported", "Native-Sound-Input is not available on Mac OS."));
358+
return null;
359+
}
360+
354361
Frame window = JOptionPane.getRootFrame();
355362
JDialog dialog = new JDialog(window, "Choose a sound output or input", true);
356363

remotelight-core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>de.lars</groupId>
99
<artifactId>remotelight</artifactId>
10-
<version>0.2.5</version>
10+
<version>0.2.5.1</version>
1111
</parent>
1212

1313
<artifactId>remotelight-core</artifactId>

remotelight-core/src/main/java/de/lars/remotelightcore/RemoteLightCore.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class RemoteLightCore {
6565
private static boolean shuttingDown = false;
6666
private static long startMillis = System.currentTimeMillis();
6767

68-
public final static String VERSION = "v0.2.5";
68+
public final static String VERSION = "v0.2.5.1";
6969
public final static boolean DEVBUILD = false;
7070
public final static String WEBSITE = "https://remotelight-software.blogspot.com";
7171
public final static String GITHUB = "https://github.com/Drumber/RemoteLight";
@@ -184,6 +184,10 @@ public static boolean isHeadless() {
184184
return headless;
185185
}
186186

187+
public static boolean isMacOS() {
188+
return System.getProperty("os.name").contains("Mac OS");
189+
}
190+
187191
public AnimationManager getAnimationManager() {
188192
return aniManager;
189193
}

remotelight-core/src/main/java/de/lars/remotelightcore/musicsync/sound/nativesound/NativeSound.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,18 @@
2828
import java.nio.ByteOrder;
2929
import java.util.ArrayList;
3030
import java.util.List;
31+
3132
import org.tinylog.Logger;
3233

33-
import com.xtaudio.xt.*;
34+
import com.xtaudio.xt.XtAudio;
35+
import com.xtaudio.xt.XtBuffer;
36+
import com.xtaudio.xt.XtDevice;
37+
import com.xtaudio.xt.XtFormat;
38+
import com.xtaudio.xt.XtService;
39+
import com.xtaudio.xt.XtStream;
40+
import com.xtaudio.xt.XtStreamCallback;
3441

42+
import de.lars.remotelightcore.RemoteLightCore;
3543
import de.lars.remotelightcore.utils.DirectoryUtil;
3644

3745
public class NativeSound {
@@ -54,6 +62,10 @@ public NativeSound(boolean init) {
5462
}
5563

5664
public void init() {
65+
if(RemoteLightCore.isMacOS()) {
66+
Logger.warn("NativeSound is not supported on Mac OS.");
67+
return;
68+
}
5769
if (!initialized) {
5870
boolean isWin = System.getProperty("os.name").contains("Windows");
5971

remotelight-plugincompat/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>de.lars</groupId>
88
<artifactId>remotelight</artifactId>
9-
<version>0.2.5</version>
9+
<version>0.2.5.1</version>
1010
</parent>
1111
<artifactId>remotelight-plugincompat</artifactId>
1212

remotelight-plugincore/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>de.lars</groupId>
99
<artifactId>remotelight</artifactId>
10-
<version>0.2.5</version>
10+
<version>0.2.5.1</version>
1111
</parent>
1212

1313
<artifactId>remotelight-plugincore</artifactId>

remotelight-restapi/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>de.lars</groupId>
88
<artifactId>remotelight</artifactId>
9-
<version>0.2.5</version>
9+
<version>0.2.5.1</version>
1010
</parent>
1111

1212
<artifactId>remotelight-restapi</artifactId>

0 commit comments

Comments
 (0)