wavelength 1.0.0
Loading...
Searching...
No Matches
playlist.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "met/freqlist.h"
7#include "os/string.h"
8#include "script/dataarray.h"
9
18class PlayList : public FreqList {
19public:
28 PlayList(DataArray *pData, const char *pszPanel);
29
36 ~PlayList() override {
37 }
38
48 static UIComponent *New(DataArray *pData, const char *pszPanel) {
49 return new PlayList(pData, pszPanel);
50 }
51
60 void UpdateRow(int nRow, int nItem) override;
61
68 void UpdateCursor() override;
69
80 void SetSongs(const std::vector<PlaylistSongData> &songs, int nNumGroups);
81
91
93 const std::vector<PlaylistSongData> &GetSongs() const {
94 return mSongs;
95 }
96
98 std::vector<PlaylistSongData> &GetSongs() {
99 return mSongs;
100 }
101
102private:
103 std::vector<PlaylistSongData> mSongs;
104
105 String mPicPanel; // The description's `pic_panel`, the panel of the picture.
106
107 int mNumGroups; // The number of entries at the start that stand for groups of songs.
108};
Reference-counted array of script data nodes.
Definition dataarray.h:20
FreqList(DataArray *pData, const char *pszPanel)
Construct the list from its script description.
void UpdateCursor() override
Move the cursor and show the picture of the selected entry.
void UpdateRow(int nRow, int nItem) override
Show the light and the name or the artist of an entry in a row.
const std::vector< PlaylistSongData > & GetSongs() const
Definition playlist.h:93
void ToggleSelected()
Turn the selected entry on or off.
static UIComponent * New(DataArray *pData, const char *pszPanel)
Create a list from its script description.
Definition playlist.h:48
void SetSongs(const std::vector< PlaylistSongData > &songs, int nNumGroups)
Replace the entries and keep the selection.
std::vector< PlaylistSongData > & GetSongs()
Definition playlist.h:98
PlayList(DataArray *pData, const char *pszPanel)
Construct a list from its script description.
~PlayList() override
Destroy the list.
Definition playlist.h:36
Growable text buffer that is also a PrnStream.
Definition string.h:19
UIComponent(DataArray *pData)
Construct a showing component in the normal state.
Definition uicomponent.h:37