2011-01-03 16:49:41 +01:00
|
|
|
// The QWidget base class is deliberately hidden
|
|
|
|
struct PlaylistSequence {
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "playlist/playlistsequence.h"
|
|
|
|
%End
|
|
|
|
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
Contains the shuffle and repeat state of the player.
|
|
|
|
|
|
|
|
This state is shared between all playlists. You can access the global
|
|
|
|
PlaylistSequence instance through the L{PlaylistManager}:
|
|
|
|
|
|
|
|
>>> sequence = clementine.playlists.sequence()
|
|
|
|
... sequence.SetShuffleMode(clementine.PlaylistSequence.Shuffle_All)
|
|
|
|
... sequence.SetRepeatMode(clementine.PlaylistSequence.Repeat_Playlist)
|
|
|
|
|
|
|
|
The constants defined in this class are:
|
|
|
|
|
|
|
|
- C{Repeat_Off}
|
|
|
|
- C{Repeat_Track} - repeats the current track
|
|
|
|
- C{Repeat_Album} - repeats the current album
|
|
|
|
- C{Repeat_Playlist} - repeats the whole playlist
|
|
|
|
- C{Shuffle_Off}
|
|
|
|
- C{Shuffle_All} - plays tracks in a random order
|
|
|
|
- C{Shuffle_Album} - plays tracks from the current album in a random order
|
|
|
|
|
|
|
|
@group Signals: RepeatModeChanged, ShuffleModeChanged
|
|
|
|
@group Slots: SetRepeatMode, SetShuffleMode, SetUsingDynamicPlaylist
|
|
|
|
%End
|
|
|
|
|
2011-01-03 16:49:41 +01:00
|
|
|
public:
|
|
|
|
enum RepeatMode {
|
|
|
|
Repeat_Off = 0,
|
|
|
|
Repeat_Track = 1,
|
|
|
|
Repeat_Album = 2,
|
|
|
|
Repeat_Playlist = 3,
|
|
|
|
};
|
|
|
|
enum ShuffleMode {
|
|
|
|
Shuffle_Off = 0,
|
|
|
|
Shuffle_All = 1,
|
|
|
|
Shuffle_Album = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
RepeatMode repeat_mode() const;
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
repeat_mode() -> int
|
|
|
|
Returns the current repeat mode.
|
|
|
|
|
|
|
|
@return: one of the C{Repeat_} constants.
|
|
|
|
%End
|
|
|
|
|
2011-01-03 16:49:41 +01:00
|
|
|
ShuffleMode shuffle_mode() const;
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
shuffle_mode() -> int
|
|
|
|
Returns the current shuffle mode.
|
|
|
|
|
|
|
|
@return: one of the C{Shuffle_} constants.
|
|
|
|
%End
|
2011-01-03 16:49:41 +01:00
|
|
|
|
|
|
|
QMenu* repeat_menu() const;
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
repeat_menu() -> L{PyQt4.QtGui.QMenu}
|
|
|
|
Returns a menu that can be added to a button or another menu to allow the user
|
|
|
|
to control the repeat behaviour.
|
|
|
|
%End
|
|
|
|
|
2011-01-03 16:49:41 +01:00
|
|
|
QMenu* shuffle_menu() const;
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
shuffle_menu() -> L{PyQt4.QtGui.QMenu}
|
|
|
|
Returns a menu that can be added to a button or another menu to allow the user
|
|
|
|
to control the shuffle behaviour.
|
|
|
|
%End
|
2011-01-03 16:49:41 +01:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void SetRepeatMode(PlaylistSequence::RepeatMode mode);
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
SetRepeatMode(mode)
|
|
|
|
Changes the repeat mode.
|
|
|
|
|
|
|
|
@param mode: one of the C{Repeat_} constants.
|
|
|
|
%End
|
|
|
|
|
2011-01-03 16:49:41 +01:00
|
|
|
void SetShuffleMode(PlaylistSequence::ShuffleMode mode);
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
SetShuffleMode(mode)
|
|
|
|
Changes the shuffle mode.
|
|
|
|
|
|
|
|
@param mode: one of the C{Shuffle_} constants.
|
|
|
|
%End
|
|
|
|
|
2011-01-03 16:49:41 +01:00
|
|
|
void SetUsingDynamicPlaylist(bool dynamic);
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
SetUsingDynamicPlaylist(dynamic)
|
|
|
|
When using dynamic playlists changing the shuffle and repeat modes is not
|
|
|
|
allowed, their buttons in the interface are disabled, and the L{repeat_mode()}
|
|
|
|
and L{shuffle_mode()} functions always return C{Repeat_Off} and C{Shuffle_Off}.
|
|
|
|
|
|
|
|
@type dynamic: bool
|
|
|
|
%End
|
2011-01-03 16:49:41 +01:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void RepeatModeChanged(PlaylistSequence::RepeatMode mode);
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
RepeatModeChanged(new_mode)
|
|
|
|
Emitted when the repeat mode is changed, either by the user or by a call to
|
|
|
|
L{SetRepeatMode()}.
|
|
|
|
%End
|
|
|
|
|
2011-01-03 16:49:41 +01:00
|
|
|
void ShuffleModeChanged(PlaylistSequence::ShuffleMode mode);
|
2011-02-27 18:16:22 +01:00
|
|
|
%Docstring
|
|
|
|
ShuffleModeChanged(new_mode)
|
|
|
|
Emitted when the shuffle mode is changed, either by the user or by a call to
|
|
|
|
L{SetShuffleMode()}.
|
|
|
|
%End
|
2011-01-03 16:49:41 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
PlaylistSequence();
|
|
|
|
};
|