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