Vortex progbutton.m

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ariszlo
    Major Dude
    • Jun 2015
    • 917

    Vortex progbutton.m

    (Continued from Why does this crash Winamp?)

    The programmable buttons in the left drawer of Vortex used to work fine when Vortex was released for Winamp 5.2 but are broken in recent versions of Winamp.

    You can still bookmark the currently played song by right-clicking on a button and selecting the option but then you cannot play it by left-clicking on the button.

    However, the same feature works well in KameleonDUI.

    I looked inside studio.xnf to see the difference between how Vortex and KameleonDUI save the currently played song and I found that Vortex starts the path with
    code:
    PATH|file://C:\
    while KameleonDUI starts it with
    code:
    PATH|C:\
    After adding file:// between PATH| and C:\ the bookmarked song could be played by left-clicking on the programmed button.

    My question is how shall I modify progbutton.m to make it save the path of the currently played song with file:// between PATH| and C:\ ?

    Plague has a script that has something to do with the file:// part but I cannot figure out how it could help with this issue.
    Ariszló @ WinCustomize & DeviantArt
  • PeterK.
    Quinto Black CT Developer
    • Sep 2016
    • 791

    #2
    Originally Posted by ariszlo View Post
    ...
    Do both skins use exactly the same command? Please copy and paste the lines from both scripts.
    Quinto Black CT

    Comment

    • ariszlo
      Major Dude
      • Jun 2015
      • 917

      #3
      It was enough to ask the question to find the answer. All I had to do was replace "PATH|" with "PATH|file://" in two lines of progbutton.m.

      Now another question. Right-clicking on a programmable button and left-clicking on "type path/url" does nothing in Vortex. In KameleonDUI, it pops up a dialog.

      What does Vortex do wrong? How shall I modify progbutton.m?
      Attached Files
      Ariszló @ WinCustomize & DeviantArt

      Comment

      • ariszlo
        Major Dude
        • Jun 2015
        • 917

        #4
        Originally Posted by PeterK. View Post
        Do both skins use exactly the same command? Please copy and paste the lines from both scripts.
        KameleonDUI does not provide the source of progbutton.maki.
        Ariszló @ WinCustomize & DeviantArt

        Comment

        • PeterK.
          Quinto Black CT Developer
          • Sep 2016
          • 791

          #5
          Originally Posted by ariszlo View Post
          KameleonDUI does not provide the source of progbutton.maki.
          Really?



          Originally Posted by ariszlo View Post
          ...Right-clicking on a programmable button and left-clicking on "type path/url" does nothing in Vortex....
          It seems there are a lot of things that do nothing in Vortex. Like those Open buttons in Skin Preferences.

          Attached Files
          Quinto Black CT

          Comment

          • ariszlo
            Major Dude
            • Jun 2015
            • 917

            #6
            Originally Posted by PeterK. View Post
            Really?
            Oh, yes, it does. I was looking inside the wrong .wal file.
            Ariszló @ WinCustomize & DeviantArt

            Comment

            • PeterK.
              Quinto Black CT Developer
              • Sep 2016
              • 791

              #7
              Originally Posted by ariszlo View Post
              ... How shall I modify progbutton.m?
              Are you looking for this?

              Attached Files
              Quinto Black CT

              Comment

              • ariszlo
                Major Dude
                • Jun 2015
                • 917

                #8
                Yes. How did you fix it?
                Ariszló @ WinCustomize & DeviantArt

                Comment

                • PeterK.
                  Quinto Black CT Developer
                  • Sep 2016
                  • 791

                  #9
                  Originally Posted by ariszlo View Post
                  Yes. How did you fix it?
                  Add <include file="xml/popup-container.xml"/> to skin.xml.
                  Quinto Black CT

                  Comment

                  • ariszlo
                    Major Dude
                    • Jun 2015
                    • 917

                    #10
                    Thanks a lot!

                    Two more remaining issues:
                    1. Replacing "PATH|" with "PATH|file://" fixes bookmarking but it is a bit ugly (although it seems to work) that urls are stored in studio.xnf as "PATH|file://http://..."
                    2. Albumart is not shown if I play a song by left-clicking on a programmed button.
                    Ariszló @ WinCustomize & DeviantArt

                    Comment

                    • PeterK.
                      Quinto Black CT Developer
                      • Sep 2016
                      • 791

                      #11
                      Originally Posted by ariszlo View Post
                      Thanks a lot!

                      Two more remaining issues:
                      Replacing "PATH|" with "PATH|file://" fixes bookmarking but it is a bit ugly (although it seems to work) that urls are stored in studio.xnf as "PATH|file://http://..."
                      Where would you like to store them otherwise? And why is it ugly? No user will ever see it.

                      Originally Posted by ariszlo View Post
                      Albumart is not shown if I play a song by left-clicking on a programmed button.
                      Which button? One of those 5 on the right side? Please provide a screenshot showing what you click and where the Albumart is missing.
                      Quinto Black CT

                      Comment

                      • ariszlo
                        Major Dude
                        • Jun 2015
                        • 917

                        #12
                        Originally Posted by PeterK. View Post
                        Please provide a screenshot showing what you click and where the Albumart is missing.
                        I programmed prog.button.1 in the left drawer to play "When a Blind Man Cries" by right-clicking on prog.button.1 and selecting "Bookmark current song". When I play the song from a playlist or open it from the disk then the album art is shown:



                        However, if I start playing the song by left-clicking on prog.button.1 then the album art is not shown:



                        Originally Posted by PeterK. View Post
                        Which button? One of those 5 on the right side?
                        Ah, those. They do not work for me. They used to work in Winamp 5.2 but not in recent versions.
                        Attached Files
                        Ariszló @ WinCustomize & DeviantArt

                        Comment

                        • PeterK.
                          Quinto Black CT Developer
                          • Sep 2016
                          • 791

                          #13
                          First of all I managed to get those buttons in the left drawer to work properly - without adding any "file://" to the PATH string.

                          This is what you should add to progbutton.m script:

                          PHP Code:
                          Function string pathToURL(string path); 
                          PHP Code:
                          string pathToURL(string path) {
                              
                          int clen strlen(path);
                              
                          string ret ""char;

                              
                              
                          c=0;
                              while (
                          len) {
                                  
                          char strmid(path,c,1);
                                  if (
                          char==chr(92)) {
                                      
                          ret ret chr(47);
                                      
                          ++;
                                  } else if (
                          char==":") { //for ":/"
                                      
                          ret ret ":";
                                      
                          ++;
                                      
                                      
                          char strmid(path,c,1);
                                      if (
                          char==chr(92)) {
                                          
                          ret ret chr(47) + chr(47);
                                          
                          ++;
                                      }
                                  } else {
                                      
                          ret ret char;
                                      
                          c++;
                                  }
                              }
                              
                              return 
                          ret;

                          (It does not matter where in the script you place those lines from above)

                          Change the line 237 from
                          PHP Code:
                          string currPath getPlayItemMetaDataString("filename"); 
                          to
                          PHP Code:
                          string currPath System.getPlayItemString(); 
                          Change the line 156 from
                          PHP Code:
                          playFile(path); 
                          to
                          PHP Code:
                          playFile(pathToURL(path)); 
                          You can find those lines in progbutton.m in leechbite's Kameleon skin.

                          Furthermore: Kameleon seems to have exactly the same problem with AlbumArt not being shown after left clicking on a button which was programmed to play a bookmarked song:



                          So for now I cannot promise any working solutions.
                          Attached Files
                          Quinto Black CT

                          Comment

                          • PeterK.
                            Quinto Black CT Developer
                            • Sep 2016
                            • 791

                            #14
                            The prefix file:// is the reason why there is no Albumart shown, but when we delete it Winamp refuses to play the bookmarked song.

                            Attached Files
                            Quinto Black CT

                            Comment

                            • PeterK.
                              Quinto Black CT Developer
                              • Sep 2016
                              • 791

                              #15
                              I do remember my struggle with the System.playFile() command which would not play my saved bookmarks while adding Track Bookmarks feature to my skin. It turned out that this particular line in std.mi library is buggy. So Victhor had an idea to choose another approach in order to obtain files's location on the hard drive and being able to play it. I, on the other side, found out that using the plDir.mi library we could play a bookmarked song, but first we had to remove the file:// prefix. So this is what I did and now you do have AlbumArt in the window.

                              Please delete line 128 - playFile(path) - and paste those:

                              PHP Code:
                              int i=strlen(pathToURL(path))-7
                              string s=strright(pathToURL(path),i);
                              plEdit.clear(); 
                              plEdit.enqueueFile(s);
                              int playThisFile=plEdit.getNumTracks();
                              plEdit.playTrack(playThisFile); 
                              Additional you need to add the plDir.mi library:
                              PHP Code:
                              #include <lib/pldir.mi> 
                              Quinto Black CT

                              Comment

                              Working...
                              X