-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/games/rednblack/miniaudio/MADeviceNotificationListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package games.rednblack.miniaudio; | ||
|
||
public interface MADeviceNotificationListener { | ||
void onNotification(MADeviceNotificationType type); | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/games/rednblack/miniaudio/MADeviceNotificationType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package games.rednblack.miniaudio; | ||
|
||
public enum MADeviceNotificationType { | ||
STARTED(0), | ||
STOPPED(1), | ||
REROUTED(2), | ||
INTERRUPTION_BEGAN(3), | ||
INTERRUPTION_ENDED(4), | ||
UNLOCKED(5); | ||
|
||
public final int code; | ||
|
||
MADeviceNotificationType(int code) { | ||
this.code = code; | ||
} | ||
|
||
public static MADeviceNotificationType decode (int code) { | ||
switch (code) { | ||
case 0: | ||
return MADeviceNotificationType.STARTED; | ||
case 1: | ||
return MADeviceNotificationType.STOPPED; | ||
case 2: | ||
return MADeviceNotificationType.REROUTED; | ||
case 3: | ||
return MADeviceNotificationType.INTERRUPTION_BEGAN; | ||
case 4: | ||
return MADeviceNotificationType.INTERRUPTION_ENDED; | ||
case 5: | ||
return MADeviceNotificationType.UNLOCKED; | ||
default: | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.