/
tracklist_op.cpp
54 lines (41 loc) · 980 Bytes
/
tracklist_op.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
/* ------------------------------------------------------------------
libofa -- the Open Fingerprint Architecture library
Copyright (C) 2006 MusicIP Corporation
All rights reserved.
-------------------------------------------------------------------*/
// FILE: "tracklist_op.cpp"
// MODULE: Implementation for class TrackList
// AUTHOR: Stephen Pope
// DATE CREATED: 01/12/06
#include "trackdata_op.h"
#include "tracklist_op.h"
// Constructor
TrackList_op::TrackList_op()
{
NumFrames = 0;
BaseFr = 0;
LastFr = 0;
}
// Delete the list of frames on delete
TrackList_op::~TrackList_op()
{
TrackFrame_op* frm = BaseFr;
while (frm != 0) {
TrackFrame_op* next = frm->getNext();
delete frm;
frm = next;
}
}
// Element add/remove
void
TrackList_op::Add(TrackFrame_op* td)
{
if (NumFrames == 0) {
BaseFr = td;
LastFr = td;
} else {
LastFr->setNext(td);
LastFr = td;
}
NumFrames++;
}