1 /* 2 * Copyright (C) 2002 - David W. Durham 3 * 4 * This file is part of ReZound, an audio editing application. 5 * 6 * ReZound is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published 8 * by the Free Software Foundation; either version 2 of the License, 9 * or (at your option) any later version. 10 * 11 * ReZound is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 */ 20 21 #ifndef __CMetersWindow_H__ 22 #define __CMetersWindow_H__ 23 24 #include "../../config/common.h" 25 #include "fox_compat.h" 26 27 #include <vector> 28 29 #include "../backend/CSound_defs.h" 30 #include "../misc/TAutoBuffer.h" 31 32 class CLevelMeter; 33 class CBalanceMeter; 34 class CAnalyzer; 35 class CStereoPhaseMeter; 36 37 class ASoundPlayer; 38 39 class CMetersWindow : public FXHorizontalFrame 40 { 41 FXDECLARE(CMetersWindow) 42 public: 43 CMetersWindow(FXComposite *parent); 44 virtual ~CMetersWindow(); 45 46 void setSoundPlayer(ASoundPlayer *soundPlayer); 47 48 void resetGrandMaxPeakLevels(); 49 50 bool isLevelMetersEnabled() const; 51 void enableLevelMeters(bool enable); 52 53 bool isStereoPhaseMetersEnabled() const; 54 void enableStereoPhaseMeters(bool enable); 55 56 bool isFrequencyAnalyzerEnabled() const; 57 void enableFrequencyAnalyzer(bool enable); 58 59 enum 60 { 61 ID_UPDATE_CHORE=FXTopWindow::ID_LAST, 62 ID_UPDATE_TIMEOUT, 63 ID_LABEL_FRAME, 64 ID_GRAND_MAX_PEAK_LEVEL_LABEL, 65 66 ID_LAST 67 }; 68 69 long onUpdateMeters(FXObject *sender,FXSelector,void*); 70 71 long onLabelFrameConfigure(FXObject *sender,FXSelector,void*); 72 73 long onResetGrandMaxPeakLevels(FXObject *sender,FXSelector,void*); 74 75 void showHideAll(); 76 77 protected: 78 CMetersWindow() {} 79 80 private: 81 FXFont *statusFont; 82 FXPacker *levelMetersFrame; 83 FXPacker *headerFrame; 84 FXPacker *labelFrame; 85 FXLabel *grandMaxPeakLevelLabel; 86 FXPacker *balanceMetersFrame; 87 FXLabel *balanceMetersRightMargin; 88 89 CAnalyzer *analyzer; 90 91 TAutoBuffer<sample_t> samplingForStereoPhaseMeters; 92 vector<CStereoPhaseMeter *> stereoPhaseMeters; 93 94 vector<CLevelMeter *> levelMeters; 95 vector<CBalanceMeter *> balanceMeters; 96 97 ASoundPlayer *soundPlayer; 98 99 FXTimer *timeout; 100 101 }; 102 103 104 #endif 105