コード例 #1
0
ファイル: PDActivity.java プロジェクト: emecas/PlasmaSound
        @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;
        }
コード例 #2
0
ファイル: PDActivity.java プロジェクト: emecas/PlasmaSound
 public void readSettings() {
   if (inst == null) {
     // Log.d("ReadSettings", "Called with inst being null!");
     // Thread.dumpStack();
     return;
   }
   final SharedPreferences mPrefs =
       PDActivity.this.getSharedPreferences(SHARED_PREFERENCES_AUDIO, 0);
   // Log.d("ReadSettings", "Called with inst being all good");
   inst.updateSettings(this, mPrefs);
 }