| 1 |
/* IntensityTierEditor.cpp |
| 2 |
* |
| 3 |
* Copyright (C) 1992-2012,2014-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 "IntensityTierEditor.h" |
| 20 |
#include "EditorM.h" |
| 21 |
|
| 22 |
Thing_implement (IntensityTierEditor, RealTierEditor, 0); |
| 23 |
|
| 24 |
static void HELP_IntensityTierHelp (IntensityTierEditor, EDITOR_ARGS) { |
| 25 |
HELP (U"IntensityTier") |
| 26 |
} |
| 27 |
|
| 28 |
void structIntensityTierEditor :: v_createMenuItems_help (EditorMenu menu) { |
| 29 |
IntensityTierEditor_Parent :: v_createMenuItems_help (menu); |
| 30 |
EditorMenu_addCommand (menu, U"IntensityTier help", 0, HELP_IntensityTierHelp); |
| 31 |
} |
| 32 |
|
| 33 |
void structIntensityTierEditor :: v_play (double startTime, double endTime) { |
| 34 |
if (our soundArea()) { |
| 35 |
Sound_playPart (our soundArea() -> sound(), startTime, endTime, theFunctionEditor_playCallback, this); |
| 36 |
} else { |
| 37 |
//IntensityTier_playPart (our data, startTime, endTime, false); |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
autoIntensityTierEditor IntensityTierEditor_create (conststring32 title, IntensityTier intensityTier, Sound soundToCopy) { |
| 42 |
try { |
| 43 |
autoIntensityTierEditor me = Thing_new (IntensityTierEditor); |
| 44 |
my realTierArea() = IntensityTierArea_create (true, nullptr, me.get()); |
| 45 |
if (soundToCopy) |
| 46 |
my soundArea() = SoundArea_create (false, soundToCopy, me.get()); |
| 47 |
FunctionEditor_init (me.get(), title, intensityTier); |
| 48 |
return me; |
| 49 |
} catch (MelderError) { |
| 50 |
Melder_throw (U"IntensityTier window not created."); |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
/* End of file IntensityTierEditor.cpp */ |