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

    catching volume change requests

    Hi - If a plugin wants to be informed / capture all volume change requests for a given a player, what's the best way to do that? sub-class the right player class and overload the volume sub? Is there something more simple? It's for the shairtunes plugin, I'd like to catche volume changes made by LMS and forward them to the AirPlay controller.

    Thanks
    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,779

    catching volume change requests

    > Hi - If a plugin wants to be informed / capture all volume change
    > requests for a given a player, what's the best way to do that? sub-class


    Subscribe to the "mixer volume" event?

    --

    Michael

  3. #3
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,302
    Quote Originally Posted by mherger View Post
    > Hi - If a plugin wants to be informed / capture all volume change
    > requests for a given a player, what's the best way to do that? sub-class


    Subscribe to the "mixer volume" event?

    --

    Michael
    I have to confess my total ignorance of that programming piece of LMS. Can you give me a pointer to one example where it's done. I'll find my way then, but maybe any plugin or part of inside LMS where it's already done? Thank you
    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

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

    catching volume change requests

    > I have to confess my total ignorance of that programming piece of LMS.

    Try something like:

    Slim::Control::Request::subscribe( \&myCallback, [['mixer'],
    ['volume']], $client );

    sub myCallback {
    my $request = shift;
    my $client = $request->client();

    ...
    }

    This should call myCallback whenever the volume changes on your player.
    --

    Michael

  5. #5
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,302
    This is super cool Micheal - thanks for taking the time
    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

  6. #6
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    3,302
    Works like a charm - thanks again
    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
  •