Old 12th July 2018, 21:59   #1
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quinto Black CT v2.1 (Release)

Skin Name: Quinto Black CT v2.1
Author: PeterK.
Type: Modern Skin
File Extension: wal
SHA-1: F88C9FA05E70ADEAED1EC6501454419DBE661445
Size: 1,89 MB

Changelog:

- added: Track Bookmarks

Download Link: Here

Enjoy!



Attached Thumbnails
Click image for larger version

Name:	Update 2.1.png
Views:	509
Size:	400.5 KB
ID:	53918  
PeterK. is offline   Reply With Quote
Old 13th July 2018, 02:30   #2
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
Quote:
Originally Posted by PeterK. View Post

Changelog:

- added: Track Bookmarks
Wait.. what??? Already???

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 13th July 2018, 07:37   #3
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quote:
Originally Posted by Victhor View Post
Wait.. what??? Already???


What a pity it is not possible to start a music file using a script line. Having such a feature would make it possible to have some additional options/buttons which, once clicked, would start a particular file and make the progress thumb jump into the saved position - this would give us a real bookmark button.

Instead, we still have to launch the file manually and hit GO on the Track Bookmarks window.

PeterK. is offline   Reply With Quote
Old 16th July 2018, 00:41   #4
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
I'll tell you the truth.. I was kinda let down with the bookmark functionality, is a good idea but needs more work and ultimately found little use of it in its current state. So I've been doing some testing to see if I could find the solution.. and I could!!

I succesfully managed to get the playing item path, save it and play it with System.playFile (which is picky to work as-is). I used this:

code:
button1.onLeftClick(){
string myfilefrombutton1 = System.getPlayItemString();

setPrivateString (getSkinName(), "music", myfilefrombutton1);
}

button2.onLeftClick(){
string PlayThisFile = (getPrivateString (getSkinName(), "music", "myfilefrombutton1"));

System.playFile(PlayThisFile);
}



Voilá!

From here you can add the positions I guess. I haven't tested it, I'll leave that to you .

You can also add somewhere (probably next to each button) some clue to what the file is with

code:
string whatisplaying = (getPlayItemMetaDataString("artist") + getPlayItemMetaDataString("title"));


Let me know if it works please.


PS: Note that System.playFile will clear the playlist and play the item. An alternative to this would be System.enqueueFile or a functionality I used on my BBM skin which actually saves the button to Winamp's bookmarks (see "Bookmark current item" on Custom buttons from Multi-tools view).

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 16th July 2018, 20:28   #5
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quote:
Originally Posted by Victhor View Post
System.playFile();
PeterK. is offline   Reply With Quote
Old 16th July 2018, 20:31   #6
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
-_- (I've tested it, what is not working for you?)

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 16th July 2018, 20:33   #7
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quote:
Originally Posted by Victhor View Post
-_- (I've tested it, what is not working for you?)
Winamp playing a file after hitting a button. (playFile() shows no effect).
PeterK. is offline   Reply With Quote
Old 16th July 2018, 20:56   #8
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550





(See the code on the background? Did you do the same and it's still not working?)

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 17th July 2018, 03:32   #9
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
Aaaand a more perfected implementation:



I just used this (a bit of a dirty code here, just as example):

code:
#include <lib/pldir.mi>
...
...
...
...
buttonSet1.onLeftClick()
{
x1=getPosition();
bookmark1.setText(integerToLongTime(x1));
string myfilefrombutton1 = System.getPlayItemString();
setPrivateString (getSkinName(), "music", myfilefrombutton1);
setPrivateInt("Quinto","bookmark1",x1);

string artisttxt = getPlayitemmetadatastring("artist"); //Optional
string titlettxt = getPlayitemmetadatastring("title"); //Optional
bookmark1label.setText(artisttxt + " " + titlettxt); //Optional
bookmark1label.setXmlParam("fontsize", "10"); //Not needed if the window is larger
}

buttonGo1.onLeftClick()
{
string AddThisFile = (getPrivateString (getSkinName(), "music", "myfilefrombutton1"));
System.enqueueFile(AddThisFile);
int PlayThisFile = PlEdit.getNumTracks (); //This returns the total amount of tracks on PL ("4" on the GIF), with this number..
PlEdit.playTrack (PlayThisFile); //..I tell Winamp to play it
seekTo(x1);
}


· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 17th July 2018, 18:30   #10
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quote:
Originally Posted by Victhor View Post
...

Wow, wow, cowboy, please calm your horses!
I appreciate, as always, your help and suggestions but this time it is waaaaay to much at a time. And since I am not interested in "Copy & Paste" methods I would like to propose to make it "peu à peu" as Frenchmen say.

Why do we not start at the top and check the command playFile(); again, which would allow me to add bookmarks button without pldir.mi library file.

Please do the following:
1) put a mp3 file on your desktop
2) add the following to the buttonGo1.onLeftClick() line: playFile("C:\Users\...\Desktop\...mp3")
3) play a different file, open the Track Bookmarks window and hit GO1 button

