IPS_SetProperty ('DeviceName') funktioniert bei der MediaPlayer Instanz nicht

Hallo zusammen,

wie in einem anderen Thread beschrieben, kämpfe ich mit hängenden Prozessen. Inzwischen bin ich soweit, dass ich einen Zusammenhang mit den Funktionen WAC_SetVolume und WAC_Reset sehe: vermutlich gibt es ein Problem, wenn die Funktionen zu einem Zeitpunkt aufgerufen werden, wenn das Sound Device nicht verfügbar ist.

Um der Sache näher zu kommen, versuche ich die Instanzeinstellungen per Script zu verändern, leider ohne Erfolg:

Wenn ich versuche, das Gerät zum Test auf „No sound“ umzustellen, so returnieren die Funktionen zwar mit ‚true‘, aber bleiben letztendlich wirkungslos. Die MediaPlayer Einstellungen in der Konsole bleiben bezüglich des ‚Gerätes‘ unverändert. Auch funktioniert eine Soundausgabe weiterhin.

Hier mein Beispiel:


print_r(IPS_GetInstance(ID_MEDIA_PLAYER));
echo 'DeviceNum: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceNum').PHP_EOL;
echo 'DeviceName: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceName').PHP_EOL;
echo 'UpdateInterval: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'UpdateInterval').PHP_EOL;
echo 'DeviceDriver: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceDriver').PHP_EOL;

echo (int) IPS_SetProperty(ID_MEDIA_PLAYER, 'DeviceNum', 0).PHP_EOL;
echo (int) IPS_SetProperty(ID_MEDIA_PLAYER, 'DeviceName', 'No Sound').PHP_EOL;
echo (int) IPS_SetProperty(ID_MEDIA_PLAYER, 'UpdateInterval', 99).PHP_EOL;
echo (int) IPS_ApplyChanges(ID_MEDIA_PLAYER).PHP_EOL;
echo 'DeviceNum: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceNum').PHP_EOL;
echo 'DeviceName: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceName').PHP_EOL;
echo 'DeviceName: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'UpdateInterval').PHP_EOL;

Und so sieht die Ausgabe aus:


Array
(
    [ConnectionID] => 0
    [InstanceID] => 25632
    [InstanceStatus] => 102
    [LastChange] => 0
    [ModuleInfo] => Array
        (
            [ModuleID] => {2999EBBB-5D36-407E-A52B-E9142A45F19C}
            [ModuleName] => Media Player
            [ModuleType] => 3
        )

)
DeviceNum: 1
DeviceName: Acer T232HL (Intel(R) Display-Audio)
UpdateInterval: 4
DeviceDriver: {0.0.0.00000000}.{6d58e4fa-9b46-47d5-850e-e6fd4dfcf88e}
1
1
1
1
DeviceNum: 0
DeviceName: No Sound
DeviceName: 99

Scheinbar werden alle Einstellungen erfolgreich umgesetzt. Tatsächlich ist dem aber nicht so:( Nur das Intervall wurde umgesetzt:

Hat dazu jemand eine Idee?

Viele Grüße

Burkhard

Der MediaPlayer nutzt die drei Properties nach der folgenden Reihenfolge, um dein Gerät zu finden:

  1. DeviceDriver
  2. DeviceName
  3. DeviceNum

Da du den DeviceDriver nicht auf „“ setzt, ist er bei dir immer noch gültig und wird somit auf deine Soundkarte gemappt :slight_smile:
Die anderen Properties sind somit nicht mehr relevant :wink:

paresy

Ah gut, wichtiger Hinweis.

Für die Nachwelt;), so funktionert es:


print_r(IPS_GetInstance(ID_MEDIA_PLAYER));
echo 'DeviceNum: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceNum').PHP_EOL;
echo 'DeviceName: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceName').PHP_EOL;
echo 'UpdateInterval: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'UpdateInterval').PHP_EOL;
echo 'DeviceDriver: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceDriver').PHP_EOL;

echo (int) IPS_SetProperty(ID_MEDIA_PLAYER, 'DeviceNum', 0).PHP_EOL;
echo (int) IPS_SetProperty(ID_MEDIA_PLAYER, 'DeviceName', 'No Sound').PHP_EOL;
echo (int) IPS_SetProperty(ID_MEDIA_PLAYER, 'DeviceDriver', '').PHP_EOL;
echo (int) IPS_SetProperty(ID_MEDIA_PLAYER, 'UpdateInterval', 99).PHP_EOL;
echo (int) IPS_ApplyChanges(ID_MEDIA_PLAYER).PHP_EOL;

echo 'DeviceNum: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceNum').PHP_EOL;
echo 'DeviceName: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceName').PHP_EOL;
echo 'DeviceDriver: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'DeviceDriver').PHP_EOL;
echo 'DeviceUpdateInterval: '.IPS_GetProperty(ID_MEDIA_PLAYER, 'UpdateInterval').PHP_EOL;