Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,535

    addDispatch problem?

    I guess I'm not well awake today, but why does

    my $old = addDispatch(['pause', '_newvalue', '_fadein', '_suppressShowBriefly'], [1, 0, 0, \&mySUB]);

    give me the result where mySub is only called to get pause status (no parameter given) and when pausing, not when retsrated
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    19,872

    addDispatch problem?

    > my $old = addDispatch(['pause', '_newvalue', '_fadein',
    > '_suppressShowBriefly'], [1, 0, 0, \&mySUB]);
    >
    > give me the result where mySub is only called to get pause status (no
    > parameter given) and when pausing, not when retsrated


    I'm not sure I understand your question: this command would _not_ create
    a listener, but register your own handler for the "pause 1|0|?" command.
    Eg. it would be called if something did a "pause 1" command, but not if
    it was a "play".

    --

    Michael

  3. #3
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,535
    Quote Originally Posted by mherger View Post
    > my $old = addDispatch(['pause', '_newvalue', '_fadein',
    > '_suppressShowBriefly'], [1, 0, 0, \&mySUB]);
    >
    > give me the result where mySub is only called to get pause status (no
    > parameter given) and when pausing, not when retsrated


    I'm not sure I understand your question: this command would _not_ create
    a listener, but register your own handler for the "pause 1|0|?" command.
    Eg. it would be called if something did a "pause 1" command, but not if
    it was a "play".

    --

    Michael
    Yes, I wanted to *manage" the pause action, not just listen to it (i.e. in some cases I did not want to pause). I was expecting that on pause and resume, I would get a call with 'pause 1|0', but it's not the case at least when using the UI - I only get called with the query version (i.e. no parameter) and with pause (param 1), but not when resuming (I though it would be param 0). What is being called when the web UI is used seems to be "playlist pause".

    But when subscribing to 'pause' (as a listener), then the callback was called on pause and resume when using the webUI, hence I was confused.
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •