Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[429088]: kwave / signalview.h Maximize Restore History

Download this file

signalview.h    130 lines (115 with data), 3.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#ifndef _KWAVESIGNALVIEW_H_
#define _KWAVESIGNALVIEW_H_ 1
#include <qfile.h>
#include <qstring.h>
#include <qfiledlg.h>
#include <qwidget.h>
#include <qtimer.h>
#include <kapp.h>
#include <kselect.h>
#include <kstatusbar.h>
#include <kbutton.h>
#include "sample.h"
#include "multistateimage.h"
#include "overview.h"
#include "menumanager.h"
#include "markers.h"
#define ADDMARK 7000
#define DELETEMARK 7001
#define EDITMARK 7002
#define LOADMARK 7003
#define SAVEMARK 7004
#define APPENDMARK 7005
#define MARKSIGNAL 7006
#define MARKPERIOD 7007
#define SAVEPERIODS 7008
#define TOPITCH 7009
#define ADDMARKTYPE 7010
#define SELECTMARK 7100 //leave #MAXMENU Items space behind !
//***********************************************************
class SignalWidget : public QWidget
//this class is mainly responsible for displaying signals in the time-domain
{
Q_OBJECT
public:
SignalWidget (QWidget *parent,MenuManager *manage);
// SignalWidget (QWidget *parent,MenuManager *manage,const char *name=0);
~SignalWidget ();
void setSignal (QString *filename,int type=0);
void saveSignal (QString *filename,int,int=false);
void saveBlocks (int);
void saveSelectedSignal (QString *filename,int,int=false);
void setSignal (MSignal *signal);
void setZoom (double);
void setRange (int,int);
unsigned char *getOverview (int);
int checkPosition (int);
void drawSelection (int,int);
void setMarkType(int);
void addMarkType();
void addMarkType (struct MarkerType *marker);
public slots:
void refresh ();
void setOffset (int);
void setRangeOp (int);
void toggleChannel (int);
void time ();
void zoomRange ();
void zoomIn ();
void zoomOut ();
void zoomNormal ();
void signalinserted (int,int);
void signaldeleted (int,int);
signals:
void channelReset ();
void playingfinished ();
void viewInfo (int,int,int);
void lengthInfo (int);
void rateInfo (int);
void timeInfo (int);
void selectedtimeInfo (int);
void channelInfo (int);
void addMarkerType (struct MarkerType *);
protected:
void mousePressEvent (QMouseEvent * );
void mouseReleaseEvent (QMouseEvent * );
void mouseMoveEvent (QMouseEvent * );
void paintEvent (QPaintEvent *);
void deleteLastRange ();
void drawRange ();
void drawSignal (int *,int,int);
void drawInterpolatedSignal (int *,int,int);
void drawOverviewSignal (int *,int,int);
void calcTimeInfo ();
void loadMarks ();
void appendMarks ();
void deleteMarks ();
void convertMarkstoPitch ();
void saveMarks ();
void addMark ();
void jumptoLabel ();
void markSignal ();
void markPeriods ();
void savePeriods ();
void createSignal ();
private:
int offset;
int width,height; //of widget
int down,reset; //flags for drawing
double zoomy;
double zoom; //number of samples represented by 1
//vertical line on the screen
int firstx,lastx,nextx; //markers for mouse mark operation
int lasty; //marker for mouse zoom...
int playpointer,lastplaypointer;
int playing; //flag if playing task is running...
int redraw; //flag for redrawing pixmap
MSignal *signal;
QTimer *timer;
QPainter p;
QPixmap *pixmap; //pixmap to be blitted to screen
MarkerList *markers; //linked list of markers
MarkerType *markertype; //selected marker type
MenuManager *manage;
};
#endif //_KWAVESIGNALVIEW_H_