@Override protected void onPause() { super.onPause(); if (pdman != null) pdman.onPause(); if (wl != null && wl.isHeld()) wl.release(); if (frag != null) frag.onPause(); }
public void runSequencer(boolean setup, boolean fragmentTransaction) { // Log.d("PDActivity", "Running sequencer"); hideBoth(); if (frag != null) { // Log.d("PDActivity", "Backgrounding current"); frag.background(); } frag = sequencer; if (setup) { // Log.d("PDActivity", "Setting up sequencer"); frag.setup(); } if (fragmentTransaction) { FragmentManager man = this.getFragmentManager(); FragmentTransaction trans = man.beginTransaction(); removeTheremin(trans); addSequencer(trans); trans.commit(); } }
@Override public void setup() { hint(DISABLE_DEPTH_TEST); hint(DISABLE_OPENGL_ERRORS); hint(PApplet.DISABLE_OPTIMIZED_STROKE); hint(PApplet.DISABLE_DEPTH_MASK); hint(PApplet.DISABLE_DEPTH_SORT); frameRate(60); mtManager = new MTManager(); mtManager.addTouchListener(this); asyncSetup.execute(new Void[0]); debug(); if (frag != null) frag.setup(); }
@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(); }
@Override public void presetChanged(JSONObject preset) { if (frag != null) frag.presetChanged(preset); }
@Override public void draw() { if (frag != null) frag.draw(); }
@Override public void touchUp(final Cursor c) { if (frag != null) frag.touchUp(c); }
/** override to select a custom menu * */ private int getMenu() { if (frag != null) return frag.getMenu(); else return com.rj.processing.plasmasound.R.menu.main_menu; }