~ubuntu-branches/debian/lenny/libofa/lenny

« back to all changes in this revision

Viewing changes to lib/trackdata_op.h

  • Committer: Bazaar Package Importer
  • Author(s): Lukáš Lalinský
  • Date: 2006-08-21 23:06:01 UTC
  • Revision ID: james.westby@ubuntu.com-20060821230601-ik253yugpxbbo9xt
Tags: upstream-0.9.3
Import upstream version 0.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ------------------------------------------------------------------
 
2
 
 
3
   libofa -- the Open Fingerprint Architecture library
 
4
 
 
5
   Copyright (C) 2006 MusicIP Corporation
 
6
   All rights reserved.
 
7
 
 
8
-------------------------------------------------------------------*/
 
9
// FILE: "trackdata_op.h"
 
10
// MODULE: Specification file for track data elements
 
11
// AUTHOR: Stephen Pope
 
12
// DATE CREATED: 01/12/06
 
13
 
 
14
#ifndef TRACK_DATA_OP_H
 
15
#define TRACK_DATA_OP_H 1
 
16
 
 
17
 
 
18
class TrackData_op {
 
19
 
 
20
public:
 
21
        TrackData_op();
 
22
        TrackData_op(float time, float frequency, float amplitude, float frDur);
 
23
        ~TrackData_op();
 
24
 
 
25
// Accessing methods
 
26
 
 
27
        float getTime() const { return StartTime; }
 
28
        float getAmplitude() const { return Amplitude; }
 
29
        float getPitch() const { return Pitch;}
 
30
        float getEndPitch() const { return EndPitch;}
 
31
        float getAvgAmplitude() const { return AvgAmplitude; }
 
32
        float getAvgPitch() const { return AvgPitch;}
 
33
        void setAvgAmplitude(float val) { AvgAmplitude = val; }
 
34
        void setAvgPitch(float val) { AvgPitch = val;}
 
35
        void setEndPitch(float val) { EndPitch = val;}
 
36
 
 
37
        float getDuration();
 
38
        float getStartTime() const { return StartTime; }
 
39
 
 
40
        void SetInTrack(bool in) { InTrack = in; }
 
41
        bool IsInTrack() { return InTrack; }
 
42
 
 
43
// Data/frame/list structure
 
44
 
 
45
        void linkTo(TrackData_op* pr);
 
46
        void linkPrevious(TrackData_op* pr) { previous = pr; }
 
47
        void linkNext(TrackData_op* pr) { next = pr; }
 
48
 
 
49
        TrackData_op* getPrev() const { return previous; }
 
50
        TrackData_op* getNext() const { return next; }
 
51
        TrackData_op* getHigher() const { return higher; }
 
52
        void linkHigher(TrackData_op* pr) { higher = pr; }
 
53
        TrackData_op* getHead();
 
54
        TrackData_op* getTail();
 
55
 
 
56
// Inquiry
 
57
 
 
58
        bool isOrphan() const { return ((previous == 0) && (next == 0)); }
 
59
        bool isHead() const { return ((previous == 0) && (next != 0)); }
 
60
        bool isTail() const { return ((previous != 0) && (next == 0)); }
 
61
 
 
62
private:
 
63
 
 
64
// Instance variables
 
65
 
 
66
        float Amplitude;                // single values
 
67
        float Pitch;
 
68
        float StartTime;
 
69
        float EndTime;
 
70
        float AvgAmplitude;
 
71
        float AvgPitch;
 
72
        float EndPitch;
 
73
        float FrameDur;
 
74
 
 
75
// Inter-item links
 
76
 
 
77
        TrackData_op* previous;
 
78
        TrackData_op* next;
 
79
        TrackData_op* higher;
 
80
 
 
81
// State
 
82
        bool InTrack;
 
83
};
 
84
 
 
85
#endif