| 1 | #ifndef _TextGrid_extensions_h_ |
| 2 | #define _TextGrid_extensions_h_ |
| 3 | /* TextGrid_extensions.h |
| 4 | * |
| 5 | * Copyright (C) 1993-2018,2023 David Weenink |
| 6 | * |
| 7 | * This code is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This code is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | /* |
| 22 | djmw 20020516 GPL header |
| 23 | djmw 20120418 Latest modification |
| 24 | */ |
| 25 | |
| 26 | #include "TextGrid.h" |
| 27 | |
| 28 | void TextGrid_extendTime (TextGrid me, double delta_time, int position); |
| 29 | /* |
| 30 | Extend the begin-time (delta_time<0) or end-time (delta_time>0). |
| 31 | For Point-tiers only the domain will be extended. |
| 32 | Interval tiers will have a new (empty) interval at the start or the end. |
| 33 | */ |
| 34 | |
| 35 | void TextGrid_setTierName (TextGrid me, integer itier, conststring32 newName); |
| 36 | |
| 37 | void TextTier_changeLabels (TextTier me, integer from, integer to, conststring32 search, conststring32 replace, bool use_regexp, integer *nmatches, integer *nstringmatches); |
| 38 | |
| 39 | void IntervalTier_changeLabels (IntervalTier me, integer from, integer to, conststring32 search, conststring32 replace, bool use_regexp, integer *nmatches, integer *nstringmatches); |
| 40 | |
| 41 | void TextGrid_addInterval_force (TextGrid me, double tmin, double tmax, integer tierNumber, conststring32 newLabel); |
| 42 | |
| 43 | void IntervalTier_removeBoundariesBetweenIdenticallyLabeledIntervals (IntervalTier me, conststring32 label); |
| 44 | |
| 45 | void IntervalTier_combineIntervalsOnLabelMatch (IntervalTier me, conststring32 label); |
| 46 | |
| 47 | void IntervalTier_cutIntervals_minimumDuration (IntervalTier me, conststring32 label, double minimumDuration); |
| 48 | |
| 49 | void TextGrid_changeLabels (TextGrid me, integer tier, integer from, integer to, conststring32 search, conststring32 replace, bool use_regexp, integer *nmatches, integer *nstringmatches); |
| 50 | |
| 51 | /* Set the start/end time to a smaller/larger value. |
| 52 | * If mark is null, only times are changed |
| 53 | * If mark != null, mark the previous start/end time |
| 54 | * For a TextTier this involves adding a point with the marker |
| 55 | * For an IntervalTier this involves adding a new interval |
| 56 | */ |
| 57 | void IntervalTier_setLaterEndTime (IntervalTier me, double xmax, conststring32 mark); |
| 58 | |
| 59 | void IntervalTier_setEarlierStartTime (IntervalTier me, double xmin, conststring32 mark); |
| 60 | |
| 61 | void TextTier_setLaterEndTime (TextTier me, double xmax, conststring32 mark); |
| 62 | |
| 63 | void TextTier_setEarlierStartTime (TextTier me, double xmin, conststring32 mark); |
| 64 | |
| 65 | void TextGrid_setEarlierStartTime (TextGrid me, double xmin, conststring32 intervalMark, conststring32 pointMark); |
| 66 | |
| 67 | void TextGrid_setLaterEndTime (TextGrid me, double xmax, conststring32 intervalMark, conststring32 pointMark); |
| 68 | |
| 69 | |
| 70 | // Precondition: if (preserveTimes) { my xmax <= thy xmin } |
| 71 | // Postcondition: my xmin preserved |
| 72 | void IntervalTiers_append_inplace (IntervalTier me, IntervalTier thee, bool preserveTimes); |
| 73 | |
| 74 | void TextTiers_append_inplace (TextTier me, TextTier thee, bool preserveTimes); |
| 75 | |
| 76 | void TextGrids_append_inplace (TextGrid me, TextGrid thee, bool preserveTimes); |
| 77 | |
| 78 | autoTextGrid TextGrids_to_TextGrid_appendContinuous (OrderedOf<structTextGrid>* me, bool preserveTimes); |
| 79 | |
| 80 | double TextGrid_getTotalDurationOfIntervalsWhere (TextGrid me, integer tierNumber, kMelder_string which, conststring32 criterion); |
| 81 | |
| 82 | #endif /* _TextGrid_extensions_h_ */ |