HephAudio v3.0.6
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 Types

enum  TransitionEffect : uint8_t {
  None , Delay , Fade , FadeIn ,
  FadeOut
}
 

Public Member Functions

 AudioPlaylist (Native::NativeAudio *pNativeAudio)
 
 AudioPlaylist (Audio &audio)
 
 AudioPlaylist (Native::NativeAudio *pNativeAudio, const std::vector< std::filesystem::path > &files)
 
 AudioPlaylist (Audio &audio, const std::vector< std::filesystem::path > &files)
 
 AudioPlaylist (Native::NativeAudio *pNativeAudio, TransitionEffect transitionEffect, double transitionDuration_s)
 
 AudioPlaylist (Audio &audio, TransitionEffect transitionEffect, double transitionDuration_s)
 
 AudioPlaylist (Native::NativeAudio *pNativeAudio, TransitionEffect transitionEffect, double transitionDuration_s, const std::vector< std::filesystem::path > &files)
 
 AudioPlaylist (Audio &audio, TransitionEffect transitionEffect, double transitionDuration_s, 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
 
Native::NativeAudioGetNativeAudio () const
 
TransitionEffect GetTransitionEffect () const
 
void SetTransitionEffect (TransitionEffect transitionEffect)
 
double GetTransitionDuration () const
 
void SetTransitionDuration (double transitionDuration_s)
 
void Start ()
 
void Stop ()
 
bool IsPaused () const
 
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.

Member Enumeration Documentation

◆ TransitionEffect

indicates which effect will be applied while switching from one file to another.

Constructor & Destructor Documentation

◆ AudioPlaylist() [1/9]

HephAudio::AudioPlaylist::AudioPlaylist ( Native::NativeAudio * pNativeAudio)

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

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

◆ AudioPlaylist() [2/9]

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/9]

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

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

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

◆ AudioPlaylist() [4/9]

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/9]

HephAudio::AudioPlaylist::AudioPlaylist ( Native::NativeAudio * pNativeAudio,
TransitionEffect transitionEffect,
double transitionDuration_s )

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

Parameters
pNativeAudiopointer to the native audio instance that will be used for playing the files.
transitionEffectthe effect that will be applied while switching files.
transitionDuration_sduration of the transition effect in seconds.

◆ AudioPlaylist() [6/9]

HephAudio::AudioPlaylist::AudioPlaylist ( Audio & audio,
TransitionEffect transitionEffect,
double transitionDuration_s )

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

Parameters
audiothe audio instance that will be used for playing the files.
transitionEffectthe effect that will be applied while switching files.
transitionDuration_sduration of the transition effect in seconds.

◆ AudioPlaylist() [7/9]

HephAudio::AudioPlaylist::AudioPlaylist ( Native::NativeAudio * pNativeAudio,
TransitionEffect transitionEffect,
double transitionDuration_s,
const std::vector< std::filesystem::path > & files )

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

Parameters
pNativeAudiopointer to the native audio instance that will be used for playing the files.
transitionEffectthe effect that will be applied while switching files.
transitionDuration_sduration of the transition effect in seconds.
filesfile paths.

◆ AudioPlaylist() [8/9]

HephAudio::AudioPlaylist::AudioPlaylist ( Audio & audio,
TransitionEffect transitionEffect,
double transitionDuration_s,
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.
transitionEffectthe effect that will be applied while switching files.
transitionDuration_sduration of the transition effect in seconds.
filesfile paths.

◆ AudioPlaylist() [9/9]

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()

Native::NativeAudio * HephAudio::AudioPlaylist::GetNativeAudio ( ) const

gets the pointer to the NativeAudio instance that's used for playing the files.

◆ GetTransitionEffect()

TransitionEffect HephAudio::AudioPlaylist::GetTransitionEffect ( ) const

gets the transition effect.

◆ SetTransitionEffect()

void HephAudio::AudioPlaylist::SetTransitionEffect ( TransitionEffect transitionEffect)

sets the transition effect.

◆ GetTransitionDuration()

double HephAudio::AudioPlaylist::GetTransitionDuration ( ) const

gets the transition duration in seconds.

◆ SetTransitionDuration()

void HephAudio::AudioPlaylist::SetTransitionDuration ( double transitionDuration_s)

sets the transition duration in seconds.

◆ Start()

void HephAudio::AudioPlaylist::Start ( )

starts (resumes) playing the files.

◆ Stop()

void HephAudio::AudioPlaylist::Stop ( )

stops (pauses) playing the files.

◆ IsPaused()

bool HephAudio::AudioPlaylist::IsPaused ( ) const

checks whether the playlist is paused (stopped).

Returns
true if the playlist is paused, otherwise false.

◆ 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.