@SoundEditor.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class SoundEditor : PropWin
  4. {
  5. UID elm_id;
  6. Elm *elm;
  7. bool changed,
  8. loop,
  9. seek_set;
  10. flt volume, seek_pos;
  11. Sound sound;
  12. Property *import_as, *length, *channels, *freq, *kbps, *size, *codec, *vol;
  13. Slider progress;
  14. Button play, locate, apply_vol;
  15. static void Locate(SoundEditor &editor);
  16. static void Seek (SoundEditor &editor);
  17. static void Play (SoundEditor &editor);
  18. class ImportAs
  19. {
  20. cchar8 *name;
  21. SOUND_CODEC codec;
  22. int bit_rate; // -1=original, 0=auto, >0=relative to 44.1KHz stereo
  23. };
  24. static ImportAs Import_as[]
  25. ;
  26. static int ImportAsElms;
  27. static void SetImportAs(SoundEditor &editor, C Str &t);
  28. static Str GetImportAs(C SoundEditor &editor);
  29. static void ApplyVol(SoundEditor &editor);
  30. void create();
  31. void update(bool set_frac=true);
  32. void setInfo();
  33. virtual void update(C GuiPC &gpc)override;
  34. virtual void draw(C GuiPC &gpc)override;
  35. virtual SoundEditor& hide()override;
  36. void flush();
  37. void setChanged();
  38. void set(Elm *elm);
  39. void activate(Elm *elm);
  40. void toggle (Elm *elm);
  41. void closeElm(C UID &elm_id);
  42. void elmChanged(C UID &elm_id);
  43. void erasing(C UID &elm_id);
  44. public:
  45. SoundEditor();
  46. };
  47. /******************************************************************************/
  48. /******************************************************************************/
  49. extern SoundEditor SoundEdit;
  50. /******************************************************************************/