kwave
18.07.70
|
#include <ClipBoard.h>
Public Slots | |
void | slotChanged (QClipboard::Mode mode) |
Signals | |
void | clipboardChanged (bool data_available) |
Public Member Functions | |
ClipBoard () | |
virtual | ~ClipBoard () |
void | copy (QWidget *widget, Kwave::SignalManager &signal_manager, const QList< unsigned int > &track_list, sample_index_t offset, sample_index_t length) |
bool | paste (QWidget *widget, Kwave::SignalManager &signal_manager, sample_index_t offset, sample_index_t length) |
void | clear () |
bool | isEmpty () |
Static Public Member Functions | |
static ClipBoard & | instance () |
Private Attributes | |
unsigned int | m_tracks |
Implements a global clipboard for Kwave. It supports only the three simple operations put
, get
and clear
.
Definition at line 41 of file ClipBoard.h.
Kwave::ClipBoard::ClipBoard | ( | ) |
Constructor.
Definition at line 45 of file ClipBoard.cpp.
|
virtual |
Destructor
Definition at line 51 of file ClipBoard.cpp.
void Kwave::ClipBoard::clear | ( | ) |
Clears the internal buffers. The clipboard will be empty after this function returns and the sample rate will be set to zero.
Definition at line 124 of file ClipBoard.cpp.
Referenced by Kwave::SignalManager::executeCommand().
|
signal |
Emitted whenever the clipboard has changed from empty to non-empty (with decodeable data) or vice versa.
data_available | if true: contains decodeable data, if false: nothing decodeable or empty |
Referenced by slotChanged().
void Kwave::ClipBoard::copy | ( | QWidget * | widget, |
Kwave::SignalManager & | signal_manager, | ||
const QList< unsigned int > & | track_list, | ||
sample_index_t | offset, | ||
sample_index_t | length | ||
) |
Discards the current content of the clipboard and fills it with a selected range of samples from a set of tracks.
widget | the widget used as parent for displaying error messages |
signal_manager | the SignalManager with the tracks to read from |
track_list | a list of indices of tracks for reading |
offset | first sample to copy |
length | number of samples |
Definition at line 69 of file ClipBoard.cpp.
References Kwave::MimeData::clear(), Kwave::MimeData::encode(), Kwave::SignalManager::metaData(), and Kwave::SinglePassForward.
Referenced by Kwave::SignalManager::executeCommand().
|
static |
returns the static instance of the clipboard
Definition at line 39 of file ClipBoard.cpp.
References g_clipboard.
Referenced by Kwave::App::App(), Kwave::SignalWidget::contextMenuEvent(), Kwave::SignalManager::executeCommand(), Kwave::TopWidget::init(), and Kwave::TopWidget::updateMenu().
bool Kwave::ClipBoard::isEmpty | ( | ) |
Returns true if the buffer is empty.
Definition at line 130 of file ClipBoard.cpp.
References Kwave::CodecManager::canDecode().
Referenced by Kwave::SignalManager::executeCommand(), paste(), slotChanged(), and Kwave::TopWidget::updateMenu().
bool Kwave::ClipBoard::paste | ( | QWidget * | widget, |
Kwave::SignalManager & | signal_manager, | ||
sample_index_t | offset, | ||
sample_index_t | length | ||
) |
Transfers all stored data from the clipboard into a SignalManager.
widget | the widget used as parent for displaying error messages |
signal_manager | the SignalManager with the tracks to write to |
offset | sample position where to paste |
length | length of the current selection in samples |
Definition at line 99 of file ClipBoard.cpp.
References Kwave::MimeData::decode(), Kwave::SignalManager::deleteRange(), isEmpty(), and Kwave::SignalManager::selectRange().
Referenced by Kwave::SignalManager::executeCommand().
|
slot |
emits clipboardChanged() whenever the clipboard has changed from empty to filled (with decodeable data) or vice versa (connected to the Qt clipboard)
Definition at line 57 of file ClipBoard.cpp.
References clipboardChanged(), and isEmpty().
|
private |
number of tracks of the content
Definition at line 115 of file ClipBoard.h.