Old 14th September 2010, 22:06   #1
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
I want to create plug in but don't know how to start..

I'm doing a research project. But I don't really know how to start.

There is not much information on how to make winamp plug in in web sites.

Could anyone teach me about this?


Sorry about my English, hope you understand what I mean.

Thank you
assualt is offline   Reply With Quote
Old 14th September 2010, 22:17   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
it all really depends on what you're want to do as to what to suggest as usually it's best to just have a look at an existing plug-in to see what goes on in them.

though i'd have a look at http://nunzioweb.com/daz/gen_lang_example/ which is a basic general purpose plug-in and contains some information on what is needed and is a good base for a plug-in to work properly with client releases from the last few years.

also having an understanding of some of the basics of Win32 programming helps though that's only really something you can learn by just trying out code samples, etc

-daz
DrO is offline   Reply With Quote
Old 14th September 2010, 23:07   #3
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
If I just want my plug in to show out some message. How can I do that?
Thank you.
assualt is offline   Reply With Quote
Old 14th September 2010, 23:16   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
you'd use a MessageBox (http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx). though this is going to be easier to answer if you can provide some more information on what it is you're trying to achieve with the Winamp plug-in you're wanting to make...

-daz
DrO is offline   Reply With Quote
Old 15th September 2010, 08:00   #5
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
The example you gave me was error.

It say "This application has failed to start because MSVCR90.dll was not found. Re-installing the application may fix this problem.

I want to implement plug in C++. Can you give me some simple example code.

Thank you.
assualt is offline   Reply With Quote
Old 15th September 2010, 09:43   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
the installer installs source code for the plug-in as well as the plug-in if you select it from the install type options (guess i'll have to rework the installer if it wasn't that clear).

the dll dependency is due to the example plug-in being built in VS2008 without static linking (which is fixed for when i roll out an update of my site in a week or two) but can be easily resolved on your copy by changing to using multi-threaded library instead of multi-threaded dll when building it.

also the source is placed in a gen_lang_example folder in the plugins folder of the Winamp install used incase you cannot find it (something else i need to resolve in the installer as other people have not checked the installer log to see where it was saved into).

-daz
DrO is offline   Reply With Quote
Old 15th September 2010, 09:55   #7
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
I can't open "gen_lang_example.dll".
Does it need a specific program to open? If yes, what is that program?
assualt is offline   Reply With Quote
Old 15th September 2010, 10:08   #8
DrO
 
Join Date: Sep 2003
Posts: 27,873
er why are you trying to open the dll? that doesn't contain the source code for re-building the plug-in.

re-run the installer and on the second page change the option in the combobox box to plugin+source or everything to get the source installed (the next version of the installer will allow for just the source code to be installed). this is then stored in <folder_on_first_page>\plugins\gen_lang_example though you'll need to move it into the Winamp sdk folder (i'll assume you've already downloaded and installed that).

-daz
DrO is offline   Reply With Quote
Old 15th September 2010, 11:35   #9
DrO
 
Join Date: Sep 2003
Posts: 27,873
i've just pushed v1.1 of the example live (ignoring that some of the header page links aren't valid at the moment) so it no longer has the MSVCR90.DLL dependency and it should be clearer now what the installer does (with plug-in + source the default install action now).

-daz
DrO is offline   Reply With Quote
Old 1st December 2010, 17:48   #10
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
wanna learn to create a plug-in

Can anyone teach me how to make a plug-in step-by-step?

I've try read many thread and downloaded some examples.

I found that they're difficult for me to understand by myself.

Thank
assualt is offline   Reply With Quote
Old 1st December 2010, 18:29   #11
DrO
 
Join Date: Sep 2003
Posts: 27,873
i've merged your new post into the old thread about learning to make a plug-in.

so firstly did you ever get the example working as this is about as simple as a plug-in can get. also as i mentioned in my first post, unless you have a basic understanding of coding for Win32 then you're going to be struggling no matter what as Winamp plug-ins rely quite heavily upon it.

