-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCDType.cpp
73 lines (63 loc) · 1.21 KB
/
CDType.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "stdafx.h"
#include "CDType.h"
MSFAddress::MSFAddress(void)
{
// Hour = 0;
Minute = 0;
Second = 0;
Frame = 0;
}
MSFAddress::~MSFAddress(void)
{
}
void MSFAddress::operator =(DWORD LBA)
{
LBA;
Frame = static_cast<BYTE>(LBA % 75);
LBA /= 75;
Second = static_cast<BYTE>(LBA % 60);
LBA /= 60;
Minute = static_cast<BYTE>(LBA);
}
MSFAddress MSFAddress::operator +(MSFAddress MSF)
{
MSFAddress msf;
DWORD LBA;
LBA = GetByLBA() + MSF.GetByLBA();
msf = LBA;
return msf;
}
MSFAddress MSFAddress::operator -(MSFAddress MSF)
{
MSFAddress msf;
DWORD lba;
lba = GetByLBA() - MSF.GetByLBA();
msf = lba;
return msf;
}
MSFAddress MSFAddress::operator -(DWORD LBA)
{
MSFAddress msf;
LBA = GetByLBA() - LBA;
msf = LBA;
return msf;
}
void MSFAddress::operator =(MSFAddress MSF)
{
// Hour = MSF.Hour;
Minute = MSF.Minute;
Second = MSF.Second;
Frame = MSF.Frame;
}
DWORD MSFAddress::GetByLBA(void)
{
return Frame + 75 * (Second + 60 * Minute);
}
bool MSFAddress::operator ==(MSFAddress comp)
{
if (Minute == comp.Minute && Second == comp.Second && Frame == comp.Frame)
{
return true;
}
return false;
}