Old 21st December 2018, 16:28   #1
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
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.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 21st December 2018, 16:44   #2
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
...
Do both skins use exactly the same command? Please copy and paste the lines from both scripts.
PeterK. is offline   Reply With Quote
Old 21st December 2018, 17:05   #3
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
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 Thumbnails
Click image for larger version

Name:	KameleonDUI-dialog.png
Views:	165
Size:	22.9 KB
ID:	54264  

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

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 21st December 2018, 17:24   #5
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
KameleonDUI does not provide the source of progbutton.maki.
Really?



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

Name:	kameleon.png
Views:	422
Size:	11.4 KB
ID:	54266  
PeterK. is offline   Reply With Quote
Old 21st December 2018, 17:53   #6
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
Originally Posted by PeterK. View Post
Really?
Oh, yes, it does. I was looking inside the wrong .wal file.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 21st December 2018, 17:56   #7
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
... How shall I modify progbutton.m?
Are you looking for this?

Attached Thumbnails
Click image for larger version

Name:	popup container.png
Views:	406
Size:	34.5 KB
ID:	54267  
PeterK. is offline   Reply With Quote
Old 21st December 2018, 18:24   #8
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Yes. How did you fix it?

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 21st December 2018, 18:27   #9
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
Yes. How did you fix it?
Add <include file="xml/popup-container.xml"/> to skin.xml.
PeterK. is offline   Reply With Quote
Old 21st December 2018, 18:59   #10
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
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.

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

Quote:
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.
PeterK. is offline   Reply With Quote
Old 21st December 2018, 22:42   #12
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
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:



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

Name:	vortex-albumart.jpg
Views:	411
Size:	68.4 KB
ID:	54268   Click image for larger version

Name:	vortex-lama-art.jpg
Views:	415
Size:	65.8 KB
ID:	54269  

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 22nd December 2018, 08:24   #13
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
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 Thumbnails
Click image for larger version

Name:	no preview.png
Views:	412
Size:	87.5 KB
ID:	54270  
PeterK. is offline   Reply With Quote
Old 22nd December 2018, 08:53   #14
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
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 Thumbnails
Click image for larger version

Name:	prefix.png
Views:	392
Size:	139.5 KB
ID:	54271  
PeterK. is offline   Reply With Quote
Old 22nd December 2018, 09:40   #15
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
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> 
PeterK. is offline   Reply With Quote
Old 22nd December 2018, 14:22   #16
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
And when you open the file quicksongpick.m and replace the line System.playFile(filename);

with those following lines ...

PHP Code:
plEdit.clear(); 
plEdit.enqueueFile(filename);
int playThisFile=plEdit.getNumTracks();
plEdit.playTrack(playThisFile); 
... you also can use those memory buttons on the right side of the Main Window.

Wait! You also have to add the plDir.mi library to the script file.

Kinda cool, huh?
PeterK. is offline   Reply With Quote
Old 22nd December 2018, 14:23   #17
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
Originally Posted by PeterK. View Post
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 more elegant than my solution. Thank you!

Quote:
Originally Posted by PeterK. View Post
You can find those lines in progbutton.m in leechbite's Kameleon skin.
Where did you get KameleonDUI? Versions 1.0 and 1.1 hosted at the Nullsoft archive have the maki sources but bookmarking with buttons is broken with them. Bookmarking works well with Version 1.5 hosted at DeviantArt but it has no maki sources.

Quote:
Originally Posted by PeterK. View Post
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:
Now, this fixes Album Art but breaks playing bookmarked streams or songs added by the "Type path/url" dialog.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 22nd December 2018, 15:09   #18
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
Originally Posted by PeterK. View Post
And when you open the file quicksongpick.m and replace the line System.playFile(filename);
I don't have that. I only have playfile(filename);

Quote:
Originally Posted by PeterK. View Post
with those following lines ...

PHP Code:
plEdit.clear(); 
plEdit.enqueueFile(filename);
int playThisFile=plEdit.getNumTracks();
plEdit.playTrack(playThisFile); 
... you also can use those memory buttons on the right side of the Main Window.

Wait! You also have to add the plDir.mi library to the script file.
Replaced playfile(filename); with those lines and added the plDir.mi library:
code:
#include "../../../lib/pldir.mi"

but it still does not work for me.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 22nd December 2018, 15:13   #19
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
... Where did you get KameleonDUI? ...

