mirror of
https://github.com/DrBeef/Doom3Quest.git
synced 2024-11-23 12:22:20 +00:00
Update aar files to support haptic streaming
This commit is contained in:
parent
26125033dd
commit
3bf8db107a
5 changed files with 39 additions and 0 deletions
BIN
Projects/Android/libs/bhaptics_ble.aar
Normal file
BIN
Projects/Android/libs/bhaptics_ble.aar
Normal file
Binary file not shown.
BIN
Projects/Android/libs/bhaptics_commons.aar
Normal file
BIN
Projects/Android/libs/bhaptics_commons.aar
Normal file
Binary file not shown.
BIN
Projects/Android/libs/bhaptics_core.aar
Normal file
BIN
Projects/Android/libs/bhaptics_core.aar
Normal file
Binary file not shown.
BIN
Projects/Android/libs/bhaptics_manager.aar
Normal file
BIN
Projects/Android/libs/bhaptics_manager.aar
Normal file
Binary file not shown.
|
@ -9,6 +9,7 @@ import android.util.Log;
|
|||
import com.bhaptics.bhapticsmanger.BhapticsManager;
|
||||
import com.bhaptics.bhapticsmanger.BhapticsManagerCallback;
|
||||
import com.bhaptics.bhapticsmanger.BhapticsModule;
|
||||
import com.bhaptics.bhapticsmanger.HapticStreamer;
|
||||
import com.bhaptics.bhapticsmanger.HapticPlayer;
|
||||
import com.bhaptics.commons.PermissionUtils;
|
||||
import com.bhaptics.commons.model.BhapticsDevice;
|
||||
|
@ -63,6 +64,7 @@ public class bHaptics {
|
|||
private static boolean initialised = false;
|
||||
|
||||
private static HapticPlayer player;
|
||||
private HapticStreamer hapticStreamer;
|
||||
|
||||
private static Context context;
|
||||
|
||||
|
@ -289,6 +291,43 @@ public class bHaptics {
|
|||
enabled = false;
|
||||
}
|
||||
|
||||
public static void startStreaming() {
|
||||
if (hapticStreamer == null) {
|
||||
hapticStreamer = new DefaultHapticStreamer();
|
||||
hapticStreamer.setCallback(new HapticStreamer.HapticStreamerCallback() {
|
||||
@Override
|
||||
public void onDiscover(String host) {
|
||||
Log.i(TAG, "onDiscover: " + host);
|
||||
if (defaultConnect) {
|
||||
hapticStreamer.connect(host);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnect(String host) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisconnect(String host) {
|
||||
|
||||
}
|
||||
});
|
||||
hapticStreamer.refreshCandidateIps();
|
||||
}
|
||||
}
|
||||
|
||||
public static void stopStreaming() {
|
||||
hapticStreamer.dispose();
|
||||
hapticStreamer = null;
|
||||
}
|
||||
|
||||
public static void refreshIp() {
|
||||
if (hapticStreamer != null) {
|
||||
hapticStreamer.refreshCandidateIps();
|
||||
}
|
||||
}
|
||||
|
||||
public static void beginFrame()
|
||||
{
|
||||
if (enabled && hasPairedDevice) {
|
||||
|
|
Loading…
Reference in a new issue