Dante Application Library API
Types.hpp
1 #pragma once
2 
3 #ifdef _WIN32
4 #include <winsock2.h>
5 #include <windows.h>
6 #else
7 #include <stdint.h>
8 #endif
9 
10 #include <string>
11 
12 
13 
14 namespace Audinate { namespace DAL {
15 
16 #define AUDINATE_DAL_INTERFACE_NAME_LENGTH 256
17 
18 #ifdef _WIN32
19 
20 typedef UINT8 Uint8;
21 typedef UINT16 Uint16;
22 typedef UINT32 Uint32;
23 typedef UINT64 Uint64;
24 
25 typedef INT32 Int32;
26 
27 typedef std::wstring InterfaceName;
28 
29 
30 #else
31 
32 typedef uint8_t Uint8;
33 typedef uint16_t Uint16;
34 typedef uint32_t Uint32;
35 typedef uint64_t Uint64;
36 
37 typedef int32_t Int32;
38 
39 typedef std::string InterfaceName;
40 
41 #endif
42 
43 
44 typedef unsigned int InterfaceIndex;
45 typedef unsigned int Error;
46 
47 typedef Uint32 Samplerate;
48 
52 class Version
53 {
54 public:
55  Uint8 mMajor;
56  Uint8 mMinor;
57  Uint16 mBugfix;
59  Version() : mMajor(), mMinor(), mBugfix() {}
60  Version(Uint8 major, Uint8 minor, Uint16 bugfix) : mMajor(major), mMinor(minor), mBugfix(bugfix) {}
61  ~Version() {}
62 
63 
64  bool operator==(const Version & o) const { return mMajor == o.mMajor && mMinor == o.mMinor && mBugfix == o.mBugfix; }
65  bool operator!=(const Version & o) const { return ! operator==(o); }
66  Version& operator=(const Version & o) { mMajor = o.mMajor; mMinor = o.mMinor; mBugfix = o.mBugfix; return *this; }
67 };
68 
72 class DALVersion: public Version
73 {
74 public:
75 
76  Uint16 mBuildNumber;
78  DALVersion() : Version(), mBuildNumber() {}
79  DALVersion(Uint8 major, Uint8 minor, Uint16 bugfix, Uint16 buildNumber) : Version(major, minor, bugfix), mBuildNumber(buildNumber){}
80  ~DALVersion() {}
81 
82 
83  bool operator==(const DALVersion & o) const { return mMajor == o.mMajor && mMinor == o.mMinor && mBugfix == o.mBugfix && mBuildNumber == o.mBuildNumber; }
84  bool operator!=(const DALVersion & o) const { return !operator==(o); }
85  DALVersion& operator=(const DALVersion & o) { mMajor = o.mMajor; mMinor = o.mMinor; mBugfix = o.mBugfix; mBuildNumber = o.mBuildNumber; return *this; }
86 };
87 
88 #define AUDINATE_DAL_ID64_LENGTH 8
89 
90 class Id64
91 {
92 public:
93  Uint8 mData[AUDINATE_DAL_ID64_LENGTH];
94 
95  Id64(Uint8 b0, Uint8 b1, Uint8 b2, Uint8 b3, Uint8 b4, Uint8 b5, Uint8 b6, Uint8 b7): mData() { mData[0] = b0; mData[1] = b1; mData[2] = b2; mData[3] = b3; mData[4] = b4; mData[5] = b5; mData[6] = b6; mData[7] = b7; }
96  Id64(): mData() {}
97  ~Id64() {}
98 
99  bool operator==(const Id64 & o) const { return !memcmp(mData, o.mData, AUDINATE_DAL_ID64_LENGTH); }
100  bool operator!=(const Id64 & o) const { return ! operator==(o); }
101  Id64& operator=(const Id64 & o) { memcpy(mData, o.mData, AUDINATE_DAL_ID64_LENGTH); return *this; }
102 };
103 
104 
105 
106 
107 }; };
Audinate::DAL::DALVersion::mBuildNumber
Uint16 mBuildNumber
Build version number.
Definition: Types.hpp:76
Audinate::DAL::Version::mMajor
Uint8 mMajor
Major version number.
Definition: Types.hpp:55
Audinate::DAL::Version
A Version class used for tracking updates to your DAL Dante device.
Definition: Types.hpp:52
Audinate::DAL::Version::mBugfix
Uint16 mBugfix
Bugfix version number.
Definition: Types.hpp:57
Audinate::DAL::Id64
Definition: Types.hpp:90
Audinate::DAL::Version::mMinor
Uint8 mMinor
Minor version number.
Definition: Types.hpp:56
Audinate::DAL::DALVersion
The DALVersion class used for tracking updates to the DAL library.
Definition: Types.hpp:72