//========================================================= // MusE // Linux Music Editor // $Id: waveview.h,v 1.3.2.6 2009/02/02 21:38:01 terminator356 Exp $ // (C) Copyright 2000 Werner Schweer (ws@seh.de) //========================================================= #ifndef WAVE_VIEW_H #define WAVE_VIEW_H #include "view.h" #include //Added by qt3to4: #include #include "wave.h" class PartList; class QPainter; class QRect; class WavePart; class MidiEditor; class SndFileR; struct WaveEventSelection { SndFileR file; unsigned startframe; unsigned endframe; }; typedef std::list WaveSelectionList; typedef std::list::iterator iWaveSelection; //--------------------------------------------------------- // WaveView //--------------------------------------------------------- class WaveView : public View { MidiEditor* editor; unsigned pos[3]; int yScale; int button; int startSample; int endSample; WavePart* curPart; int curPartId; enum { NORMAL, DRAG } mode; enum { MUTE = 0, NORMALIZE, FADE_IN, FADE_OUT, REVERSE, GAIN, EDIT_EXTERNAL }; //!< Modify operations unsigned selectionStart, selectionStop, dragstartx; Q_OBJECT virtual void pdraw(QPainter&, const QRect&); virtual void draw(QPainter&, const QRect&); virtual void viewMousePressEvent(QMouseEvent*); virtual void viewMouseMoveEvent(QMouseEvent*); virtual void viewMouseReleaseEvent(QMouseEvent*); bool getUniqueTmpfileName(QString& newFilename); //!< Generates unique filename for temporary SndFile WaveSelectionList getSelection(unsigned startpos, unsigned stoppos); int lastGainvalue; //!< Stores the last used gainvalue when specifiying gain value in the editgain dialog void modifySelection(int operation, unsigned startpos, unsigned stoppos, double paramA); //!< Modifies selection void muteSelection(unsigned channels, float** data, unsigned length); //!< Mutes selection void normalizeSelection(unsigned channels, float** data, unsigned length); //!< Normalizes selection void fadeInSelection(unsigned channels, float** data, unsigned length); //!< Linear fade in of selection void fadeOutSelection(unsigned channels, float** data, unsigned length); //!< Linear fade out of selection void reverseSelection(unsigned channels, float** data, unsigned length); //!< Reverse selection void applyGain(unsigned channels, float** data, unsigned length, double gain); //!< Apply gain to selection void editExternal(unsigned file_format, unsigned file_samplerate, unsigned channels, float** data, unsigned length); //void applyLadspa(unsigned channels, float** data, unsigned length); //!< Apply LADSPA plugin on selection private slots: void setPos(int idx, unsigned val, bool adjustScrollbar); public slots: void setYScale(int); void songChanged(int type); signals: void followEvent(int); void timeChanged(unsigned); public: WaveView(MidiEditor*, QWidget* parent, int xscale, int yscale); QString getCaption() const; void range(int*, int*); void cmd(int n); WavePart* part() { return curPart; } }; #endif