Debian Codegraph @

foned/PitchEditor.cpp

raw
1 /* PitchEditor.cpp
2 *
3 * Copyright (C) 1992-2012,2014-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 "PitchEditor.h"
20 #include "EditorM.h"
21
22 Thing_implement (PitchEditor, FunctionEditor, 0);
23
24 static void menu_cb_PitchEditorHelp (PitchEditor, EDITOR_ARGS) { Melder_help (U"PitchEditor"); }
25 static void menu_cb_PitchHelp (PitchEditor, EDITOR_ARGS) { Melder_help (U"Pitch"); }
26
27 void structPitchEditor :: v_createMenuItems_help (EditorMenu menu) {
28 PitchEditor_Parent :: v_createMenuItems_help (menu);
29 EditorMenu_addCommand (menu, U"PitchEditor help", U'?', menu_cb_PitchEditorHelp);
30 EditorMenu_addCommand (menu, U"Pitch help", 0, menu_cb_PitchHelp);
31 }
32
33 autoPitchEditor PitchEditor_create (conststring32 title, Pitch pitch) {
34 try {
35 autoPitchEditor me = Thing_new (PitchEditor);
36 my pitchArea() = PitchArea_create (true, nullptr, me.get());
37 FunctionEditor_init (me.get(), title, pitch);
38 return me;
39 } catch (MelderError) {
40 Melder_throw (U"Pitch window not created.");
41 }
42 }
43
44 /* End of file PitchEditor.cpp */