| 1 | /* OptimalCeilingTierEditor.cpp |
| 2 | * |
| 3 | * Copyright (C) 2015-2019 David Weenink, 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 "OptimalCeilingTierEditor.h" |
| 20 | #include "EditorM.h" |
| 21 | |
| 22 | Thing_implement (OptimalCeilingTierEditor, RealTierEditor, 0); |
| 23 | |
| 24 | static void menu_cb_OptimalCeilingTierHelp (OptimalCeilingTierEditor, EDITOR_ARGS) { Melder_help (U"OptimalCeilingTier"); } |
| 25 | |
| 26 | void structOptimalCeilingTierEditor :: v_createMenuItems_help (EditorMenu menu) { |
| 27 | OptimalCeilingTierEditor_Parent :: v_createMenuItems_help (menu); |
| 28 | EditorMenu_addCommand (menu, U"OptimalCeilingTier help", 0, menu_cb_OptimalCeilingTierHelp); |
| 29 | } |
| 30 | |
| 31 | void structOptimalCeilingTierEditor :: v_play (double startTime, double endTime) { |
| 32 | if (our soundArea()) |
| 33 | Sound_playPart (our soundArea() -> sound(), startTime, endTime, theFunctionEditor_playCallback, this); |
| 34 | //else |
| 35 | // OptimalCeilingTier_playPart (data, startTime, endTime, false); |
| 36 | } |
| 37 | |
| 38 | autoOptimalCeilingTierEditor OptimalCeilingTierEditor_create (conststring32 title, |
| 39 | OptimalCeilingTier optimalCeilingTier, Sound soundToCopy) |
| 40 | { |
| 41 | try { |
| 42 | autoOptimalCeilingTierEditor me = Thing_new (OptimalCeilingTierEditor); |
| 43 | my realTierArea() = OptimalCeilingTierArea_create (true, nullptr, me.get()); |
| 44 | if (soundToCopy) |
| 45 | my soundArea() = SoundArea_create (false, soundToCopy, me.get()); |
| 46 | FunctionEditor_init (me.get(), title, optimalCeilingTier); |
| 47 | return me; |
| 48 | } catch (MelderError) { |
| 49 | Melder_throw (U"OptimalCeilingTier window not created."); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /* End of file OptimalCeilingTierEditor.cpp */ |