HephAudio v3.1.0
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
HephAudio::AudioPlaylist Class Referencefinal

class for creating playlists. Uses AudioStream internally to play the files. More...

#include <AudioPlaylist.h>

Public Member Functions

 AudioPlaylist (std::shared_ptr< Native::NativeAudio > pNativeAudio)
 
 AudioPlaylist (Audio &audio)
 
 AudioPlaylist (std::shared_ptr< Native::NativeAudio > pNativeAudio, const std::vector< std::filesystem::path > &files)
 
 AudioPlaylist (Audio &audio, const std::vector< std::filesystem::path > &files)
 
 AudioPlaylist (const AudioPlaylist &)=delete
 
 AudioPlaylist (AudioPlaylist &&rhs) noexcept
 
AudioPlaylistoperator= (const AudioPlaylist &)=delete
 
AudioPlaylistoperator= (const std::filesystem::path &rhs)
 
AudioPlaylistoperator= (const std::vector< std::filesystem::path > &rhs)
 
AudioPlaylistoperator= (AudioPlaylist &&rhs) noexcept
 
size_t Size () const
 
std::shared_ptr< Native::NativeAudioGetNativeAudio () const
 
AudioObjectGetAudioObject () const
 
void Start ()
 
void Stop ()
 
void Add (const std::filesystem::path &filePath)
 
void Add (const std::vector< std::filesystem::path > &files)
 
void Insert (const std::filesystem::path &filePath, size_t index)
 
void Insert (const std::vector< std::filesystem::path > &files, size_t index)
 
void Remove (size_t index)
 
void Remove (size_t index, size_t count)
 
void Remove (const std::filesystem::path &filePath)
 
void Skip ()
 
void Skip (size_t n)
 
void Clear ()
 

Detailed Description

class for creating playlists. Uses AudioStream internally to play the files.

Constructor & Destructor Documentation

◆ AudioPlaylist() [1/5]

HephAudio::AudioPlaylist::AudioPlaylist ( std::shared_ptr< Native::NativeAudio > pNativeAudio)

creates a new instance and initializes it with the provided values.

Parameters
pNativeAudioshared pointer to the native audio instance that will be used for playing the files.

◆ AudioPlaylist() [2/5]

HephAudio::AudioPlaylist::AudioPlaylist ( Audio & audio)

creates a new instance and initializes it with the provided values.

Parameters
audiothe audio instance that will be used for playing the files.

◆ AudioPlaylist() [3/5]

HephAudio::AudioPlaylist::AudioPlaylist ( std::shared_ptr< Native::NativeAudio > pNativeAudio,
const std::vector< std::filesystem::path > & files )

creates a new instance and initializes it with the provided values.

Parameters
pNativeAudioshared pointer to the native audio instance that will be used for playing the files.
filesfile paths.

◆ AudioPlaylist() [4/5]

HephAudio::AudioPlaylist::AudioPlaylist ( Audio & audio,
const std::vector< std::filesystem::path > & files )

creates a new instance and initializes it with the provided values.

Parameters
audiothe audio instance that will be used for playing the files.
filesfile paths.

◆ AudioPlaylist() [5/5]

HephAudio::AudioPlaylist::AudioPlaylist ( AudioPlaylist && rhs)
noexcept

creates a new instance and moves the rhs's data to it.

Parameters
rhsinstance whose data will be moved.

Member Function Documentation

◆ Size()

size_t HephAudio::AudioPlaylist::Size ( ) const

gets the number of files present in the playlist.

◆ GetNativeAudio()

std::shared_ptr< Native::NativeAudio > HephAudio::AudioPlaylist::GetNativeAudio ( ) const

gets the shared pointer to the native audio instance that's used for playing the files.

◆ GetAudioObject()

AudioObject * HephAudio::AudioPlaylist::GetAudioObject ( ) const

gets the pointer to the audio object instance that's created to play audio data.

◆ Start()

void HephAudio::AudioPlaylist::Start ( )

starts (resumes) playing the files.

◆ Stop()

void HephAudio::AudioPlaylist::Stop ( )

stops (pauses) playing the files.

◆ Add() [1/2]

void HephAudio::AudioPlaylist::Add ( const std::filesystem::path & filePath)

adds a file to the end of the playlist.

Parameters
filePathpath of the file that will be added to the playlist.

◆ Add() [2/2]

void HephAudio::AudioPlaylist::Add ( const std::vector< std::filesystem::path > & files)

adds multiple files to the end of the playlist.

Parameters
filesfile paths.

◆ Insert() [1/2]

void HephAudio::AudioPlaylist::Insert ( const std::filesystem::path & filePath,
size_t index )

inserts the provided file to the playlist.

Parameters
filePathpath of the file that will be added to the playlist.
indexposition of the new file within the playlist.

◆ Insert() [2/2]

void HephAudio::AudioPlaylist::Insert ( const std::vector< std::filesystem::path > & files,
size_t index )

inserts the provided files to the playlist.

Parameters
filesfile paths.
indexposition of the new files within the playlist.

◆ Remove() [1/3]

void HephAudio::AudioPlaylist::Remove ( size_t index)

removes the file at the provided index.

Parameters
indexindex of the file to be removed.

◆ Remove() [2/3]

void HephAudio::AudioPlaylist::Remove ( size_t index,
size_t count )

removes the files at the provided index.

Parameters
indexindex of the first file to be removed.
countnumber of files to remove.

◆ Remove() [3/3]

void HephAudio::AudioPlaylist::Remove ( const std::filesystem::path & filePath)

removes the file with the provided path.

◆ Skip() [1/2]

void HephAudio::AudioPlaylist::Skip ( )

skips to the next file.

◆ Skip() [2/2]

void HephAudio::AudioPlaylist::Skip ( size_t n)

skips the first n files.

Parameters
nnumber of files to skip.

◆ Clear()

void HephAudio::AudioPlaylist::Clear ( )

removes all files from the playlist.