Skip to content

Commit

Permalink
sync works only on linux
Browse files Browse the repository at this point in the history
investigate on win32
  • Loading branch information
Shaji Khan committed Nov 26, 2024
1 parent e2c2764 commit c3ab069
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/shajikhan/ladspa/amprack/FirestoreDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,17 @@ public void savePresets(JSONObject jsonObject, boolean shared, AlertDialog dialo

JSONObject controls = jo.getJSONObject("controls");
Iterator<String> controlKeys = controls.keys();
Map<String, String> controlsMap = new HashMap<>();
Map<String, Object> controlsMap = new HashMap<>();

while (controlKeys.hasNext()) {
String control = controlKeys.next();
JSONObject controlJson = controls.getJSONObject(control);
Log.d(TAG, String.format ("[%s] control: %s: %s %s", jo.get("name"), control,
controlJson.get("name"), controlJson.get("controls")));
Map <String, String> controlMap = new HashMap<>();
controlsMap.put("controls", controlJson.getString("controls"));
controlsMap.put("name", controlJson.getString("name"));
// controlsMap.put(control, controlMap);
controlMap.put("controls", controlJson.getString("controls"));
controlMap.put("name", controlJson.getString("name"));
controlsMap.put(control, controlMap);
}

Log.d(TAG, String.format ("[controls] %s: %s", jo.get("name"), controlsMap));
Expand Down Expand Up @@ -256,7 +256,7 @@ public void onFailure(@NonNull Exception e) {
public void onSuccess(Void unused) {
dialog.dismiss();
Toast.makeText(context,
"Patch saved successfully",
"Synced presets successfully",
Toast.LENGTH_LONG)
.show();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4113,6 +4113,10 @@ public static Map JSONtoMap (JSONObject j) {
// todo: do each control individually
JSONObject controls = j.getJSONObject ("controls");
Iterator<String> keys = controls.keys();
if (! keys.hasNext()) {
Log.e(TAG, "JSONtoMap: no controls found! error! error!");
return map;
}
String next = keys.next();
while (keys.hasNext()) {
JSONObject settings = controls.getJSONObject(next);
Expand Down

0 comments on commit c3ab069

Please sign in to comment.