Add bindings for Queue and PlaylistSequence
This commit is contained in:
parent
e1b899bc61
commit
3a3cba3a85
@ -712,14 +712,14 @@ if(HAVE_SCRIPTING_PYTHON)
|
||||
|
||||
add_sip_binding(SOURCES
|
||||
scripting/python/clementine.sip
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineQList0100Directory.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineQList0100LibraryBackendAlbum.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineQList0100Subdirectory.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineLibraryBackendAlbum.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementinePlaylistItemOptions.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementinePlaylistItemPtr.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineQList0100Directory.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineQList0100LibraryBackendAlbum.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineQList0100PlaylistItemPtr.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineQList0100Song.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sipclementineQList0100Subdirectory.cpp
|
||||
)
|
||||
endif(HAVE_SCRIPTING_PYTHON)
|
||||
|
||||
|
@ -11,7 +11,9 @@
|
||||
%Include playlist.sip
|
||||
%Include playlistitem.sip
|
||||
%Include playlistmanager.sip
|
||||
%Include playlistsequence.sip
|
||||
%Include pythonengine.sip
|
||||
%Include queue.sip
|
||||
%Include scriptinterface.sip
|
||||
%Include song.sip
|
||||
%Include uiinterface.sip
|
||||
|
@ -10,7 +10,7 @@ public:
|
||||
|
||||
PlaylistItemPtr GetCurrentItem() const;
|
||||
PlaylistItemPtr GetItemAt(int pos) const;
|
||||
//PlaylistManager* playlists() const { return playlists_; }
|
||||
PlaylistManager* playlists() const;
|
||||
|
||||
public slots:
|
||||
// Manual track change to the specified track
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
|
||||
// Accessors
|
||||
QSortFilterProxyModel* proxy() const;
|
||||
// Queue* queue() const;
|
||||
Queue* queue() const;
|
||||
|
||||
int id() const;
|
||||
|
||||
@ -85,7 +85,7 @@ public:
|
||||
SongList GetAllSongs() const;
|
||||
quint64 GetTotalLength() const; // in seconds
|
||||
|
||||
// PlaylistSequence* sequence() const { return playlist_sequence_; }
|
||||
PlaylistSequence* sequence() const;
|
||||
|
||||
QUndoStack* undo_stack() const;
|
||||
|
||||
|
@ -18,9 +18,9 @@ public:
|
||||
|
||||
QString name(int index) const;
|
||||
|
||||
// LibraryBackend* library_backend() const;
|
||||
LibraryBackend* library_backend() const;
|
||||
// PlaylistBackend* playlist_backend() const;
|
||||
// PlaylistSequence* sequence() const;
|
||||
PlaylistSequence* sequence() const;
|
||||
// PlaylistParser* parser() const;
|
||||
|
||||
public slots:
|
||||
|
40
src/scripting/python/playlistsequence.sip
Normal file
40
src/scripting/python/playlistsequence.sip
Normal file
@ -0,0 +1,40 @@
|
||||
// The QWidget base class is deliberately hidden
|
||||
struct PlaylistSequence {
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "playlist/playlistsequence.h"
|
||||
%End
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
static const char* kSettingsGroup;
|
||||
|
||||
RepeatMode repeat_mode() const;
|
||||
ShuffleMode shuffle_mode() const;
|
||||
|
||||
QMenu* repeat_menu() const;
|
||||
QMenu* shuffle_menu() const;
|
||||
|
||||
public slots:
|
||||
void SetRepeatMode(PlaylistSequence::RepeatMode mode);
|
||||
void SetShuffleMode(PlaylistSequence::ShuffleMode mode);
|
||||
void SetUsingDynamicPlaylist(bool dynamic);
|
||||
|
||||
signals:
|
||||
void RepeatModeChanged(PlaylistSequence::RepeatMode mode);
|
||||
void ShuffleModeChanged(PlaylistSequence::ShuffleMode mode);
|
||||
|
||||
private:
|
||||
PlaylistSequence();
|
||||
};
|
25
src/scripting/python/queue.sip
Normal file
25
src/scripting/python/queue.sip
Normal file
@ -0,0 +1,25 @@
|
||||
struct Queue : QAbstractProxyModel {
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "playlist/queue.h"
|
||||
%End
|
||||
|
||||
public:
|
||||
Queue();
|
||||
|
||||
static const char* kRowsMimetype;
|
||||
|
||||
// Query the queue
|
||||
bool is_empty() const;
|
||||
int PositionOf(const QModelIndex& source_index) const;
|
||||
bool ContainsSourceRow(int source_row) const;
|
||||
int PeekNext() const;
|
||||
|
||||
// Modify the queue
|
||||
int TakeNext();
|
||||
void ToggleTracks(const QModelIndexList& source_indexes);
|
||||
void Clear();
|
||||
void Move(const QList<int>& proxy_rows, int pos);
|
||||
void MoveUp(int row);
|
||||
void MoveDown(int row);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user