MythTV  master
mainvisual.h
Go to the documentation of this file.
1 // Copyright (c) 2000-2001 Brad Hughes <bhughes@trolltech.com>
2 //
3 // Use, modification and distribution is allowed without limitation,
4 // warranty, or liability of any kind.
5 //
6 
7 #ifndef MAINVISUAL_H
8 #define MAINVISUAL_H
9 
10 #include <vector>
11 using namespace std;
12 
13 #include "constants.h"
14 
15 #include <QResizeEvent>
16 #include <QPaintEvent>
17 #include <QStringList>
18 #include <QHideEvent>
19 #include <QWidget>
20 #include <QPixmap>
21 #include <QTimer>
22 #include <QList>
23 
24 // MythTV headers
25 #include <visual.h>
26 
27 // MythMusic
28 #include "visualize.h"
29 
30 class MythUIVideo;
31 
32 // base class to handle things like frame rate...
33 class MainVisual : public QObject, public MythTV::Visual
34 {
35  Q_OBJECT
36 
37  public:
38  explicit MainVisual(MythUIVideo *visualizer);
39  ~MainVisual() override;
40 
41  VisualBase *visual(void) const { return m_vis; }
42  void setVisual(const QString &name);
43 
44  void stop(void);
45 
46  void resize(const QSize &size);
47 
48  void add(const void *buffer, unsigned long b_len, unsigned long timecode,
49  int source_channel, int bits_per_sample) override; // Visual
50  void prepare(void) override; // Visual
51 
52  void customEvent(QEvent *event) override; // QObject
53 
54  void setFrameRate(int newfps);
55  int frameRate(void) const { return m_fps; }
56 
57  QStringList getVisualizations(void) { return m_visualizers; }
58 
59  int getCurrentVisual(void) const { return m_currentVisualizer; }
60 
61  public slots:
62  void timeout();
63 
64  private:
65  MythUIVideo *m_visualizerVideo {nullptr};
66  QStringList m_visualizers;
67  int m_currentVisualizer {0};
68  VisualBase *m_vis {nullptr};
69  QPixmap m_pixmap;
70  QList<VisualNode*> m_nodes;
71  bool m_playing {false};
72  int m_fps {20};
73  unsigned long m_samples {SAMPLES_DEFAULT_SIZE};
74  QTimer *m_updateTimer {nullptr};
75 };
76 
77 #endif // MAINVISUAL_H
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
MainVisual::setFrameRate
void setFrameRate(int newfps)
VisualBase
Definition: visualize.h:73
slots
unsigned int slots[4]
Definition: element.cpp:38
SAMPLES_DEFAULT_SIZE
#define SAMPLES_DEFAULT_SIZE
Definition: visualize.h:46
MythTV::Visual
Definition: visual.h:17
prepare
query prepare("SELECT chanid, channum, callsign, name " "FROM channel WHERE chanid = :CHANID;")
visualize.h
MainVisual::visual
VisualBase * visual(void) const
Definition: mainvisual.h:41
MainVisual::getVisualizations
QStringList getVisualizations(void)
Definition: mainvisual.h:57
MainVisual::getCurrentVisual
int getCurrentVisual(void) const
Definition: mainvisual.h:59
MainVisual
Definition: mainvisual.h:34
MainVisual::frameRate
int frameRate(void) const
Definition: mainvisual.h:55
MythUIVideo
Video widget, displays raw image data.
Definition: mythuivideo.h:15
constants.h
MainVisual::m_nodes
QList< VisualNode * > m_nodes
Definition: mainvisual.h:70
MainVisual::m_visualizers
QStringList m_visualizers
Definition: mainvisual.h:66
MainVisual::m_pixmap
QPixmap m_pixmap
Definition: mainvisual.h:69
visual.h