-daz
DrO is offline   Reply With Quote
Old 2nd December 2010, 18:10   #12
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
Quote:
Originally Posted by DrO View Post
i've merged your new post into the old thread about learning to make a plug-in.

so firstly did you ever get the example working as this is about as simple as a plug-in can get. also as i mentioned in my first post, unless you have a basic understanding of coding for Win32 then you're going to be struggling no matter what as Winamp plug-ins rely quite heavily upon it.

-daz

Yes, I don't know anything about it.
Could you help me to understand what it is?
How to use it?


Thx
assualt is offline   Reply With Quote
Old 2nd December 2010, 18:20   #13
DrO
 
Join Date: Sep 2003
Posts: 27,873
what is it that you don't understand? where the comments in the code not clear? or is this more that you just don't understand the code used ? (if the later then there's not too much i can help on as that's something you need to read up on code examples, etc).

-daz
DrO is offline   Reply With Quote
Old 4th December 2010, 05:48   #14
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
What if I want my init function run when shuffle button is ON.

How can I make that condition?
assualt is offline   Reply With Quote
Old 4th December 2010, 11:47   #15
DrO
 
Join Date: Sep 2003
Posts: 27,873
init(..) is called when the plug-in is loaded. you can test for the shuffle state being on (using the api in wa_ipc.h) and then decide to handle things from there i.e. setting a variable to then control whatever it is that you're trying to do.

might be easier to say what you're trying to achieve so a better set of suggestions can be made in one go rather than multiple posts which go nowhere.

-daz
DrO is offline   Reply With Quote
Old 4th December 2010, 15:06   #16
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
Quote:
Originally Posted by DrO View Post
init(..) is called when the plug-in is loaded. you can test for the shuffle state being on (using the api in wa_ipc.h) and then decide to handle things from there i.e. setting a variable to then control whatever it is that you're trying to do.

might be easier to say what you're trying to achieve so a better set of suggestions can be made in one go rather than multiple posts which go nowhere.

-daz
OK, my idea is to create a plug-in which able to select next song that has the closest bpm to the current playing song (I hope to get BPM from music information because I think it must be difficult to calculate BPM myself.)
Something like this.

Sorry for my English. If you don't get it. Please ask me.
assualt is offline   Reply With Quote
Old 4th December 2010, 17:34   #17
DrO
 
Join Date: Sep 2003
Posts: 27,873
well there's the metadata reading options which allow you to use "bpm" as a query (though there's no guarantee a file will even have it stored in it (and not all input plug-ins support it especially with 3rd party input plug-ins).

as for selecting the next to play, it depends on if you want it automated or just be selected as the automated approach pretty much requires using the api_queue service (which locks you into Winamp 5.5+ which is sensible to do anyway).

-daz
DrO is offline   Reply With Quote
Old 5th December 2010, 07:19   #18
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
int init() {

int shufflestat=SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_GET_SHUFFLE);

if(shufflestat==1)
{
main();
return 0;
}
else
{return 1;}
}


I try something like this and it doesn't work.
and if I make a condition before init(), it will be an error.
What else I can try?
assualt is offline   Reply With Quote
Old 5th December 2010, 13:47   #19
DrO
 
Join Date: Sep 2003
Posts: 27,873
what you've posted will make Winamp unload the plug-in if shuffle is disabled (though it could then be enabled later on by the user).

in your init(..) is where you would need to subclass Winamp or get the first state of shuffle / anything else needed and then in your subclassed proceedure then handle things as needed along with detecting the starting of playback, etc.

http://nunzioweb.com/daz/gen_play_state/ is an example of how the subclassing and catching of the messages will work and can then be applied to other messages. once you understand what is going on with that plug-in example then you may find things a bit easier to follow (though understanding how Win32 window proceedures and messages will make it more obvious as to what Winamp is doing as that is what most of the api's are based upon).

-daz
DrO is offline   Reply With Quote
Old 6th December 2010, 08:10   #20
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
What is wasabi? What is it for?
How to use it?

