Skip to content

Commit

Permalink
Updated MixerX, PGE-FL, AudioCodecs, and DirManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Wohlstand committed Sep 9, 2024
1 parent ebd01f1 commit 23495ae
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ private boolean isXboxOneController(UsbDevice usbDevice, UsbInterface usbInterfa
0x044f, // Thrustmaster
0x045e, // Microsoft
0x0738, // Mad Catz
0x0b05, // ASUS
0x0e6f, // PDP
0x0f0d, // Hori
0x10f5, // Turtle Beach
Expand Down Expand Up @@ -590,7 +591,13 @@ public boolean openDevice(int deviceID) {
} else {
flags = 0;
}
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
if (Build.VERSION.SDK_INT >= 33 /* Android 14.0 (U) */) {
Intent intent = new Intent(HIDDeviceManager.ACTION_USB_PERMISSION);
intent.setPackage(mContext.getPackageName());
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, intent, flags));
} else {
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
}
} catch (Exception e) {
Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
HIDDeviceOpenResult(deviceID, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public static Context getContext() {
}

public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
loadLibrary(libraryName, mContext);
}

public static void loadLibrary(String libraryName, Context context) throws UnsatisfiedLinkError, SecurityException, NullPointerException {

if (libraryName == null) {
throw new NullPointerException("No library name provided.");
Expand All @@ -53,10 +57,10 @@ public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError,
// To use ReLinker, just add it as a dependency. For more information, see
// https://github.com/KeepSafe/ReLinker for ReLinker's repository.
//
Class<?> relinkClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
Class<?> relinkListenerClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
Class<?> contextClass = mContext.getClassLoader().loadClass("android.content.Context");
Class<?> stringClass = mContext.getClassLoader().loadClass("java.lang.String");
Class<?> relinkClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
Class<?> relinkListenerClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
Class<?> contextClass = context.getClassLoader().loadClass("android.content.Context");
Class<?> stringClass = context.getClassLoader().loadClass("java.lang.String");

// Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if
// they've changed during updates.
Expand All @@ -66,7 +70,7 @@ public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError,

// Actually load the library!
Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass);
loadMethod.invoke(relinkInstance, mContext, libraryName, null, null);
loadMethod.invoke(relinkInstance, context, libraryName, null, null);
}
catch (final Throwable e) {
// Fall back
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 2;
private static final int SDL_MINOR_VERSION = 30;
private static final int SDL_MICRO_VERSION = 3;
private static final int SDL_MICRO_VERSION = 6;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
Expand Down Expand Up @@ -281,7 +281,7 @@ protected String[] getLibraries() {
// Load the .so
public void loadLibraries() {
for (String lib : getLibraries()) {
SDL.loadLibrary(lib);
SDL.loadLibrary(lib, this);
}
}

Expand Down Expand Up @@ -995,8 +995,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint)
/* No valid hint, nothing is explicitly allowed */
if (!is_portrait_allowed && !is_landscape_allowed) {
if (resizable) {
/* All orientations are allowed */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
/* All orientations are allowed, respecting user orientation lock setting */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
} else {
/* Fixed window and nothing specified. Get orientation from w/h of created window */
req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
Expand All @@ -1005,8 +1005,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint)
/* At least one orientation is allowed */
if (resizable) {
if (is_portrait_allowed && is_landscape_allowed) {
/* hint allows both landscape and portrait, promote to full sensor */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
/* hint allows both landscape and portrait, promote to full user */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
} else {
/* Use the only one allowed "orientation" */
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);
Expand Down
6 changes: 4 additions & 2 deletions MusicPlayer/AssocFiles/assoc_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ AssocFiles::AssocFiles(QWidget *parent) :
formats << tentry{"spc", "SPC - Super NES/Famicom Music", tr("Super NES/Famicom Music", "File Type Name")};
formats << tentry{"vgm", "VGM - Video Game Music", tr("Video Game Music", "File Type Name")};
formats << tentry{"vgz", "VGZ - Video Game Music (GZ Compressed)", tr("Video Game Music (GZ-compressed)", "File Type Name")};
formats << tentry{"imf", "IMF - Imago Orpheus/Id Music File", tr("Imago Orpheus/Id Music File", "File Type Name")};
formats << tentry{"wlf", "WLF - Id Music File (Wolfenstein)", tr("Id Music File (Wolfenstein)", "File Type Name")};

formats << tentry{"669", "669 - Composer 669, Unis 669", tr("Composer 669, Unis 669", "File Type Name")};
formats << tentry{"amf", "AMF - ASYLUM Music Format V1.0/DSMI Advanced Module Format", tr("ASYLUM Music Format", "File Type Name")};
Expand All @@ -58,7 +60,6 @@ AssocFiles::AssocFiles(QWidget *parent) :
formats << tentry{"gdm", "GDM - General DigiMusic", tr("General DigiMusic File", "File Type Name")};
formats << tentry{"it", "IT - Impulse Tracker", tr("Impulse Tracker File", "File Type Name")};
formats << tentry{"mptm", "MPTM - Open ModPlug Tracker", tr("Open ModPlug Tracker Music", "File Type Name")};
formats << tentry{"imf", "IMF - Imago Orpheus/Id Music File", tr("Imago Orpheus/Id Music File", "File Type Name")};
formats << tentry{"mod", "MOD - 15 and 31 instruments", tr("Module Music file", "File Type Name")};
formats << tentry{"med", "MED - OctaMED", tr("OctaMED Music File", "File Type Name")};
formats << tentry{"mtm", "MTM - MultiTracker Module editor", tr("MultiTracker Module File", "File Type Name")};
Expand Down Expand Up @@ -109,6 +110,8 @@ void AssocFiles::on_reset_clicked()
defaultFormats["spc"] = true;
defaultFormats["vgm"] = true;
defaultFormats["vgz"] = true;
defaultFormats["imf"] = true;
defaultFormats["wlf"] = true;

defaultFormats["669"] = true;
defaultFormats["amf"] = true;
Expand All @@ -118,7 +121,6 @@ void AssocFiles::on_reset_clicked()
defaultFormats["gdm"] = true;
defaultFormats["it"] = true;
defaultFormats["mptm"]= true;
defaultFormats["imf"] = true;
defaultFormats["mod"] = true;
defaultFormats["med"] = true;
defaultFormats["mtm"] = true;
Expand Down
2 changes: 1 addition & 1 deletion _Libs/AudioCodecs
Submodule AudioCodecs updated 279 files
2 changes: 1 addition & 1 deletion _Libs/DirManager

0 comments on commit 23495ae

Please sign in to comment.