/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. #ifndef AUDIOCONTROLS_H
  20. #define AUDIOCONTROLS_H
  21. #include "Result.h"
  22. #include "PlaylistInterface.h"
  23. #include "Query.h"
  24. #include <QWidget>
  25. #include <QTimer>
  26. #include <QTimeLine>
  27. class QDropEvent;
  28. class QDragEnterEvent;
  29. class QDragMoveEvent;
  30. class SocialWidget;
  31. namespace Ui
  32. {
  33. class AudioControls;
  34. }
  35. class AudioControls : public QWidget
  36. {
  37. Q_OBJECT
  38. public:
  39. AudioControls( QWidget* parent = 0 );
  40. ~AudioControls();
  41. signals:
  42. void playPressed();
  43. void pausePressed();
  44. public slots:
  45. void onRepeatModeChanged( Tomahawk::PlaylistModes::RepeatMode mode );
  46. void onShuffleModeChanged( bool enabled );
  47. protected:
  48. void changeEvent( QEvent* e );
  49. void dragEnterEvent ( QDragEnterEvent* );
  50. void dragMoveEvent ( QDragMoveEvent* );
  51. void dropEvent ( QDropEvent* );
  52. private slots:
  53. void phononTickCheckTimeout();
  54. void onPlaybackStarted( const Tomahawk::result_ptr& result );
  55. void onPlaybackLoading( const Tomahawk::result_ptr& result );
  56. void onPlaybackPaused();
  57. void onPlaybackResumed();
  58. void onPlaybackSeeked( qint64 msec );
  59. void onPlaybackStopped();
  60. void onPlaybackTimer( qint64 msElapsed );
  61. void onVolumeChanged( int volume );
  62. void onRepeatClicked();
  63. void onShuffleClicked();
  64. void onArtistClicked();
  65. void onAlbumClicked();
  66. void onTrackClicked();
  67. void onSocialButtonClicked();
  68. void onLoveButtonClicked( bool );
  69. void onOwnerButtonClicked();
  70. void droppedTracks( QList<Tomahawk::query_ptr> );
  71. void onCoverUpdated();
  72. void onSocialActionsLoaded();
  73. private:
  74. void setCover();
  75. void setSocialActions();
  76. Ui::AudioControls* ui;
  77. QWeakPointer<SocialWidget> m_socialWidget;
  78. Tomahawk::result_ptr m_currentTrack;
  79. Tomahawk::PlaylistModes::RepeatMode m_repeatMode;
  80. bool m_shuffled;
  81. QPixmap m_defaultSourceIcon;
  82. QTimer m_phononTickCheckTimer;
  83. QTimeLine m_sliderTimeLine;
  84. bool m_seeked;
  85. qint64 m_lastSliderCheck;
  86. qint64 m_lastTextSecondShown;
  87. QWidget* m_parent;
  88. };
  89. #endif // AUDIOCONTROLS_H