Debian Codegraph @

fon/praat_TimeTier.cpp

raw symbols SCIP
1 /* praat_TimeTier.cpp
2 *
3 * Copyright (C) 1992-2012,2013,2014,2015,2016 Paul Boersma
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "praat_TimeTier.h"cxx . . $ `<file>/fon/praat_TimeTier.h`/
20
21 // MARK: TIMETIER
22
23 // MARK: Query
24
25 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INTEGER_TimeTier_getNumberOfPoints) {
26 QUERY_ONE_FOR_REALcxx . . $ `sys/praatM.h:827:9`! (AnyTier)
27 const integercxx . . $ integer# result = mycxx . . $ `melder/melder.h:44:9`! pointscxx . . $ structAnyTier#points..sizecxx . . $ CollectionOf#size.;
28 QUERY_ONE_FOR_REAL_ENDcxx . . $ `sys/praatM.h:829:9`! (U" points")
29 }
30
31 FORMcxx . . $ `sys/praatM.h:79:9`! (INTEGER_TimeTier_getLowIndexFromTime, U"Get low index", U"AnyTier: Get low index from time...") {
32 REALcxx . . $ `sys/praatM.h:92:9`! (time, U"Time (s)", U"0.5")
33 OKcxx . . $ `sys/praatM.h:327:9`!
34 DOcxx . . $ `sys/praatM.h:354:9`!
35 QUERY_ONE_FOR_REALcxx . . $ `sys/praatM.h:827:9`! (AnyTier)
36 const double result =
37 mycxx . . $ `melder/melder.h:44:9`! pointscxx . . $ structAnyTier#points..sizecxx . . $ CollectionOf#size. == 0 ? undefinedcxx . . $ undefined. : AnyTier_timeToLowIndexcxx . . $ AnyTier_timeToLowIndex(9d58fc2471e8b6f6). (me, time);
38 QUERY_ONE_FOR_REAL_ENDcxx . . $ `sys/praatM.h:829:9`! (U"")
39 }
40
41 FORMcxx . . $ `sys/praatM.h:79:9`! (INTEGER_TimeTier_getHighIndexFromTime, U"Get high index", U"AnyTier: Get high index from time...") {
42 REALcxx . . $ `sys/praatM.h:92:9`! (time, U"Time (s)", U"0.5")
43 OKcxx . . $ `sys/praatM.h:327:9`!
44 DOcxx . . $ `sys/praatM.h:354:9`!
45 QUERY_ONE_FOR_REALcxx . . $ `sys/praatM.h:827:9`! (AnyTier)
46 const double result =
47 mycxx . . $ `melder/melder.h:44:9`! pointscxx . . $ structAnyTier#points..sizecxx . . $ CollectionOf#size. == 0 ? undefinedcxx . . $ undefined. : AnyTier_timeToHighIndexcxx . . $ AnyTier_timeToHighIndex(9d58fc2471e8b6f6). (me, time);
48 QUERY_ONE_FOR_REAL_ENDcxx . . $ `sys/praatM.h:829:9`! (U"")
49 }
50
51 FORMcxx . . $ `sys/praatM.h:79:9`! (INTEGER_TimeTier_getNearestIndexFromTime, U"Get nearest index", U"AnyTier: Get nearest index from time...") {
52 REALcxx . . $ `sys/praatM.h:92:9`! (time, U"Time (s)", U"0.5")
53 OKcxx . . $ `sys/praatM.h:327:9`!
54 DOcxx . . $ `sys/praatM.h:354:9`!
55 QUERY_ONE_FOR_REALcxx . . $ `sys/praatM.h:827:9`! (AnyTier) // TODO: make it more general that we don't return an integer, because we should be able to return undefined, as here
56 const double result =
57 mycxx . . $ `melder/melder.h:44:9`! pointscxx . . $ structAnyTier#points..sizecxx . . $ CollectionOf#size. == 0 ? undefinedcxx . . $ undefined. : AnyTier_timeToNearestIndexcxx . . $ AnyTier_timeToNearestIndex(9d58fc2471e8b6f6). (me, time);
58 QUERY_ONE_FOR_REAL_ENDcxx . . $ `sys/praatM.h:829:9`! (U"")
59 }
60
61 FORMcxx . . $ `sys/praatM.h:79:9`! (REAL_TimeTier_getTimeFromIndex, U"Get time", nullptr /*"AnyTier: Get time from index..."*/) {
62 NATURALcxx . . $ `sys/praatM.h:120:9`! (pointNumber, U"Point number", U"10")
63 OKcxx . . $ `sys/praatM.h:327:9`!
64 DOcxx . . $ `sys/praatM.h:354:9`!
65 QUERY_ONE_FOR_REALcxx . . $ `sys/praatM.h:827:9`! (AnyTier)
66 const double result =
67 pointNumber > mycxx . . $ `melder/melder.h:44:9`! pointscxx . . $ structAnyTier#points..sizecxx . . $ CollectionOf#size. ? undefinedcxx . . $ undefined. : mycxx . . $ `melder/melder.h:44:9`! pointscxx . . $ structAnyTier#points..atcxx . . $ CollectionOf#at. [cxx . . $ ArrayOf#`operator[]`(a7f36fee1ae21897).pointNumber] -> numbercxx . . $ structSimpleDouble#number.;
68 QUERY_ONE_FOR_REAL_ENDcxx . . $ `sys/praatM.h:829:9`! (U" seconds")
69 }
70
71 // MARK: Modify
72
73 FORMcxx . . $ `sys/praatM.h:79:9`! (MODIFY_TimeTier_removePoint, U"Remove one point", U"AnyTier: Remove point...") {
74 NATURALcxx . . $ `sys/praatM.h:120:9`! (pointNumber, U"Point number", U"1")
75 OKcxx . . $ `sys/praatM.h:327:9`!
76 DOcxx . . $ `sys/praatM.h:354:9`!
77 MODIFY_EACHcxx . . $ `sys/praatM.h:1017:9`! (AnyTier)
78 AnyTier_removePointcxx . . $ AnyTier_removePoint(3a0c526758bc4e90). (me, pointNumber);
79 MODIFY_EACH_ENDcxx . . $ `sys/praatM.h:1020:9`!
80 }
81
82 FORMcxx . . $ `sys/praatM.h:79:9`! (MODIFY_TimeTier_removePointNear, U"Remove one point", U"AnyTier: Remove point near...") {
83 REALcxx . . $ `sys/praatM.h:92:9`! (time, U"Time (s)", U"0.5")
84 OKcxx . . $ `sys/praatM.h:327:9`!
85 DOcxx . . $ `sys/praatM.h:354:9`!
86 MODIFY_EACHcxx . . $ `sys/praatM.h:1017:9`! (AnyTier)
87 AnyTier_removePointNearcxx . . $ AnyTier_removePointNear(b9141c6a676b04b9). (me, time);
88 MODIFY_EACH_ENDcxx . . $ `sys/praatM.h:1020:9`!
89 }
90
91 FORMcxx . . $ `sys/praatM.h:79:9`! (MODIFY_TimeTier_removePointsBetween, U"Remove points", U"AnyTier: Remove points between...") {
92 REALcxx . . $ `sys/praatM.h:92:9`! (fromTime, U"left Time range (s)", U"0.0")
93 REALcxx . . $ `sys/praatM.h:92:9`! (toTime, U"right Time range (s)", U"1.0")
94 OKcxx . . $ `sys/praatM.h:327:9`!
95 DOcxx . . $ `sys/praatM.h:354:9`!
96 MODIFY_EACHcxx . . $ `sys/praatM.h:1017:9`! (AnyTier)
97 AnyTier_removePointsBetweencxx . . $ AnyTier_removePointsBetween(15327dad64b67f1a). (me, fromTime, toTime);
98 MODIFY_EACH_ENDcxx . . $ `sys/praatM.h:1020:9`!
99 }
100
101 // MARK: - buttons
102
103 void praat_TimeTier_query_initcxx . . $ praat_TimeTier_query_init(b2b8400651464df9). (ClassInfocxx . . $ ClassInfo# klas) {
104 praat_TimeFunction_query_initcxx . . $ praat_TimeFunction_query_init(b2b8400651464df9). (klas);
105 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 1, U"Get number of points", nullptr, 1, INTEGER_TimeTier_getNumberOfPoints);
106 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 1, U"Get low index from time...", nullptr, 1, INTEGER_TimeTier_getLowIndexFromTime);
107 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 1, U"Get high index from time...", nullptr, 1, INTEGER_TimeTier_getHighIndexFromTime);
108 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 1, U"Get nearest index from time...", nullptr, 1, INTEGER_TimeTier_getNearestIndexFromTime);
109 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 1, U"Get time from index...", nullptr, 1, REAL_TimeTier_getTimeFromIndex);
110 }
111
112 void praat_TimeTier_modify_initcxx . . $ praat_TimeTier_modify_init(b2b8400651464df9). (ClassInfocxx . . $ ClassInfo# klas) {
113 praat_TimeFunction_modify_initcxx . . $ praat_TimeFunction_modify_init(b2b8400651464df9). (klas);
114 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 0, U"Remove point...", nullptr, 1, MODIFY_TimeTier_removePoint);
115 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 0, U"Remove point near...", nullptr, 1, MODIFY_TimeTier_removePointNear);
116 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (klas, 0, U"Remove points between...", nullptr, 1, MODIFY_TimeTier_removePointsBetween);
117 }
118
119 /* End of file praat_TimeTier.cpp */