36#ifndef MODULES_INCLUDE_AUDIO_UTILITIES_PLAYLIST_H
37#define MODULES_INCLUDE_AUDIO_UTILITIES_PLAYLIST_H
39#include "memutils/s_stl/queue.h"
140 strncpy(m_track_db_file_name, file_name,
sizeof(m_track_db_file_name));
141 memset(m_playlist_path, 0,
sizeof(m_playlist_path));
162 bool init(
const char *playlist_path);
224 bool addTrack(FAR
const char *key_str,
int track_no);
309 bool open(FAR
const char *mode);
311 bool readLine(FAR
char *line, uint32_t line_size);
313 FAR
const char *key_str,
315 bool loadAliasList(
void);
316 bool shuffleList(
int idx_top);
317 bool parseTrackInfo(FAR
Track *track, FAR
char *line, uint32_t line_size);
319 FAR
const char *key_str,
323 static const int FileNameMaxLength = 128;
324 static const int LineMaxLength = 256;
326 char m_playlist_path[FileNameMaxLength];
332 char m_line_buffer[LineMaxLength];
333 char m_track_db_file_name[FileNameMaxLength];
334 FAR FILE *m_track_db_fp;
336 s_std::Queue<uint32_t, 256> m_alias_list;
CXD5602 Audio High Level API.
Definition: playlist.h:78
bool addTrack(FAR const char *key_str, int track_no)
Add track to playlist.
bool getPrevTrack(FAR Track *track)
Get previous track.
PlayMode
Definition: playlist.h:81
@ PlayModeNormal
Normal play mode.
Definition: playlist.h:84
@ PlayModeShuffle
Shuffle play mode.
Definition: playlist.h:88
RepeatMode
Definition: playlist.h:94
@ RepeatModeOff
Play all track at once.
Definition: playlist.h:97
@ RepeatModeOn
Play all track repeat.
Definition: playlist.h:101
bool select(ListType type, FAR const char *key_str)
Select playlist to play.
bool init(const char *playlist_path)
Init playlist.
bool setPlayMode(PlayMode play_mode)
Set play mode.
Playlist(FAR const char *file_name)
Playlist Constructor.
Definition: playlist.h:133
bool setRepeatMode(RepeatMode repeat_mode)
Set repeat mode.
bool restart(void)
Restart playlist.
ListType
Definition: playlist.h:107
@ ListTypeAlbum
Album categorized track list.
Definition: playlist.h:118
@ ListTypeUser
User defined track list.
Definition: playlist.h:122
@ ListTypeArtist
Artist categorized track list.
Definition: playlist.h:114
@ ListTypeAllTrack
All track (which is written in playlist file) list.
Definition: playlist.h:110
bool deleteOne(ListType type, FAR const char *key_str)
Delete playlist.
bool getNextTrack(FAR Track *track)
Get next track.
bool updatePlaylist(ListType type, FAR const char *key_str)
Update playlist.
~Playlist()
Playlist Destructor.
Definition: playlist.h:148
bool removeTrack(FAR const char *key_str, uint32_t remove_pos)
Remove track from playlist.
bool updateTrackDb(const char *audiofile_root_path)
Update track database.
bool deleteAll(void)
Delete all playlist.
Definition: playlist.h:45
char author[64]
Author name.
Definition: playlist.h:52
char album[64]
Album name.
Definition: playlist.h:56
uint8_t codec_type
Codec type of the track.
Definition: playlist.h:72
char title[64]
Track title (file name)
Definition: playlist.h:48
uint8_t channel_number
Number of channels.
Definition: playlist.h:60
uint32_t sampling_rate
Sampling rate of the track.
Definition: playlist.h:68
uint8_t bit_length
Bit length of the track.
Definition: playlist.h:64