diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/attributes.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Winamp/attributes.h')
-rw-r--r-- | Src/Winamp/attributes.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/Src/Winamp/attributes.h b/Src/Winamp/attributes.h new file mode 100644 index 00000000..419f8aab --- /dev/null +++ b/Src/Winamp/attributes.h @@ -0,0 +1,94 @@ +#ifndef NULLSOFT_WINAMP_ATTRIBUTES_H +#define NULLSOFT_WINAMP_ATTRIBUTES_H + +#include "../Agave/Config/ifc_configitem.h" + +class _bool_base : public ifc_configitem +{ +public: + _bool_base(); + bool GetBool(); + void SetBool(bool boolValue); + intptr_t GetInt(); + void SetInt(intptr_t intValue); + operator intptr_t(); + intptr_t operator =(intptr_t intValue); + bool operator =(bool boolValue); + operator bool(); + operator UINT(); // for CheckDlgButton + bool operator !(); +protected: + bool value; +}; + +class _bool : public _bool_base +{ +public: + _bool(bool defaultValue); +protected: + RECVS_DISPATCH; +}; + +/* _mutable_bool allows the config item to be changed via users of api_config */ +class _mutable_bool : public _bool_base +{ +public: + _mutable_bool(bool defaultValue); +protected: + RECVS_DISPATCH; +}; + +class _unsigned : public ifc_configitem +{ +public: + _unsigned(); + _unsigned(uintptr_t defaultValue); + + uintptr_t GetUnsigned() { return value; } + uintptr_t operator =(uintptr_t uintValue); + operator uintptr_t() { return value; } + +protected: + RECVS_DISPATCH; +private: + uintptr_t value; +}; + +class _int : public ifc_configitem +{ +public: + _int(); + _int(intptr_t defaultValue); + + intptr_t GetInt() { return value; } + float GetFloat() { return (float)value; } + intptr_t operator =(intptr_t uintValue); + operator intptr_t() { return value; } + +protected: + RECVS_DISPATCH; +private: + intptr_t value; +}; + +class _float : public ifc_configitem +{ +public: + _float(); + _float(float defaultValue); + + intptr_t GetInt() { return (intptr_t)value; } + intptr_t operator =(intptr_t uintValue); + operator intptr_t() { return static_cast<intptr_t>(value); } + + float GetFloat() { return value; } + float operator =(float uintValue); + operator float () { return value; } + +protected: + RECVS_DISPATCH; +private: + float value; +}; + +#endif
\ No newline at end of file |