Debian Codegraph @

foned/TextGridEditor.h

raw symbols SCIP
1 #cxx . . $ `<file>/foned/TextGridEditor.h`/ifndef _TextGridEditor_h_
2 #define _TextGridEditor_h_cxx . . $ `foned/TextGridEditor.h:2:9`!
3 /* TextGridEditor.h
4 *
5 * Copyright (C) 1992-2005,2007-2022 Paul Boersma
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.
15 * See the GNU 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 #include "FunctionEditor.h"cxx . . $ `<file>/foned/FunctionEditor.h`/
22 #include "TextGridArea.h"cxx . . $ `<file>/foned/TextGridArea.h`/
23 #include "LongSoundArea.h"cxx . . $ `<file>/foned/LongSoundArea.h`/
24 #include "SoundAnalysisArea.h"cxx . . $ `<file>/foned/SoundAnalysisArea.h`/
25
26 Thing_definecxx . . $ mutableTextGridEditor# (TextGridEditor, FunctionEditor) {
27 DEFINE_FunctionAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235). (1, TextGridArea, textGridArea)
28 DEFINE_FunctionAreacxx . . $ `foned/FunctionArea.h:209:9`! (2, SoundArea, soundArea)
29 DEFINE_FunctionAreacxx . . $ structFunctionEditor#functionAreas. (3, SoundAnalysisArea, soundAnalysisArea)
30
31 TextGridcxx . . $ TextGrid# textGridcxx . . $ structTextGridEditor#textGrid(5278f8d4efff58bd).() { return static_cast <TextGridcxx . . $ TextGrid#> (ourcxx . . $ `melder/melder.h:42:9`! datacxx . . $ structDataGui#data(e8441e10bf3a9c6e).()); }
32
33 void v_createMenuItems_helpcxx . . $ structTextGridEditor#v_createMenuItems_help(6ea9c8c6ea2f58a9). (EditorMenucxx . . $ EditorMenu# menu)
34 override;
35 void v1_dataChangedcxx . . $ structTextGridEditor#v1_dataChanged(c0154a85f79216c7). (Editorcxx . . $ Editor# sender) override {
36 Melder_clipRightcxx . . $ Melder_clipRight(5b63ce711df1ade7). (& ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). selectedTiercxx . . $ structTextGridArea#selectedTier., ourcxx . . $ `melder/melder.h:42:9`! textGridcxx . . $ structTextGridEditor#textGrid(5278f8d4efff58bd).() -> tierscxx . . $ structTextGrid#tiers.->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab).sizecxx . . $ CollectionOf#size.); // crucial: before v_updateText (bug 2022-07-23)!
37 ourcxx . . $ `melder/melder.h:42:9`! structFunctionEditorcxx . . $ structFunctionEditor# :: v1_dataChangedcxx . . $ structFunctionEditor#v1_dataChanged(c0154a85f79216c7). (sender);
38 ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). functionChangedcxx . . $ structFunctionArea#functionChanged(18c8ee0a6873bee4). (ourcxx . . $ `melder/melder.h:42:9`! textGridcxx . . $ structTextGridEditor#textGrid(5278f8d4efff58bd).());
39 if (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).()) {
40 ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). functionChangedcxx . . $ structFunctionArea#functionChanged(18c8ee0a6873bee4). (nullptr); // BUG: this function has not actually changed
41 ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). functionChangedcxx . . $ structFunctionArea#functionChanged(18c8ee0a6873bee4). (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). functioncxx . . $ structFunctionArea#function(8985a8e07d4255bd).());
42 }
43 }
44 void v_distributeAreascxx . . $ structTextGridEditor#v_distributeAreas(49f6e7a06ebc5aa8). () override {
45 if (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).()) {
46 const bool showAnalysis = ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). hasContentToShowcxx . . $ structSoundAnalysisArea#hasContentToShow(c9857a73d68e59ba).();
47 const integercxx . . $ integer# numberOfTiers = ourcxx . . $ `melder/melder.h:42:9`! textGridcxx . . $ structTextGridEditor#textGrid(5278f8d4efff58bd).() -> tierscxx . . $ structTextGrid#tiers.->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab).sizecxx . . $ CollectionOf#size.;
48 const integercxx . . $ integer# numberOfVisibleChannels =
49 Melder_clippedRightcxx . . $ Melder_clippedRight(f80f7d6260b3ee3a). (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). soundOrLongSoundcxx . . $ structSoundArea#soundOrLongSound(e416179ecdeca61e).() -> nycxx . . $ structSampledXY#ny., 8_integercxx . . $ `operator""_integer`(85240eb457c3721a).);
50 const double soundY = numberOfTiers / (2.0 * numberOfVisibleChannels +
51 numberOfTiers * ( showAnalysis ? 1.8 : 1.3 ));
52 ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setGlobalYRange_fractioncxx . . $ structFunctionArea#setGlobalYRange_fraction(bc12c9ec15586e6a). (0.0, soundY);
53 if (showAnalysis) {
54 const double soundY2 = 0.5 * (1.0 + soundY);
55 ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setGlobalYRange_fractioncxx . . $ structFunctionArea#setGlobalYRange_fraction(bc12c9ec15586e6a). (soundY, soundY2);
56 ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setGlobalYRange_fractioncxx . . $ structFunctionArea#setGlobalYRange_fraction(bc12c9ec15586e6a). (soundY2, 1.0);
57 } else {
58 ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setGlobalYRange_fractioncxx . . $ structFunctionArea#setGlobalYRange_fraction(bc12c9ec15586e6a). (soundY, soundY);
59 ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setGlobalYRange_fractioncxx . . $ structFunctionArea#setGlobalYRange_fraction(bc12c9ec15586e6a). (soundY, 1.0);
60 }
61 } else {
62 ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). setGlobalYRange_fractioncxx . . $ structFunctionArea#setGlobalYRange_fraction(bc12c9ec15586e6a). (0.0, 1.0);
63 }
64 }
65 void v_drawcxx . . $ structTextGridEditor#v_draw(49f6e7a06ebc5aa8). () override {
66 if (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).()) {
67 FunctionArea_prepareCanvascxx . . $ FunctionArea_prepareCanvas(88b39197b202d92f). (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
68 if (ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). instancePref_pulses_showcxx . . $ structSoundAnalysisArea#instancePref_pulses_show(50ce9a9e25b4a850).())
69 ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). v_draw_analysis_pulsescxx . . $ structSoundAnalysisArea#v_draw_analysis_pulses(49f6e7a06ebc5aa8). ();
70 FunctionArea_drawInsidecxx . . $ FunctionArea_drawInside(88b39197b202d92f). (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
71 if (ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). hasContentToShowcxx . . $ structSoundAnalysisArea#hasContentToShow(c9857a73d68e59ba).()) {
72 FunctionArea_prepareCanvascxx . . $ FunctionArea_prepareCanvas(88b39197b202d92f). (ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
73 ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). v_draw_analysiscxx . . $ structSoundAnalysisArea#v_draw_analysis(49f6e7a06ebc5aa8). ();
74 }
75 }
76 FunctionArea_drawOnecxx . . $ FunctionArea_drawOne(88b39197b202d92f). (ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
77 }
78 bool v_hasTextcxx . . $ structTextGridEditor#v_hasText(c9857a73d68e59ba). () override { return true; }
79 bool v_hasSelectionViewercxx . . $ structTextGridEditor#v_hasSelectionViewer(c9857a73d68e59ba). () override { return true; }
80 void v_drawSelectionViewercxx . . $ structTextGridEditor#v_drawSelectionViewer(49f6e7a06ebc5aa8). () override {
81 TextGridArea_drawSelectionViewercxx . . $ TextGridArea_drawSelectionViewer(2e1574b2e91b5572). (ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
82 }
83 void v_drawRealTimeSelectionViewercxx . . $ structTextGridEditor#v_drawRealTimeSelectionViewer(ba8836b59fb42830). (double /* time */) override {
84 TextGridArea_drawSelectionViewercxx . . $ TextGridArea_drawSelectionViewer(2e1574b2e91b5572). (ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); // avoid discontinuity during play
85 }
86
87 void v_clickSelectionViewercxx . . $ structTextGridEditor#v_clickSelectionViewer(bc12c9ec15586e6a). (double x_fraction, double y_fraction) override {
88 TextGridArea_clickSelectionViewercxx . . $ TextGridArea_clickSelectionViewer(1c925e44836ddbf6). (ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), x_fraction, y_fraction);
89 }
90 conststring32cxx . . $ conststring32# v_selectionViewerNamecxx . . $ structTextGridEditor#v_selectionViewerName(1912f6684645c851). ()
91 override { return U"IPA chart"; }
92 void v_playcxx . . $ structTextGridEditor#v_play(bc12c9ec15586e6a). (double startTime, double endTime) override {
93 if (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).())
94 SoundArea_playcxx . . $ SoundArea_play(8591d98d1e7b94a5). (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), startTime, endTime);
95 }
96 void v_drawLegendscxx . . $ structTextGridEditor#v_drawLegends(49f6e7a06ebc5aa8). () override {
97 FunctionArea_drawLegendcxx . . $ FunctionArea_drawLegend(b4cb387346b51cd7). (ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(),
98 FunctionArea_legend_TEXTGRIDcxx . . $ `foned/FunctionArea.h:250:10`! U" ##modifiable TextGrid",
99 DataGui_defaultForegroundColourcxx . . $ DataGui_defaultForegroundColour(7d058e310f398cfa). (ourcxx . . $ `melder/melder.h:42:9`! textGridAreacxx . . $ structTextGridEditor#textGridArea(fd24f7f644037235).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), false)
100 );
101 if (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).()) {
102 const bool pulsesAreVisible = ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). hasPulsesToShowcxx . . $ structSoundAnalysisArea#hasPulsesToShow(c9857a73d68e59ba). ();
103 FunctionArea_drawLegendcxx . . $ FunctionArea_drawLegend(b4cb387346b51cd7). (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(),
104 FunctionArea_legend_WAVEFORMcxx . . $ `foned/FunctionArea.h:248:10`! U" %%non-modifiable copy of sound",
105 DataGui_defaultForegroundColourcxx . . $ DataGui_defaultForegroundColour(7d058e310f398cfa). (ourcxx . . $ `melder/melder.h:42:9`! soundAreacxx . . $ structTextGridEditor#soundArea(f75ec617f241a3e6).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), false),
106 pulsesAreVisible ? FunctionArea_legend_POLEScxx . . $ `foned/FunctionArea.h:247:10`! U" %%derived pulses" : nullptr,
107 Melder_GREYcxx . . $ Melder_GREY.
108 );
109 SoundAnalysisArea_drawDefaultLegendscxx . . $ SoundAnalysisArea_drawDefaultLegends(16a0e84e612eeb2). (ourcxx . . $ `melder/melder.h:42:9`! soundAnalysisAreacxx . . $ structTextGridEditor#soundAnalysisArea(189f664f81248f0).().getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
110 }
111 }
112
113 #include "TextGridEditor_prefs.h"cxx . . $ `<file>/foned/TextGridEditor_prefs.h`/
114 };
115
116 autoTextGridEditorcxx . . $ autoTextGridEditor# TextGridEditor_createcxx . . $ TextGridEditor_create(14111359858baa66). (conststring32cxx . . $ conststring32# title, TextGridcxx . . $ TextGrid# grid,
117 SampledXYcxx . . $ SampledXY# sound, // either a Sound or a LongSound, or null
118 SpellingCheckercxx . . $ SpellingChecker# spellingChecker,
119 conststring32cxx . . $ conststring32# callbackSocket
120 );
121
122 /* End of file TextGridEditor.h */
123 #endif