@Override protected Void doInBackground(final Void... params) { startingup = true; Log.v("PlasmaSoundSetup", "creating pd"); // PD Stuff pdman = new PDManager(PDActivity.this); Log.v("PlasmaSoundSetup", "launching pd"); pdready = false; pdman.onResume(); Log.v("PlasmaSoundSetup", "Starting instrument"); // Make the Instrument inst = new Instrument(pdman); Log.v("PlasmaSoundSetup", "setting instrument patch"); inst.setPatch(PATCH_PATH); inst.setMidiMin(70); inst.setMidiMax(87); Log.v("PlasmaSoundSetup", "Reading settings"); loadPresets(); // readSettings(); if (loadPresets()) { if (JSONPresets.getPresets().loadDefault(PDActivity.this, inst) == null) {} // if there is no defaults // readSettings(); } else { // readSettings(); } readSettings(); Log.v("PlasmaSoundSetup", "Done!"); return null; }
public void run() { if (startingup == false) { pdready = false; if (pdman != null) { pdman.onResume(); pdready = true; Log.v("PlasmaSoundReadyRunnable", "Destroying popup!"); } runOnUiThread( new Runnable() { public void run() { loadingview.setVisibility(View.GONE); } }); } }
@Override protected void onResume() { super.onResume(); PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "PlasmaSoundHDLock"); wl.acquire(); if (loadingview == null) loadingview = this.findViewById(com.rj.processing.plasmasound.R.id.loadingview); loadingview.setVisibility(View.VISIBLE); if (pdready == true) { pdready = false; if (pdman != null) pdman.onResume(readyrunnable); } readSettings(); checkAndRemindThemToGiveMeAGoodRating(); checkAndGiveThemATutorial(); if (frag != null) frag.onResume(); }