diff options
Diffstat (limited to 'Src/Plugins/Library/ml_nft')
-rw-r--r-- | Src/Plugins/Library/ml_nft/api__ml_nft.h | 15 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/listview.cpp | 128 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/listview.h | 144 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/main.cpp | 111 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/main.h | 24 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/ml_nft.rc | 128 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/ml_nft.vcxproj | 313 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/ml_nft.vcxproj.filters | 88 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/resource.h | 20 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/resources/NFT_16x16.bmp | bin | 0 -> 822 bytes | |||
-rw-r--r-- | Src/Plugins/Library/ml_nft/resources/_NFT_16x16.png | bin | 0 -> 456 bytes | |||
-rw-r--r-- | Src/Plugins/Library/ml_nft/version.rc2 | 39 | ||||
-rw-r--r-- | Src/Plugins/Library/ml_nft/view.cpp | 388 |
13 files changed, 1398 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_nft/api__ml_nft.h b/Src/Plugins/Library/ml_nft/api__ml_nft.h new file mode 100644 index 00000000..6924cab3 --- /dev/null +++ b/Src/Plugins/Library/ml_nft/api__ml_nft.h @@ -0,0 +1,15 @@ +#ifndef NULLSOFT_API_ML_NFT_H +#define NULLSOFT_API_ML_NFT_H + +#include <api/service/waServiceFactory.h> + +#include "../Agave/Language/api_language.h" + +#include "../Winamp/api_stats.h" +extern api_stats *statsApi; +#define AGAVE_API_STATS statsApi + +#include <api/application/api_application.h> +#define WASABI_API_APP applicationApi + +#endif // !NULLSOFT_API_ML_NFT_H
\ No newline at end of file diff --git a/Src/Plugins/Library/ml_nft/listview.cpp b/Src/Plugins/Library/ml_nft/listview.cpp new file mode 100644 index 00000000..a3ceb22c --- /dev/null +++ b/Src/Plugins/Library/ml_nft/listview.cpp @@ -0,0 +1,128 @@ +/* +** Copyright (C) 2003 Nullsoft, Inc. +** +** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held +** liable for any damages arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to +** alter it and redistribute it freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. +** If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +** +** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +** +** 3. This notice may not be removed or altered from any source distribution. +** +*/ + +#include <windows.h> +#include <commctrl.h> +#include "listview.h" + +#ifdef GEN_ML_EXPORTS +#include "main.h" // for getting the font +#include "config.h" +#endif +// bp Comment: all the calls beginning "ListView_" are +// MACROs defined in commctrl.h + +void W_ListView :: AddCol (char *text, int w) +{ + LVCOLUMN lvc={0,}; + lvc.mask = LVCF_TEXT|LVCF_WIDTH; + lvc.pszText = text; + if (w) lvc.cx=w; + ListView_InsertColumn (m_hwnd, m_col, &lvc); + m_col++; +} + +int W_ListView::GetColumnWidth (int col) +{ + if (col < 0 || col >= m_col) return 0; + return ListView_GetColumnWidth (m_hwnd, col); +} + + +int W_ListView::GetParam (int p) +{ + LVITEM lvi={0,}; + lvi.mask = LVIF_PARAM; + lvi.iItem = p; + ListView_GetItem (m_hwnd, &lvi); + return lvi.lParam; +} + +int W_ListView::InsertItem (int p, char *text, int param) +{ + LVITEM lvi={0,}; + lvi.mask = LVIF_TEXT | LVIF_PARAM; + lvi.iItem = p; + lvi.pszText = text; + lvi.cchTextMax=strlen (text); + lvi.lParam = param; + return ListView_InsertItem (m_hwnd, &lvi); +} + + +void W_ListView::SetItemText (int p, int si, char *text) +{ + LVITEM lvi={0,}; + lvi.iItem = p; + lvi.iSubItem = si; + lvi.mask = LVIF_TEXT; + lvi.pszText = text; + lvi.cchTextMax = strlen (text); + ListView_SetItem (m_hwnd, &lvi); +} + +void W_ListView::SetItemParam (int p, int param) +{ + LVITEM lvi={0,}; + lvi.iItem = p; + lvi.mask=LVIF_PARAM; + lvi.lParam=param; + ListView_SetItem (m_hwnd, &lvi); +} + +void W_ListView::refreshFont () +{ + if (m_font) + { + DeleteFont (m_font); + SetWindowFont (m_hwnd, NULL, FALSE); + } + m_font = NULL; + + HWND h; +#ifdef GEN_ML_EXPORTS + h=g_hwnd; +#else + h=m_libraryparent; +#endif + if (h && m_allowfonts) + { + int a=SendMessage (h, WM_USER+0x1000 /*WM_ML_IPC*/,66, 0x0600 /*ML_IPC_SKIN_WADLG_GETFUNC*/); + if (a) + { + m_font= (HFONT)a; + SetWindowFont (m_hwnd, m_font, FALSE); + } + } + InvalidateRect (m_hwnd, NULL, TRUE); +} + +void W_ListView::setallowfonts (int allow) +{ + m_allowfonts=allow; +} + +void W_ListView::setwnd (HWND hwnd) +{ + m_hwnd = hwnd; + if (hwnd) + { + ListView_SetExtendedListViewStyle (hwnd, LVS_EX_FULLROWSELECT|LVS_EX_UNDERLINEHOT ); + refreshFont (); + } +} diff --git a/Src/Plugins/Library/ml_nft/listview.h b/Src/Plugins/Library/ml_nft/listview.h new file mode 100644 index 00000000..5938a4dc --- /dev/null +++ b/Src/Plugins/Library/ml_nft/listview.h @@ -0,0 +1,144 @@ +/* +** Copyright (C) 2003 Nullsoft, Inc. +** +** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held +** liable for any damages arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to +** alter it and redistribute it freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. +** If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +** +** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +** +** 3. This notice may not be removed or altered from any source distribution. +** +*/ +#if 0 +#ifndef _LISTVIEW_H_ +#define _LISTVIEW_H_ + +#include <windows.h> +#include <windowsx.h> +#include <commctrl.h> + +class W_ListView +{ +public: + W_ListView() + { + m_hwnd=NULL; + m_col=0; + m_allowfonts=1; + m_font=NULL; +#ifndef GEN_ML_EXPORTS + m_libraryparent=NULL; +#endif + } + W_ListView(HWND hwnd) + { + m_hwnd=NULL; + m_col=0; + m_allowfonts=1; + m_font=NULL; +#ifndef GEN_ML_EXPORTS + m_libraryparent=NULL; +#endif + setwnd(hwnd); + } + ~W_ListView() + { + if (m_font) DeleteFont(m_font); + m_font=0; + } + + void refreshFont(); + +#ifndef GEN_ML_EXPORTS + void setLibraryParentWnd(HWND hwndParent) + { + m_libraryparent=hwndParent; + }// for Winamp Font getting stuff +#endif + void setallowfonts(int allow=1); + void setwnd(HWND hwnd); + void AddCol(char *text, int w); + int GetCount(void) + { + return ListView_GetItemCount(m_hwnd); + } + int GetParam(int p); + void DeleteItem(int n) + { + ListView_DeleteItem(m_hwnd,n); + } + void Clear(void) + { + ListView_DeleteAllItems(m_hwnd); + } + int GetSelected(int x) + { + return(ListView_GetItemState(m_hwnd, x, LVIS_SELECTED) & LVIS_SELECTED)?1:0; + } + + int GetSelectedCount() + { + return ListView_GetSelectedCount(m_hwnd); + } + + int GetSelectionMark() + { + return ListView_GetSelectionMark(m_hwnd); + } + void SetSelected(int x) + { + ListView_SetItemState(m_hwnd,x,LVIS_SELECTED,LVIS_SELECTED); + } + int InsertItem(int p, char *text, int param); + void GetItemRect(int i, RECT *r) + { + ListView_GetItemRect(m_hwnd, i, r, LVIR_BOUNDS); + } + void SetItemText(int p, int si, char *text); + void SetItemParam(int p, int param); + + void GetText(int p, int si, char *text, int maxlen) + { + ListView_GetItemText(m_hwnd, p, si, text, maxlen); + } + int FindItemByParam(int param) + { + LVFINDINFO fi={LVFI_PARAM,0,param}; + return ListView_FindItem(m_hwnd,-1,&fi); + } + int FindItemByPoint(int x, int y) + { + int l=GetCount(); + for (int i=0;i<l;i++) + { + RECT r; + GetItemRect(i, &r); + if (r.left<=x && r.right>=x && r.top<=y && r.bottom>=y) return i; + } + return -1; + } + int GetColumnWidth(int col); + HWND getwnd(void) + { + return m_hwnd; + } + +protected: + HWND m_hwnd; + HFONT m_font; + int m_col; + int m_allowfonts; +#ifndef GEN_ML_EXPORTS + HWND m_libraryparent; +#endif +}; + +#endif//_LISTVIEW_H_ + +#endif
\ No newline at end of file diff --git a/Src/Plugins/Library/ml_nft/main.cpp b/Src/Plugins/Library/ml_nft/main.cpp new file mode 100644 index 00000000..aa7fcc71 --- /dev/null +++ b/Src/Plugins/Library/ml_nft/main.cpp @@ -0,0 +1,111 @@ +#define PLUGIN_VERSION L"0.1" + +#include <strsafe.h> + +#include "Main.h" +#include "../nu/AutoWide.h" + +#include "../../General/gen_ml/menu.h" +#include "../../General/gen_ml/ml_ipc_0313.h" + +#include "../WAT/WAT.h" + +static int Init(); +static void Quit(); + +extern "C" winampMediaLibraryPlugin plugin = +{ + MLHDR_VER, + "nullsoft(ml_nft.dll)", + Init, + Quit, + nft_pluginMessageProc, + 0, + 0, + 0, +}; + +int nft_treeItem = 0; + +HCURSOR hDragNDropCursor; +C_Config *g_config = 0; +WNDPROC waProc = 0; + +// wasabi based services for localisation support +api_language *WASABI_API_LNG = 0; +HINSTANCE WASABI_API_LNG_HINST = 0; +HINSTANCE WASABI_API_ORIG_HINST = 0; +api_stats *AGAVE_API_STATS = 0; +api_application *WASABI_API_APP = 0; + +static DWORD WINAPI wa_newWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) +{ + if ( waProc ) + return (DWORD)CallWindowProcW( waProc, hwnd, msg, wParam, lParam ); + else + return (DWORD)DefWindowProc( hwnd, msg, wParam, lParam ); +} + +int Init() +{ + waProc = (WNDPROC)SetWindowLongPtrW( plugin.hwndWinampParent, GWLP_WNDPROC, (LONG_PTR)wa_newWndProc ); + + mediaLibrary.library = plugin.hwndLibraryParent; + mediaLibrary.winamp = plugin.hwndWinampParent; + mediaLibrary.instance = plugin.hDllInstance; + + waServiceFactory *sf = plugin.service->service_getServiceByGuid( languageApiGUID ); + if ( sf ) + WASABI_API_LNG = reinterpret_cast<api_language *>( sf->getInterface() ); + + sf = plugin.service->service_getServiceByGuid( AnonymousStatsGUID ); + if ( sf ) + AGAVE_API_STATS = reinterpret_cast<api_stats *>( sf->getInterface() ); + + sf = plugin.service->service_getServiceByGuid( applicationApiServiceGuid ); + if ( sf ) + WASABI_API_APP = reinterpret_cast<api_application *>( sf->getInterface() ); + + // need to have this initialised before we try to do anything with localisation features + WASABI_API_START_LANG( plugin.hDllInstance, MlNFTLangGUID ); + + static wchar_t szDescription[ 256 ]; + StringCchPrintfW( szDescription, ARRAYSIZE( szDescription ), WASABI_API_LNGSTRINGW( IDS_NULLSOFT_NFT ), PLUGIN_VERSION ); + plugin.description = (char *)szDescription; + + wchar_t inifile[ MAX_PATH ] = { 0 }; + mediaLibrary.BuildPath( L"Plugins", inifile, MAX_PATH ); + CreateDirectoryW( inifile, NULL ); + + mediaLibrary.BuildPath( L"Plugins\\gen_ml.ini", inifile, MAX_PATH ); + g_config = new C_Config( inifile ); + + hDragNDropCursor = LoadCursor( GetModuleHandle( L"gen_ml.dll" ), MAKEINTRESOURCE( ML_IDC_DRAGDROP ) ); + + NAVINSERTSTRUCT nis = { 0 }; + nis.item.cbSize = sizeof( NAVITEM ); + nis.item.pszText = WASABI_API_LNGSTRINGW( IDS_NFT ); + nis.item.pszInvariant = L"NFT Library"; + nis.item.mask = NIMF_TEXT | NIMF_TEXTINVARIANT | NIMF_IMAGE | NIMF_IMAGESEL; + nis.item.iSelectedImage = nis.item.iImage = mediaLibrary.AddTreeImageBmp( IDB_TREEITEM_NFT ); + + // map to item id (will probably have to change but is a quick port to support invariant item naming) + NAVITEM nvItem = { sizeof( NAVITEM ),0,NIMF_ITEMID, }; + nvItem.hItem = MLNavCtrl_InsertItem( plugin.hwndLibraryParent, &nis ); + MLNavItem_GetInfo( plugin.hwndLibraryParent, &nvItem ); + nft_treeItem = nvItem.id; + + + return 0; +} + +void Quit() +{ + if ( g_config != 0 ) + delete g_config; +} + +extern "C" __declspec(dllexport) winampMediaLibraryPlugin *winampGetMediaLibraryPlugin() +{ + return &plugin; +}
\ No newline at end of file diff --git a/Src/Plugins/Library/ml_nft/main.h b/Src/Plugins/Library/ml_nft/main.h new file mode 100644 index 00000000..fd93d9a7 --- /dev/null +++ b/Src/Plugins/Library/ml_nft/main.h @@ -0,0 +1,24 @@ +#ifndef NULLSOFT_NFT_MAIN_H +#define NULLSOFT_NFT_MAIN_H + +#include <windows.h> +#include "../Plugins/General/gen_ml/ml.h" +#include "../nu/MediaLibraryInterface.h" +#include "resource.h" +#include <windowsx.h> +#include "resource.h" +#include "../winamp/wa_ipc.h" +#include "../Plugins/General/gen_ml/ml.h" +#include "../Plugins/General/gen_ml/config.h" +#include "api__ml_nft.h" + + +#define NFT_BASE_URL L"https://nftlib.winamp.com/" + +extern winampMediaLibraryPlugin plugin; +INT_PTR nft_pluginMessageProc( int message_type, INT_PTR param1, INT_PTR param2, INT_PTR param3 ); +extern int nft_treeItem; + + + +#endif // !NULLSOFT_NFT_MAIN_H
\ No newline at end of file diff --git a/Src/Plugins/Library/ml_nft/ml_nft.rc b/Src/Plugins/Library/ml_nft/ml_nft.rc new file mode 100644 index 00000000..1eefde12 --- /dev/null +++ b/Src/Plugins/Library/ml_nft/ml_nft.rc @@ -0,0 +1,128 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#include ""version.rc2""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_VIEW_NFT DIALOGEX 0, 0, 184, 92 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN +EXSTYLE WS_EX_ACCEPTFILES | WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_LIST_NFT,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_TABSTOP,0,0,184,79 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_TREEITEM_NFT BITMAP "resources\\NFT_16x16.bmp" + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_VIEW_NFT, DIALOG + BEGIN + RIGHTMARGIN, 123 + BOTTOMMARGIN, 61 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// AFX_DIALOG_LAYOUT +// + +IDD_VIEW_NFT AFX_DIALOG_LAYOUT +BEGIN + 0 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_NULLSOFT_NFT "Nullsoft NFT Library v%s" + 65535 "{C1DE900F-8047-4B04-AE6B-8EACD9A9B8E1}" +END + +STRINGTABLE +BEGIN + IDS_NFT "NFT Library" +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#include "version.rc2" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Src/Plugins/Library/ml_nft/ml_nft.vcxproj b/Src/Plugins/Library/ml_nft/ml_nft.vcxproj new file mode 100644 index 00000000..9c3c7b60 --- /dev/null +++ b/Src/Plugins/Library/ml_nft/ml_nft.vcxproj @@ -0,0 +1,313 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{31463181-D72E-4613-A306-8446F2946179}</ProjectGuid> + <RootNamespace>ml_nft</RootNamespace> + <WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir> + <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir> + <IncludePath>$(IncludePath)</IncludePath> + <LibraryPath>$(LibraryPath)</LibraryPath> + <EmbedManifest>true</EmbedManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir> + <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir> + <EmbedManifest>true</EmbedManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir> + <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir> + <IncludePath>$(IncludePath)</IncludePath> + <LibraryPath>$(LibraryPath)</LibraryPath> + <EmbedManifest>true</EmbedManifest> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir> + <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir> + <EmbedManifest>true</EmbedManifest> + </PropertyGroup> + <PropertyGroup Label="Vcpkg"> + <VcpkgEnableManifest>false</VcpkgEnableManifest> + <VcpkgEnabled>false</VcpkgEnabled> + </PropertyGroup> + <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <VcpkgInstalledDir> + </VcpkgInstalledDir> + <VcpkgUseStatic>false</VcpkgUseStatic> + <VcpkgConfiguration>Debug</VcpkgConfiguration> + </PropertyGroup> + <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <VcpkgInstalledDir> + </VcpkgInstalledDir> + <VcpkgUseStatic>false</VcpkgUseStatic> + </PropertyGroup> + <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <VcpkgInstalledDir> + </VcpkgInstalledDir> + <VcpkgUseStatic>false</VcpkgUseStatic> + <VcpkgConfiguration>Debug</VcpkgConfiguration> + </PropertyGroup> + <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <VcpkgInstalledDir> + </VcpkgInstalledDir> + <VcpkgUseStatic>false</VcpkgUseStatic> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_WIN32_WINNT=0x0601;WINVER=0x0601;WIN32;_DEBUG;_WINDOWS;_USRDLL;ML_NFT_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>false</MinimalRebuild> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <BufferSecurityCheck>true</BufferSecurityCheck> + <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName> + </ClCompile> + <Link> + <AdditionalDependencies>comctl32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> + <TargetMachine>MachineX86</TargetMachine> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ModuleDefinitionFile> + </ModuleDefinitionFile> + </Link> + <PostBuildEvent> + <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ +xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command> + <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message> + </PostBuildEvent> + <ResourceCompile> + <PreprocessorDefinitions>_WIN32_WINNT=0x0601;WINVER=0x0601;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Manifest> + <OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).intermediate.manifest</OutputManifestFile> + </Manifest> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_WIN32_WINNT=0x0601;WINVER=0x0601;WIN64;_DEBUG;_WINDOWS;_USRDLL;ML_NFT_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>false</MinimalRebuild> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4302;4311;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <BufferSecurityCheck>true</BufferSecurityCheck> + <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName> + </ClCompile> + <Link> + <AdditionalDependencies>comctl32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + </Link> + <PostBuildEvent> + <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ +xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command> + <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message> + </PostBuildEvent> + <ResourceCompile> + <PreprocessorDefinitions>_WIN32_WINNT=0x0601;WINVER=0x0601;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Manifest> + <OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).intermediate.manifest</OutputManifestFile> + </Manifest> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MinSpace</Optimization> + <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> + <AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_WIN32_WINNT=0x0601;WINVER=0x0601;WIN32;NDEBUG;_WINDOWS;_USRDLL;ML_NFT_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName> + </ClCompile> + <Link> + <AdditionalDependencies>comctl32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <GenerateDebugInformation>false</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> + <TargetMachine>MachineX86</TargetMachine> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ModuleDefinitionFile> + </ModuleDefinitionFile> + </Link> + <PostBuildEvent> + <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command> + <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message> + </PostBuildEvent> + <ResourceCompile> + <PreprocessorDefinitions>_WIN32_WINNT=0x0601;WINVER=0x0601;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Manifest> + <OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).intermediate.manifest</OutputManifestFile> + </Manifest> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>MinSpace</Optimization> + <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> + <AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_WIN32_WINNT=0x0601;WINVER=0x0601;WIN64;NDEBUG;_WINDOWS;_USRDLL;ML_NFT_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <DisableSpecificWarnings>4302;4311;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName> + </ClCompile> + <Link> + <AdditionalDependencies>comctl32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <GenerateDebugInformation>false</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <ModuleDefinitionFile> + </ModuleDefinitionFile> + </Link> + <PostBuildEvent> + <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command> + <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message> + </PostBuildEvent> + <ResourceCompile> + <PreprocessorDefinitions>_WIN32_WINNT=0x0601;WINVER=0x0601;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <Manifest> + <OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).intermediate.manifest</OutputManifestFile> + </Manifest> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\nu\MediaLibraryInterface.cpp" /> + <ClCompile Include="..\..\General\gen_ml\config.cpp" /> + <ClCompile Include="..\..\General\gen_ml\menu.cpp" /> + <ClCompile Include="..\..\..\nu\DialogSkinner.cpp" /> + <ClCompile Include="..\..\..\nu\listview.cpp" /> + <ClCompile Include="main.cpp" /> + <ClCompile Include="view.cpp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\nu\listview.h" /> + <ClInclude Include="..\..\..\nu\MediaLibraryInterface.h" /> + <ClInclude Include="..\..\General\gen_ml\config.h" /> + <ClInclude Include="..\..\General\gen_ml\menu.h" /> + <ClInclude Include="..\..\..\nu\DialogSkinner.h" /> + <ClInclude Include="api__ml_nft.h" /> + <ClInclude Include="main.h" /> + <ClInclude Include="resource.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="ml_nft.rc" /> + </ItemGroup> + <ItemGroup> + <Image Include="resources\nft_16x16.bmp" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\Wasabi\Wasabi.vcxproj"> + <Project>{3e0bfa8a-b86a-42e9-a33f-ec294f823f7f}</Project> + </ProjectReference> + <ProjectReference Include="..\..\..\WAT\WAT.vcxproj"> + <Project>{c5714908-a71f-4644-bd95-aad8ee7914da}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Src/Plugins/Library/ml_nft/ml_nft.vcxproj.filters b/Src/Plugins/Library/ml_nft/ml_nft.vcxproj.filters new file mode 100644 index 00000000..121f1986 --- /dev/null +++ b/Src/Plugins/Library/ml_nft/ml_nft.vcxproj.filters @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClCompile Include="view.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="main.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\..\General\gen_ml\config.cpp"> + <Filter>Source Files\gen_ml</Filter> + </ClCompile> + <ClCompile Include="..\..\..\nu\DialogSkinner.cpp"> + <Filter>Source Files\nu</Filter> + </ClCompile> + <ClCompile Include="..\..\..\nu\listview.cpp"> + <Filter>Source Files\nu</Filter> + </ClCompile> + <ClCompile Include="..\..\..\nu\MediaLibraryInterface.cpp"> + <Filter>Source Files\nu</Filter> + </ClCompile> + <ClCompile Include="..\..\General\gen_ml\menu.cpp"> + <Filter>Source Files\gen_ml</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="api__ml_nft.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="main.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\General\gen_ml\config.h"> + <Filter>Header Files\gen_ml</Filter> + </ClInclude> + <ClInclude Include="..\..\..\nu\DialogSkinner.h"> + <Filter>Header Files\nu</Filter> + </ClInclude> + <ClInclude Include="..\..\..\nu\MediaLibraryInterface.h"> + <Filter>Header Files\nu</Filter> + </ClInclude> + <ClInclude Include="..\..\General\gen_ml\menu.h"> + <Filter>Header Files\gen_ml</Filter> + </ClInclude> + <ClInclude Include="..\..\..\nu\listview.h"> + <Filter>Header Files\nu</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <Filter Include="Header Files"> + <UniqueIdentifier>{b4c6c983-ad68-4d2d-a542-7f1bf6b1c155}</UniqueIdentifier> + </Filter> + <Filter Include="Ressource Files"> + <UniqueIdentifier>{f072eba6-51ff-4c40-b136-bf3c79f3e120}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files"> + <UniqueIdentifier>{b04fff17-1af4-4d74-b609-169c1a32b097}</UniqueIdentifier> + </Filter> + <Filter Include="Image Files"> + <UniqueIdentifier>{56f5b459-ac0f-423d-b448-563135bf4bd8}</UniqueIdentifier> + </Filter> + <Filter Include="Header Files\gen_ml"> + <UniqueIdentifier>{0f139e2a-24a0-4f2f-8ef5-9f429704fc09}</UniqueIdentifier> + </Filter> + <Filter Include="Header Files\nu"> + <UniqueIdentifier>{33c224c5-9689-4e39-9fc1-95b30d7f72fd}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\gen_ml"> + <UniqueIdentifier>{2a93abc4-8246-41d7-b991-d111d36d5353}</UniqueIdentifier> + </Filter> + <Filter Include="Source Files\nu"> + <UniqueIdentifier>{b1c88e02-70f6-4a54-80fc-60a246835520}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="ml_nft.rc"> + <Filter>Ressource Files</Filter> + </ResourceCompile> + </ItemGroup> + <ItemGroup> + <Image Include="resources\nft_16x16.bmp"> + <Filter>Image Files</Filter> + </Image> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Src/Plugins/Library/ml_nft/resource.h b/Src/Plugins/Library/ml_nft/resource.h new file mode 100644 index 00000000..9e1bc082 --- /dev/null +++ b/Src/Plugins/Library/ml_nft/resource.h @@ -0,0 +1,20 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ml_nft.rc +// +#define IDS_NFT 1 +#define IDD_VIEW_NFT 102 +#define IDC_LIST_NFT 1001 +#define IDB_TREEITEM_NFT 1003 +#define IDS_NULLSOFT_NFT 65534 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 114 +#define _APS_NEXT_COMMAND_VALUE 40013 +#define _APS_NEXT_CONTROL_VALUE 1010 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/Src/Plugins/Library/ml_nft/resources/NFT_16x16.bmp b/Src/Plugins/Library/ml_nft/resources/NFT_16x16.bmp Binary files differnew file mode 100644 index 00000000..b781254b --- /dev/null +++ b/Src/Plugins/Library/ml_nft/resources/NFT_16x16.bmp diff --git a/Src/Plugins/Library/ml_nft/resources/_NFT_16x16.png b/Src/Plugins/Library/ml_nft/resources/_NFT_16x16.png Binary files differnew file mode 100644 index 00000000..9e27b323 --- /dev/null +++ b/Src/Plugins/Library/ml_nft/resources/_NFT_16x16.png diff --git a/Src/Plugins/Library/ml_nft/version.rc2 b/Src/Plugins/Library/ml_nft/version.rc2 new file mode 100644 index 00000000..102a3f3e --- /dev/null +++ b/Src/Plugins/Library/ml_nft/version.rc2 @@ -0,0 +1,39 @@ + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +#include "../../../Winamp/buildType.h" +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,1,0,0 + PRODUCTVERSION WINAMP_PRODUCTVER + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Winamp SA" + VALUE "FileDescription", "Winamp Media Library Plug-in" + VALUE "FileVersion", "0,1,0,0" + VALUE "InternalName", "Nullsoft NFT Library" + VALUE "LegalCopyright", "Copyright © 2003-2023 Winamp SA" + VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA" + VALUE "OriginalFilename", "ml_nft.dll" + VALUE "ProductName", "Winamp" + VALUE "ProductVersion", STR_WINAMP_PRODUCTVER + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/Src/Plugins/Library/ml_nft/view.cpp b/Src/Plugins/Library/ml_nft/view.cpp new file mode 100644 index 00000000..7d03e13c --- /dev/null +++ b/Src/Plugins/Library/ml_nft/view.cpp @@ -0,0 +1,388 @@ +#include <strsafe.h> + +#include "main.h" + +#include "../nu/DialogSkinner.h" +#include "../nu/ListView.h" + +#include "../../General/gen_ml/ml_ipc.h" +#include "../../General/gen_ml/menu.h" + +#include "../WAT/WAT.h" + +INT_PTR CALLBACK view_NFTDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam); +static W_ListView m_nft_list; +static HWND m_headerhwnd, m_hwnd; +extern C_Config *g_config; +extern char *g_ext_list; +static int customAllowed; +static viewButtons view; + +C_Config *g_wa_config = 0; +char *g_ext_list = 0; + +// used for the send-to menu bits +static INT_PTR IPC_LIBRARY_SENDTOMENU; +static librarySendToMenuStruct s; +BOOL myMenu = FALSE; + +extern HMENU g_context_menus, g_context_menus2; +extern HCURSOR hDragNDropCursor; + + +static int NFT_contextMenu( INT_PTR param1, HWND hHost, POINTS pts ) +{ + return TRUE; +} + +static int pluginHandleIpcMessage(int msg, int param) +{ + return (int)SendMessage( plugin.hwndLibraryParent, WM_ML_IPC, param, msg ); +} + +INT_PTR nft_pluginMessageProc(int message_type, INT_PTR param1, INT_PTR param2, INT_PTR param3) +{ + if (message_type == ML_MSG_NO_CONFIG) + { + return TRUE; + } + else if (message_type == ML_MSG_TREE_ONCREATEVIEW && param1 == nft_treeItem ) + { + return (INT_PTR)WASABI_API_CREATEDIALOGW(IDD_VIEW_NFT, (HWND)param2, view_NFTDialogProc); + } + else if (message_type == ML_MSG_NAVIGATION_CONTEXTMENU) + { + return NFT_contextMenu(param1, (HWND)param2, MAKEPOINTS(param3)); + } + else if (message_type == ML_MSG_ONSENDTOSELECT || message_type == ML_MSG_TREE_ONDROPTARGET) + { + // set with droptarget defaults =) + UINT_PTR type = 0,data = 0; + + if (message_type == ML_MSG_ONSENDTOSELECT) + { + if (param3 != (INT_PTR)nft_pluginMessageProc) return 0; + + type=(int)param1; + data = (int)param2; + } + else + { + if (param1 != nft_treeItem ) return 0; + + type=(int)param2; + data=(int)param3; + + if (!data) + { + return (type == ML_TYPE_ITEMRECORDLISTW || type == ML_TYPE_ITEMRECORDLIST || + type == ML_TYPE_FILENAMES || type == ML_TYPE_STREAMNAMES || + type == ML_TYPE_FILENAMESW || type == ML_TYPE_STREAMNAMESW || + type == ML_TYPE_CDTRACKS || + type == ML_TYPE_PLAYLIST || type == ML_TYPE_PLAYLISTS) ? 1 : -1; + } + } + } + + + return 0; +} + + +static HRGN g_rgnUpdate = NULL; +static int offsetX = 0, offsetY = 0; + +typedef struct _LAYOUT +{ + INT id; + HWND hwnd; + INT x; + INT y; + INT cx; + INT cy; + DWORD flags; + HRGN rgn; +} +LAYOUT, PLAYOUT; + +#define SETLAYOUTPOS(_layout, _x, _y, _cx, _cy) { _layout->x=_x; _layout->y=_y;_layout->cx=_cx;_layout->cy=_cy;_layout->rgn=NULL; } +#define SETLAYOUTFLAGS(_layout, _r) \ + { \ + BOOL fVis; \ + fVis = (WS_VISIBLE & (LONG)GetWindowLongPtr(_layout->hwnd, GWL_STYLE)); \ + if (_layout->x == _r.left && _layout->y == _r.top) _layout->flags |= SWP_NOMOVE; \ + if (_layout->cx == (_r.right - _r.left) && _layout->cy == (_r.bottom - _r.top)) _layout->flags |= SWP_NOSIZE; \ + if ((SWP_HIDEWINDOW & _layout->flags) && !fVis) _layout->flags &= ~SWP_HIDEWINDOW; \ + if ((SWP_SHOWWINDOW & _layout->flags) && fVis) _layout->flags &= ~SWP_SHOWWINDOW; \ + } + +#define LAYOUTNEEEDUPDATE(_layout) ((SWP_NOMOVE | SWP_NOSIZE) != ((SWP_NOMOVE | SWP_NOSIZE | SWP_HIDEWINDOW | SWP_SHOWWINDOW) & _layout->flags)) + +#define GROUP_MIN 0x1 +#define GROUP_MAX 0x2 +#define GROUP_STATUSBAR 0x1 +#define GROUP_MAIN 0x2 + +static void LayoutWindows(HWND hwnd, BOOL fRedraw, BOOL fUpdateAll = FALSE) +{ + static INT controls[] = + { + GROUP_STATUSBAR, GROUP_MAIN, IDC_LIST_NFT + }; + + INT index; + RECT rc, rg, ri; + LAYOUT layout[sizeof(controls)/sizeof(controls[0])], *pl; + BOOL skipgroup; + HRGN rgn = NULL; + + GetClientRect(hwnd, &rc); + if ( rc.right == rc.left || rc.bottom == rc.top ) + return; + + if ( rc.right > WASABI_API_APP->getScaleX( 4 ) ) + rc.right -= WASABI_API_APP->getScaleX( 4 ); + + SetRect(&rg, rc.left, rc.top, rc.right, rc.top); + + pl = layout; + skipgroup = FALSE; + + InvalidateRect(hwnd, NULL, TRUE); + + for (index = 0; index < sizeof(controls) / sizeof(*controls); index++) + { + if (controls[index] >= GROUP_MIN && controls[index] <= GROUP_MAX) // group id + { + skipgroup = FALSE; + switch (controls[index]) + { + case GROUP_MAIN: + SetRect(&rg, rc.left + WASABI_API_APP->getScaleX(1), rc.top, rc.right, rc.bottom); + break; + } + continue; + } + if (skipgroup) continue; + + pl->id = controls[index]; + pl->hwnd = GetDlgItem(hwnd, pl->id); + if (!pl->hwnd) continue; + + GetWindowRect(pl->hwnd, &ri); + MapWindowPoints(HWND_DESKTOP, hwnd, (LPPOINT)&ri, 2); + pl->flags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS; + + switch (pl->id) + { + case IDC_LIST_NFT: + pl->flags |= (rg.top < rg.bottom) ? SWP_SHOWWINDOW : SWP_HIDEWINDOW; + SETLAYOUTPOS(pl, rg.left, rg.top + WASABI_API_APP->getScaleY(1), + rg.right - rg.left + WASABI_API_APP->getScaleY(1), + (rg.bottom - rg.top) - WASABI_API_APP->getScaleY(2)); + break; + } + + SETLAYOUTFLAGS(pl, ri); + if (LAYOUTNEEEDUPDATE(pl)) + { + if (SWP_NOSIZE == ((SWP_HIDEWINDOW | SWP_SHOWWINDOW | SWP_NOSIZE) & pl->flags) && + ri.left == (pl->x + offsetX) && ri.top == (pl->y + offsetY) && IsWindowVisible(pl->hwnd)) + { + SetRect(&ri, pl->x, pl->y, pl->cx + pl->x, pl->y + pl->cy); + ValidateRect(hwnd, &ri); + } + pl++; + } + else if ((fRedraw || (!offsetX && !offsetY)) && IsWindowVisible(pl->hwnd)) + { + ValidateRect(hwnd, &ri); + if (GetUpdateRect(pl->hwnd, NULL, FALSE)) + { + if (!rgn) rgn = CreateRectRgn(0, 0, 0, 0); + GetUpdateRgn(pl->hwnd, rgn, FALSE); + OffsetRgn(rgn, pl->x, pl->y); + InvalidateRgn(hwnd, rgn, FALSE); + } + } + } + + if (pl != layout) + { + LAYOUT *pc; + HDWP hdwp = BeginDeferWindowPos((INT)(pl - layout)); + for(pc = layout; pc < pl && hdwp; pc++) + { + hdwp = DeferWindowPos(hdwp, pc->hwnd, NULL, pc->x, pc->y, pc->cx, pc->cy, pc->flags); + } + if (hdwp) EndDeferWindowPos(hdwp); + + if (!rgn) rgn = CreateRectRgn(0, 0, 0, 0); + + if (fRedraw) + { + GetUpdateRgn(hwnd, rgn, FALSE); + for(pc = layout; pc < pl && hdwp; pc++) + { + if (pc->rgn) + { + OffsetRgn(pc->rgn, pc->x, pc->y); + CombineRgn(rgn, rgn, pc->rgn, RGN_OR); + } + } + + RedrawWindow(hwnd, NULL, rgn, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASENOW | RDW_ALLCHILDREN); + } + if (g_rgnUpdate) + { + GetUpdateRgn(hwnd, g_rgnUpdate, FALSE); + for(pc = layout; pc < pl && hdwp; pc++) + { + if (pc->rgn) + { + OffsetRgn(pc->rgn, pc->x, pc->y); + CombineRgn(g_rgnUpdate, g_rgnUpdate, pc->rgn, RGN_OR); + } + } + } + + for(pc = layout; pc < pl && hdwp; pc++) if (pc->rgn) DeleteObject(pc->rgn); + } + + if (rgn) DeleteObject(rgn); + ValidateRgn(hwnd, NULL); +} + +static BOOL NFT_OnDisplayChange() +{ + ListView_SetTextColor(m_nft_list.getwnd(),dialogSkinner.Color(WADLG_ITEMFG)); + ListView_SetBkColor(m_nft_list.getwnd(),dialogSkinner.Color(WADLG_ITEMBG)); + ListView_SetTextBkColor(m_nft_list.getwnd(),dialogSkinner.Color(WADLG_ITEMBG)); + m_nft_list.SetFont(dialogSkinner.GetFont()); + LayoutWindows(m_hwnd, TRUE); + return 0; +} + + +enum +{ + BPM_ECHO_WM_COMMAND = 0x1, // send WM_COMMAND and return value + BPM_WM_COMMAND = 0x2, // just send WM_COMMAND +}; + +static BOOL NFT_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) +{ + return FALSE; +} + +static BOOL NFT_OnDestroy(HWND hwnd) +{ + m_hwnd = 0; + + return FALSE; +} + +static BOOL NFT_OnNotify(HWND hwnd, NMHDR *notification) +{ + if (notification->idFrom== IDC_LIST_NFT ) + { + if (notification->code == LVN_BEGINDRAG) + { + SetCapture(hwnd); + } + } + return FALSE; +} + +static BOOL NFT_OnInitDialog(HWND hwndDlg, HWND hwndFocus, LPARAM lParam) +{ + m_hwnd = hwndDlg; + m_nft_list.setwnd(GetDlgItem(hwndDlg, IDC_LIST_NFT )); + + if (!view.play) + { + SENDMLIPC(plugin.hwndLibraryParent, ML_IPC_GET_VIEW_BUTTON_TEXT, (WPARAM)&view); + } + + + NFT_OnDisplayChange(); + + m_headerhwnd = ListView_GetHeader( m_nft_list.getwnd() ); + + // v5.66+ - re-use the old predixis parts so the button can be used functionally via ml_enqplay + // pass the hwnd, button id and plug-in id so the ml plug-in can check things as needed + customAllowed = FALSE; + + MLSKINWINDOW m = {0}; + m.skinType = SKINNEDWND_TYPE_DIALOG; + m.style = SWS_USESKINCOLORS | SWS_USESKINCURSORS | SWS_USESKINFONT; + m.hwndToSkin = hwndDlg; + + MLSkinWindow(plugin.hwndLibraryParent, &m); + + + ShellExecuteW( NULL, L"open", NFT_BASE_URL, NULL, NULL, SW_SHOWNORMAL ); + + delete g_wa_config; + + SetTimer( hwndDlg, 100, 15, NULL ); + + + return TRUE; +} + +INT_PTR CALLBACK view_NFTDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam) +{ + INT_PTR a = dialogSkinner.Handle(hwndDlg, uMsg, wParam, lParam); + if (a) return a; + + switch(uMsg) + { + HANDLE_MSG(hwndDlg, WM_INITDIALOG, NFT_OnInitDialog); + HANDLE_MSG(hwndDlg, WM_COMMAND, NFT_OnCommand); + HANDLE_MSG(hwndDlg, WM_DESTROY, NFT_OnDestroy); + + case WM_WINDOWPOSCHANGED: + if ((SWP_NOSIZE | SWP_NOMOVE) != ((SWP_NOSIZE | SWP_NOMOVE) & ((WINDOWPOS*)lParam)->flags) || + (SWP_FRAMECHANGED & ((WINDOWPOS*)lParam)->flags)) + { + LayoutWindows(hwndDlg, !(SWP_NOREDRAW & ((WINDOWPOS*)lParam)->flags)); + } + return 0; + + case WM_USER + 0x200: + SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, 1); // yes, we support no - redraw resize + return TRUE; + + case WM_USER + 0x201: + offsetX = (short)LOWORD(wParam); + offsetY = (short)HIWORD(wParam); + g_rgnUpdate = (HRGN)lParam; + return TRUE; + + case WM_PAINT: + { + int tab[] = { IDC_LIST_NFT |DCW_SUNKENBORDER}; + dialogSkinner.Draw(hwndDlg, tab, sizeof(tab) / sizeof(tab[0])); + } + return 0; + + case WM_INITMENUPOPUP: + if (wParam && (HMENU)wParam == s.build_hMenu && s.mode==1) + { + myMenu = TRUE; + if(SendMessage(plugin.hwndWinampParent, WM_WA_IPC, (WPARAM)&s, IPC_LIBRARY_SENDTOMENU)==0xffffffff) + s.mode=2; + myMenu = FALSE; + } + return 0; + + case WM_DISPLAYCHANGE: + return NFT_OnDisplayChange(); + + case WM_NOTIFY: + return NFT_OnNotify(hwndDlg, (LPNMHDR)lParam); + } + + return FALSE; +}
\ No newline at end of file |