kwave  18.07.70
PlayerToolBar.h
Go to the documentation of this file.
1 /***************************************************************************
2  PlayerToolBar.h - Toolbar with control logic for playback/record
3  -------------------
4  begin : 2012-04-23
5  copyright : (C) 2012 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <Thomas.Eschenbacher@gmx.de>
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #ifndef PLAYER_TOOL_BAR_H
20 #define PLAYER_TOOL_BAR_H
21 
22 #include "config.h"
23 
24 #include <QObject>
25 #include <QPointer>
26 #include <QTimer>
27 
28 #include <KToolBar>
29 
30 #include "libkwave/LabelList.h"
31 #include "libkwave/MetaDataList.h"
32 #include "libkwave/Sample.h"
33 
34 class QAction;
35 class KMainWindow;
36 
37 namespace Kwave
38 {
39 
40  class FileContext;
41  class MenuManager;
42  class PlaybackController;
43 
44  class PlayerToolBar: public KToolBar
45  {
46  Q_OBJECT
47  public:
54  PlayerToolBar(KMainWindow *parent, const QString &name,
55  Kwave::MenuManager &menu_manager
56  );
57 
59  virtual ~PlayerToolBar();
60 
61  signals:
62 
64  void sigCommand(const QString &command);
65 
67  void sigSetMenuItemEnabled(const QString &uid, bool enable);
68 
69  public slots:
70 
72  void contextSwitched(Kwave::FileContext *context);
73 
75  void contextDestroyed(Kwave::FileContext *context);
76 
81  int executeCommand(const QString &command);
82 
88  void metaDataChanged(Kwave::MetaDataList meta_data);
89 
98  sample_index_t visible,
99  sample_index_t total);
100 
101  private slots:
102 
104  void toolbarRewindPrev();
105 
107  void toolbarRewind();
108 
110  void toolbarRecord();
111 
113  void toolbarStart();
114 
116  void toolbarLoop();
117 
119  void playbackPaused();
120 
122  void toolbarPause();
123 
125  void toolbarStop();
126 
128  void blinkPause();
129 
131  void toolbarForward();
132 
134  void toolbarForwardNext();
135 
137  void updateState();
138 
141 
142  private:
143 
146 
148  QAction *m_action_prev;
149 
151  QAction *m_action_rewind;
152 
154  QAction *m_action_record;
155 
157  QAction *m_action_play;
158 
160  QAction *m_action_loop;
161 
163  QAction *m_action_pause;
164 
166  QAction *m_action_stop;
167 
170 
172  QAction *m_action_next;
173 
175  QTimer *m_pause_timer;
176 
179 
181  QPointer<Kwave::PlaybackController> m_playback;
182 
185 
188 
190  unsigned int m_last_tracks;
191 
194 
197 
200 
201  };
202 
203 }
204 
205 #endif /* PLAYER_TOOL_BAR_H */
206 
207 //***************************************************************************
208 //***************************************************************************
void contextSwitched(Kwave::FileContext *context)
void updatePlaybackPos(sample_index_t pos)
void contextDestroyed(Kwave::FileContext *context)
Definition: App.h:33
quint64 sample_index_t
Definition: Sample.h:28
const char name[16]
Definition: memcpy.c:510
Manager class for access to Kwave&#39;s menu subsystem.
Definition: MenuManager.h:46
Kwave::FileContext * m_context
PlayerToolBar(KMainWindow *parent, const QString &name, Kwave::MenuManager &menu_manager)
void visibleRangeChanged(sample_index_t offset, sample_index_t visible, sample_index_t total)
void sigSetMenuItemEnabled(const QString &uid, bool enable)
sample_index_t m_last_visible
Kwave::LabelList m_labels
int executeCommand(const QString &command)
QPointer< Kwave::PlaybackController > m_playback
sample_index_t m_last_offset
unsigned int m_last_tracks
sample_index_t m_last_length
void sigCommand(const QString &command)
void metaDataChanged(Kwave::MetaDataList meta_data)
QAction * m_action_forward
Kwave::MenuManager & m_menu_manager