#ifndef _SoundExample_WavInfo_h_ #define _SoundExample_WavInfo_h_ NAMESPACE_UPP; String FormatFileSize(int64 n); //defined in FileSel.cpp END_UPP_NAMESPACE; class Wav : public WithWavLayout { typedef Wav CLASSNAME; FileSel fs; public: Wav(){ CtrlLayout(*this, ""); browse.SetImage(CtrlImg::open()); play.SetImage(SoundImg::Play()); play.Disable(); browse<<=THISBACK(OnBrowse); play<<=THISBACK(OnPlay); fn<<=THISBACK(OnChange); fs.Type("Wave files","*.wav"); fs.Type("All files","*.*"); } void OnBrowse(){ if(fs.ExecuteOpen()) fn<<=fs.Get(); OnChange(); } void OnChange(){ String file=fn; if(!FileExists(file)){ info<<=""; play.Disable(); return; } if(!IsWavFile(file)){ info<<="[1 This is not a valid WAVE file.]"; play.Disable(); return; } WaveFile f; f.OpenRead(file); String s="[2 Audio information:] [1 &"; s<<"[ [ {{1:1@NFNGN^<200 " "[ File size:]:: [ "<