SlimServer iTunes plugin...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AndreasG
    Member
    • Apr 2006
    • 58

    SlimServer iTunes plugin...

    Hi everybody,

    I am a Mac user, so I use iTunes as my music player (on the Mac there just is no decent alternative -- yet). I really like my Squeezebox but I also miss the ease of use of iTunes. The SlimServer web interface is clumsy, slow and a real pain to use when compared to iTunes -- sorry to say that. Frequently I use iTunes and my Apple Airport Express instead of SlimServer/Squeezebox because it is so much easier to find songs, make playlists etc...

    If I had a "whish" for a new feature in SlimServer/Squeezebox, it would be being able to control my Squeezebox from iTunes. As far as I understand, iTunes is capable of using plugins, so the question really is: Would it theoretically be possible to write an iTunes plugin that sends the currently played song to the Squeezebox (via SlimServer or not)? Am I the only one interested in such a thing?

    Thanks for any replies.

    Andreas
  • erland
    Senior Member
    • Jan 2006
    • 11323

    #2
    Originally posted by AndreasG
    Would it theoretically be possible to write an iTunes plugin that sends the currently played song to the Squeezebox (via SlimServer or not)?
    I'm pretty sure it shall be possible. I know its possible to give slimserver a command to play a specific song, so if there are any problems they are on the iTunes side. But since there seems to be iTunes plugins which is able to to show information about currently played song I suspect there shouldn't be any problem on the iTunes side either.

    Originally posted by AndreasG
    Am I the only one interested in such a thing?
    There are probably more people interested in this since you are not the only one that has complained on the slimserver web interface. Personally I think I would prefer integration with a simplier musicplayer instead of iTunes, or even better to improve the current slimserver web interface.
    Erland Lindmark (My homepage)
    Developer of many plugins/applets
    Starting with LMS 8.0 I no longer support my plugins/applets (see here for more information )

    Comment

    • James
      Senior Member
      • Apr 2005
      • 647

      #3
      once upon a time...


      James

      Comment

      • alexfw
        Junior Member
        • Nov 2005
        • 2

        #4
        I messed around with the Applescript below (found via James's link above) and could not get it to work. My incompetence is the likely culprit, but it could also be that SlimServer and/or iTunes have changed enough since late '04 that it just don't work.

        Should the below script still work as originally designed? Spousal ambivalence has turned into downright hostility, and being able to use iTunes as the interface is the key to bringing her 'round.

        TIA,

        Alex

        Old 2004-10-02, 11:12
        Anton F. van der Kraaij

        Posts: n/a
        Default Control SlimServer _from_ iTunes
        Hi Everyone,

        Well I think I have a solution for my problem. This applescript will
        check if a song is playing in iTunes. If that is the case, it will play
        it in the SlimServer. There is a check made for special symbols in
        filenames. My guess is that some symbols are not fully supported yet
        (it works for my library so far). Save it as an application and don't
        forget to tick the 'stay open' checkbox. Probably still bugs or
        features missing, but it is a start :-)

        Hope this helps. Oscar, thanks for your help and the link to the old
        post.

        Greetings,

        Anton.

        -- Begin of Script
        -- iSlimServer: Control SlimServer from iTunes
        -- Plays whatever song is currently playing in iTunes on the SlimServer
        -- Copyright Anton F. van der Kraaij 2004
        -- Thanks to a script by Barry Brown for inspiration and help from
        Oscar Marsch
        --
        -- This program is free software; you can redistribute it and/or modify
        -- it under the terms of the GNU General Public License as published by
        -- the Free Software Foundation; either version 2 of the License, or
        -- (at your option) any later version.
        --
        -- This program is distributed in the hope that it will be useful,
        -- but WITHOUT ANY WARRANTY; without even the implied warranty of
        -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
        -- GNU General Public License for more details.
        --
        -- INSTRUCTIONS:
        -- Set your variables server_address and server_port to your situation
        -- Save this script as an application, making sure to click 'stay open'

        global server_address, server_port, current_file_track

        set server_address to "127.0.0.1" -- This is the slimserver's address
        set server_port to "9000" -- This is the slimserver's port

        set current_file_track to ""

        on idle
        try
        tell application "Finder"
        if (get name of every process) contains "iTunes" then set okflag to
        true
        end tell
        if okflag then
        -- iTunes is running. Check if it is playing a song.
        tell application "iTunes"
        if player state is paused or player state is stopped then
        -- iTunes is not playing. Stop slimserver.
        do shell script ("curl \"http://" & server_address & ":" &
        server_port & "/status.html?p0=stop\"")
        set okflag to false
        return 10
        end if
        end tell
        end if
        if okflag then
        tell application "iTunes"
        if class of current track is file track then
        try
        copy current track's location to file_path_of_track
        on error errText
        display dialog errText buttons {"Cancel"} with icon 0
        end try
        end if -- not a file track
        -- return file_path_of_track
        if (current_file_track is not file_path_of_track) then
        -- File in iTunes is different than file on SlimServer.
        -- Thus update variable
        set current_file_track to file_path_of_track

        -- convert mac path to unix path for use in URL with curl (be
        careful with special characters here)
        set mac_path to (file_path_of_track as text)
        set root to (offset of ":" in mac_path)
        set rootdisk to (characters 1 thru (root - 1) of mac_path)
        tell application "Finder"
        if (disk (rootdisk as string) is the startup disk) then
        set unixpath to "%2f" & (characters (root + 1) thru end of
        mac_path)
        else
        set unixpath to "%2fVolumes:" & mac_path
        end if
        end tell
        set chars to every character of unixpath
        repeat with i from 2 to length of chars
        if item i of chars as text is equal to "/" then
        set item i of chars to ":"
        else if item i of chars as text is equal to ":" then
        set item i of chars to "%2f"
        else if item i of chars as text is equal to "\"" then
        set item i of chars to "\\" & "\""
        else if item i of chars as text is equal to "*" then
        set item i of chars to "\\*"
        else if item i of chars as text is equal to "?" then
        set item i of chars to "\\?"
        else if item i of chars as text is equal to " " then
        set item i of chars to "%20"
        else if item i of chars as text is equal to "+" then
        set item i of chars to "%2b"
        else if item i of chars as text is equal to "&" then
        set item i of chars to "%26"
        else if item i of chars as text is equal to "\\" then
        set item i of chars to "\\\\"
        end if
        end repeat
        set filetoplay to every item of chars as string
        -- end conversion
        -- Tell slimserver to stop current song and play the song
        currently playing in iTunes
        do shell script ("curl \"http://" & server_address & ":" &
        server_port & "/status.html?p0=stop\"")
        do shell script ("curl \"http://" & server_address & ":" &
        server_port & "/status.html?p0=playlist&p1=play&p2=" & filetoplay &
        "\"")
        end if
        end tell
        end if
        end try
        return 10
        end idle
        -- end of script

        Comment

        • evergreen25
          Junior Member
          • Nov 2005
          • 7

          #5
          I agree the iTunes interface is superior to the current slimserver. My main complaint with iTunes is that it doesn't support FLAC, but I guess we can't have everything in life.

          I am using a Windows-only plugin that updates the slimserver playlist from the iTunes Party Shuffle playlist. More info here:


          and here


          If I want to listen at the same time on my computer I use the latest version of Softsqueeze for Slimserver 6.3 and sync softsqueeze with my Squeezebox v2. It is working surprisingly well for such a kludgy solution.

          Sorry I can't be of more help with a Mac solution, but maybe you can glean something from Mr. Craig's good work.

          Comment

          • Craig, James (IT)

            #6
            Re: SlimServer iTunes plugin...

            Alex,
            What happened when you tried it? Anything at all?

            Do you have more than 1 squeezebox - The script below assumes only one
            player.

            James
            --------------------------------------------------------

            NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

            Comment

            • lagosirio
              Member
              • Jan 2008
              • 71

              #7
              Hi Together!
              I just found this interesting thread and think about buying a SB.
              I would like very much to go even a step further end use FrontRow instead of iTunes. (With its extremely simple and comfortable user interface).
              Will that work?

              Comment

              • Peter
                Senior Member
                • Apr 2005
                • 1283

                #8
                SlimServer iTunes plugin...

                lagosirio wrote:
                > Hi Together!
                > I just found this interesting thread and think about buying a SB.
                > I would like very much to go even a step further end use FrontRow
                > instead of iTunes. (With its extremely simple and comfortable user
                > interface).
                > Will that work?
                >


                In a word: No

                Regards,
                Peter


                Comment

                • lagosirio
                  Member
                  • Jan 2008
                  • 71

                  #9
                  As recommended I now installed SoftSqueeze and SqueezeServer to see how that works.
                  A really cool thing this software!
                  ( Additionally I use Safari and ScirptDebugger 4.0)

                  However with the script I have now one problem which I don't unterstand:
                  Executing the "do shell script" lines in the end I get the Error Message below.

                  What is this about?



                  <HTML><HEAD><TITLE>403 Forbidden</TITLE></HEAD>
                  <BODY>403 Forbidden: status.html
                  <!--.................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. ..................................................-->
                  <p>In order to request this URL from a Bookmark/Favorite, or some means other than following a link from the SqueezeCenter web interface, you will need to use a URL with a \"cauth\" security parameter. If you received this error when following a link from the SqueezeCenter web interface, you will want to make sure your web browser software (including proxy servers and spyware/privacy software) is allowing \"Referer\" headers to be sent. Below is the appropriate URL for the URL you attempted.<br>
                  <br>
                  <A HREF="/status.html?p0=stop&;cauth=a30a2b67010c9827e402922 d42a8f519">http://127.0.0.1:9000/status.html?p0=stop&;cauth=a30a2b67010c9827e402922 d42a8f519</A></p><p>Because your CSRF protection level is set at 'MEDIUM', you can use the same &quot;;cauth=&quot; value for any URL; this means you should be more careful who you share your URLs with.</p>
                  </BODY></HTML>

                  Comment

                  • James
                    Senior Member
                    • Apr 2005
                    • 647

                    #10
                    Try changing the CSRF protection level setting in Settings->Advanced->Security to none.

                    James

                    Comment

                    • lagosirio
                      Member
                      • Jan 2008
                      • 71

                      #11
                      Found a much better solution:
                      Convert the iTunes output to a radio-stream!
                      A great tool for this is "NiceCast"
                      For Apple Apple Leopard download V1.9 or later.

                      @peter: Regarding your "in a word": This works even with FrontRow !



                      See even: http://forums.slimdevices.com/archiv...p/t-30222.html
                      Last edited by lagosirio; 2008-01-27, 22:20.

                      Comment

                      • Scallywagfr78
                        Member
                        • Apr 2006
                        • 41

                        #12
                        No rescan of iTunes musicbase and other questions

                        Hello,
                        Two small points while I "have the floor":

                        1. I read somewhere on the slimdevices site about SS that there was no need under version 6.5.4 to rescan a musicbase managed through iTunes presumably after changes and/or additions. I am using 6.5.5 five SB2+3s and I never came across this possibility?

                        2. Concerning the new Duet hand-held controller: Am I to understand the I would be able to run my whole installation with this Controller, collectively and individually (each SB separately)? My present setup consists of Winxp SS 6.5.5 SB2s and SB3s using both ethernet and wifi and a (iTunes managed) musicbase of some size.

                        Any clarification and help would be appreciated.
                        Regards and thanks

                        Comment

                        • Craig, James \(IT\)

                          #13
                          SlimServer iTunes plugin...

                          > 1. I read somewhere on the slimdevices site about SS that there was no
                          need under version 6.5.4 to rescan a musicbase managed through iTunes
                          presumably after changes and/or additions. I am using 6.5.5 five SB2+3s
                          and I never came across this possibility?

                          This is not true. Any changes in music library always require a
                          SlimServer rescan, regardless of the source.

                          James
                          --------------------------------------------------------

                          NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

                          Comment

                          • Scallywagfr78
                            Member
                            • Apr 2006
                            • 41

                            #14
                            Originally posted by Craig, James \(IT\)
                            > 1. I read somewhere on the slimdevices site about SS that there was no
                            need under version 6.5.4 to rescan a musicbase managed through iTunes
                            presumably after changes and/or additions. I am using 6.5.5 five SB2+3s
                            and I never came across this possibility?

                            This is not true. Any changes in music library always require a
                            SlimServer rescan, regardless of the source.

                            James
                            --------------------------------------------------------

                            NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
                            Hello,
                            I sense from your reply that we seem to "play on similar wavelengths". That is also my understanding.
                            I suggest you have a look at (under "Tips and Tricks: iTunes (Mac or Windows)":

                            Maybe some Logitech "wishfull thinking" ....
                            Thanks for your answer.
                            More generally: this leaves item 2 of my original message unanswered.
                            Anyone motivated?
                            Regards

                            Comment

                            • nacmacfeegle
                              Senior Member
                              • Apr 2006
                              • 138

                              #15
                              "Any changes in music library always require a
                              SlimServer rescan, regardless of the source."

                              I'm pretty sure that if you 'browse music folder' via the SB to your changed music directories, eg a new album etc, then you don't need a rescan.
                              Custom mini itx server in a 1940s radio case, currently being revamped to add XBMC, Acer Revo as a stand-in. Favourite 7,500 tracks on the Touch USB server.
                              Kitchen --- SB3>Aego M
                              Conservatory --- >SB3 (custom case)>Musical Fidelity Tempest>Canon S50
                              Lounge---SB Touch>yamaha 863>Kef3005SE\Sennheiser RS 170
                              Bedroom---SB3>Audioengine A3
                              Bathroom---Radio, now work in progress
                              Gaming room/roving commission---Boom
                              Control---Ipeng on Iphone,Pod and Pad
                              More Audiofool than Audiophile!

                              Comment

                              Working...