Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 10

Thread: IOS Client

  1. #1
    Senior Member sckramer's Avatar
    Join Date
    Oct 2008
    Posts
    284

    iOS Client

    Hi,

    Doing a quick "feasibility" study on building an IOS squeezebox client app. Have some ideas I'd like to play with.

    First are there 100's out there, or just the abandoned logitech official, ipeng, and iPad only squeezepad? I didn't really look that hard


    I whipped this together & it already works-- some basic web requests with json responses.

    But using a web view for navigation, list etc... do the other apps have to parse HTML, or is there a way to get it as a data feed json/xml?

    edit:

    OK, can get json back, then walk along drilling down--

    {"id":1,"method":"slim.request","params":["",["browselibrary", "items", 0, 500, "mode:albumsö ]]}
    {"id":1,"method":"slim.request","params":["",["browselibrary", "items", 0, 500, "mode:artists" ]]}

    {"id":1,"method":"slim.request","params":["",["browselibrary", "items", 0, 500, "mode:bmf" ]]}
    {"id":1,"method":"slim.request","params":["",["browselibrary", "items", 0, 500, "mode:bmf", "item_id:0" ]]}
    {"id":1,"method":"slim.request","params":["",["browselibrary", "items", 0, 500, "mode:bmf", "item_id:0.3.15.1.0" ]]}

    Thanks!!

    Name:  Screen Shot 2016-05-20 at 9.24.47 PM.jpg
Views: 338
Size:  175.7 KB
    Last edited by sckramer; 2016-05-22 at 17:43.
    Scott Kramer - AudioSystem - YouTube - Twitter

  2. #2
    Senior Member sckramer's Avatar
    Join Date
    Oct 2008
    Posts
    284
    Really surprised how fast you can get data out of LMS, and how iOS can handle json data--

    4,346 albums took 450ms (half second) to load-- text only of course! Thats the request to LMS, net transfer, and json parse to a text view, on an iPod touch (A8 cpu version)!

    Name:  IMG_0003 2.PNG
Views: 252
Size:  193.7 KB
    Scott Kramer - AudioSystem - YouTube - Twitter

  3. #3
    Senior Member pippin's Avatar
    Join Date
    Oct 2007
    Location
    Berlin
    Posts
    14,183
    What do you expect? Chances are that your phone is faster than your computer.
    And "how fast you can get data out of LMS" totally depends on the machine you are running it on. Request too much data too fast on a NAS and you can lock the whole thing up
    ---
    learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
    Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
    at penguinlovesmusic.com
    New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

  4. #4
    Senior Member sckramer's Avatar
    Join Date
    Oct 2008
    Posts
    284
    Quote Originally Posted by pippin View Post
    What do you expect? Chances are that your phone is faster than your computer.
    And "how fast you can get data out of LMS" totally depends on the machine you are running it on. Request too much data too fast on a NAS and you can lock the whole thing up
    Damn, so much for pulling 50,000 tracks from a SBT running LMS kidding of course, just checking stuff out, got enthused when I finally figured that out-- docs on the jsonrpc seem non-existant. Old hat for everyone here I 'spose.
    Last edited by sckramer; 2016-05-23 at 09:02.
    Scott Kramer - AudioSystem - YouTube - Twitter

  5. #5
    Senior Member pippin's Avatar
    Join Date
    Oct 2007
    Location
    Berlin
    Posts
    14,183
    There's the CLI documentation for the commands and here in the dev forum there's a description on how the JSON/RPC interface works (it uses CLI commands over JSON/ROC)
    ---
    learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
    Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
    at penguinlovesmusic.com
    New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

  6. #6
    Senior Member sckramer's Avatar
    Join Date
    Oct 2008
    Posts
    284
    Quote Originally Posted by pippin View Post
    There's the CLI documentation for the commands and here in the dev forum there's a description on how the JSON/RPC interface works (it uses CLI commands over JSON/ROC)
    Yep, know the CLI doc.

    Can you give me a hint on the best way to, play an album, play a track.

    Is it all playlist related?

    Here's what I found out to play a single file:

    {"id":1,"method":"slim.request","params":["00:04:20:22:19:20",["playlist", "play", "file:///G:/music/albums12/Ennio%20Morricone~~~~~~.flac"]]}

    How do I play an album easily?
    Scott Kramer - AudioSystem - YouTube - Twitter

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

    IOS Client

    > Yep, know the CLI doc.

    You do?

    > Can you give me a hint on the best way to, play an album, play a track.


    In your web browser open Edit/Find, enter "album", browse results :-P.

    There's the playercontrol command which should do what you're looking
    for. Or "playlist playalbum" etc.

    > Is it all playlist related?


    The "play queue" is what is referred to as playlist in this context.


    --

    Michael

  8. #8
    Senior Member sckramer's Avatar
    Join Date
    Oct 2008
    Posts
    284
    Quote Originally Posted by mherger View Post
    > Yep, know the CLI doc.

    You do?

    Michael
    Know "of" -- This right? --> http://LMS:9000/html/docs/cli-api.html

    Thanks for the hints!
    Scott Kramer - AudioSystem - YouTube - Twitter

  9. #9
    Senior Member wt0's Avatar
    Join Date
    Jul 2008
    Posts
    568
    If you have a SB Touch, Radio, or Duet Controller, you can enable CometD logging on the server to see the requests from those devices and the server's responses.

    Oh, and depending on how far down the rabbit hole you want to go, you may want to look into using the CometD interface for the server instead of json/rpc.
    --------------
    Squeezebox apps for webOS, Android and Windows Phone, http://www.angrygoatapps.com

  10. #10
    Senior Member sckramer's Avatar
    Join Date
    Oct 2008
    Posts
    284

    Playing around

    Playing around with LMS server discovery, some swift4 UI design. Trying to make a very modular UI and modular LMS client components-- Stuffing JSON in the displays to start as I go.

    I spin off 255* simult. threads sending an http/json request for serverstatus -- works really well and quickly shows multiple servers, coming and going nicely... also I have the http request timeout very quickly, so they don't hang around on the device (on the threads without a response).
    Good way to do it?

    Also open a realtime raw socket to 9090 and send a listen 1, and serverstatus -- just to see what that is all about (col 1 in the video) -- things do get pushed into it, it scrolls on it's own.
    Gonna avoid relying on that, or as a 2nd faster way to get certain things along with the equiv json poll.


    In the serverstatus json (all tags)... there's everything but it's own name (server)?! The only place is buried in other_players_loop, on a diff server.

    Am I missing a tag or something?

    Video: http://bit.ly/2xyCfrr

    Also, iOS11 Native FLAC playback 16/44 -- 24/384 is cool too and works, straight from LMS -- dead air on iOS10-

    *host portion of the ip network address.

    PS... 0 xcode interface builder... doing it all in code.

    Thanks!
    Last edited by sckramer; 2017-09-21 at 06:43.
    Scott Kramer - AudioSystem - YouTube - Twitter

Posting Permissions

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