Old 16th September 2010, 19:10   #1
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,012
Send a message via Skype™ to thinktink
Classic skin rendering for plugin external windows.

Is there a way to retrieve the current classic skin properties/bitmaps through the Winamp API and somehow apply the current classic skin theme to an external non-embedded window created by third-party plugins? I was thinking about using the GEN, GENEX, TEXT, EQMAIN (maybe for the sliders), and maybe the PLEDIT.TXT map and optional cursors to render my external plugin windows. I've looked at the API headers but nothing jumped out at me as the answer I'm looking for.

Not hugely important but it would be nice to implement if at all possible. Even if it's just an API that returns the file path/name of the currently selected classic skin would probably be enough to process the skin myself and render it.

Thanks in advance either way.
thinktink is offline   Reply With Quote
Old 16th September 2010, 19:55   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
Quote:
Originally Posted by thinktink View Post
...to an external non-embedded window created by third-party plugins?
how external is the window ie is it in the Winamp process or completely separate of it? depending on that fact will determine what i can tell you

-daz
DrO is offline   Reply With Quote
Old 16th September 2010, 21:01   #3
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,012
Send a message via Skype™ to thinktink
Created by a plugin under the same thread context as the main Winamp UI thread, parented by the Desktop Window, but root owned by the main Winamp Window.

For example the SHOUTcast DSP's main Window or my LiveWire DSP's main Window.

Attached Thumbnails
Click image for larger version

Name:	WinampAndLiveWireWinpeekScreenshot.jpg
Views:	328
Size:	64.1 KB
ID:	47575  
thinktink is offline   Reply With Quote
Old 16th September 2010, 21:29   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
as it's an in-process plug-in you could just use an embedded window and parent the window to be a child of the created frame like i've done with http://nunzioweb.com/daz/gen_embedwnd/ (funny how this comes up just after i sorted out the basis of that example yesterday).

the example doesn't show how to skin the internal parts either via wa_dlg.h or by using some of the apis exported by the media library though that will be coming over the next few days (having almost sorted it out from the amalgam of code i've had trying to control the embedded windows over the years into something that's simple and just does it).

the only issue i can see if using the example project for a dsp (as is your main area ) then there will be issues with some of the aspects of it due to the dynamic loading/unloading of them and that the embedded window unfortunately requires some subclassing of Winamp to ensure it's handled correctly in all cases.


if not there's nothing stopping you using IPC_GETSKIN(W) to get the path of the current skin be it in a wsz/zip/wal (returns the extracted path) or in a folder - is just when it's the classic skin then it returns nothing. from there you can then either manually create the frame as a new window and embed the existing window in as a child control or custom draw the non-client area.

either way you could use the existing image files (reverting to those in winamp.exe if the required ones don't exist) or you could make your own file but getting skinners to make / include it is a nightmare let alone getting them to make 5.x compatible classic skins. i found the information in the skinners atlas readme brilliant for working out what and where the different parts of the skin files is meant to go when i was making my classic skin previewer for the skin manager plug-in.

-daz
DrO is offline   Reply With Quote
Old 16th September 2010, 21:36   #5
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,012
Send a message via Skype™ to thinktink
Awesome, looks like a good starting point. Thanks.
thinktink is offline   Reply With Quote
Old 16th September 2010, 21:48   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
just checked and the things affected by not being able to subclass Winamp's main window would be:
  • catching the WM_COMMAND & WM_SYSCOMMAND messages for an added main menu item isn't possible (i suppose a SetWindowsHookEx(..) could be used but that's evil)
  • the window size wouldn't be correct restored in a weird classic->modern->close winamp->start winamp->back to classic action (it leaves the window after the restart->back to classic in the size of the modern skin frame)
  • handling of a minimised Winamp start-up would be trickier but if done from a dsp then that could be checked in a different way though not 100% sure
so it's not major issues but it could be for some people as i've tried to cover all of the quirks i've found with embedded windows in the example (which i've now got to roll out into a few of my plug-ins as the example code is a lot nicer than what i've been working with as it's evolved over the years).

-daz
DrO is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Tags
classic skin, external window

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