Author Topic: Event to Turn of Media in Another room  (Read 5706 times)

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Event to Turn of Media in Another room
« on: November 19, 2010, 02:31:58 am »
I added a Squeezeslave player to my core/hybrid, and assigned it to a room, the player is really in my bedroom which has an MD, but did not get it to work assigning it to that room, so I created another room.

What I am hoping to achieve, is when I put on any type of media on the MD, it turns off the media(audio) playing on the squeezeslave  player in the other room assigned. In attempting to achieve this, I created two events, one for listening to media in the bedroom and the other for watching media in the bedroom, to turn of the media playing in the room of the squeezeslave player, but some how it seems I messed it up; it does not work; this is even with testing the command in the event.

I am wandering if this is because I did not set any values for the #41 StreamID (int) or #42 MediaPosition  (string).

What value should StreamID (int), take, tried the value I got from tailing DCE router log when I pause the media playing, but that did not work?

I have in the event criteria, the PK_EventParameter set to the bedroom the MD is and the PK_DeviceCategory set to Media Players and the commands is the SqueezeBox Player[bedroom1_2] Stop Media

Any suggestion on better achieving is welcomed.

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: Event to Turn of Media in Another room
« Reply #1 on: November 19, 2010, 08:54:36 am »
All media control commands should go through the media plugin. You should try sending the command to that device, and specify the room and/or EA you want to control.

br,
sambuca

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Event to Turn of Media in Another room
« Reply #2 on: November 20, 2010, 11:32:47 am »
I changed the command to Media Plug-in[Closet/Storage Space] - this is where I saw it - and MH Stop Media. After adding I set the PK_Device to the Squeeze Player, the PK_DeviceTemplate to the of the device in A/V Equipment (110) and set the PK_EntertainArea to the room where the  player is in; I did not set anything for PK_MediaType, nor Bypass Event.

Unfortunately, testing the command does not work, nor the event. I did a quick reload and even a reboot, but same results.

I wondering if the PK_MediaType needs to be entered and what value?

Thanks for you assistance.

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Event to Turn of Media in Another room
« Reply #3 on: November 20, 2010, 12:30:21 pm »
The iOrbiter is using a simple send to media plugin (ID 10), Filename and PK_EntertainArea. That's it.

EDIT: For stop, it is a simple MH_Stop with PK_EntertainArea set, send to the media plugin.

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Event to Turn of Media in Another room
« Reply #4 on: November 20, 2010, 05:54:29 pm »
I set the PK_EntertainArea to the room but am getting the following in the DCErouter.log - the entertainment area is invalid, find that strange, as I am playing audio in it at present and can change to that room and pause, stop and manipulate media.
Quote
05      11/20/10 12:48:44.684           Router::RemoveAndDeleteSocket 0x467433a0 -1003 <0x37ce5b90>
08      11/20/10 12:49:17.556           Received Message from 0 (unknown / ) to 10 (Media Plug-in / Closet/Storage Space), type 1 id 44 Command:MH Stop Media, retry none, parameters: <0x37ce5b90>
08      11/20/10 12:49:17.557             Parameter 44(PK_DeviceTemplate): 110 <0x37ce5b90>
08      11/20/10 12:49:17.557             Parameter 45(PK_EntertainArea): BedLesterAudio <0x37ce5b90>
01      11/20/10 12:49:17.568           Received a play media for an invalid entertainment area 0 0 BedLesterAudio <0x820e6b90>
05      11/20/10 12:49:17.608           Socket::ReceiveData 0x467433a0 failed, bytes left 0 start: 1140000 1: 0 1b: 0 2: 0 2b: 0 m_Socket: 271 Incoming_Conn Socket 271 192.168.80.1 <0x37ce5b90>
05      11/20/10 12:49:17.608           Socket::ReceiveString2 ReceiveData failed m_Socket: -1 Incoming_Conn Socket 271 192.168.80.1 <0x37ce5b90>
05      11/20/10 12:49:17.608           TCPIP: Closing connection to -1003 (Router Dev #0) 0x467433a0 m_Socket: -1 <0x37ce5b90>
05      11/20/10 12:49:17.608           Router::RemoveAndDeleteSocket 0x467433a0 -1003 <0x37ce5b90>


Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Event to Turn of Media in Another room
« Reply #5 on: November 20, 2010, 09:04:54 pm »
[..]
08      11/20/10 12:49:17.557             Parameter 45(PK_EntertainArea): BedLesterAudio <0x37ce5b90>

PK_EntertainArea must be numeric, and not a string.

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Event to Turn of Media in Another room
« Reply #6 on: November 20, 2010, 10:33:50 pm »
I got it to work, for the life of me I could not seem to find the correct numeric value for the room (the number I pulled from my sql query did not work), then got a whim, if numeric  required, then putting the numeric for this field #2 PK_Device (int), to the device number of the (squeeze player) without filling the other fields should work, and it did ;D.

Thanks for the assistance

Quick question though, in the admin site, PK_EntertainArea should read (int) instead of (string)?