|
|
#1 |
|
Member
Join Date: Nov 2004
Posts: 63
|
ml_org: Organize Media Library
I've checked through the samples and the FAQ's and I'm still needing a little help at just getting started. This is my first Winamp plugin, so go easy on me...
![]() I thought that I'd try to tackle the "Keep My Media Library Organized" functionallity that shows up on the wishlist. This is something that I too would love to have. I thought that I would take the approach of having a button or menu item added to the media library that would selected by the user to do the organization (instead of trying to monitor the library for changes to tags). Most development I've done to date has been for embedded systems, so I have very little knowledge of Windows programming. For a basic test, I would like to be able to display the new button (or menu item) in the ML, the simply iterate through all items in the ML just to see that I can get that far ![]() Here's what I need some help with:
Any takers? |
|
|
|
|
|
#2 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
You can't add a button to the ML as there is no API made for this yet (well nothing is impossible, but it would require serious hacks which would take too much time). You can instead add a menu item to the menu that appears when you click the Library button below the ML tree-view control (I guess you know a litt about the basics of Win32 programming after all).
You must then replace the window procedure (function pointer) of the Media Library Window (called subclassing for some reason, in the DOS days we called it vectoring) by using the SetWindowLong (or SetWindowLongPtr for 64-bit Windows forward-compatibility) with the GWL_WNDPROC (or GWLP_WNDPROC if using SetWindowLongPtr) to set your new Window Procedure. SetWindowLong[Ptr] will return the previous Windows Procedure function pointer which you must keep in a WNDPROC type variable so you can call into the old Window Procedure from you own Windows Procedure to handle default processing (and keep Winamp from dead-locking). You do this using CallWindowProc and not calling the function pointer directly (short story: this is so Windows can handle ANSI vs. Unicode). I guess this post was a bit elaborate, and It would be easier to just tell you to buy a damn "Win32 Programming for Dummies" book. |
|
|
|
|
|
#3 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Wow... Thanks for all the information! Looks like I do need to just get a book on it, eh?
I'm a little surprised that there are not more resources on the internet for creating Winamp plugins. Oh-well... That probably helps to keep n00bs like me away from writing code when they shouldn't. ![]() I'm definitely going to pursue this plugin, as it is the only thing missing from the media library that I need a third part prog to do. I'd also like to get feedback on features and such... Is Winamp Discussion the best place for that? |
|
|
|
|
|
#4 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
You may try out one of the other forums here at forums.winamp.com, but everything development related (eg.: contains a lot of code talk and in-depth explanations of things) should remain here.
Try to ask what features people want in Winamp Discussion and then decide if you want to write a plugin that does just that. |
|
|
|
|
|
#5 |
|
Member
Join Date: Nov 2004
Posts: 63
|
I'll look for some feedback there..
While I'm here, though, any thoughts on the plugin? Here's a link to the thread in the WA Discussion... |
|
|
|
|
|
#6 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Well, I'm trying to figure out what's wrong... I am building the ml_ex from the SDK, but I only get .lib and .exp output. I was expecting a DLL...
Any help here? |
|
|
|
|
|
#7 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Check project settings
Check the project settings. The project may put the compiled DLL in another folder.
|
|
|
|
|
|
#8 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Duh. Sample project ouputd the DLL to the Winamp plugins dir instead of the build directory...
|
|
|
|
|
|
#9 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Woo-Hoo! I'm on my way (well, I think I am...)
I've got my plugin loading and I can see it initialize. Also, I've got a hold of the window proc pointer (many thanks so far, saivert). Now, as far as adding to the "Library" button at the bottom of the Media Library window... No idea how to do this. I tried to track down Francis, as his ml_impex plugin would be a perfect place for me to start (just rename files instead of making XML), but no word back from him. Any thoughts on adding this item to the menu? |
|
|
|
|
|
#10 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Can I check your source code? Do you intend to release it?
|
|
|
|
|
|
#11 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Definitely. I hate when I can't find source code for things
![]() You can find the plugin page (well, source code only right now) here. Since pretty much all I have at this point is a skeleton, I released that in another thread (that I want to add to as I go) here. PS: Thanks for all the help you have given! Once I get past this first stage of figuring out the basics of plugin programm, hopefully I can start making some real progress... |
|
|
|
|
|
#12 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Nullsoft has their own skeleton ml plugin in the "C:\Program Files\Winamp5.04 SDK\gen_ml\ml_ex" folder. I happened to compile this without problems using Visual C++ 6.0. And compiling it under VS .NET 2003 should be as easy as creating a new project and adding the files from ml_ex folder.
|
|
|
|
|
|
#13 |
|
Member
Join Date: Nov 2004
Posts: 63
|
I started with that, but it seemed to get a little confusing, so I wanted to make my own skeleton real quick (also just to understand how things are laid out). Probably wouldn't be confusing for someone who knows Win32 programming more than me.
|
|
|
|
|
|
#14 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
It is always nice that someone gets starting to code. Hope you learn quick.
|
|
|
|
|
|
#15 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Updated source
I have worked on your source code and this is what I did to it:
- Implemented menu item. Clicking menu item still does nothing (up to you my friend). - Fixed project files (.sln and .vcproj) so they would build under MS Visual Studio .NET 2003 without problems (at least for me). I have attached the updated code. |
|
|
|
|
|
#16 |
|
Member
Join Date: Nov 2004
Posts: 63
|
This is awesome! Thanks so much... I have been looking through the code and it seems pretty easy to follow. I'll probably abandon my skeleton, since this is straight forward, and it should be easy to reuse.
On to the actual organization now... |
|
|
|
|
|
#17 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Getting the entire library
I'm trying to use the mlGetTreeStruct to get the entire library (I think that is correct). I'm not sure of two things:
1. the item_start parameter wants "TREE_PLAYLISTS, TREE_DEVICES..." but I don't see any of those defines in the SDK. 2. when I get the HMENU back, do I need to loop through the whole thing and add each item to a itemRecordList? Is there an easier way? |
|
|
|
|
|
#18 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Ignore last post... I'm actually, I'm going to take a different approach... It looks like a good thing to do would be to run queries and look at the results.
I'll post again w/ questions.
|
|
|
|
|
|
#19 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Well, I haven't quite gotten to the renaming part, yet... I could use a little help with my progress bar dialog if someone has the time.
In the function MLOrg::Organize(itemRecordList...), I want to display a progress bar that shows progress as I loop through all the records. Right now, the dialog is not showing up. I have two questions: 1. How do I make the dialog show up modeless? 2. How do I get the progress control to set the range of it? I've tried GetDlgItem, but I'm not sure how to change the HWND to a CProgressCtrl... Thanks!! |
|
|
|
|
|
#20 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Here's my source code...
|
|
|
|
|
|
#21 |
|
Member
Join Date: Nov 2004
Posts: 63
|
I've gotten past a lot of the Win32 stuff that was holding me up. Now, the plugin even pops up a progress bar as if it's actually doing something...
I'll be keeping my site updated for this plugin as I go... I've gotten a bit of it done, but it is still a ways from complete. Feel free to visit: http://winamp.heddway.com/ml_org/ |
|
|
|
|
|
#22 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Development is going very well... Just a couple final things before release 1.0.
Right now the plugin is running quite slowly. The bottle neck is in some querying I am doing. I am trying to take a particular record and see if it matches a query string. So do this, currently I am taking that query string, appending "filename == pRecord->filename" and running that query. This takes a while to run in large databases. Any thoughts on how to make this faster? That's really the last thing for v1.0! |
|
|
|
|
|
#23 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Nice. I have been unable to follow your progress for a long time (seeing noe replies between your posts). But I guess you have progressed nicely. You actually start to know what you are doing.
You already know this by now, but anyways code: Just so other people can know. I don't know exactly how you are "organizing" the ML, but If I can get your lates source code I might have a look. |
|
|
|
|
|
#24 |
|
Member
Join Date: Nov 2004
Posts: 63
|
BETA VERSION AVAILABLE
Get the beta 1 version of the plugin here. The source code is also available from that page. THIS IS BETA!! I have run it many times without a problem, but make sure that you have a backup of your library before running this plugin. You should have a backup anyway... There are only two issues that remain outstanding to test:
|
|
|
|
|
|
#25 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
What about switching to Windows Template Library instead of using old MFC for your code?
Download the WTL from here: http://www.sourceforge.net/projects/wtl The best would be to use neither MFC nor WTL, and just plain old Win32 calls. Makes your plugins smaller and more efficient. I'll also check out the new code to see how you progressed. |
|
|
|
|
|
#26 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
NSIS Installer
Here's a NSIS script file I made for your plugin.
Just download NSIS from http://nsis.sf.net and compile it. It should compile with the standard stuff that is included with NSIS (i.e. no 3rd party dependencies). |
|
|
|
|
|
#27 | ||
|
Member
Join Date: Nov 2004
Posts: 63
|
Quote:
I'm not using any MFC (as far as I know) in the plugin. Can you give me an example?Quote:
|
||
|
|
|
|
|
#28 | |
|
Member
Join Date: Nov 2004
Posts: 63
|
Re: NSIS Installer
Quote:
(Sorry for the new thread... I was trying to help reduce clutter in this thread) |
|
|
|
|
|
|
#29 |
|
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Oh. I see. I thought it was a reference (sorry, lame mistake). but & is used to declare references, but can be used to turn a variable into a pointer. okay. Now that's sorted out.
|
|
|
|
|
|
#30 |
|
Member
Join Date: Nov 2004
Posts: 63
|
No worries. I make lots of those.
|
|
|
|
|
|
#31 |
|
Member
Join Date: Nov 2004
Posts: 63
|
Anyone have any ideas why my plugin is running so slow? (see thread for link).
|
|
|
|
|
|
#32 |
|
Registered User
Join Date: May 2005
Posts: 6
|
Any updates? It has been a year almost...
I just found this plugin and it suits EXACTLY what I need in winamp to be able to fully abandon iTunes. |
|
|
|
|
|
#33 |
|
Member
Join Date: Nov 2004
Posts: 63
|
I haven't made any updates to this plugin since the version posted. I'll take a look at your email to see if I can make the changes you requested, but please be patient with me... I'm at a new job that doesn't afford me quite as much free time.
|
|
|
|
|
|
#34 |
|
Nullsoft Newbie
(Moderator) Join Date: Mar 2001
Location: Sheffield, England
Posts: 5,568
|
What I'd really like is a "Send to -> Organise to library"
So I can right click some mp3s i've downloaded and have it move them into my library file naming structure. DO NOT PM ME WITH TECH SUPPORT QUESTIONS |
|
|
|
|
|
#35 |
|
Junior Member
|
I hope this gets a reply, considering the thread has been inactive a year or so.
I downloaded the plugin, and find it incredibly useful, but there are times when I really don't want to change the filename, or just append something to the existing filename. This could be fixed by having an <OriginalFilename> parameter in the file renaming string options. This would surely be a very small amount of work, yet I unfortunately lack the programming skills necessary. Anyone willing to take this one on? MM P.S. I don't seem to get to the plugin website... |
|
|
|
|
|
#36 |
|
Junior Member
Join Date: Jan 2008
Posts: 1
|
winamp 5.52?
It's possible that it's just my system, but I just updated to 5.52 and it doesn't seem to work. It's killing winamp as soon as it starts to run.
what's the chance of an update to support 5.52? I suppose I could try an earlier version but I prefer not to do that... the ability to remove duplicate tracks is something that itunes sorely lacks, and part of why I wanted to switch to another media player. Sorting through all 45+ GB of music isn't something I want to do. |
|
|
|
|
|
#37 | |
|
Junior Member
Join Date: Jul 2007
Posts: 21
|
Re: winamp 5.52?
Quote:
http://forums.winamp.com/showthread....=&pagenumber=2 My comment on that thread, and to anyone who uses this plugin: BACK UP YOUR FILES FIRST! That's a basic rule for any situation where you attempt to make drastic changes to your files. That said, this plugin has worked beautifully for me. |
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|