| 1 | /* EEGWindow.cpp |
| 2 | * |
| 3 | * Copyright (C) 2011-2018,2021,2022 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 "EEGWindow.h"cxx . . $ `<file>/EEG/EEGWindow.h`/ |
| 20 | #include "EditorM.h"cxx . . $ `<file>/sys/EditorM.h`/ |
| 21 | |
| 22 | Thing_implementcxx . . $ `sys/Thing.h:65:9`! (EEGWindow, FunctionEditor, 0); |
| 23 | |
| 24 | #include "Prefs_define.h"cxx . . $ `<file>/sys/Prefs_define.h`/ |
| 25 | #include "EEGWindow_prefs.h"cxx . . $ `<file>/EEG/EEGWindow_prefs.h`/ |
| 26 | #include "Prefs_install.h"cxx . . $ `<file>/sys/Prefs_install.h`/ |
| 27 | #include "EEGWindow_prefs.h"cxx . . $ `<file>/EEG/EEGWindow_prefs.h`/ |
| 28 | #include "Prefs_copyToInstance.h"cxx . . $ `<file>/sys/Prefs_copyToInstance.h`/ |
| 29 | #include "EEGWindow_prefs.h"cxx . . $ `<file>/EEG/EEGWindow_prefs.h`/ |
| 30 | |
| 31 | static void menu_cb_EEGWindowHelpcxx . . $ menu_cb_EEGWindowHelp(e99f44c52f738310). (EEGWindowcxx . . $ EEGWindow#, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { Melder_helpcxx . . $ Melder_help(ff00d524ab0355ec). (U"EEG window"); } |
| 32 | |
| 33 | void structEEGWindowcxx . . $ structEEGWindow# :: v_createMenuItems_helpcxx . . $ structEEGWindow#v_createMenuItems_help(6ea9c8c6ea2f58a9). (EditorMenucxx . . $ EditorMenu# menu) { |
| 34 | structFunctionEditorcxx . . $ structFunctionEditor# :: v_createMenuItems_helpcxx . . $ structFunctionEditor#v_createMenuItems_help(6ea9c8c6ea2f58a9). (menu); |
| 35 | EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (menu, U"EEGWindow help", '?', menu_cb_EEGWindowHelpcxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 36 | } |
| 37 | |
| 38 | static void CONVERT_DATA_TO_ONE__ExtractSelectedEEG_preserveTimescxx . . $ CONVERT_DATA_TO_ONE__ExtractSelectedEEG_preserveTimes(e99f44c52f738310). (EEGWindowcxx . . $ EEGWindow# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 39 | CONVERT_DATA_TO_ONEcxx . . $ `sys/EditorM.h:616:9`! |
| 40 | if (mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection. <= mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection.) |
| 41 | Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"No selection."); |
| 42 | autoEEGcxx . . $ autoEEG# result = EEG_extractPartcxx . . $ EEG_extractPart(4b0b976428c6cf0). (mycxx . . $ `melder/melder.h:44:9`! eegcxx . . $ structEEGWindow#eeg(9572b73916fe0e61).(), mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection., mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection., true); |
| 43 | CONVERT_DATA_TO_ONE_ENDcxx . . $ `sys/EditorM.h:618:9`! (U"untitled") |
| 44 | } |
| 45 | |
| 46 | static void CONVERT_DATA_TO_ONE__ExtractSelectedEEG_timeFromZerocxx . . $ CONVERT_DATA_TO_ONE__ExtractSelectedEEG_timeFromZero(e99f44c52f738310). (EEGWindowcxx . . $ EEGWindow# me, EDITOR_ARGScxx . . $ `sys/EditorM.h:25:9`!) { |
| 47 | CONVERT_DATA_TO_ONEcxx . . $ `sys/EditorM.h:616:9`! |
| 48 | if (mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection. <= mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection.) |
| 49 | Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"No selection."); |
| 50 | autoEEGcxx . . $ autoEEG# result = EEG_extractPartcxx . . $ EEG_extractPart(4b0b976428c6cf0). (mycxx . . $ `melder/melder.h:44:9`! eegcxx . . $ structEEGWindow#eeg(9572b73916fe0e61).(), mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionEditor#startSelection., mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionEditor#endSelection., false); |
| 51 | CONVERT_DATA_TO_ONE_ENDcxx . . $ `sys/EditorM.h:618:9`! (U"untitled") |
| 52 | } |
| 53 | |
| 54 | void structEEGWindowcxx . . $ structEEGWindow# :: v_createMenuscxx . . $ structEEGWindow#v_createMenus(49f6e7a06ebc5aa8). () { |
| 55 | EEGWindow_Parentcxx . . $ EEGWindow_Parent# :: v_createMenuscxx . . $ structFunctionEditor#v_createMenus(49f6e7a06ebc5aa8). (); |
| 56 | EditorMenucxx . . $ EditorMenu# eegMenu = Editor_addMenucxx . . $ Editor_addMenu(8b39ac34ca8e016f). (this, U"EEG", 0); |
| 57 | ourcxx . . $ `melder/melder.h:42:9`! extractSelectedEEGPreserveTimesButtoncxx . . $ structEEGWindow#extractSelectedEEGPreserveTimesButton. = EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (eegMenu, U"Extract selected EEG (preserve times)", 0, |
| 58 | CONVERT_DATA_TO_ONE__ExtractSelectedEEG_preserveTimescxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 59 | ourcxx . . $ `melder/melder.h:42:9`! extractSelectedEEGTimeFromZeroButtoncxx . . $ structEEGWindow#extractSelectedEEGTimeFromZeroButton. = EditorMenu_addCommandcxx . . $ EditorMenu_addCommand(b3c50ad5ffa1d58a). (eegMenu, U"Extract selected EEG (time from zero)", 0, |
| 60 | CONVERT_DATA_TO_ONE__ExtractSelectedEEG_timeFromZerocxx . . $ MelderCallback#MelderCallback(aaa169a015c1cf97).); |
| 61 | } |
| 62 | |
| 63 | void structEEGWindowcxx . . $ structEEGWindow# :: v_updateMenuItemscxx . . $ structEEGWindow#v_updateMenuItems(49f6e7a06ebc5aa8). () { |
| 64 | EEGWindow_Parentcxx . . $ EEGWindow_Parent# :: v_updateMenuItemscxx . . $ structFunctionEditor#v_updateMenuItems(49f6e7a06ebc5aa8). (); |
| 65 | GuiThing_setSensitivecxx . . $ GuiThing_setSensitive(99178548e0926398). (ourcxx . . $ `melder/melder.h:42:9`! extractSelectedEEGPreserveTimesButtoncxx . . $ structEEGWindow#extractSelectedEEGPreserveTimesButton., ourcxx . . $ `melder/melder.h:42:9`! endSelectioncxx . . $ structFunctionEditor#endSelection. > ourcxx . . $ `melder/melder.h:42:9`! startSelectioncxx . . $ structFunctionEditor#startSelection.); |
| 66 | GuiThing_setSensitivecxx . . $ GuiThing_setSensitive(99178548e0926398). (ourcxx . . $ `melder/melder.h:42:9`! extractSelectedEEGTimeFromZeroButtoncxx . . $ structEEGWindow#extractSelectedEEGTimeFromZeroButton., ourcxx . . $ `melder/melder.h:42:9`! endSelectioncxx . . $ structFunctionEditor#endSelection. > ourcxx . . $ `melder/melder.h:42:9`! startSelectioncxx . . $ structFunctionEditor#startSelection.); |
| 67 | } |
| 68 | |
| 69 | autoEEGWindowcxx . . $ autoEEGWindow# EEGWindow_createcxx . . $ EEGWindow_create(146da99163248bbf). (conststring32cxx . . $ conststring32# title, EEGcxx . . $ EEG# eeg) { |
| 70 | try { |
| 71 | autoEEGWindowcxx . . $ autoEEGWindow# me = Thing_newcxx . . $ `sys/Thing.h:514:9`! (EEGWindow); |
| 72 | mycxx . . $ `melder/melder.h:44:9`! eegAreacxx . . $ structEEGWindow#eegArea(3e44019bbe744b12).() =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). EEGArea_createcxx . . $ EEGArea_create(7a8ba2fcf84676df). (false, nullptr, me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 73 | mycxx . . $ `melder/melder.h:44:9`! eegAreacxx . . $ structEEGWindow#eegArea(3e44019bbe744b12).() ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). borrowedEEGcxx . . $ structEEGArea#borrowedEEG. = eeg; |
| 74 | mycxx . . $ `melder/melder.h:44:9`! eegAnalysisAreacxx . . $ structEEGWindow#eegAnalysisArea(9bbbca8bcbd0ed18).() =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). EEGAnalysisArea_createcxx . . $ EEGAnalysisArea_create(eb69a86077f8e256). (false, nullptr, me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 75 | mycxx . . $ `melder/melder.h:44:9`! textGridAreacxx . . $ structEEGWindow#textGridArea(fd24f7f644037235).() =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). TextGridArea_createcxx . . $ TextGridArea_create(f68f4a3a607552fc). (true, nullptr, me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 76 | FunctionEditor_initcxx . . $ FunctionEditor_init(719bc58b4917372e). (me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), title, eeg); |
| 77 | // no spelling checker |
| 78 | // no callback socket |
| 79 | return mecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 80 | } catch (MelderErrorcxx . . $ MelderError#) { |
| 81 | Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"EEG window not created."); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | /* End of file EEGWindow.cpp */ |