RealTierEditor.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef _RealTierEditor_h_
  2. #define _RealTierEditor_h_
  3. /* RealTierEditor.h
  4. *
  5. * Copyright (C) 1992-2011,2012,2015,2017 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "TimeSoundEditor.h"
  21. #include "RealTier.h"
  22. Thing_define (RealTierEditor, TimeSoundEditor) {
  23. double ymin, ymax, ycursor;
  24. void v_createMenus ()
  25. override;
  26. void v_dataChanged ()
  27. override;
  28. void v_draw ()
  29. override;
  30. bool v_click (double xWC, double yWC, bool shiftKeyPressed)
  31. override;
  32. void v_play (double tmin, double tmax)
  33. override;
  34. void v_createMenuItems_view (EditorMenu menu)
  35. override;
  36. virtual double v_minimumLegalValue () { return undefined; }
  37. virtual double v_maximumLegalValue () { return undefined; }
  38. virtual conststring32 v_quantityText () { return U"Y"; } // normally includes units
  39. virtual conststring32 v_rightTickUnits () { return U""; }
  40. virtual double v_defaultYmin () { return 0.0; }
  41. virtual double v_defaultYmax () { return 1.0; }
  42. virtual conststring32 v_setRangeTitle () { return U"Set range..."; }
  43. virtual conststring32 v_defaultYminText () { return U"0.0"; }
  44. virtual conststring32 v_defaultYmaxText () { return U"1.0"; }
  45. virtual conststring32 v_yminText () { return U"Minimum"; } // normally includes units
  46. virtual conststring32 v_ymaxText () { return U"Maximum"; } // normally includes units
  47. };
  48. void RealTierEditor_updateScaling (RealTierEditor me);
  49. /*
  50. Computes the ymin and ymax values on the basis of the data.
  51. Call after every change in the data.
  52. */
  53. void RealTierEditor_init (RealTierEditor me, conststring32 title, RealTier data, Sound sound, bool ownSound);
  54. /*
  55. `sound` may be null;
  56. if `ownSound` is `true`, the editor will contain a deep copy of the Sound,
  57. which the editor will destroy when the editor is destroyed.
  58. */
  59. /* End of file RealTierEditor.h */
  60. #endif