kwave
18.07.70
|
#include <PlayerToolBar.h>
Public Slots | |
void | contextSwitched (Kwave::FileContext *context) |
void | contextDestroyed (Kwave::FileContext *context) |
int | executeCommand (const QString &command) |
void | metaDataChanged (Kwave::MetaDataList meta_data) |
void | visibleRangeChanged (sample_index_t offset, sample_index_t visible, sample_index_t total) |
Signals | |
void | sigCommand (const QString &command) |
void | sigSetMenuItemEnabled (const QString &uid, bool enable) |
Public Member Functions | |
PlayerToolBar (KMainWindow *parent, const QString &name, Kwave::MenuManager &menu_manager) | |
virtual | ~PlayerToolBar () |
Private Slots | |
void | toolbarRewindPrev () |
void | toolbarRewind () |
void | toolbarRecord () |
void | toolbarStart () |
void | toolbarLoop () |
void | playbackPaused () |
void | toolbarPause () |
void | toolbarStop () |
void | blinkPause () |
void | toolbarForward () |
void | toolbarForwardNext () |
void | updateState () |
void | updatePlaybackPos (sample_index_t pos) |
Private Attributes | |
Kwave::FileContext * | m_context |
QAction * | m_action_prev |
QAction * | m_action_rewind |
QAction * | m_action_record |
QAction * | m_action_play |
QAction * | m_action_loop |
QAction * | m_action_pause |
QAction * | m_action_stop |
QAction * | m_action_forward |
QAction * | m_action_next |
QTimer * | m_pause_timer |
bool | m_blink_on |
QPointer< Kwave::PlaybackController > | m_playback |
Kwave::MenuManager & | m_menu_manager |
Kwave::LabelList | m_labels |
unsigned int | m_last_tracks |
sample_index_t | m_last_offset |
sample_index_t | m_last_visible |
sample_index_t | m_last_length |
Definition at line 44 of file PlayerToolBar.h.
Kwave::PlayerToolBar::PlayerToolBar | ( | KMainWindow * | parent, |
const QString & | name, | ||
Kwave::MenuManager & | menu_manager | ||
) |
Constructor
parent | a KMainWidget |
name | the name of the toolbar (for config) |
menu_manager | the MenuManager |
Definition at line 50 of file PlayerToolBar.cpp.
References _, m_action_forward, m_action_loop, m_action_next, m_action_pause, m_action_play, m_action_prev, m_action_record, m_action_rewind, m_action_stop, toolbarForward(), toolbarForwardNext(), toolbarLoop(), toolbarPause(), toolbarRecord(), toolbarRewind(), toolbarRewindPrev(), toolbarStart(), toolbarStop(), and updateState().
|
virtual |
Destructor
Definition at line 123 of file PlayerToolBar.cpp.
References m_context, and m_pause_timer.
|
privateslot |
toggles the state of the pause button
Definition at line 305 of file PlayerToolBar.cpp.
References _, m_action_pause, m_blink_on, and m_playback.
Referenced by playbackPaused(), and updateState().
|
slot |
called when a file context has been deleted
Definition at line 178 of file PlayerToolBar.cpp.
References contextSwitched(), and m_context.
|
slot |
called when the file context has been (updates the toolbar)
Definition at line 131 of file PlayerToolBar.cpp.
References Kwave::connect(), m_context, m_playback, Kwave::SignalManager::playbackController(), playbackPaused(), Kwave::FileContext::signalManager(), updatePlaybackPos(), updateState(), and visibleRangeChanged().
Referenced by contextDestroyed().
|
slot |
Executes a playback command
command | string with the command |
Definition at line 475 of file PlayerToolBar.cpp.
References CASE_COMMAND, m_action_forward, m_action_loop, m_action_next, m_action_pause, m_action_play, m_action_prev, m_action_rewind, and m_action_stop.
Referenced by Kwave::TopWidget::executeCommand().
|
slot |
Called when the meta data of the current signal has changed, to track changes in signal length
meta_data | the new meta data, after the change |
Definition at line 507 of file PlayerToolBar.cpp.
References Kwave::FileInfo::length(), m_labels, m_last_length, m_last_tracks, m_playback, Kwave::FileInfo::tracks(), and updateState().
|
privateslot |
playback has been paused
Definition at line 264 of file PlayerToolBar.cpp.
References blinkPause(), Kwave::connect(), m_blink_on, m_pause_timer, and updateState().
Referenced by contextSwitched().
|
signal |
Tells this widget's parent to execute a command
Referenced by toolbarForward(), toolbarForwardNext(), toolbarRecord(), toolbarRewind(), and toolbarRewindPrev().
|
signal |
Emitted when an action has been enabled/disabled
|
privateslot |
toolbar button for "forward" pressed
Definition at line 319 of file PlayerToolBar.cpp.
References _, m_action_forward, m_playback, SEEK_LENGTH, and sigCommand().
Referenced by PlayerToolBar().
|
privateslot |
toolbar button for "forward to end" pressed
Definition at line 351 of file PlayerToolBar.cpp.
References _, m_action_next, m_labels, m_playback, Kwave::LabelList::nextLabelRight(), and sigCommand().
Referenced by PlayerToolBar().
|
privateslot |
toolbar button for "loop" pressed
Definition at line 258 of file PlayerToolBar.cpp.
References m_playback.
Referenced by PlayerToolBar().
|
privateslot |
connected to the clicked() signal of the pause button
Definition at line 282 of file PlayerToolBar.cpp.
References m_action_pause, m_last_length, m_last_tracks, and m_playback.
Referenced by PlayerToolBar().
|
privateslot |
toolbar button for "record" pressed
Definition at line 244 of file PlayerToolBar.cpp.
References _, m_action_record, and sigCommand().
Referenced by PlayerToolBar().
|
privateslot |
toolbar button for "rewind" pressed
Definition at line 213 of file PlayerToolBar.cpp.
References _, m_action_rewind, m_playback, SEEK_LENGTH, and sigCommand().
Referenced by PlayerToolBar().
|
privateslot |
toolbar button for "rewind to start" pressed
Definition at line 185 of file PlayerToolBar.cpp.
References _, m_action_prev, m_labels, m_playback, Kwave::LabelList::nextLabelLeft(), and sigCommand().
Referenced by PlayerToolBar().
|
privateslot |
toolbar button for "start" pressed
Definition at line 252 of file PlayerToolBar.cpp.
References m_playback.
Referenced by PlayerToolBar().
|
privateslot |
toolbar button for "stop" pressed
Definition at line 299 of file PlayerToolBar.cpp.
References m_playback.
Referenced by PlayerToolBar().
|
privateslot |
updates the current playback position
Definition at line 468 of file PlayerToolBar.cpp.
References updateState().
Referenced by contextSwitched().
|
privateslot |
update the state of all toolbar buttons
Definition at line 368 of file PlayerToolBar.cpp.
References _, blinkPause(), m_action_forward, m_action_loop, m_action_next, m_action_pause, m_action_play, m_action_prev, m_action_record, m_action_rewind, m_action_stop, m_blink_on, m_labels, m_last_length, m_last_offset, m_last_tracks, m_last_visible, m_menu_manager, m_pause_timer, m_playback, Kwave::LabelList::nextLabelLeft(), Kwave::LabelList::nextLabelRight(), SEEK_LENGTH, Kwave::MenuManager::setItemEnabled(), and UPDATE_MENU.
Referenced by contextSwitched(), metaDataChanged(), playbackPaused(), PlayerToolBar(), updatePlaybackPos(), and visibleRangeChanged().
|
slot |
Updates the enabled/disabled state of the seek buttons after changes of the currently visible view range
offset | index of the first visible sample |
visible | number of visible samples |
total | length of the whole signal |
Definition at line 527 of file PlayerToolBar.cpp.
References m_last_length, m_last_offset, m_last_visible, and updateState().
Referenced by contextSwitched().
|
private |
action of the "forward" toolbar button
Definition at line 169 of file PlayerToolBar.h.
Referenced by executeCommand(), PlayerToolBar(), toolbarForward(), and updateState().
|
private |
action of the "start playback and loop" toolbar button
Definition at line 160 of file PlayerToolBar.h.
Referenced by executeCommand(), PlayerToolBar(), and updateState().
|
private |
action of the "forward to end" toolbar button
Definition at line 172 of file PlayerToolBar.h.
Referenced by executeCommand(), PlayerToolBar(), toolbarForwardNext(), and updateState().
|
private |
action of the "pause playback" toolbar button
Definition at line 163 of file PlayerToolBar.h.
Referenced by blinkPause(), executeCommand(), PlayerToolBar(), toolbarPause(), and updateState().
|
private |
action of the "start playback" toolbar button
Definition at line 157 of file PlayerToolBar.h.
Referenced by executeCommand(), PlayerToolBar(), and updateState().
|
private |
action of the "rewind to start" toolbar button
Definition at line 148 of file PlayerToolBar.h.
Referenced by executeCommand(), PlayerToolBar(), toolbarRewindPrev(), and updateState().
|
private |
action of the "start record" toolbar button
Definition at line 154 of file PlayerToolBar.h.
Referenced by PlayerToolBar(), toolbarRecord(), and updateState().
|
private |
action of the "rewind" toolbar button
Definition at line 151 of file PlayerToolBar.h.
Referenced by executeCommand(), PlayerToolBar(), toolbarRewind(), and updateState().
|
private |
action of the "stop playback" toolbar button
Definition at line 166 of file PlayerToolBar.h.
Referenced by executeCommand(), PlayerToolBar(), and updateState().
|
private |
determines the state of blinking toolbar buttons
Definition at line 178 of file PlayerToolBar.h.
Referenced by blinkPause(), playbackPaused(), and updateState().
|
private |
the current file context (could be null)
Definition at line 145 of file PlayerToolBar.h.
Referenced by contextDestroyed(), contextSwitched(), and ~PlayerToolBar().
|
private |
list of labels (sorted)
Definition at line 187 of file PlayerToolBar.h.
Referenced by metaDataChanged(), toolbarForwardNext(), toolbarRewindPrev(), and updateState().
|
private |
last length of the signal
Definition at line 199 of file PlayerToolBar.h.
Referenced by metaDataChanged(), toolbarPause(), updateState(), and visibleRangeChanged().
|
private |
last offset of the current view
Definition at line 193 of file PlayerToolBar.h.
Referenced by updateState(), and visibleRangeChanged().
|
private |
last number of tracks
Definition at line 190 of file PlayerToolBar.h.
Referenced by metaDataChanged(), toolbarPause(), and updateState().
|
private |
last number of visible samples
Definition at line 196 of file PlayerToolBar.h.
Referenced by updateState(), and visibleRangeChanged().
|
private |
reference to a menu manager
Definition at line 184 of file PlayerToolBar.h.
Referenced by updateState().
|
private |
Timer used to let the pause button blink...
Definition at line 175 of file PlayerToolBar.h.
Referenced by playbackPaused(), updateState(), and ~PlayerToolBar().
|
private |
pointer to a playback controller
Definition at line 181 of file PlayerToolBar.h.
Referenced by blinkPause(), contextSwitched(), metaDataChanged(), toolbarForward(), toolbarForwardNext(), toolbarLoop(), toolbarPause(), toolbarRewind(), toolbarRewindPrev(), toolbarStart(), toolbarStop(), and updateState().