As I remember correctly, I started once the skin and got a notification about an update. So I downlaoded the 1.6 Beta WITH m-files.


Quote:
Originally Posted by ariszlo View Post
Now, this fixes Album Art but breaks playing bookmarked streams or songs added by the "Type path/url" dialog.
A typical scenario while fixing a code: you get rid of one bug but create two more.

Last edited by PeterK.; 22nd December 2018 at 18:07.
PeterK. is offline   Reply With Quote
Old 22nd December 2018, 15:23   #20
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
Originally Posted by PeterK. View Post
As I remember correctly, I started once the skin and got a notification about an update. So I downlaoded the 1.6 Beta WITH m-files.
Yes! Thank you.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 22nd December 2018, 18:08   #21
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Trying to apply your pathToURL solution for quicksongpick.m, I added these lines:

Quote:
Originally Posted by PeterK. View Post
Function string pathToURL(string path);

string pathToURL(string path) { ... }
Then replaced this line (line 69 in the original file):
PHP Code:
playfile(filename); 
with this:
PHP Code:
playFile(pathToURL(filename)); 
And then this (line 83):
PHP Code:
setPrivateString(getSkinName(), buttonIDfilename); 
with this:
PHP Code:
setPrivateString(getSkinName(), buttonID"PATH|"+filename); 
The result is partial success: the first memory button can save the currently played song but the other four buttons cannot. And once the first button has saved a song, it will never forget it. I cannot save another song.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 22nd December 2018, 18:26   #22
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
I don't have that. I only have playfile(filename);
It is the same.

Quote:
Originally Posted by ariszlo View Post
Replaced playfile(filename); with those lines and added the plDir.mi library:
code:
#include "../../../lib/pldir.mi"

but it still does not work for me.

Memory Buttons section should look like this:


PHP Code:
MemoryButtons.onLeftButtonUp(int xint y)
{
    
buttonDown 0;
    
buttondelay.stop();
    
    if (
songrecorded) return;
    
    
string filename getPrivateString(getSkinName(), buttonID"");
    if (
filename!="")
    {
        
plEdit.clear();
        
plEdit.enqueueFile(filename);
        
int playThisFile=plEdit.getNumTracks();
        
plEdit.playTrack(playThisFile);
        
        
tempText("Play file: "+filename);
    }

PeterK. is offline   Reply With Quote
Old 22nd December 2018, 18:54   #23
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
You know that you have to hold the memory button for 2 seconds untill you see the text "Song recorded" on the display?
PeterK. is offline   Reply With Quote
Old 22nd December 2018, 18:54   #24
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
The good news: The plDir solution for quicksongpick.m works fine with songs on disk. I'm just not dexterous enough with small buttons. I must have held the mouse button down a couple of pixels away...

The bad news: it hangs Winamp if I want to save a stream.

So it seems the plDir solution does not like streams. Both the left-drawer progbuttons and the right-side memory buttons are broken with streams if we use the plDir solution.

As for the left-drawer progbuttons I do not mind losing albumart if that is the price of playing streams or songs opened with the "Type path/url" dialog.

Latest and greatest modern skins: Big Bento Modern v1.13 & Quinto Black CT v3.1
ariszlo is offline   Reply With Quote
Old 22nd December 2018, 23:00   #25
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Fixed progbutton.m!

The solution is what you posted in #13 with one difference. Do not change this line:

PHP Code:
string currPath getPlayItemMetaDataString("filename"); 

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, 08:16   #26
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
Fixed progbutton.m!
Great news...
And those memory buttons?
PeterK. is offline   Reply With Quote
Old 23rd December 2018, 14:31   #27
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
Originally Posted by PeterK. View Post
Great news...
A huge THANK YOU to you, PeterK.!

Quote:
Originally Posted by PeterK. View Post
And those memory buttons?
That's tough. I will start a new topic about them.

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, 14:33   #28
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Off topic: Seeing your new signature one might think we pay you for this.
PeterK. is offline   Reply With Quote
Old 23rd December 2018, 14:55   #29
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 495
Quote:
Originally Posted by PeterK. View Post
Off topic: Seeing your new signature one might think we pay you for this.
I'm just ashamed that my Vortex topics are pushing down your release announcements from the main page.

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, 15:01   #30
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
I'm just ashamed that my Vortex topics are pushing down your release announcements from the main page.

As long as they are on the Modern Skins page visible you do not have to worry about it. This section is not Quinto's section but ours. Right?
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