Old 23rd December 2018, 14:44   #1
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
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.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 23rd December 2018, 16:34   #2
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
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.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 23rd December 2018, 17:58   #3
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
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.

Quote:
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 Thumbnails
Click image for larger version

Name:	bookmarked stream.png
Views:	345
Size:	23.1 KB
ID:	54274  
PeterK. is offline   Reply With Quote
Old 23rd December 2018, 19:20   #4
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
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.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 23rd December 2018, 19:22   #5
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
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?
PeterK. is offline   Reply With Quote
Old 23rd December 2018, 19:39   #6
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
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.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 23rd December 2018, 22:04   #7
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
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?

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 24th December 2018, 07:53   #8
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
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.)
PeterK. is offline   Reply With Quote
Old 24th December 2018, 08:57   #9
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Couldn't we add if else lines as you did for CircSlider.m?

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 24th December 2018, 10:56   #10
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
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.
PeterK. is offline   Reply With Quote
Old 24th December 2018, 15:49   #11
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
I got it!

Details tonight.
PeterK. is offline   Reply With Quote
Old 24th December 2018, 16:21   #12
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
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;
    }
  }




Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 24th December 2018, 19:53   #13
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
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.
PeterK. is offline   Reply With Quote
Old 24th December 2018, 21:41   #14
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
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.

Quote:
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.

Quote:
Originally Posted by PeterK. View Post
2. Add
Quote:
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.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 25th December 2018, 10:27   #15
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
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.

Quote:
Originally Posted by ariszlo View Post
Thank you, PeterK., you made my day finding out what made Winamp crash!
Always a pleasure Ariszló.
PeterK. is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump