-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTag.cpp
38 lines (32 loc) · 1.08 KB
/
Tag.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
// Version 3, 29 June 2007
//
// Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
//
// Everyone is permitted to copy and distribute verbatim copies of this license
// document, but changing it is not allowed.
//
// This version of the GNU Lesser General Public License incorporates the terms
// and conditions of version 3 of the GNU General Public License, supplemented
// by the additional permissions listed below.
#include "stdafx.h"
#include "Tag.h"
CTag::CTag(CMPAStream* stream, LPCTSTR name, bool is_appended, unsigned offset,
unsigned size)
: m_pStream(stream),
m_dwOffset(offset),
m_dwSize(size),
m_dwNumItems(0),
m_bAppended(is_appended) {
assert(stream);
assert(name);
m_fVersion = 0.0f;
m_szName = strdup(name);
}
CTag::~CTag() { free(m_szName); }
void CTag::SetVersion(unsigned char version_1, unsigned char version_2,
unsigned char version_3) {
// only values between 0 and 9 are displayed correctly
m_fVersion = version_1;
m_fVersion += version_2 * 0.1f;
m_fVersion += version_3 * 0.01f;
}