PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/src/audiocontrols.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 114 lines | 71 code | 25 blank | 18 comment | 0 complexity | e0e67e3a59bdcf0b5ef2c88b405bf37a MD5 | raw file
  1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
  2 *
  3 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
  4 *   Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
  5 *
  6 *   Tomahawk is free software: you can redistribute it and/or modify
  7 *   it under the terms of the GNU General Public License as published by
  8 *   the Free Software Foundation, either version 3 of the License, or
  9 *   (at your option) any later version.
 10 *
 11 *   Tomahawk is distributed in the hope that it will be useful,
 12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 14 *   GNU General Public License for more details.
 15 *
 16 *   You should have received a copy of the GNU General Public License
 17 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
 18 */
 19
 20#ifndef AUDIOCONTROLS_H
 21#define AUDIOCONTROLS_H
 22
 23#include "Result.h"
 24#include "PlaylistInterface.h"
 25#include "Query.h"
 26
 27#include <QWidget>
 28#include <QTimer>
 29#include <QTimeLine>
 30
 31class QDropEvent;
 32class QDragEnterEvent;
 33class QDragMoveEvent;
 34class SocialWidget;
 35
 36namespace Ui
 37{
 38    class AudioControls;
 39}
 40
 41class AudioControls : public QWidget
 42{
 43Q_OBJECT
 44
 45public:
 46    AudioControls( QWidget* parent = 0 );
 47    ~AudioControls();
 48
 49signals:
 50    void playPressed();
 51    void pausePressed();
 52
 53public slots:
 54    void onRepeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
 55    void onShuffleModeChanged( bool enabled );
 56
 57protected:
 58    void changeEvent( QEvent* e );
 59    void dragEnterEvent ( QDragEnterEvent* );
 60    void dragMoveEvent ( QDragMoveEvent* );
 61    void dropEvent ( QDropEvent* );
 62
 63private slots:
 64    void phononTickCheckTimeout();
 65
 66    void onPlaybackStarted( const Tomahawk::result_ptr& result );
 67    void onPlaybackLoading( const Tomahawk::result_ptr& result );
 68    void onPlaybackPaused();
 69    void onPlaybackResumed();
 70    void onPlaybackSeeked( qint64 msec );
 71    void onPlaybackStopped();
 72
 73    void onPlaybackTimer( qint64 msElapsed );
 74    void onVolumeChanged( int volume );
 75
 76    void onRepeatClicked();
 77    void onShuffleClicked();
 78
 79    void onArtistClicked();
 80    void onAlbumClicked();
 81    void onTrackClicked();
 82    void onSocialButtonClicked();
 83    void onLoveButtonClicked( bool );
 84    void onOwnerButtonClicked();
 85
 86    void droppedTracks( QList<Tomahawk::query_ptr> );
 87
 88    void onCoverUpdated();
 89    void onSocialActionsLoaded();
 90
 91private:
 92    void setCover();
 93    void setSocialActions();
 94
 95    Ui::AudioControls* ui;
 96
 97    QWeakPointer<SocialWidget> m_socialWidget;
 98
 99    Tomahawk::result_ptr m_currentTrack;
100    Tomahawk::PlaylistModes::RepeatMode m_repeatMode;
101    bool m_shuffled;
102
103    QPixmap m_defaultSourceIcon;
104
105    QTimer m_phononTickCheckTimer;
106    QTimeLine m_sliderTimeLine;
107    bool m_seeked;
108    qint64 m_lastSliderCheck;
109    qint64 m_lastTextSecondShown;
110
111    QWidget* m_parent;
112};
113
114#endif // AUDIOCONTROLS_H