Beispiel #1
0
  protected void setBusy(boolean busy) {
    boolean changed = false;

    synchronized (this) {
      if (busy) {

        changed = busy_count++ == 0;

      } else {

        changed = busy_count-- == 1;
      }
    }

    if (changed) {

      manager.deviceChanged(this, false);
    }
  }
Beispiel #2
0
  protected void setInfo(Object key, String info) {
    boolean changed = false;

    if (info == null || info.length() == 0) {

      synchronized (infos) {
        changed = infos.remove(key) != null;
      }
    } else {

      String existing;

      synchronized (infos) {
        existing = infos.put(key, info);
      }

      changed = existing == null || !existing.equals(info);
    }

    if (changed) {

      manager.deviceChanged(this, false);
    }
  }
Beispiel #3
0
  protected void setError(Object key, String error) {
    boolean changed = false;

    if (error == null || error.length() == 0) {

      synchronized (errors) {
        changed = errors.remove(key) != null;
      }
    } else {

      String existing;

      synchronized (errors) {
        existing = errors.put(key, error);
      }

      changed = existing == null || !existing.equals(error);
    }

    if (changed) {

      manager.deviceChanged(this, false);
    }
  }
Beispiel #4
0
  protected void setTranscoding(boolean _transcoding) {
    transcoding = _transcoding;

    manager.deviceChanged(this, false);
  }