|
|
|
|
#1 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
Question on coding WACs
Right, I've decided to have a play around with building some Winamp3 components, and I've got a bit stuck - this is about my first time coding C++, I've come from doing C on UNIX, and (*shudder*) VB.
OK, I've got the thing to compile and load (a struggle in itself ), and I've got integer options showing up in the prefs screen (i.e. _int something("Something", 1); ) , but I'm rather stuck on how to get boolean or string values to work there.Secondly, can I get Winamp to call me back when the song changes, or do I have to poll it on a timer? (I haven't looked very hard with this) -- Russ Garrett |
|
|
|
|
#2 |
|
Senior Member
|
the _int is one of the attribute types.
Look in attribute.h Here are some known types : INT = 'int', STRING = 'str', BOOL = 'bool', FLOAT = 'flot' R.N. aka soundsys |
|
|
|
|
#3 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
Thanks, I had noticed that - maybe I'm being stupid, but I change:
_int something("Something", 1); to: _bool something("Something", TRUE); and I get: error C2146: syntax error : missing ';' before identifier 'something' error C2501: '_bool' : missing storage-class or type specifiers fatal error C1004: unexpected end of file found on that line, similarly with str or flot. -- Russ |
|
|
|
|
#4 |
|
Major Dude
|
make sure you got the right header included...
use this: #include "../attribs/attribs.h" this will automatically include all 4 types of attributes. after this, _bool SHOULD in theory work. -=- Darkain Dragoon -=- |
|
|
|
|
#5 |
|
Winamp3 Component Guuuru
Beta Team |
To answer your question on the Song Change callback... yes there is...
Here is how: 1. include "../studio/corecb.h" 2. Derive a class from CoreCallbackI 3. call api->core_addCallback in your class's constructor and api->core_delCallback in your class's destructor. 4. Override the functions of CoreCallbackI that interest you... VERY IMPORTANT.... You need to look at CoreHandle to see exactly how your constructor and destructor have to work. You can find their definitions in common\corehandle.h and .cpp SPECIAL HINT.... for when you are looking at CoreHandle, a token of 0 is the core identifier for the main playback engine in Winamp3. Hope this helps. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein Winamp 3 Projects | Winamp 2x Plugin Manager | Explorer Playlist | FileSystem Object | Shoutcast List | Sashimi
|
|
|
|
|
#6 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
Aha... I'd been including attribute.h instead, and it wasn't complaining (should it?). And why does _int work where all the others don't?
Edit: It appears you need to use _string for strings, contrary to what it says in attribute.h. -- Russ |
|
|
|
|
#7 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
OK, I'm having a little trouble getting the callbacks to work - could you possibly post an example? I'm struggling a bit with all these classes
.
For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave. |Musicbrainz|Audioscrobbler|last.fm| |
|
|
|
|
#8 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
Ain't it typical... got it working now
. Moved api->core_addCallback from the constructor to onCreate() and now it works. Makes sense now I think about it.. . Thanks everyone.
For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave. |Musicbrainz|Audioscrobbler|last.fm| |
|
|
|
|
#9 | |
|
Winamp3 Component Guuuru
Beta Team |
Quote:
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein Winamp 3 Projects | Winamp 2x Plugin Manager | Explorer Playlist | FileSystem Object | Shoutcast List | Sashimi
|
|
|
|
|
|
#10 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
Eek... ran into another problem which I thought would be easy... How the hell do I get info on the currently playing file? Do I have to use this metadb stuff (if so, how?
).
For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave. |Musicbrainz|Audioscrobbler|last.fm| |
|
|
|
|
#11 |
|
Winamp3 Component Guuuru
Beta Team |
Thats pretty much the ONLY thing you can do right now involving song info since you can't traverse the playlist with the current SDK... try this:
api->core_getCurrent( ... ) This returns a const char* which has the playstring that can then be passed into the metadb.. I think. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein Winamp 3 Projects | Winamp 2x Plugin Manager | Explorer Playlist | FileSystem Object | Shoutcast List | Sashimi
|
|
|
|
|
#12 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
Ah, great - I'll have a play
For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave. |Musicbrainz|Audioscrobbler|last.fm| |
|
|
|
|
#13 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
Hmmm... the metadb functions are in dire need of documentation... Could someone show me how to get the ID3 info from the playstring?
For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave. |Musicbrainz|Audioscrobbler|last.fm| |
|
|
|
|
#14 |
|
Winamp3 Component Guuuru
Beta Team |
Haven't messed around with this really... but I'll give you a few places to start...
Look in common\metatags.h to see the supported tags and their constants... Then look at these functions in api: int metadb_getMetaData(const char *playstring, const char *name, char *data, int data_len, int data_type=0); int metadb_getMetaDataType(const char *name); The rest you should try figuring out.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein Winamp 3 Projects | Winamp 2x Plugin Manager | Explorer Playlist | FileSystem Object | Shoutcast List | Sashimi
|
|
|
|
|
#15 |
|
Mostly Harmless
(Alumni) Join Date: Jan 2001
Location: UK
Posts: 2,319
|
Aaaaaaand it works (in the end) - I'll probably post it with the code in another thread as an example of a general plugin, so people can see how it all goes together
For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave. |Musicbrainz|Audioscrobbler|last.fm| |
|
|
|
|
#16 |
|
Member
|
Is it possible to have callbacks for song changes in Winamp 2.x? Also, if it is, can someone please port some code over to Visual Basic 6 for me? I need it bad cause I hate timers!
Ethan |
|
|
|
|
#17 | |
|
Winamp3 Component Guuuru
Beta Team |
Quote:
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein Winamp 3 Projects | Winamp 2x Plugin Manager | Explorer Playlist | FileSystem Object | Shoutcast List | Sashimi
|
|
|
|
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|