Skip to content

Commit

Permalink
Print BASS version
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni0451 committed May 13, 2024
1 parent 5b7a425 commit ef4b984
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface BassLibrary extends Library {

BassLibrary INSTANCE = loadNative();

int BASSVERSION = 0x02041100; // 2.4.17
int BASSVERSION = 0x204;

// BASS_Init flags
int BASS_DEVICE_8BITS = 1; // unused
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public static BassSoundSystem createCapture(final int maxSounds, final AudioForm
private BassSoundSystem(final int maxSounds) {
super(0);

if (BassLibrary.INSTANCE.BASS_GetVersion() != BassLibrary.BASSVERSION) {
final int version = BassLibrary.INSTANCE.BASS_GetVersion();
if (((version >> 16) & 0xFFFF) != BassLibrary.BASSVERSION) {
throw new RuntimeException("BASS version is not correct");
}
if (!BassLibrary.INSTANCE.BASS_Init(-1, 44100, 0, 0, null)) {
Expand All @@ -92,7 +93,8 @@ private BassSoundSystem(final int maxSounds) {
this.close();
}));

System.out.println("Initialized BASS on " + deviceInfo.name);
final String versionString = "v" + ((version >> 24) & 0xFF) + "." + ((version >> 16) & 0xFF) + "." + ((version >> 8) & 0xFF) + "." + (version & 0xFF);
System.out.println("Initialized BASS " + versionString + " on " + deviceInfo.name);
}

@Override
Expand Down

0 comments on commit ef4b984

Please sign in to comment.