示例#1
0
 @Override
 protected void onPause() {
   super.onPause();
   if (pdman != null) pdman.onPause();
   if (wl != null && wl.isHeld()) wl.release();
   if (frag != null) frag.onPause();
 }
示例#2
0
        @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;
        }
示例#3
0
 public void record() {
   String name;
   try {
     name = JSONPresets.getPresets().getCurrent().getString("name");
     if (sequencer.isAdded()) {
       name += "_" + JSONSequencerPresets.getPresets().getCurrent().getString("name");
     }
   } catch (Exception e) {
     e.printStackTrace();
     name = "errorerrorerror";
   }
   File outfolder = new File(Environment.getExternalStorageDirectory(), "Plasma Sound");
   outfolder.mkdirs();
   String filename = pdman.recordOnOff(outfolder, name, true);
   MiscDialogs.checkForSoundcloudAndDoThatOrNot(this, filename, name);
 }
示例#4
0
        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);
                  }
                });
          }
        }
示例#5
0
  @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();
  }
示例#6
0
 @Override
 public void onDestroy() {
   if (pdman != null) pdman.cleanup();
   super.onDestroy();
   if (wl != null && wl.isHeld()) wl.release();
 }