| 1 | /* SpectrumArea.cpp |
| 2 | * |
| 3 | * Copyright (C) 1992-2023 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 "SpectrumArea.h"cxx . . $ `<file>/foned/SpectrumArea.h`/ |
| 20 | #include "EditorM.h"cxx . . $ `<file>/sys/EditorM.h`/ |
| 21 | |
| 22 | Thing_implementcxx . . $ `sys/Thing.h:65:9`! (SpectrumArea, FunctionArea, 0); |
| 23 | |
| 24 | #include "Prefs_define.h"cxx . . $ `<file>/sys/Prefs_define.h`/ |
| 25 | #include "SpectrumArea_prefs.h"cxx . . $ `<file>/foned/SpectrumArea_prefs.h`/ |
| 26 | #include "Prefs_install.h"cxx . . $ `<file>/sys/Prefs_install.h`/ |
| 27 | #include "SpectrumArea_prefs.h"cxx . . $ `<file>/foned/SpectrumArea_prefs.h`/ |
| 28 | #include "Prefs_copyToInstance.h"cxx . . $ `<file>/sys/Prefs_copyToInstance.h`/ |
| 29 | #include "SpectrumArea_prefs.h"cxx . . $ `<file>/foned/SpectrumArea_prefs.h`/ |
| 30 | |
| 31 | |
| 32 | #pragma mark - SpectrumArea helpers |
| 33 | |
| 34 | inline static autoSpectrumcxx . . $ autoSpectrum# Spectrum_bandcxx . . $ Spectrum_band(78931193cbbe0d40). (Spectrumcxx . . $ Spectrum# me, double fmin, double fmax) { |
| 35 | autoSpectrumcxx . . $ autoSpectrum# band = Data_copycxx . . $ Data_copy(97a542a26794c80e). (me); |
| 36 | double *re = & band ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). zcxx . . $ structMatrix#z. [cxx . . $ automatrix#`operator[]`(2d545b3cb3f8e666).1] [cxx . . $ vector#`operator[]`(8a4599b8835d1ce1).0], *im = & band ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). zcxx . . $ structMatrix#z. [cxx . . $ automatrix#`operator[]`(2d545b3cb3f8e666).2] [cxx . . $ vector#`operator[]`(8a4599b8835d1ce1).0]; |
| 37 | const integercxx . . $ integer# imin = Sampled_xToLowIndexcxx . . $ Sampled_xToLowIndex(405c2491bc3636e9). (band.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), fmin); |
| 38 | const integercxx . . $ integer# imax = Sampled_xToHighIndexcxx . . $ Sampled_xToHighIndex(405c2491bc3636e9). (band.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), fmax); |
| 39 | for (integercxx . . $ integer# i = 1; i <= imin; i ++) |
| 40 | re [i] = 0.0, im [i] = 0.0; |
| 41 | for (integercxx . . $ integer# i = imax; i <= band ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). nxcxx . . $ structSampled#nx.; i ++) |
| 42 | re [i] = 0.0, im [i] = 0.0; |
| 43 | return bandcxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 44 | } |
| 45 | inline static autoSoundcxx . . $ autoSound# Spectrum_to_Sound_partcxx . . $ Spectrum_to_Sound_part(6821094b82e5d912). (Spectrumcxx . . $ Spectrum# me, double fmin, double fmax) { |
| 46 | autoSpectrumcxx . . $ autoSpectrum# band = Spectrum_bandcxx . . $ Spectrum_band(78931193cbbe0d40). (me, fmin, fmax); |
| 47 | autoSoundcxx . . $ autoSound# sound = Spectrum_to_Soundcxx . . $ Spectrum_to_Sound(b9577246d0f6b8d7). (band.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 48 | return soundcxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 49 | } |
| 50 | |
| 51 | |
| 52 | #pragma mark - SpectrumArea info |
| 53 | |
| 54 | void structSpectrumAreacxx . . $ structSpectrumArea# :: v1_infocxx . . $ structSpectrumArea#v1_info(49f6e7a06ebc5aa8). () { |
| 55 | MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Dynamic range: ", ourcxx . . $ `melder/melder.h:42:9`! instancePref_dynamicRangecxx . . $ structSpectrumArea#instancePref_dynamicRange(21b6c25e127938e2).(), U" dB"); |
| 56 | MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Cursor height: ", ourcxx . . $ `melder/melder.h:42:9`! cursorHeightcxx . . $ structSpectrumArea#cursorHeight., U" dB"); |
| 57 | MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Minimum: ", ourcxx . . $ `melder/melder.h:42:9`! minimumcxx . . $ structSpectrumArea#minimum(31fa7155c10fdd13).(), U" dB"); |
| 58 | MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Maximum: ", ourcxx . . $ `melder/melder.h:42:9`! maximumcxx . . $ structSpectrumArea#maximum(31fa7155c10fdd13).(), U" dB"); |
| 59 | } |
| 60 | |
| 61 | |
| 62 | #pragma mark - SpectrumArea drawing |
| 63 | |
| 64 | void structSpectrumAreacxx . . $ structSpectrumArea# :: v_drawInsidecxx . . $ structSpectrumArea#v_drawInside(49f6e7a06ebc5aa8). () { |
| 65 | Spectrum_drawInsidecxx . . $ Spectrum_drawInside(d2c1ceecc2e1e81c). (ourcxx . . $ `melder/melder.h:42:9`! spectrumcxx . . $ structSpectrumArea#spectrum(1a09b0bdb439daa1).(), ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), ourcxx . . $ `melder/melder.h:42:9`! startWindowcxx . . $ structFunctionArea#startWindow(21b6c25e127938e2).(), ourcxx . . $ `melder/melder.h:42:9`! endWindowcxx . . $ structFunctionArea#endWindow(21b6c25e127938e2).(), |
| 66 | ourcxx . . $ `melder/melder.h:42:9`! minimumcxx . . $ structSpectrumArea#minimum(31fa7155c10fdd13).(), ourcxx . . $ `melder/melder.h:42:9`! maximumcxx . . $ structSpectrumArea#maximum(31fa7155c10fdd13).()); |
| 67 | Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (ourcxx . . $ `melder/melder.h:42:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), Melder_BLUEcxx . . $ Melder_BLUE.); |
| 68 | FunctionArea_drawRightMarkcxx . . $ FunctionArea_drawRightMark(df9b3f4958966f01). (this, ourcxx . . $ `melder/melder.h:42:9`! maximumcxx . . $ structSpectrumArea#maximum(31fa7155c10fdd13).(), |
| 69 | Melder_fixedcxx . . $ Melder_fixed(5b9062840a6ade99). (ourcxx . . $ `melder/melder.h:42:9`! maximumcxx . . $ structSpectrumArea#maximum(31fa7155c10fdd13).(), 1), U" dB", Graphics_HALFcxx . . $ `sys/Graphics.h:253:9`!); |
| 70 | FunctionArea_drawRightMarkcxx . . $ FunctionArea_drawRightMark(df9b3f4958966f01). (this, ourcxx . . $ `melder/melder.h:42:9`! minimumcxx . . $ structSpectrumArea#minimum(31fa7155c10fdd13).(), |
| 71 | Melder_fixedcxx . . $ Melder_fixed(5b9062840a6ade99). (ourcxx . . $ `melder/melder.h:42:9`! minimumcxx . . $ structSpectrumArea#minimum(31fa7155c10fdd13).(), 1), U" dB", Graphics_HALFcxx . . $ `sys/Graphics.h:253:9`!); |
| 72 | if (ourcxx . . $ `melder/melder.h:42:9`! cursorHeightcxx . . $ structSpectrumArea#cursorHeight. > ourcxx . . $ `melder/melder.h:42:9`! minimumcxx . . $ structSpectrumArea#minimum(31fa7155c10fdd13).() && ourcxx . . $ `melder/melder.h:42:9`! cursorHeightcxx . . $ structSpectrumArea#cursorHeight. < ourcxx . . $ `melder/melder.h:42:9`! maximumcxx . . $ structSpectrumArea#maximum(31fa7155c10fdd13).()) |
| 73 | FunctionEditor_drawHorizontalHaircxx . . $ FunctionEditor_drawHorizontalHair(9ee54d933d3f4330). (ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).(), ourcxx . . $ `melder/melder.h:42:9`! cursorHeightcxx . . $ structSpectrumArea#cursorHeight., |
| 74 | Melder_fixedcxx . . $ Melder_fixed(5b9062840a6ade99). (ourcxx . . $ `melder/melder.h:42:9`! cursorHeightcxx . . $ structSpectrumArea#cursorHeight., 1), U" dB"); |
| 75 | } |
| 76 | |
| 77 | |
| 78 | #pragma mark - SpectrumArea tracking |
| 79 | |
| 80 | bool structSpectrumAreacxx . . $ structSpectrumArea# :: v_mousecxx . . $ structSpectrumArea#v_mouse(3d5a26054778c78d). (GuiDrawingArea_MouseEventcxx . . $ GuiDrawingArea_MouseEvent# event, double x_world, double localY_fraction) { |
| 81 | ourcxx . . $ `melder/melder.h:42:9`! cursorHeightcxx . . $ structSpectrumArea#cursorHeight. = ourcxx . . $ `melder/melder.h:42:9`! minimumcxx . . $ structSpectrumArea#minimum(31fa7155c10fdd13).() + localY_fraction * (ourcxx . . $ `melder/melder.h:42:9`! maximumcxx . . $ structSpectrumArea#maximum(31fa7155c10fdd13).() - ourcxx . . $ `melder/melder.h:42:9`! minimumcxx . . $ structSpectrumArea#minimum(31fa7155c10fdd13).()); |
| 82 | return FunctionEditor_defaultMouseInWideDataViewcxx . . $ FunctionEditor_defaultMouseInWideDataView(f60eeae5fe5430ba). (ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).(), event, x_world) || true; // BUG: |
| 83 | } |
| 84 | |
| 85 | |
| 86 | #pragma mark - SpectrumArea View |
| 87 | |
| 88 | static void menu_cb_setDynamicRangecxx . . $ menu_cb_setDynamicRange(a664f839c3294a06). (SpectrumAreacxx . . $ SpectrumArea# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 89 | EDITOR_FORMcxx . . $ `sys/EditorM.h:33:9`! (U"Set dynamic range", nullptr) |
| 90 | POSITIVEcxx . . $ `sys/EditorM.h:117:9`! (dynamicRange, U"Dynamic range (dB)", mycxx . . $ `melder/melder.h:44:9`! default_dynamicRange()) |
| 91 | EDITOR_OKcxx . . $ `sys/EditorM.h:38:9`! |
| 92 | SET_REALcxx . . $ `sys/EditorM.h:462:9`! (dynamicRange, mycxx . . $ `melder/melder.h:44:9`! instancePref_dynamicRange()) |
| 93 | EDITOR_DOcxx . . $ `sys/EditorM.h:43:9`! |
| 94 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_dynamicRangecxx . . $ structSpectrumArea#setInstancePref_dynamicRange(ba8836b59fb42830). (dynamicRange); |
| 95 | mycxx . . $ `melder/melder.h:44:9`! updateRangecxx . . $ structSpectrumArea#updateRange(49f6e7a06ebc5aa8). (); |
| 96 | FunctionEditor_redrawcxx . . $ FunctionEditor_redraw(8d3b84f45830d365). (mycxx . . $ `melder/melder.h:44:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).()); |
| 97 | EDITOR_ENDcxx . . $ `sys/EditorM.h:80:9`! |
| 98 | } |
| 99 | |
| 100 | |
| 101 | #pragma mark - SpectrumArea Modify |
| 102 | |
| 103 | static void menu_cb_passBandcxx . . $ menu_cb_passBand(a664f839c3294a06). (SpectrumAreacxx . . $ SpectrumArea# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 104 | EDITOR_FORMcxx . . $ `sys/EditorM.h:33:9`! (U"Filter (pass Hann band)", U"Spectrum: Filter (pass Hann band)..."); |
| 105 | REALcxx . . $ `sys/EditorM.h:95:9`! (bandSmoothing, U"Band smoothing (Hz)", mycxx . . $ `melder/melder.h:44:9`! default_bandSmoothing()) |
| 106 | EDITOR_OKcxx . . $ `sys/EditorM.h:38:9`! |
| 107 | SET_REALcxx . . $ `sys/EditorM.h:462:9`! (bandSmoothing, mycxx . . $ `melder/melder.h:44:9`! instancePref_bandSmoothing()) |
| 108 | EDITOR_DOcxx . . $ `sys/EditorM.h:43:9`! |
| 109 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_bandSmoothingcxx . . $ structSpectrumArea#setInstancePref_bandSmoothing(ba8836b59fb42830). (bandSmoothing); |
| 110 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (mycxx . . $ `melder/melder.h:44:9`! endSelection() > mycxx . . $ `melder/melder.h:44:9`! startSelection(), |
| 111 | U"To apply a band-pass filter, first make a selection."); |
| 112 | |
| 113 | FunctionArea_savecxx . . $ FunctionArea_save(7511dfaa04acd353). (me, U"Pass band"); |
| 114 | |
| 115 | Spectrum_passHannBandcxx . . $ Spectrum_passHannBand(4e1fbc861a283982). (mycxx . . $ `melder/melder.h:44:9`! spectrumcxx . . $ structSpectrumArea#spectrum(1a09b0bdb439daa1).(), mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionArea#startSelection(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionArea#endSelection(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! instancePref_bandSmoothingcxx . . $ structSpectrumArea#instancePref_bandSmoothing(21b6c25e127938e2).()); |
| 116 | |
| 117 | FunctionArea_broadcastDataChangedcxx . . $ FunctionArea_broadcastDataChanged(88b39197b202d92f). (me); |
| 118 | EDITOR_ENDcxx . . $ `sys/EditorM.h:80:9`! |
| 119 | } |
| 120 | static void menu_cb_stopBandcxx . . $ menu_cb_stopBand(a664f839c3294a06). (SpectrumAreacxx . . $ SpectrumArea# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 121 | EDITOR_FORMcxx . . $ `sys/EditorM.h:33:9`! (U"Filter (stop Hann band)", nullptr) |
| 122 | REALcxx . . $ `sys/EditorM.h:95:9`! (bandSmoothing, U"Band smoothing (Hz)", mycxx . . $ `melder/melder.h:44:9`! default_bandSmoothing()) |
| 123 | EDITOR_OKcxx . . $ `sys/EditorM.h:38:9`! |
| 124 | SET_REALcxx . . $ `sys/EditorM.h:462:9`! (bandSmoothing, mycxx . . $ `melder/melder.h:44:9`! instancePref_bandSmoothing()) |
| 125 | EDITOR_DOcxx . . $ `sys/EditorM.h:43:9`! |
| 126 | mycxx . . $ `melder/melder.h:44:9`! setInstancePref_bandSmoothingcxx . . $ structSpectrumArea#setInstancePref_bandSmoothing(ba8836b59fb42830). (bandSmoothing); |
| 127 | Melder_requirecxx . . $ `melder/melder_require.h:21:9`! (mycxx . . $ `melder/melder.h:44:9`! endSelection() > mycxx . . $ `melder/melder.h:44:9`! startSelection(), |
| 128 | U"To apply a band-stop filter, first make a selection."); |
| 129 | |
| 130 | FunctionArea_savecxx . . $ FunctionArea_save(7511dfaa04acd353). (me, U"Stop band"); |
| 131 | |
| 132 | Spectrum_stopHannBandcxx . . $ Spectrum_stopHannBand(4e1fbc861a283982). (mycxx . . $ `melder/melder.h:44:9`! spectrumcxx . . $ structSpectrumArea#spectrum(1a09b0bdb439daa1).(), mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionArea#startSelection(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionArea#endSelection(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! instancePref_bandSmoothingcxx . . $ structSpectrumArea#instancePref_bandSmoothing(21b6c25e127938e2).()); |
| 133 | |
| 134 | FunctionArea_broadcastDataChangedcxx . . $ FunctionArea_broadcastDataChanged(88b39197b202d92f). (me); |
| 135 | EDITOR_ENDcxx . . $ `sys/EditorM.h:80:9`! |
| 136 | } |
| 137 | |
| 138 | |
| 139 | #pragma mark - SpectrumArea Select |
| 140 | |
| 141 | static void menu_cb_moveCursorToPeakcxx . . $ menu_cb_moveCursorToPeak(a664f839c3294a06). (SpectrumAreacxx . . $ SpectrumArea# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 142 | MelderPointcxx . . $ MelderPoint# peak = Spectrum_getNearestMaximumcxx . . $ Spectrum_getNearestMaximum(5c1dcaad34bb82aa). (mycxx . . $ `melder/melder.h:44:9`! spectrumcxx . . $ structSpectrumArea#spectrum(1a09b0bdb439daa1).(), 0.5 * (mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionArea#startSelection(21b6c25e127938e2).() + mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionArea#endSelection(21b6c25e127938e2).())); |
| 143 | mycxx . . $ `melder/melder.h:44:9`! setSelectioncxx . . $ structFunctionArea#setSelection(bc12c9ec15586e6a). (peak. xcxx . . $ MelderPoint#x., peak. xcxx . . $ MelderPoint#x.); |
| 144 | mycxx . . $ `melder/melder.h:44:9`! cursorHeightcxx . . $ structSpectrumArea#cursorHeight. = peak. ycxx . . $ MelderPoint#y.; |
| 145 | Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (isdefined (mycxx . . $ `melder/melder.h:44:9`! startSelection())); // precondition of FunctionEditor_selectionMarksChanged() |
| 146 | FunctionEditor_selectionMarksChangedcxx . . $ FunctionEditor_selectionMarksChanged(8d3b84f45830d365). (mycxx . . $ `melder/melder.h:44:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).()); |
| 147 | } |
| 148 | |
| 149 | |
| 150 | #pragma mark - SpectrumArea Extract |
| 151 | |
| 152 | static void CONVERT_DATA_TO_ONE__PublishBandcxx . . $ CONVERT_DATA_TO_ONE__PublishBand(a664f839c3294a06). (SpectrumAreacxx . . $ SpectrumArea# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 153 | CONVERT_DATA_TO_ONEcxx . . $ `sys/EditorM.h:616:9`! |
| 154 | autoSpectrumcxx . . $ autoSpectrum# result = Spectrum_bandcxx . . $ Spectrum_band(78931193cbbe0d40). (mycxx . . $ `melder/melder.h:44:9`! spectrumcxx . . $ structSpectrumArea#spectrum(1a09b0bdb439daa1).(), mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionArea#startSelection(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionArea#endSelection(21b6c25e127938e2).()); |
| 155 | CONVERT_DATA_TO_ONE_ENDcxx . . $ `sys/EditorM.h:618:9`! (U"untitled") |
| 156 | } |
| 157 | static void CONVERT_DATA_TO_ONE__PublishSoundcxx . . $ CONVERT_DATA_TO_ONE__PublishSound(a664f839c3294a06). (SpectrumAreacxx . . $ SpectrumArea# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 158 | CONVERT_DATA_TO_ONEcxx . . $ `sys/EditorM.h:616:9`! |
| 159 | autoSoundcxx . . $ autoSound# result = Spectrum_to_Sound_partcxx . . $ Spectrum_to_Sound_part(6821094b82e5d912). (mycxx . . $ `melder/melder.h:44:9`! spectrumcxx . . $ structSpectrumArea#spectrum(1a09b0bdb439daa1).(), mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionArea#startSelection(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionArea#endSelection(21b6c25e127938e2).()); |
| 160 | CONVERT_DATA_TO_ONE_ENDcxx . . $ `sys/EditorM.h:618:9`! (U"untitled") |
| 161 | } |
| 162 | |
| 163 | |
| 164 | #pragma mark - SpectrumArea all menus? |
| 165 | |
| 166 | void structSpectrumAreacxx . . $ structSpectrumArea# :: v_createMenuscxx . . $ structSpectrumArea#v_createMenus(49f6e7a06ebc5aa8). () { |
| 167 | EditorMenucxx . . $ EditorMenu# menu = Editor_addMenucxx . . $ Editor_addMenu(8b39ac34ca8e016f). (ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).(), U"Spectrum", 0); |
| 168 | |
| 169 | FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"Power density range:", 0, nullptrcxx . . $ MelderCallback#MelderCallback(fc624d2cd197112)., this); |
| 170 | FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"Set dynamic range...", 1, |
| 171 | menu_cb_setDynamicRangecxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97)., this); |
| 172 | |
| 173 | FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"- Modify spectrum:", 0, nullptrcxx . . $ MelderCallback#MelderCallback(fc624d2cd197112)., this); |
| 174 | FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"Pass band...", 1, |
| 175 | menu_cb_passBandcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97)., this); |
| 176 | FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"Stop band...", 1, |
| 177 | menu_cb_stopBandcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97)., this); |
| 178 | |
| 179 | FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"- Select by spectrum:", 0, nullptrcxx . . $ MelderCallback#MelderCallback(fc624d2cd197112)., this); |
| 180 | FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"Move cursor to nearest peak", 'K' | GuiMenu_DEPTH_1cxx . . $ `sys/Gui.h:862:9`!, |
| 181 | menu_cb_moveCursorToPeakcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97)., this); |
| 182 | |
| 183 | FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"- Extract spectrum:", 0, nullptrcxx . . $ MelderCallback#MelderCallback(fc624d2cd197112)., this); |
| 184 | ourcxx . . $ `melder/melder.h:42:9`! publishBandButtoncxx . . $ structSpectrumArea#publishBandButton. = FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"Publish band", 1, |
| 185 | CONVERT_DATA_TO_ONE__PublishBandcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97)., this); |
| 186 | ourcxx . . $ `melder/melder.h:42:9`! publishSoundButtoncxx . . $ structSpectrumArea#publishSoundButton. = FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (menu, U"Publish band-filtered sound", 1, |
| 187 | CONVERT_DATA_TO_ONE__PublishSoundcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97)., this); |
| 188 | } |
| 189 | |
| 190 | |
| 191 | #pragma mark - SpectrumArea functions |
| 192 | |
| 193 | void SpectrumArea_playcxx . . $ SpectrumArea_play(a16cff1b14bba2f9). (SpectrumAreacxx . . $ SpectrumArea# me, double fromFrequency, double toFrequency) { |
| 194 | autoSoundcxx . . $ autoSound# sound = Spectrum_to_Sound_partcxx . . $ Spectrum_to_Sound_part(6821094b82e5d912). (mycxx . . $ `melder/melder.h:44:9`! spectrumcxx . . $ structSpectrumArea#spectrum(1a09b0bdb439daa1).(), fromFrequency, toFrequency); |
| 195 | Sound_playcxx . . $ Sound_play(8cd75def0156a342). (sound.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), nullptrcxx . . $ MelderCallback#MelderCallback(88514059881c9050)., nullptr); |
| 196 | } |
| 197 | |
| 198 | /* End of file SpectrumArea.cpp */ |