| 1 | /* PitchTierEditor.cpp |
| 2 | * |
| 3 | * Copyright (C) 1992-2012,2015,2016,2018,2020-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 "PitchTierEditor.h" |
| 20 | #include "EditorM.h" |
| 21 | |
| 22 | Thing_implement (PitchTierEditor, FunctionEditor, 0); |
| 23 | |
| 24 | static void menu_cb_PitchTierEditorHelp (PitchTierEditor, EDITOR_ARGS) { |
| 25 | HELP (U"PitchTierEditor") |
| 26 | } |
| 27 | |
| 28 | static void menu_cb_PitchTierHelp (PitchTierEditor, EDITOR_ARGS) { |
| 29 | HELP (U"PitchTier") |
| 30 | } |
| 31 | |
| 32 | void structPitchTierEditor :: v_createMenuItems_help (EditorMenu menu) { |
| 33 | PitchTierEditor_Parent :: v_createMenuItems_help (menu); |
| 34 | EditorMenu_addCommand (menu, U"PitchTierEditor help", 0, menu_cb_PitchTierEditorHelp); |
| 35 | EditorMenu_addCommand (menu, U"PitchTier help", 0, menu_cb_PitchTierHelp); |
| 36 | } |
| 37 | |
| 38 | autoPitchTierEditor PitchTierEditor_create (conststring32 title, PitchTier pitchTier, Sound optionalSoundToCopy) { |
| 39 | try { |
| 40 | autoPitchTierEditor me = Thing_new (PitchTierEditor); |
| 41 | my pitchTierArea() = PitchTierArea_create (true, nullptr, me.get()); |
| 42 | if (optionalSoundToCopy) |
| 43 | my soundArea() = SoundArea_create (false, optionalSoundToCopy, me.get()); |
| 44 | FunctionEditor_init (me.get(), title, pitchTier); |
| 45 | return me; |
| 46 | } catch (MelderError) { |
| 47 | Melder_throw (U"PitchTier window not created."); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | /* End of file PitchTierEditor.cpp */ |