MythTV  master
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
PlayListFile Class Reference

Class for containing the info of a pls or m3u file. More...

#include <pls.h>

Public Member Functions

 PlayListFile (void)=default
 
 ~PlayListFile (void)
 
int size (void) const
 Get the number of entries in the pls file. More...
 
PlayListFileEntryget (int i)
 Get a file entry. More...
 
int version (void) const
 Version of the parsed pls file. More...
 
void add (PlayListFileEntry *e)
 Add a entry to the playlist. More...
 
void clear (void)
 Clear out all the entries. More...
 

Static Public Member Functions

static int parse (PlayListFile *pls, const QString &filename)
 Parse a pls, m3u or asx playlist file. More...
 
static int parsePLS (PlayListFile *pls, const QString &filename)
 Parse a pls file. More...
 
static int parseM3U (PlayListFile *pls, const QString &filename)
 Parse a m3u file. More...
 
static int parseASX (PlayListFile *pls, const QString &filename)
 Parse a asx file. More...
 

Private Attributes

QList< PlayListFileEntry * > m_entries
 
int m_version {0}
 

Detailed Description

Class for containing the info of a pls or m3u file.

Definition at line 41 of file pls.h.

Constructor & Destructor Documentation

◆ PlayListFile()

PlayListFile::PlayListFile ( void  )
default

◆ ~PlayListFile()

PlayListFile::~PlayListFile ( void  )

Definition at line 32 of file pls.cpp.

Member Function Documentation

◆ size()

int PlayListFile::size ( void  ) const
inline

Get the number of entries in the pls file.

This returns the number of actual parsed entries, not the numberofentries field.

Returns
the number of entries

Definition at line 54 of file pls.h.

Referenced by DecoderHandler::createPlaylistForSingleFile(), DecoderHandler::createPlaylistFromFile(), DecoderHandler::done(), DecoderHandler::doStart(), DecoderHandler::next(), parseASX(), parseM3U(), and parsePLS().

◆ get()

PlayListFileEntry* PlayListFile::get ( int  i)
inline

Get a file entry.

Parameters
iwhich entry to get, between 0 and the value returned by calling PlayListParser::size
Returns
a pointer to a PlayListEntry

Definition at line 60 of file pls.h.

Referenced by DecoderHandler::doStart(), hardwareprofile.distros.mythtv_data.orddict.OrdDict::itervalues(), and DecoderHandler::next().

◆ version()

int PlayListFile::version ( void  ) const
inline

Version of the parsed pls file.

Returns the version number specified in the version field of the pls file.

Returns
the version number

Definition at line 75 of file pls.h.

◆ add()

void PlayListFile::add ( PlayListFileEntry e)
inline

Add a entry to the playlist.

Parameters
ea PlayListFileEntry object

Definition at line 80 of file pls.h.

Referenced by DecoderHandler::createPlaylistForSingleFile(), parseASX(), parseM3U(), and parsePLS().

◆ clear()

void PlayListFile::clear ( void  )
inline

Clear out all the entries.

Definition at line 83 of file pls.h.

Referenced by DecoderHandler::start().

◆ parse()

int PlayListFile::parse ( PlayListFile pls,
const QString &  filename 
)
static

Parse a pls, m3u or asx playlist file.

Parameters
plsthe PlaylistFile to add the entries to
filenamethe playlist's filename
Returns
the number of entries parsed

Definition at line 37 of file pls.cpp.

Referenced by DecoderHandler::createPlaylistFromFile().

◆ parsePLS()

int PlayListFile::parsePLS ( PlayListFile pls,
const QString &  filename 
)
static

Parse a pls file.

Parameters
plsthe PlaylistFile to add the entries to
filenamethe playlist's filename
Returns
the number of entries parsed

Definition at line 52 of file pls.cpp.

Referenced by parse().

◆ parseM3U()

int PlayListFile::parseM3U ( PlayListFile pls,
const QString &  filename 
)
static

Parse a m3u file.

Parameters
plsthe PlaylistFile to add the entries to
filenamethe playlist's filename
Returns
the number of entries parsed

Definition at line 83 of file pls.cpp.

Referenced by parse().

◆ parseASX()

int PlayListFile::parseASX ( PlayListFile pls,
const QString &  filename 
)
static

Parse a asx file.

Parameters
plsthe PlaylistFile to add the entries to
filenamethe playlist's filename
Returns
the number of entries parsed

Definition at line 120 of file pls.cpp.

Referenced by parse().

Member Data Documentation

◆ m_entries

QList<PlayListFileEntry*> PlayListFile::m_entries
private

Definition at line 118 of file pls.h.

Referenced by add(), clear(), get(), and size().

◆ m_version

int PlayListFile::m_version {0}
private

Definition at line 119 of file pls.h.

Referenced by version().


The documentation for this class was generated from the following files: