mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 02:25:46 -04:00
Initial community commit
This commit is contained in:
1
Src/tagz/.gitattributes
vendored
Normal file
1
Src/tagz/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
tagz.txt eol=crlf
|
312
Src/tagz/FMT.cpp
Normal file
312
Src/tagz/FMT.cpp
Normal file
@ -0,0 +1,312 @@
|
||||
#include "tagz.h"
|
||||
#include "functions.h"
|
||||
#include <windows.h>
|
||||
#include <shlwapi.h>
|
||||
#include "api__tagz.h"
|
||||
#include "resource.h"
|
||||
|
||||
void CopyChar(LPTSTR dest, LPCTSTR src)
|
||||
{
|
||||
LPTSTR end = CharNext(src);
|
||||
int count = (int)(end-src);
|
||||
if (count <= 0) return;
|
||||
while (count--)
|
||||
{
|
||||
*dest++=*src++;
|
||||
}
|
||||
}
|
||||
|
||||
static int CharacterCompare(LPCTSTR ch1, LPCTSTR ch2)
|
||||
{
|
||||
TCHAR str1[3]={0,0,0}, str2[3]={0,0,0};
|
||||
|
||||
CopyChar(str1, ch1);
|
||||
CopyChar(str2, ch2);
|
||||
|
||||
return memcmp(str1, str2, 3*sizeof(TCHAR));
|
||||
}
|
||||
|
||||
static bool skipshit(wchar_t ** _p, wchar_t *skipCharacters)
|
||||
{
|
||||
LPTSTR p = *_p;
|
||||
int paranCount = 0, bracketCount = 0;
|
||||
while (p && *p)
|
||||
{
|
||||
if (!paranCount && !bracketCount && skipCharacters)
|
||||
{
|
||||
LPTSTR skipChar = skipCharacters;
|
||||
while (skipChar && *skipChar)
|
||||
{
|
||||
if (!CharacterCompare(skipChar, p))
|
||||
break;
|
||||
skipChar++;
|
||||
}
|
||||
if (skipChar && *skipChar)
|
||||
break;
|
||||
}
|
||||
|
||||
if (*p == L'\'')
|
||||
{
|
||||
p = CharNext(p);
|
||||
while (p && *p && *p != L'\'')
|
||||
p = CharNext(p);
|
||||
if (!p || p && !*p)
|
||||
return 0;
|
||||
}
|
||||
else if (*p == L'(')
|
||||
{
|
||||
paranCount++;
|
||||
}
|
||||
else if (*p == L')')
|
||||
{
|
||||
if (--paranCount < 0)
|
||||
return 0;
|
||||
}
|
||||
else if (*p == L'[')
|
||||
{
|
||||
bracketCount++;
|
||||
}
|
||||
else if (*p == L']')
|
||||
{
|
||||
if (--bracketCount < 0)
|
||||
return 0;
|
||||
}
|
||||
p = CharNext(p);
|
||||
}
|
||||
*_p = p;
|
||||
return *p && !paranCount && !bracketCount;
|
||||
}
|
||||
|
||||
void FMT::run()
|
||||
{
|
||||
if (!spec)
|
||||
{
|
||||
Error();
|
||||
return ;
|
||||
}
|
||||
while (spec && *spec)
|
||||
{
|
||||
if (*spec == L'%')
|
||||
{
|
||||
spec = CharNext(spec);
|
||||
if (spec && *spec == L'%')
|
||||
{
|
||||
str.AddChar(L'%');
|
||||
spec = CharNext(spec);
|
||||
continue;
|
||||
}
|
||||
|
||||
wchar_t *s1 = CharNext(spec);
|
||||
while (s1 && *s1 && *s1 != L'%')
|
||||
s1 = CharNext(s1);
|
||||
|
||||
if (!s1 || !*s1)
|
||||
{
|
||||
Error();
|
||||
break;
|
||||
}
|
||||
|
||||
*s1 = 0;
|
||||
wchar_t *tag = tagProvider->GetTag(spec, parameters);
|
||||
*s1 = L'%';
|
||||
if (tag && tag[0])
|
||||
{
|
||||
found++;
|
||||
str.AddString(tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
// this isgay
|
||||
//str.AddString(_TX("?"));
|
||||
}
|
||||
if (tag)
|
||||
tagProvider->FreeTag(tag);
|
||||
spec = CharNext(s1);
|
||||
}
|
||||
else if (*spec == L'$')
|
||||
{
|
||||
spec = CharNext(spec);
|
||||
if (spec && *spec == L'$')
|
||||
{
|
||||
str.AddChar(L'$');
|
||||
spec = CharNext(spec);
|
||||
continue;
|
||||
}
|
||||
wchar_t *s1 = CharNext(spec);
|
||||
while (s1 && *s1 && *s1 != L'(')
|
||||
s1 = CharNext(s1);
|
||||
|
||||
if (!s1 || !*s1)
|
||||
{
|
||||
Error();
|
||||
break;
|
||||
}
|
||||
wchar_t *s2 = CharNext(s1);
|
||||
if (!skipshit(&s2, L")"))
|
||||
{
|
||||
Error();
|
||||
break;
|
||||
}
|
||||
if (!s2 || !*s2)
|
||||
{
|
||||
Error();
|
||||
break;
|
||||
}
|
||||
wchar_t *p = CharNext(s1);
|
||||
wchar_t *temp[64] = {0};
|
||||
size_t temp_f[64] = {0};
|
||||
size_t nt = 0;
|
||||
wchar_t *p1 = CharNext(s1);
|
||||
while (p && p <= s2 && nt < 64)
|
||||
{
|
||||
if (!skipshit(&p, L",)"))
|
||||
{
|
||||
Error();
|
||||
return ;
|
||||
}
|
||||
if (p > s2 || (*p != L',' && *p != L')'))
|
||||
{
|
||||
Error(WASABI_API_LNGSTRINGW(IDS_INTERNAL_ERROR));
|
||||
return ;
|
||||
}
|
||||
wchar_t bk = *p;
|
||||
*p = 0;
|
||||
temp[nt] = _FMT(p1, &temp_f[nt]);
|
||||
nt++;
|
||||
*p = bk;;
|
||||
p1 = CharNext(p);
|
||||
p = CharNext(p);
|
||||
}
|
||||
*s1 = 0;
|
||||
size_t n;
|
||||
TEXTFUNC fn = 0;
|
||||
for (n = 0;FUNCS[n].func;n++)
|
||||
{
|
||||
if (!StrCmpI(spec, FUNCS[n].name))
|
||||
{
|
||||
fn = FUNCS[n].func;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*s1 = L'(';
|
||||
if (fn)
|
||||
{
|
||||
fn(nt, temp, temp_f, &str, vars);
|
||||
}
|
||||
else
|
||||
{
|
||||
str.AddString(WASABI_API_LNGSTRINGW(IDS_UNKNOWN_FUNCTION));
|
||||
}
|
||||
for (n = 0;n < nt;n++)
|
||||
free(temp[n]);
|
||||
spec = CharNext(s2);
|
||||
}
|
||||
else if (*spec == L'\'')
|
||||
{
|
||||
spec = CharNext(spec);
|
||||
if (spec && *spec == L'\'')
|
||||
{
|
||||
str.AddChar(L'\'');
|
||||
spec++;
|
||||
continue;
|
||||
}
|
||||
LPTSTR s1 = CharNext(spec);
|
||||
while (s1 && *s1 && *s1 != L'\'')
|
||||
s1 = CharNext(s1);
|
||||
if (!s1 || !*s1)
|
||||
{
|
||||
Error();
|
||||
break;
|
||||
}
|
||||
*s1 = 0;
|
||||
str.AddString(spec);
|
||||
*s1 = L'\'';
|
||||
spec = CharNext(s1);
|
||||
}
|
||||
else if (*spec == L'[')
|
||||
{
|
||||
spec = CharNext(spec);
|
||||
LPTSTR s1 = spec;
|
||||
if (!skipshit(&s1, L"]"))
|
||||
{
|
||||
Error();
|
||||
break;
|
||||
}
|
||||
wchar_t bk = *s1;
|
||||
*s1 = 0;
|
||||
FMT fmt(this, spec);
|
||||
fmt.run();
|
||||
if (fmt.found)
|
||||
{
|
||||
wchar_t *zz = fmt;
|
||||
str.AddString(zz);
|
||||
found += fmt.found;
|
||||
free(zz);
|
||||
}
|
||||
*s1 = bk;
|
||||
spec = CharNext(s1);
|
||||
}
|
||||
else if (*spec == L']' || *spec == L'(' || *spec == L')')
|
||||
{
|
||||
Error();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
str.AddDBChar(spec);
|
||||
spec = CharNext(spec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FMT::FMT(const wchar_t *p_spec, ifc_tagprovider *_tagProvider, ifc_tagparams *_parameters, VarList * _vars)
|
||||
: vars(_vars), tagProvider(_tagProvider), parameters(_parameters),
|
||||
found(0)
|
||||
{
|
||||
org_spec = spec = _wcsdup(p_spec);
|
||||
}
|
||||
|
||||
void FMT::Open(const wchar_t *p_spec, ifc_tagprovider *_tagProvider, ifc_tagparams *_parameters, VarList * _vars)
|
||||
{
|
||||
vars=_vars;
|
||||
tagProvider = _tagProvider;
|
||||
parameters = _parameters;
|
||||
org_spec = spec = _wcsdup(p_spec);
|
||||
}
|
||||
|
||||
FMT::operator LPTSTR()
|
||||
{
|
||||
run();
|
||||
return str.GetBuf();
|
||||
}
|
||||
|
||||
void FMT::Error(wchar_t *e)
|
||||
{
|
||||
str.Reset();
|
||||
str.AddString(e ? e : WASABI_API_LNGSTRINGW(IDS_SYNTAX_ERROR_IN_STRING));
|
||||
}
|
||||
|
||||
FMT::FMT(FMT* base, wchar_t *_spec)
|
||||
{
|
||||
vars = base->vars;
|
||||
found = 0;
|
||||
org_spec = 0;
|
||||
tagProvider = base->tagProvider;
|
||||
parameters=base->parameters;
|
||||
spec = _spec;
|
||||
}
|
||||
|
||||
wchar_t * FMT::_FMT(wchar_t * s, size_t *f)
|
||||
{
|
||||
FMT fmt(this, s);
|
||||
wchar_t * c = (wchar_t *)fmt;
|
||||
if (f) *f = fmt.found;
|
||||
found += fmt.found;
|
||||
return c;
|
||||
}
|
||||
|
||||
FMT::~FMT()
|
||||
{
|
||||
if (org_spec)
|
||||
free(org_spec);
|
||||
}
|
10
Src/tagz/api__tagz.h
Normal file
10
Src/tagz/api__tagz.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef NULLSOFT_TAGZ_API_H
|
||||
#define NULLSOFT_TAGZ_API_H
|
||||
#include <api/service/api_service.h>
|
||||
|
||||
extern api_service *serviceManager;
|
||||
#define WASABI_API_SVC serviceManager
|
||||
|
||||
#include "../Agave/Language/api_language.h"
|
||||
|
||||
#endif // !NULLSOFT_TAGZ_API_H
|
3
Src/tagz/api_tagz.cpp
Normal file
3
Src/tagz/api_tagz.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#include "api_tagz.h"
|
||||
|
||||
/* Empty file. It just exists to make sure that api_tagz.h is #includable by itself */
|
56
Src/tagz/api_tagz.h
Normal file
56
Src/tagz/api_tagz.h
Normal file
@ -0,0 +1,56 @@
|
||||
#ifndef NULLSOFT_API_TAGZH
|
||||
#define NULLSOFT_API_TAGZH
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
#include <bfc/platform/types.h>
|
||||
#include "ifc_tagprovider.h"
|
||||
#include "ifc_tagparams.h"
|
||||
|
||||
enum
|
||||
{
|
||||
TAGZ_SUCCESS=0,
|
||||
TAGZ_FAILURE=1,
|
||||
TAGZ_UNDEFINED_VARIABLE=2,
|
||||
};
|
||||
|
||||
class api_tagz : public Dispatchable
|
||||
{
|
||||
protected:
|
||||
api_tagz() {}
|
||||
~api_tagz() {}
|
||||
public:
|
||||
DISPATCH_CODES
|
||||
{
|
||||
API_TAGZ_FORMAT = 10,
|
||||
API_TAGZ_HELP_STRING=20,
|
||||
API_TAGZ_ADD_FUNC=30,
|
||||
API_TAGZ_SET_VARIABLE = 40,
|
||||
};
|
||||
|
||||
int format(const wchar_t *spec, wchar_t *out, size_t outCch, ifc_tagprovider *tagProvider, ifc_tagparams *parameters);
|
||||
char *manual();
|
||||
void SetVariable(const wchar_t *name, const wchar_t *value);
|
||||
//TODO: int AddFunction();
|
||||
};
|
||||
|
||||
inline int api_tagz::format(const wchar_t *spec, wchar_t *out, size_t outCch, ifc_tagprovider *tagProvider, ifc_tagparams *parameters)
|
||||
{
|
||||
return _call(API_TAGZ_FORMAT, (int)0, spec, out, outCch, tagProvider, parameters);
|
||||
}
|
||||
|
||||
inline char *api_tagz::manual()
|
||||
{
|
||||
return _call(API_TAGZ_HELP_STRING, (char *)0);
|
||||
}
|
||||
|
||||
inline void api_tagz::SetVariable(const wchar_t *name, const wchar_t *value)
|
||||
{
|
||||
_voidcall(API_TAGZ_SET_VARIABLE, name, value);
|
||||
}
|
||||
|
||||
// {063CD9FD-57C1-4da2-9A8F-15FFFA9ABF50}
|
||||
static const GUID tagzGUID =
|
||||
{ 0x63cd9fd, 0x57c1, 0x4da2, { 0x9a, 0x8f, 0x15, 0xff, 0xfa, 0x9a, 0xbf, 0x50 } };
|
||||
|
||||
|
||||
#endif
|
64
Src/tagz/factory_tagz.cpp
Normal file
64
Src/tagz/factory_tagz.cpp
Normal file
@ -0,0 +1,64 @@
|
||||
//#define GUID_EQUALS_DEFINED
|
||||
#include "api__tagz.h"
|
||||
#include "factory_tagz.h"
|
||||
#include "impl_tagz.h"
|
||||
|
||||
Tagz tagz;
|
||||
|
||||
static const char serviceName[] = "Advanced Title Formatter";
|
||||
|
||||
FOURCC TagzFactory::GetServiceType()
|
||||
{
|
||||
return WaSvc::UNIQUE;
|
||||
}
|
||||
|
||||
const char *TagzFactory::GetServiceName()
|
||||
{
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
GUID TagzFactory::GetGUID()
|
||||
{
|
||||
return tagzGUID;
|
||||
}
|
||||
|
||||
void *TagzFactory::GetInterface(int global_lock)
|
||||
{
|
||||
return &tagz;
|
||||
}
|
||||
|
||||
int TagzFactory::SupportNonLockingInterface()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int TagzFactory::ReleaseInterface(void *ifc)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *TagzFactory::GetTestString()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int TagzFactory::ServiceNotify(int msg, int param1, int param2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef CBCLASS
|
||||
#undef CBCLASS
|
||||
#endif
|
||||
|
||||
#define CBCLASS TagzFactory
|
||||
START_DISPATCH;
|
||||
CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
|
||||
CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
|
||||
CB(WASERVICEFACTORY_GETGUID, GetGUID)
|
||||
CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
|
||||
CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
|
||||
CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
|
||||
CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
|
||||
CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
|
||||
END_DISPATCH;
|
23
Src/tagz/factory_tagz.h
Normal file
23
Src/tagz/factory_tagz.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef NULLSOFT_FACTORY_TAGZH
|
||||
#define NULLSOFT_FACTORY_TAGZH
|
||||
|
||||
#include <api/service/waservicefactory.h>
|
||||
#include <api/service/services.h>
|
||||
|
||||
class TagzFactory : public waServiceFactory
|
||||
{
|
||||
public:
|
||||
FOURCC GetServiceType();
|
||||
const char *GetServiceName();
|
||||
GUID GetGUID();
|
||||
void *GetInterface(int global_lock);
|
||||
int SupportNonLockingInterface();
|
||||
int ReleaseInterface(void *ifc);
|
||||
const char *GetTestString();
|
||||
int ServiceNotify(int msg, int param1, int param2);
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
};
|
||||
|
||||
#endif
|
1213
Src/tagz/functions.cpp
Normal file
1213
Src/tagz/functions.cpp
Normal file
File diff suppressed because it is too large
Load Diff
19
Src/tagz/functions.h
Normal file
19
Src/tagz/functions.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef NULLSOFT_FUNCTIONSH
|
||||
#define NULLSOFT_FUNCTIONSH
|
||||
|
||||
#include "string.h"
|
||||
#include "varlist.h"
|
||||
|
||||
typedef void (*TEXTFUNC)(size_t n_src, wchar_t **src, size_t *, tagz_::string *out, VarList *vars);
|
||||
|
||||
struct TextFunction
|
||||
{
|
||||
TEXTFUNC func;
|
||||
const wchar_t *name;
|
||||
};
|
||||
|
||||
extern TextFunction FUNCS[];
|
||||
|
||||
#define TABSIZE(x) (sizeof(x)/sizeof(*x))
|
||||
|
||||
#endif
|
1
Src/tagz/ifc_tagparams.cpp
Normal file
1
Src/tagz/ifc_tagparams.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "ifc_tagparams.h"
|
31
Src/tagz/ifc_tagparams.h
Normal file
31
Src/tagz/ifc_tagparams.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef NULLSOFT_TAGZ_IFC_TAGPARAMS_H
|
||||
#define NULLSOFT_TAGZ_IFC_TAGPARAMS_H
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
#include <bfc/platform/types.h>
|
||||
|
||||
// {7CF804EA-8882-4d45-A4AC-52983815D82C}
|
||||
static const GUID filenameParameterID =
|
||||
{ 0x7cf804ea, 0x8882, 0x4d45, { 0xa4, 0xac, 0x52, 0x98, 0x38, 0x15, 0xd8, 0x2c } };
|
||||
|
||||
|
||||
class ifc_tagparams : public Dispatchable
|
||||
{
|
||||
protected:
|
||||
ifc_tagparams() {}
|
||||
~ifc_tagparams() {}
|
||||
public:
|
||||
void *GetParameter(const GUID *parameterID);
|
||||
protected:
|
||||
DISPATCH_CODES
|
||||
{
|
||||
IFC_TAGPARAMS_GETPARAMETER = 10,
|
||||
};
|
||||
};
|
||||
|
||||
inline void *ifc_tagparams::GetParameter(const GUID *parameterID)
|
||||
{
|
||||
return _call(IFC_TAGPARAMS_GETPARAMETER, (void *)0, parameterID);
|
||||
}
|
||||
|
||||
#endif
|
3
Src/tagz/ifc_tagprovider.cpp
Normal file
3
Src/tagz/ifc_tagprovider.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#include "ifc_tagprovider.h"
|
||||
|
||||
/* Empty file. It just exists to make sure that ifc_tagprovider.h is #includable by itself */
|
34
Src/tagz/ifc_tagprovider.h
Normal file
34
Src/tagz/ifc_tagprovider.h
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef NULLSOFT_TAG_PROVIDER_H
|
||||
#define NULLSOFT_TAG_PROVIDER_H
|
||||
|
||||
#include <bfc/dispatch.h>
|
||||
#include <bfc/platform/types.h>
|
||||
#include "ifc_tagparams.h"
|
||||
#include <api/service/services.h>
|
||||
|
||||
class ifc_tagprovider : public Dispatchable
|
||||
{
|
||||
protected:
|
||||
ifc_tagprovider() {}
|
||||
~ifc_tagprovider() {}
|
||||
public:
|
||||
DISPATCH_CODES
|
||||
{
|
||||
IFC_TAGPROVIDER_GET_TAG = 10,
|
||||
IFC_TAGPROVIDER_FREE_TAG = 20,
|
||||
};
|
||||
|
||||
wchar_t *GetTag(const wchar_t *name, ifc_tagparams *parameters); //return 0 if not found
|
||||
void FreeTag(wchar_t *tag);
|
||||
};
|
||||
|
||||
inline wchar_t *ifc_tagprovider::GetTag(const wchar_t *name, ifc_tagparams *parameters)
|
||||
{
|
||||
return _call(IFC_TAGPROVIDER_GET_TAG, (wchar_t *)0, name, parameters);
|
||||
}
|
||||
|
||||
inline void ifc_tagprovider::FreeTag(wchar_t *tag)
|
||||
{
|
||||
_voidcall(IFC_TAGPROVIDER_FREE_TAG, tag);
|
||||
}
|
||||
#endif
|
55
Src/tagz/impl_tagz.cpp
Normal file
55
Src/tagz/impl_tagz.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
#include "impl_tagz.h"
|
||||
#include "tagz.h"
|
||||
#include "api__tagz.h"
|
||||
#include "resource.h"
|
||||
|
||||
int Tagz::Format(const wchar_t *spec, wchar_t *out, size_t outCch, ifc_tagprovider *tagProvider, ifc_tagparams *parameters)
|
||||
{
|
||||
VarList vars;
|
||||
FMT formatter;
|
||||
formatter.Open(spec, tagProvider, parameters, &vars);
|
||||
wchar_t *zz = formatter;
|
||||
if (zz)
|
||||
{
|
||||
lstrcpyn(out, zz, (int)outCch);
|
||||
free(zz);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(out, 0, (int)outCch);
|
||||
}
|
||||
return TAGZ_SUCCESS;
|
||||
}
|
||||
|
||||
char *Tagz::Manual()
|
||||
{
|
||||
return (char*)WASABI_API_LOADRESFROMFILEW(L"TEXT", MAKEINTRESOURCE(IDR_TAGZ_TEXT), 0);
|
||||
}
|
||||
|
||||
void Tagz::SetVariable(const wchar_t *name, const wchar_t *value)
|
||||
{
|
||||
/*vars.Put(name, value);*/
|
||||
}
|
||||
|
||||
int Tagz::GetVariable(const wchar_t *name, wchar_t *value, size_t valueLen)
|
||||
{
|
||||
return TAGZ_FAILURE;
|
||||
/*
|
||||
wchar_t *val = vars.Get(name);
|
||||
if (!val)
|
||||
return TAGZ_UNDEFINED_VARIABLE;
|
||||
lstrcpynW(value, val, (int)valueLen);
|
||||
return TAGZ_SUCCESS;
|
||||
*/
|
||||
}
|
||||
|
||||
#ifdef CBCLASS
|
||||
#undef CBCLASS
|
||||
#endif
|
||||
|
||||
#define CBCLASS Tagz
|
||||
START_DISPATCH;
|
||||
CB(API_TAGZ_FORMAT, Format)
|
||||
CB(API_TAGZ_HELP_STRING, Manual)
|
||||
VCB(API_TAGZ_SET_VARIABLE, SetVariable)
|
||||
END_DISPATCH;
|
19
Src/tagz/impl_tagz.h
Normal file
19
Src/tagz/impl_tagz.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef NULLSOFT_IMPL_TAGZ_H
|
||||
#define NULLSOFT_IMPL_TAGZ_H
|
||||
|
||||
#include "api_tagz.h"
|
||||
#include "tagz.h"
|
||||
|
||||
class Tagz : public api_tagz
|
||||
{
|
||||
public:
|
||||
int Format(const wchar_t *spec, wchar_t *out, size_t outCch, ifc_tagprovider *tagProvider, ifc_tagparams *parameters);
|
||||
char *Manual();
|
||||
void SetVariable(const wchar_t *name, const wchar_t *value);
|
||||
int GetVariable(const wchar_t *name, wchar_t *value, size_t valueLen);
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
};
|
||||
|
||||
#endif
|
70
Src/tagz/main.cpp
Normal file
70
Src/tagz/main.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
#include "api__tagz.h"
|
||||
#include "api_tagz.h"
|
||||
#include "../Agave/Component/ifc_wa5component.h"
|
||||
#include "factory_tagz.h"
|
||||
|
||||
TagzFactory tagsFactory;
|
||||
|
||||
class TagzComponent : public ifc_wa5component
|
||||
{
|
||||
public:
|
||||
void RegisterServices(api_service *service);
|
||||
int RegisterServicesSafeModeOk();
|
||||
void DeregisterServices(api_service *service);
|
||||
|
||||
protected:
|
||||
RECVS_DISPATCH;
|
||||
};
|
||||
|
||||
TagzComponent tagzComponent;
|
||||
api_service *serviceManager=0;
|
||||
|
||||
// wasabi based services for localisation support
|
||||
api_language *WASABI_API_LNG = 0;
|
||||
HINSTANCE WASABI_API_LNG_HINST = 0, WASABI_API_ORIG_HINST = 0;
|
||||
|
||||
static HINSTANCE GetMyInstance()
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi = {0};
|
||||
if(VirtualQuery(GetMyInstance, &mbi, sizeof(mbi)))
|
||||
return (HINSTANCE)mbi.AllocationBase;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void TagzComponent::RegisterServices(api_service *service)
|
||||
{
|
||||
WASABI_API_SVC = service;
|
||||
WASABI_API_SVC->service_register(&tagsFactory);
|
||||
|
||||
waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(languageApiGUID);
|
||||
if (sf) WASABI_API_LNG = reinterpret_cast<api_language*>(sf->getInterface());
|
||||
|
||||
// need to have this initialised before we try to do anything with localisation features
|
||||
WASABI_API_START_LANG(GetMyInstance(),tagzLangGUID);
|
||||
}
|
||||
|
||||
void TagzComponent::DeregisterServices(api_service *service)
|
||||
{
|
||||
service->service_deregister(&tagsFactory);
|
||||
}
|
||||
|
||||
int TagzComponent::RegisterServicesSafeModeOk()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) ifc_wa5component *GetWinamp5SystemComponent()
|
||||
{
|
||||
return &tagzComponent;
|
||||
}
|
||||
|
||||
#ifdef CBCLASS
|
||||
#undef CBCLASS
|
||||
#endif
|
||||
|
||||
#define CBCLASS TagzComponent
|
||||
START_DISPATCH;
|
||||
VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices)
|
||||
CB(15, RegisterServicesSafeModeOk)
|
||||
VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices)
|
||||
END_DISPATCH;
|
23
Src/tagz/resource.h
Normal file
23
Src/tagz/resource.h
Normal file
@ -0,0 +1,23 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by tagz.rc
|
||||
//
|
||||
#define IDS_INTERNAL_ERROR 1
|
||||
#define IDS_UNKNOWN_FUNCTION 2
|
||||
#define IDS_SYNTAX_ERROR_IN_STRING 3
|
||||
#define IDS_INVALID_IF_SYNTAX 4
|
||||
#define IDS_INVALID_IFLONGER_SYNTAX 5
|
||||
#define IDS_STRING6 6
|
||||
#define IDS_INVALID_IFGREATER_SYNTAX 6
|
||||
#define IDR_TAGZ_TEXT 103
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 106
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
124
Src/tagz/string.cpp
Normal file
124
Src/tagz/string.cpp
Normal file
@ -0,0 +1,124 @@
|
||||
#include "string.h"
|
||||
#include <windows.h>
|
||||
#include <strsafe.h>
|
||||
using namespace tagz_;
|
||||
|
||||
string::string()
|
||||
{
|
||||
data = 0;
|
||||
size = 0;
|
||||
used = 0;
|
||||
}
|
||||
|
||||
void string::AddDBChar(LPTSTR c)
|
||||
{
|
||||
LPTSTR end = CharNext(c);
|
||||
while (c != end)
|
||||
AddChar(*c++);
|
||||
}
|
||||
|
||||
void string::AddChar(TCHAR c)
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
size = 512;
|
||||
data = (LPTSTR)calloc(size, sizeof(TCHAR));
|
||||
if (!data) size = 0;
|
||||
used = 0;
|
||||
}
|
||||
else if (size == used)
|
||||
{
|
||||
size <<= 1;
|
||||
LPTSTR newData = (LPTSTR)realloc((LPTSTR)data, size * sizeof(TCHAR));
|
||||
if (!newData)
|
||||
{
|
||||
free(data);
|
||||
data = (LPTSTR)calloc(size, sizeof(TCHAR));
|
||||
if (!data) size = 0;
|
||||
used = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = newData;
|
||||
memset(data+used, 0, (size - used) * sizeof(TCHAR));
|
||||
}
|
||||
}
|
||||
if (data)
|
||||
data[used++] = c;
|
||||
}
|
||||
|
||||
void string::AddInt(int i)
|
||||
{
|
||||
TCHAR simpleInt[16] = {0};
|
||||
StringCchPrintf(simpleInt, 16, TEXT("%i"), i);
|
||||
AddString(simpleInt);
|
||||
}
|
||||
|
||||
void string::AddString(LPCTSTR z)
|
||||
{
|
||||
while (z && *z)
|
||||
{
|
||||
AddChar(*z);
|
||||
z++;
|
||||
}
|
||||
}
|
||||
|
||||
void string::AddString(string & s)
|
||||
{
|
||||
AddString(s.Peek());
|
||||
}
|
||||
|
||||
string::~string()
|
||||
{
|
||||
if (data) free(data);
|
||||
}
|
||||
|
||||
LPTSTR string::GetBuf()
|
||||
{
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
LPTSTR r = (LPTSTR)realloc(data, (used + 1) * sizeof(TCHAR));
|
||||
if (!r)
|
||||
{
|
||||
free(data);
|
||||
data = 0;
|
||||
size = used + 1;
|
||||
r = (LPTSTR)calloc((used + 1), sizeof(TCHAR));
|
||||
if (!r) size = 0;
|
||||
}
|
||||
if (r) r[used] = 0;
|
||||
data = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
TCHAR string::operator[](size_t i)
|
||||
{
|
||||
if (!data || i >= used)
|
||||
return 0;
|
||||
else
|
||||
return data[i];
|
||||
}
|
||||
|
||||
size_t string::Len()
|
||||
{
|
||||
return data ? used : 0;
|
||||
}
|
||||
|
||||
void string::Reset()
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
free(data);
|
||||
data = 0;
|
||||
}
|
||||
size = 0;
|
||||
used = 0;
|
||||
}
|
||||
|
||||
LPCTSTR string::Peek()
|
||||
{
|
||||
AddChar(0);
|
||||
used--;
|
||||
return data;
|
||||
}
|
28
Src/tagz/string.h
Normal file
28
Src/tagz/string.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef NULLSOFT_TAGZ_STRINGH
|
||||
#define NULLSOFT_TAGZ_STRINGH
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace tagz_
|
||||
{
|
||||
class string
|
||||
{
|
||||
private:
|
||||
LPTSTR data;
|
||||
size_t size,used;
|
||||
public:
|
||||
string();
|
||||
void AddDBChar(LPTSTR c);
|
||||
void AddChar(TCHAR c);
|
||||
void AddInt(int i);
|
||||
void AddString(LPCTSTR z);
|
||||
void AddString(string &s);
|
||||
~string();
|
||||
LPTSTR GetBuf();
|
||||
TCHAR operator[](size_t i);
|
||||
size_t Len();
|
||||
void Reset();
|
||||
LPCTSTR Peek();
|
||||
};
|
||||
}
|
||||
#endif
|
33
Src/tagz/tagz.h
Normal file
33
Src/tagz/tagz.h
Normal file
@ -0,0 +1,33 @@
|
||||
#ifndef NULLSOFT_TAGZH
|
||||
#define NULLSOFT_TAGZH
|
||||
|
||||
#include "string.h"
|
||||
#include "varlist.h"
|
||||
#include "ifc_tagprovider.h"
|
||||
#include "ifc_tagparams.h"
|
||||
|
||||
class FMT
|
||||
{
|
||||
public:
|
||||
FMT() : vars(0), org_spec(0), spec(0), tagProvider(0), parameters(0), found(0) { }
|
||||
FMT(const wchar_t *p_spec, ifc_tagprovider *tagProvider, ifc_tagparams *_parameters, VarList * _vars);
|
||||
operator LPTSTR ();
|
||||
~FMT();
|
||||
void Open(const wchar_t *p_spec, ifc_tagprovider *tagProvider, ifc_tagparams *_parameters, VarList * _vars);
|
||||
|
||||
private:
|
||||
void run();
|
||||
void Error(LPTSTR e = 0);
|
||||
FMT(FMT *base, LPTSTR _spec);
|
||||
LPTSTR _FMT(LPTSTR s, size_t *f = 0);
|
||||
|
||||
private:
|
||||
tagz_::string str;
|
||||
VarList *vars;
|
||||
LPTSTR org_spec, spec;
|
||||
ifc_tagprovider *tagProvider;
|
||||
ifc_tagparams *parameters;
|
||||
int found;
|
||||
};
|
||||
|
||||
#endif
|
103
Src/tagz/tagz.rc
Normal file
103
Src/tagz/tagz.rc
Normal file
@ -0,0 +1,103 @@
|
||||
// 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 (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#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
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXT
|
||||
//
|
||||
|
||||
IDR_TAGZ_TEXT TEXT "tagz.txt"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
65535 "{D40620FB-E44B-47b3-98EE-8E5A089C0C94}"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_INTERNAL_ERROR "internal error"
|
||||
IDS_UNKNOWN_FUNCTION "[UNKNOWN FUNCTION]"
|
||||
IDS_SYNTAX_ERROR_IN_STRING "[SYNTAX ERROR IN FORMATTING STRING]"
|
||||
IDS_INVALID_IF_SYNTAX "[INVALID $IF SYNTAX]"
|
||||
IDS_INVALID_IFLONGER_SYNTAX "[INVALID $IFLONGER SYNTAX]"
|
||||
IDS_INVALID_IFGREATER_SYNTAX "[INVALID $IFGREATER SYNTAX]"
|
||||
END
|
||||
|
||||
#endif // English (U.K.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#include "version.rc2"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
30
Src/tagz/tagz.sln
Normal file
30
Src/tagz/tagz.sln
Normal file
@ -0,0 +1,30 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29509.3
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tagz", "tagz.vcxproj", "{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}.Release|Win32.Build.0 = Release|Win32
|
||||
{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}.Debug|x64.Build.0 = Debug|x64
|
||||
{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}.Release|x64.ActiveCfg = Release|x64
|
||||
{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {85C29539-CFE6-4792-A86B-6AAA0298DD12}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
BIN
Src/tagz/tagz.txt
Normal file
BIN
Src/tagz/tagz.txt
Normal file
Binary file not shown.
269
Src/tagz/tagz.vcxproj
Normal file
269
Src/tagz/tagz.vcxproj
Normal file
@ -0,0 +1,269 @@
|
||||
<?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>{D78D76C9-0AAC-4AFF-B059-E1E88C5A8B83}</ProjectGuid>
|
||||
<RootNamespace>tagz</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>
|
||||
<TargetExt>.w5s</TargetExt>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
<TargetExt>.w5s</TargetExt>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
<TargetExt>.w5s</TargetExt>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
<TargetExt>.w5s</TargetExt>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<VcpkgConfiguration>Debug</VcpkgConfiguration>
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
<VcpkgConfiguration>Debug</VcpkgConfiguration>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;TAGZ_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<ImportLibrary>$(ProjectDir)x86_Debug\$(ProjectName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\
|
||||
xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;TAGZ_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<ImportLibrary>$(ProjectDir)x64_Debug\$(ProjectName).lib</ImportLibrary>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\
|
||||
xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<AdditionalIncludeDirectories>../Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;TAGZ_EXPORTS;%(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>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>$(ProjectDir)x86_Release\$(ProjectName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<AdditionalIncludeDirectories>../Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;TAGZ_EXPORTS;%(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>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>$(ProjectDir)x64_Release\$(ProjectName).lib</ImportLibrary>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="api__tagz.h" />
|
||||
<ClInclude Include="api_tagz.h" />
|
||||
<ClInclude Include="factory_tagz.h" />
|
||||
<ClInclude Include="functions.h" />
|
||||
<ClInclude Include="ifc_tagparams.h" />
|
||||
<ClInclude Include="ifc_tagprovider.h" />
|
||||
<ClInclude Include="impl_tagz.h" />
|
||||
<ClInclude Include="string.h" />
|
||||
<ClInclude Include="tagz.h" />
|
||||
<ClInclude Include="varlist.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="api_tagz.cpp" />
|
||||
<ClCompile Include="factory_tagz.cpp" />
|
||||
<ClCompile Include="FMT.cpp" />
|
||||
<ClCompile Include="functions.cpp" />
|
||||
<ClCompile Include="ifc_tagparams.cpp" />
|
||||
<ClCompile Include="ifc_tagprovider.cpp" />
|
||||
<ClCompile Include="impl_tagz.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="string.cpp" />
|
||||
<ClCompile Include="varlist.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="tagz.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="tagz.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Wasabi\Wasabi.vcxproj">
|
||||
<Project>{3e0bfa8a-b86a-42e9-a33f-ec294f823f7f}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
86
Src/tagz/tagz.vcxproj.filters
Normal file
86
Src/tagz/tagz.vcxproj.filters
Normal file
@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="varlist.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="string.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="impl_tagz.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ifc_tagprovider.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ifc_tagparams.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="functions.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="FMT.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="factory_tagz.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="api_tagz.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="varlist.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tagz.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="string.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="impl_tagz.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ifc_tagprovider.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ifc_tagparams.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="functions.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="factory_tagz.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="api_tagz.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="api__tagz.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="tagz.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{69a90569-a1be-4988-9917-a5745261d4d6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Ressource Files">
|
||||
<UniqueIdentifier>{eceb1929-4690-4408-8885-fea97e006e82}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{694558c9-f512-4df6-9996-7c1d647225b7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="tagz.rc">
|
||||
<Filter>Ressource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
52
Src/tagz/varlist.cpp
Normal file
52
Src/tagz/varlist.cpp
Normal file
@ -0,0 +1,52 @@
|
||||
#include "varlist.h"
|
||||
#include <windows.h>
|
||||
|
||||
VarList::VarList()
|
||||
{
|
||||
vars = 0;
|
||||
}
|
||||
|
||||
VarList::~VarList()
|
||||
{
|
||||
VAR * p = vars;
|
||||
while (p)
|
||||
{
|
||||
VAR *n = p->next;
|
||||
free(p->name);
|
||||
free(p->value);
|
||||
delete p;
|
||||
p = n;
|
||||
}
|
||||
}
|
||||
|
||||
wchar_t *VarList::Get(const wchar_t *name)
|
||||
{
|
||||
VAR * p = vars;
|
||||
while (p)
|
||||
{
|
||||
if (!_wcsicmp(name, p->name))
|
||||
return p->value;
|
||||
p = p->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void VarList::Put(const wchar_t *name, const wchar_t *value)
|
||||
{
|
||||
VAR *p = vars;
|
||||
while (p)
|
||||
{
|
||||
if (!_wcsicmp(name, p->name))
|
||||
{
|
||||
free(p->value);
|
||||
p->value = _wcsdup(value);
|
||||
return;
|
||||
}
|
||||
p = p->next;
|
||||
}
|
||||
p = new VAR;
|
||||
p->next = vars;
|
||||
vars = p;
|
||||
p->value = _wcsdup(value);
|
||||
p->name = _wcsdup(name);
|
||||
}
|
22
Src/tagz/varlist.h
Normal file
22
Src/tagz/varlist.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef NULLSOFT_VARLISTH
|
||||
#define NULLSOFT_VARLISTH
|
||||
|
||||
#include <wchar.h>
|
||||
class VarList
|
||||
{
|
||||
private:
|
||||
struct VAR
|
||||
{
|
||||
VAR *next;
|
||||
wchar_t *name;
|
||||
wchar_t *value;
|
||||
};
|
||||
VAR *vars;
|
||||
public:
|
||||
VarList() ;
|
||||
~VarList();
|
||||
wchar_t *Get(const wchar_t *name);
|
||||
void Put(const wchar_t *name, const wchar_t *value);
|
||||
};
|
||||
|
||||
#endif
|
39
Src/tagz/version.rc2
Normal file
39
Src/tagz/version.rc2
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
#include "../Winamp/buildType.h"
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION WINAMP_PRODUCTVER
|
||||
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 5.x System Component"
|
||||
VALUE "FileVersion", STR_WINAMP_PRODUCTVER
|
||||
VALUE "InternalName", "tagz.w5s"
|
||||
VALUE "LegalCopyright", "Copyright <20> 2005-2023 Winamp SA"
|
||||
VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA"
|
||||
VALUE "OriginalFilename", "tagz.w5s"
|
||||
VALUE "ProductName", "Winamp Tagz Formatting Core Service"
|
||||
VALUE "ProductVersion", STR_WINAMP_PRODUCTVER
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
Reference in New Issue
Block a user