Beispiel #1
0
 private void input(String source) {
   Status status = powerOn();
   while (!status.getInput().equals(source)) {
     post(XMLYamaha.input(source));
     sleep(1);
     status = getStatus();
   }
 }
Beispiel #2
0
 private Status powerOn() {
   Status status = getStatus();
   while (status == null || !status.isPowerOn()) {
     post(powerOnXml());
     sleep(1);
     status = getStatus();
   }
   return status;
 }
Beispiel #3
0
 private void station(int station) {
   input("NET RADIO");
   Status status = getStatus();
   while (status.getRadioMenuLevel() == null) {
     sleep(1);
     status = getStatus();
   }
   if (status.getRadioMenuLevel() == 1) {
     post(radioListItem(1));
     sleep(2);
   }
   post(radioListItem(station));
 }
Beispiel #4
0
 private void volume(VolumeOperation op, Integer dB) {
   Status status = getStatus();
   if (status != null) {
     switch (op) {
       case DOWN:
         int newVol = status.getVolume() - 50;
         post(volumeXml(newVol));
         break;
       case UP:
         newVol = status.getVolume() + 50;
         post(volumeXml(newVol));
         break;
       case MUTE:
         post(muteXml());
         break;
       case SET:
         post(volumeXml(-dB * 10));
         break;
     }
   }
 }