Sayonara Player
Signals | Public Member Functions | Protected Member Functions | List of all members
AbstractStationHandler Class Referenceabstract

Used to interprete website data as streams. Some methods have to be overridden, to map their functions to their specific database functions. The track list is held in a map, which is accessible through its station name. It can be accessed via the get_tracks() method. More...

#include <AbstractStationHandler.h>

Inheritance diagram for AbstractStationHandler:
PodcastHandler StreamHandler

Signals

void sigStopped ()
 
void sigError ()
 
void sigDataAvailable ()
 
void sigUrlCountExceeded (int urlCount, int maxUrlCount)
 

Public Member Functions

 AbstractStationHandler (PlaylistCreator *playlistCreator, QObject *parent=nullptr)
 
bool parseStation (StationPtr station)
 Retrieves data from the station and tries to interprete it via the parse_content() method. More...
 
bool save (StationPtr station)
 Saves the station. Calls the add_stream() method. More...
 
virtual bool getAllStreams (QList< StationPtr > &streams)=0
 This method should return all stations in database. More...
 
virtual bool addNewStream (StationPtr station)=0
 This method should add a new station to database. If the station already exists, there should be a corresponding error handling. More...
 
virtual StationPtr createStreamInstance (const QString &name, const QString &url) const =0
 
virtual bool deleteStream (const QString &name)=0
 Delete a station from the database. More...
 
virtual bool update (const QString &name, StationPtr station)=0
 Update the url of a station. More...
 
virtual StationPtr station (const QString &name)=0
 
void stop ()
 Clears all station content.
 

Protected Member Functions

virtual void createPlaylist (StationPtr station, MetaDataList &tracks)
 

Detailed Description

Used to interprete website data as streams. Some methods have to be overridden, to map their functions to their specific database functions. The track list is held in a map, which is accessible through its station name. It can be accessed via the get_tracks() method.

Member Function Documentation

◆ addNewStream()

virtual bool AbstractStationHandler::addNewStream ( StationPtr  station)
pure virtual

This method should add a new station to database. If the station already exists, there should be a corresponding error handling.

Parameters
station_namestation name
urlurl
Returns
true if successful, false else

Implemented in PodcastHandler, and StreamHandler.

◆ deleteStream()

virtual bool AbstractStationHandler::deleteStream ( const QString &  name)
pure virtual

Delete a station from the database.

Parameters
station_namethe station to be deleted
Returns
true if successful, false else

Implemented in PodcastHandler, and StreamHandler.

◆ getAllStreams()

virtual bool AbstractStationHandler::getAllStreams ( QList< StationPtr > &  streams)
pure virtual

This method should return all stations in database.

Parameters
streamstarget StreamMap
Returns
true if successful, false else

Implemented in PodcastHandler, and StreamHandler.

◆ parseStation()

bool AbstractStationHandler::parseStation ( StationPtr  station)

Retrieves data from the station and tries to interprete it via the parse_content() method.

Parameters
urlurl to retrieve the data from
station_namethe station name
Returns
true, if no other station is parsed atm, false else

◆ save()

bool AbstractStationHandler::save ( StationPtr  station)

Saves the station. Calls the add_stream() method.

Parameters
station_nameThe station name.
urlthe station url.

◆ update()

virtual bool AbstractStationHandler::update ( const QString &  name,
StationPtr  station 
)
pure virtual

Update the url of a station.

Parameters
station_namethe station to be updated
urlthe new url
Returns
true if successful, false else

Implemented in PodcastHandler, and StreamHandler.