| 1 | /* PointEditor.cpp |
| 2 | * |
| 3 | * Copyright (C) 1992-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 "PointEditor.h" |
| 20 | #include "EditorM.h" |
| 21 | #include "VoiceAnalysis.h" |
| 22 | |
| 23 | Thing_implement (PointEditor, FunctionEditor, 0); |
| 24 | |
| 25 | static void HELP__PointEditorHelp (PointEditor, EDITOR_ARGS) { |
| 26 | HELP (U"PointEditor") |
| 27 | } |
| 28 | |
| 29 | void structPointEditor :: v_createMenuItems_help (EditorMenu menu) { |
| 30 | PointEditor_Parent :: v_createMenuItems_help (menu); |
| 31 | EditorMenu_addCommand (menu, U"PointEditor help", '?', |
| 32 | HELP__PointEditorHelp); |
| 33 | } |
| 34 | |
| 35 | autoPointEditor PointEditor_create (conststring32 title, PointProcess pointProcess, Sound optionalSoundToCopy) { |
| 36 | try { |
| 37 | autoPointEditor me = Thing_new (PointEditor); |
| 38 | my pointArea() = PointArea_create (true, nullptr, me.get()); |
| 39 | if (optionalSoundToCopy) { |
| 40 | autoSound monoSound = Sound_convertToMono (optionalSoundToCopy); |
| 41 | my soundArea() = SoundArea_create (false, monoSound.get(), me.get()); // BUG: double copy |
| 42 | my pointArea() -> borrowedSoundArea = my soundArea().get(); |
| 43 | } |
| 44 | FunctionEditor_init (me.get(), title, pointProcess); |
| 45 | return me; |
| 46 | } catch (MelderError) { |
| 47 | Melder_throw (U"PointProcess window not created."); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | /* End of file PointEditor.cpp */ |