kwave
18.07.70
|
#include <OverViewWidget.h>
Classes | |
class | WorkerThread |
Public Slots | |
void | setRange (sample_index_t offset, sample_index_t viewport, sample_index_t total) |
void | setSelection (sample_index_t offset, sample_index_t length) |
void | metaDataChanged (Kwave::MetaDataList meta) |
void | showCursor (sample_index_t pos=SAMPLE_INDEX_MAX) |
![]() | |
void | setImage (QImage image) |
void | setHorizOffset (int offset) |
void | setVertOffset (int offset) |
Signals | |
void | valueChanged (sample_index_t new_value) |
void | sigCommand (const QString &command) |
void | newImage (QImage image) |
![]() | |
void | viewInfo (int, int, int) |
void | sigCursorPos (const QPoint pos) |
Public Member Functions | |
OverViewWidget (Kwave::SignalManager &signal, QWidget *parent=Q_NULLPTR) | |
virtual | ~OverViewWidget () Q_DECL_OVERRIDE |
virtual QSize | minimumSize () const |
virtual QSize | sizeHint () const Q_DECL_OVERRIDE |
![]() | |
ImageView (QWidget *parent=Q_NULLPTR, bool fit_width=true, bool fit_height=true) | |
virtual | ~ImageView () Q_DECL_OVERRIDE |
QRect | imageRect () |
Protected Slots | |
void | refreshBitmap () |
void | overviewChanged () |
Protected Member Functions | |
virtual void | resizeEvent (QResizeEvent *) Q_DECL_OVERRIDE |
virtual void | mouseMoveEvent (QMouseEvent *) Q_DECL_OVERRIDE |
virtual void | mousePressEvent (QMouseEvent *) Q_DECL_OVERRIDE |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) Q_DECL_OVERRIDE |
sample_index_t | pixels2offset (int pixels) |
void | drawMark (QPainter &p, int x, int height, QColor color) |
![]() | |
virtual void | paintEvent (QPaintEvent *) Q_DECL_OVERRIDE |
Private Member Functions | |
void | calculateBitmap () |
Definition at line 47 of file OverViewWidget.h.
|
explicit |
Constructor
Definition at line 75 of file OverViewWidget.cpp.
References Kwave::connect(), m_cache, m_repaint_timer, metaDataChanged(), newImage(), overviewChanged(), refreshBitmap(), Kwave::SignalManager::selection(), Kwave::ImageView::setImage(), and setSelection().
|
virtual |
Destructor
Definition at line 115 of file OverViewWidget.cpp.
References m_repaint_timer, and m_worker_thread.
|
private |
does the calculation of the new bitmap in background
Definition at line 351 of file OverViewWidget.cpp.
References BAR_BACKGROUND, BAR_FOREGROUND, drawMark(), Kwave::OverViewCache::getOverView(), m_cache, m_cursor_position, m_labels, m_selection_length, m_selection_start, m_signal_length, m_view_offset, m_view_width, newImage(), Kwave::Label::pos(), rect(), SAMPLE_INDEX_MAX, and Kwave::toInt().
Referenced by Kwave::OverViewWidget::WorkerThread::run().
|
protected |
draws a little mark at the top and bottom of a line in the overview image
p | a QPainter used for painting, will be modified |
x | offset from the left [pixel] |
height | the height of the image [pixel] |
color | base color for the marker |
Definition at line 313 of file OverViewWidget.cpp.
Referenced by calculateBitmap().
|
slot |
should be called when meta data has changed
meta | the list of new meta data |
Definition at line 256 of file OverViewWidget.cpp.
References m_labels, m_repaint_timer, and REPAINT_INTERVAL.
Referenced by Kwave::MainWidget::MainWidget(), and OverViewWidget().
|
virtual |
minimum size of the widget,
Definition at line 223 of file OverViewWidget.cpp.
Referenced by sizeHint().
|
protectedvirtual |
On double click with the left mouse button, without shift: move the current viewport center to the clicked position, like on a single-click, but also zoom in (by sending "view:zoom_in()").
When double clicked with the left mouse button with shift: The same as above, but zoom out instead of in (by sending "view:zoom_out()").
Definition at line 153 of file OverViewWidget.cpp.
References _, m_last_offset, pixels2offset(), sigCommand(), and valueChanged().
|
protectedvirtual |
On mouse move: move the current viewport center to the clicked position.
Reimplemented from Kwave::ImageView.
Definition at line 126 of file OverViewWidget.cpp.
References mousePressEvent().
|
protectedvirtual |
On single-click with the left mouse button: move the current viewport center to the clicked position.
Reimplemented from Kwave::ImageView.
Definition at line 132 of file OverViewWidget.cpp.
References m_last_offset, m_view_width, pixels2offset(), and valueChanged().
Referenced by mouseMoveEvent().
|
signal |
emitted when the background calculation of the image is done
Referenced by calculateBitmap(), and OverViewWidget().
|
protectedslot |
connected to the m_repaint_timer, called when it has elapsed and the signal has to be repainted
Definition at line 235 of file OverViewWidget.cpp.
References m_repaint_timer, refreshBitmap(), and REPAINT_INTERVAL.
Referenced by OverViewWidget(), setRange(), and setSelection().
|
protected |
Converts a pixel offset within the overview's drawing area into the user's coordinate system.
pixels | the pixel coordinate [0...width-1] |
Definition at line 181 of file OverViewWidget.cpp.
References m_signal_length.
Referenced by mouseDoubleClickEvent(), and mousePressEvent().
|
protectedslot |
refreshes all modified parts of the bitmap
Definition at line 332 of file OverViewWidget.cpp.
References m_repaint_timer, m_worker_thread, and REPAINT_INTERVAL.
Referenced by overviewChanged(), OverViewWidget(), and resizeEvent().
|
protectedvirtual |
refreshes the bitmap when resized
Definition at line 217 of file OverViewWidget.cpp.
References refreshBitmap().
|
slot |
Sets new range parameters of the slider, using a scale that is calculated out of the slider's maximum position. All parameters are given in the user's coordinates/units (e.g. samples).
offset | index of the first visible sample |
viewport | width of the visible area |
total | width of the whole signal |
Definition at line 195 of file OverViewWidget.cpp.
References m_signal_length, m_view_offset, m_view_width, and overviewChanged().
Referenced by Kwave::MainWidget::updateViewRange().
|
slot |
called when the selected time has changed
offset | index of the first selected sample |
length | number of selected samples |
Definition at line 207 of file OverViewWidget.cpp.
References m_selection_length, m_selection_start, and overviewChanged().
Referenced by OverViewWidget().
|
slot |
shows the cursor at a given position
pos | current position of the cursor |
Definition at line 273 of file OverViewWidget.cpp.
References m_cursor_position, m_repaint_timer, m_signal_length, m_view_offset, m_view_width, REPAINT_INTERVAL_FAST, SAMPLE_INDEX_MAX, and Kwave::toInt().
|
signal |
emitted for zooming in and out via command
Referenced by mouseDoubleClickEvent().
|
virtual |
optimal size for the widget,
Definition at line 229 of file OverViewWidget.cpp.
References minimumSize().
Referenced by Kwave::MainWidget::MainWidget().
|
signal |
Will be emitted if the slider position has changed. The value is in user's units (e.g. samples).
Referenced by mouseDoubleClickEvent(), and mousePressEvent().
|
private |
cache with overview data
Definition at line 219 of file OverViewWidget.h.
Referenced by calculateBitmap(), and OverViewWidget().
|
private |
last cursor position
Definition at line 213 of file OverViewWidget.h.
Referenced by calculateBitmap(), and showCursor().
|
private |
list of labels
Definition at line 225 of file OverViewWidget.h.
Referenced by calculateBitmap(), and metaDataChanged().
|
private |
last emitted offset (for avoiding duplicate events)
Definition at line 216 of file OverViewWidget.h.
Referenced by mouseDoubleClickEvent(), and mousePressEvent().
|
private |
timer for limiting the number of repaints per second
Definition at line 222 of file OverViewWidget.h.
Referenced by metaDataChanged(), overviewChanged(), OverViewWidget(), refreshBitmap(), showCursor(), and ~OverViewWidget().
|
private |
length of the selection [samples]
Definition at line 210 of file OverViewWidget.h.
Referenced by calculateBitmap(), and setSelection().
|
private |
start of the selection [samples]
Definition at line 207 of file OverViewWidget.h.
Referenced by calculateBitmap(), and setSelection().
|
private |
length of the whole area [samples]
Definition at line 204 of file OverViewWidget.h.
Referenced by calculateBitmap(), pixels2offset(), setRange(), and showCursor().
|
private |
index of the first visible sample
Definition at line 198 of file OverViewWidget.h.
Referenced by calculateBitmap(), setRange(), and showCursor().
|
private |
width of the visible area [samples]
Definition at line 201 of file OverViewWidget.h.
Referenced by calculateBitmap(), mousePressEvent(), setRange(), and showCursor().
|
private |
worker thread for updates in background
Definition at line 228 of file OverViewWidget.h.
Referenced by refreshBitmap(), and ~OverViewWidget().