thx
assualt is offline   Reply With Quote
Old 6th December 2010, 09:34   #21
DrO
 
Join Date: Sep 2003
Posts: 27,873
it's a framework used in parts of Winamp to make it easier to extend things (is based on what Winamp3 was designed around) based around services.

as for using it, it depends on the service you're wanting to use. the examples i've linked you too show it being used in one of it's simplest forms.

-daz
DrO is offline   Reply With Quote
Old 7th January 2011, 16:15   #22
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
Quote:
Originally Posted by DrO View Post
well there's the metadata reading options which allow you to use "bpm" as a query (though there's no guarantee a file will even have it stored in it (and not all input plug-ins support it especially with 3rd party input plug-ins).

as for selecting the next to play, it depends on if you want it automated or just be selected as the automated approach pretty much requires using the api_queue service (which locks you into Winamp 5.5+ which is sensible to do anyway).

-daz
where could I find api_queue?


Happy new year.
assualt is offline   Reply With Quote
Old 9th January 2011, 11:48   #23
DrO
 
Join Date: Sep 2003
Posts: 27,873
it should be in the 5.55 sdk from what i remember otherwise am sure it'd appear on a google search - had thought i'd also included it in my jtfe sdk pack but haven't - will have to fix that when i can find the time...

-daz
DrO is offline   Reply With Quote
Old 10th January 2011, 14:58   #24
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
Quote:
Originally Posted by DrO View Post
what you've posted will make Winamp unload the plug-in if shuffle is disabled (though it could then be enabled later on by the user).

in your init(..) is where you would need to subclass Winamp or get the first state of shuffle / anything else needed and then in your subclassed proceedure then handle things as needed along with detecting the starting of playback, etc.

http://nunzioweb.com/daz/gen_play_state/ is an example of how the subclassing and catching of the messages will work and can then be applied to other messages. once you understand what is going on with that plug-in example then you may find things a bit easier to follow (though understanding how Win32 window proceedures and messages will make it more obvious as to what Winamp is doing as that is what most of the api's are based upon).

-daz
I still can't understand about subclassing. Can you give me an example that show only how subclassing? (because there are many headers and I can't find where they from)

Quote:
Originally Posted by DrO View Post
it's a framework used in parts of Winamp to make it easier to extend things (is based on what Winamp3 was designed around) based around services.

as for using it, it depends on the service you're wanting to use. the examples i've linked you too show it being used in one of it's simplest forms.

-daz

you mean which example?
assualt is offline   Reply With Quote
Old 10th January 2011, 15:41   #25
DrO
 
Join Date: Sep 2003
Posts: 27,873
http://nunzioweb.com/daz/gen_lang_example/ and http://nunzioweb.com/daz/gen_play_state/ both show the subclassing in it's simplest form for Winamp's use of it. and it was both of those examples i've been referring to with the second part of your post.

i'm sorry but i really cannot walk you through each line of code as seems to be what's needed (i just do not have the time to do that). the examples are reasonable well documented and there is more than enough information in external examples about subclassing as well - learning does involve putting in work on yourside.

-daz
DrO is offline   Reply With Quote
Old 10th January 2011, 16:46   #26
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
I've read this code and I saw there is no Wasabi in it. So I confuse do I need Wasabi in my work? and what can Wasabi does?
assualt is offline   Reply With Quote
Old 11th January 2011, 09:52   #27
AVlution
Junior Member
 
AVlution's Avatar
 
Join Date: Jan 2011
Location: Watford, Hertfordshire
Posts: 41
Loads and loads of stuff about subclassing on the net, if that's what is holding you up
AVlution is offline   Reply With Quote
Old 20th January 2011, 16:04   #28
assualt
Junior Member
 
Join Date: Sep 2010
Posts: 25
Error 1 fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] D:\My Program\Visual Studio 2005\VC\atlmfc\include\afx.h 24


I got this error. How I shut MFC down?
assualt is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

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