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>
|
|
void | sigStopped () |
| |
|
void | sigError () |
| |
|
void | sigDataAvailable () |
| |
|
void | sigUrlCountExceeded (int urlCount, int maxUrlCount) |
| |
|
|
| 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.
|
| |
|
|
virtual void | createPlaylist (StationPtr station, MetaDataList &tracks) |
| |
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.
◆ 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_name | station name |
| url | url |
- 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_name | the 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
-
- 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
-
| url | url to retrieve the data from |
| station_name | the 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_name | The station name. |
| url | the station url. |
◆ update()
| virtual bool AbstractStationHandler::update |
( |
const QString & |
name, |
|
|
StationPtr |
station |
|
) |
| |
|
pure virtual |
Update the url of a station.
- Parameters
-
| station_name | the station to be updated |
| url | the new url |
- Returns
- true if successful, false else
Implemented in PodcastHandler, and StreamHandler.