Dante Application Library API
Loading...
Searching...
No Matches
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
14namespace Audinate { namespace DAL {
15
16#define AUDINATE_DAL_INTERFACE_NAME_LENGTH 256
17
18#ifdef _WIN32
19
20typedef UINT8 Uint8;
21typedef UINT16 Uint16;
22typedef UINT32 Uint32;
23typedef UINT64 Uint64;
24
25typedef INT32 Int32;
26
27typedef std::wstring InterfaceName;
28
29
30#else
31
32typedef uint8_t Uint8;
33typedef uint16_t Uint16;
34typedef uint32_t Uint32;
35typedef uint64_t Uint64;
36
37typedef int32_t Int32;
38
39typedef std::string InterfaceName;
40
41#endif
42
43
44typedef unsigned int InterfaceIndex;
45typedef unsigned int Error;
46
47typedef Uint32 Samplerate;
48
52class Version
53{
54public:
55 Uint8 mMajor;
56 Uint8 mMinor;
57 Uint16 mBugfix;
58
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
72class DALVersion: public Version
73{
74public:
75
76 Uint16 mBuildNumber;
77
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
90class Id64
91{
92public:
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}; };
The DALVersion class used for tracking updates to the DAL library.
Definition Types.hpp:73
Uint16 mBuildNumber
Build version number.
Definition Types.hpp:76
A Version class used for tracking updates to your DAL Dante device.
Definition Types.hpp:53
Uint8 mMinor
Minor version number.
Definition Types.hpp:56
Uint8 mMajor
Major version number.
Definition Types.hpp:55
Uint16 mBugfix
Bugfix version number.
Definition Types.hpp:57