And please answer my question: does Winamp play the mp3 file?
PeterK. is offline   Reply With Quote
Old 17th July 2018, 20:51   #11
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
It won't play that way because the command needs some "formatting" to the string which you have to get from another source ( i.e. System.getPlayItemString(); ).
It doesn't work at all like it says on std.mi, but I wouldn't give it much thought, it's probably a Winamp bug, there are plenty of them. If there isn't another way to do it, or if the outcome isn´t exactly what's needed I would keep trying to find out why it doesn't work, but seeing there is another way and the outcome is flexible enough, I would spend my time trying to understand why it works like that and how I can improve it.
And what's wrong with using pldir.mi?

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 17th July 2018, 21:20   #12
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quote:
Originally Posted by Victhor View Post
It won't play that way because the command needs some "formatting" to the string which you have to get from another source ( i.e. System.getPlayItemString(); ).
According to std.mi all I need is path and filename.

Quote:
Originally Posted by Victhor View Post
And what's wrong with using pldir.mi?
Because PlEdit.playTrack() does not work either. I see a new file in the Playlist at the bottom, which has also an extension, but nothing happens. Winamp stops and double click on that particular file in the playlist does not make Winamp play it. Even if I use just PlEdit.playTrack(1), which should play the first entry, Winamp stops.

So what am I missing in here?
PeterK. is offline   Reply With Quote
Old 18th July 2018, 09:20   #13
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quote:
Originally Posted by PeterK. View Post
So what am I missing in here?
Got it! More details tonight.
PeterK. is offline   Reply With Quote
Old 18th July 2018, 14:02   #14
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
Excellent, that's what I wanted all along, for you to see what works and then dig your way around to see why it works (I myself am not sure why playfile doesn't work as-is..)

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 18th July 2018, 22:10   #15
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quote:
Originally Posted by Victhor View Post
Excellent...
No Vic, it is not excellent at all, because I found out that my approaches did not work because I was using .wav files instead of .mp3. And therefore it looks like both commands playFile() and playTrack() are limited to .mp3-format.

I did not run further tests with .flac/.mov/mp4-files, but I am afraid it will be the same outcome as with my .wav files.


PeterK. is offline   Reply With Quote
Old 18th July 2018, 23:55   #16
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
Damn, this is a hard nut to crack! NOW I'm really running out of ideas..

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 17th September 2018, 19:33   #17
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 466
Quote:
Originally Posted by Victhor View Post
Damn, this is a hard nut to crack! NOW I'm really running out of ideas..

But I had one, yesterday night, way after midnight! I was going once again step by step trough the process and found out that System.getPlayItemString() not only saves the name of the file but also the location on the hard drive. Surprisingly, it also adds the prefix file:// to the saved value, which blocks Winamp from playing those enqueued files in the Playlist Editor.

Removing the prefix file:// manually from the studio.xnf and hitting the GO button (regardless of format being played: be it mp3/flac/wav) plays the file like a charm. So all I had to do is save the location and subtract the first seven characters from the saved string. Voilà!

Having said that it is not a surprise anymore that there will be an updated - or even upgraded version of the Track Bookmarks window in the upcoming new version of my skin. Suggestions are still welcome, but please do it in the official skin thread.

PeterK. is offline   Reply With Quote
Old 21st September 2018, 13:30   #18
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,550
Awesome! DrO told me you were tinkering with it and finally found the solution, it's great, this opens a lot of possibilities!
And I really like the new Track bookmarks window, you implemented a couple of things I suggested

· · TMCT · KOMODO X
Victhor 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