Announcement

Collapse
No announcement yet.

quicksongpick.maki in Vortex and other skins

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • quicksongpick.maki in Vortex and other skins

    Vortex and several other skins (Intruder, Slade, Caught in Glass, T800, etc.) use memory buttons to access favorite songs. Unfortunately, they do not work in recent versions of Winamp. This thread is documenting PeterK.’s and my attempts to update quicksongpick.maki.

    Based on how we fixed progbutton.maki, this is how I am trying to fix quicksongpick.maki for Vortex:
    1. Changed line 69 from
      PHP Code:
      playfile(filename); 
      to
      PHP Code:
      playFile(pathToURL(filename)); 
    2. Added this line after function temptext(string t);
      PHP Code:
      Function string pathToURL(string path); 
    3. Added these lines after global timer temptextdelay;
      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;


    The results:
    1. Songs on disk can be saved and played with the memory buttons.
    2. Streams saved with the memory buttons cannot be played with them. When you try, Winamp will hang.
    Ariszló @ WinCustomize & DeviantArt

  • #2
    It is probably better to use filename instead of path because quicksongpick.m uses filename where progbutton.m uses path:

    PHP Code:
    Function string pathToURL(string filename); 
    and

    PHP Code:
    string pathToURL(string filename) {
        
    int clen strlen(filename);
        
    string ret ""char;
        
    c=0;
        while (
    len) {
            
    char strmid(filename,c,1);
            if (
    char==chr(92)) {
                
    ret ret chr(47);
                
    ++;
            } else if (
    char==":") { //for ":/"
                
    ret ret ":";
                
    ++;
                
    char strmid(filename,c,1);
                if (
    char==chr(92)) {
                    
    ret ret chr(47) + chr(47);
                    
    ++;
                }
            } else {
                
    ret ret char;
                
    c++;
            }
        }
        return 
    ret;

    Streams still hang Winamp, though.
    Ariszló @ WinCustomize & DeviantArt

    Comment


    • #3
      Originally Posted by ariszlo View Post
      It is probably better to use filename instead of path because quicksongpick.m uses filename where progbutton.m uses path.
      Yes, definitely.

      Originally Posted by ariszlo View Post
      Streams still hang Winamp, though.
      If you switch to Quinto, start the Tracks Bookmarks window, launch an Online Radio and hit SET button the stream is saved/bookmarked. Hence this should be possible in the exact same way within this quicksongpick.m file. We should have a look at track_bookmarks.m and compare it with quicksongpick.m.

      Attached Files
      Quinto Black CT

      Comment


      • #4
        Yes, I know it is possible because it is also possible in progbutton.m. I just cannot spot what is missing, what should be changed or what should be deleted.
        Ariszló @ WinCustomize & DeviantArt

        Comment


        • #5
          I just realized the word "test" in the script file. Has this feature ever worked? What about all the other skins? Do they all use leechbite's test script?
          Quinto Black CT

          Comment


          • #6
            Yes, it worked well in Winamp 5.2.

            Most variants of quicksongpick.m have
            PHP Code:
            songticker mainnormal.findObject("songticker.text"); 
            where Vortex has
            PHP Code:
            songticker mainnormal.findObject("songticker"); 
            Tattoo Amp has
            PHP Code:
            buttonID getParent().getID(); 
            where most other skins have
            PHP Code:
            buttonID getID(); 
            I tried Tattoo Amp's buttonID = getParent().getID(); with Vortex but it got even worse.
            Ariszló @ WinCustomize & DeviantArt

            Comment


            • #7
              Originally Posted by ariszlo View Post
              Yes, it worked well in Winamp 5.2.
              Checked again. Playing saved streams with the memory buttons hung Winamp 5.2, too.What shall we do?
              • Fix playing saved streams with quicksongpick.maki? I cannot see how we could do that.
              • Disable saving streams with quicksongpick.maki (with a message telling the user that streams cannot be saved with the memory buttons)?
              • Replace quicksongpick.maki?
              Ariszló @ WinCustomize & DeviantArt

              Comment


              • #8
                Originally Posted by ariszlo View Post
                Checked again. Playing saved streams with the memory buttons hung Winamp 5.2, too.What shall we do?
                In this case I would leave it as it is: not working. (and maybe add a KNOWN BUGS README file and mention this problem.)
                Quinto Black CT

                Comment


                • #9
                  Couldn't we add if else lines as you did for CircSlider.m?
                  Ariszló @ WinCustomize & DeviantArt

                  Comment


                  • #10
                    Originally Posted by ariszlo View Post
                    Couldn't we add if else lines as you did for CircSlider.m?
                    I did it yesterday and could not stop Winamp from crashing. But when you place the Online Radio's url directly into the script everything is fine. I could image that the mixture of timer and plDir.mi library causes this oddity.
                    Quinto Black CT

                    Comment


                    • #11
                      I got it!

                      Details tonight.
                      Quinto Black CT

                      Comment


                      • #12
                        Originally Posted by PeterK. View Post
                        I got it!

                        Details tonight.
                        Wow! I'm waiting in excitement!

                        Meanwhile, this is how I applied your fix for Alfa Romeo History to quicksongpick.m:

                        PHP Code:
                        buttondelay.onTimer() {
                          
                        stop();

                          if (
                        buttonDown) {

                            
                        // Disable saving streams until there is a fix:
                            
                        if (strsearch(getPlayItemString(),"http")==||
                                 
                        strsearch(getPlayItemString(),"https")==0) {
                              return;
                            }

                            else {
                              
                        string filename getPlayItemMetaDataString("Filename");

                              if (
                        filename!="") {

                                
                        setPrivateString(getSkinName(), buttonIDfilename);
                          
                                
                        tempText("Song recorded: "+buttonID);
                              }

                              
                        songrecorded 1;
                            }
                          }



                        Ariszló @ WinCustomize & DeviantArt

                        Comment


                        • #13
                          Originally Posted by ariszlo View Post
                          Wow! I'm waiting in excitement!
                          1. I would suggest, that you grab a "fresh" copy of quicksongpick.m
                          2. Add

                          PHP Code:
                          #include <lib/pldir.mi> 
                          3. Add

                          PHP Code:
                          function string pathToURL(string path); 
                          and the function as well. The same as in progbutton.m

                          4. Add

                          PHP Code:
                          string newfile=pathToURL(filename);
                          if (
                          strsearch(newfile,"http")==|| strsearch(newfile,"https")==0)
                          {
                              
                          plEdit.clear();
                              
                          plEdit.enqueueFile(newfile);
                              
                          plEdit.playTrack(1);
                          }
                          else 
                          System.playFile(newfile); 
                          after
                          PHP Code:
                          if (filename!="") { 
                          (it is line 95)

                          5. And now the most important step: open skin.xml and delete line 37 containing:
                          PHP Code:
                          <script id="scripts.quicksongpick" file="scripts/quicksongpick.maki"/> 
                          This, and only this, keeps Winamp crash. In case a crash happens using a different option/feature be sure there is no "double calling for a script" within the skin like in this particular example.

                          Compile and let me know if it works for you.
                          Quinto Black CT

                          Comment


                          • #14
                            Originally Posted by PeterK. View Post
                            5. And now the most important step: open skin.xml and delete line 37
                            LOL! That's hilarious! Then it is not bad maki code.

                            Originally Posted by PeterK. View Post
                            3. Add
                            PHP Code:
                            function string pathToURL(string path); 
                            and the function as well. The same as in progbutton.m
                            Yes, I did but replaced path with filename.

                            Originally Posted by PeterK. View Post
                            2. Add
                            Originally Posted by PeterK. View Post
                            4. Add
                            Not needed if you delete the quicksongpick line from skin.xml. It is enough to replace
                            PHP Code:
                            playfile(filename); 
                            with
                            PHP Code:
                            playfile(pathToURL(filename)); 
                            And it will save AND play streams!

                            Thank you, PeterK., you made my day finding out what made Winamp crash!

                            I wish you and all visitors a merry Christmas.
                            Ariszló @ WinCustomize & DeviantArt

                            Comment


                            • #15
                              Originally Posted by ariszlo View Post
                              ...Not needed if you delete the quicksongpick line from skin.xml.
                              And it will save AND play streams!
                              This is the reason why four eyes always see more than two. Or maybe I was just too worried about getting it done with the other solution that I simply did not come up with the idea to test the original file. In the end I am very happy it works properly.

                              Originally Posted by ariszlo View Post
                              Thank you, PeterK., you made my day finding out what made Winamp crash!
                              Always a pleasure Ariszló.
                              Quinto Black CT

                              Comment

                              Working...
                              X