![]() |
Sayonara Player
|
#include <AbstractStreamHandler.h>
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.
Signals | |
void | sig_stopped () |
void | sig_error () |
void | sig_data_available () |
void | sig_too_many_urls_found (int n_urls, int max_n_urls) |
Public Member Functions | |
AbstractStreamHandler (QObject *parent=nullptr) | |
bool | parse_station (const QString &url, const QString &station_name) |
Retrieves data from the station and tries to interprete it via the parse_content() method. More... | |
void | save (const QString &station_name, const QString &url) |
Saves the station. Calls the add_stream() method. More... | |
virtual bool | get_all_streams (StreamMap &streams)=0 |
This method should return all stations in database. More... | |
virtual bool | add_stream (const QString &station_name, const QString &url)=0 |
This method should add a new station to database. If the station already exists, there should be a corresponding error handling. More... | |
virtual bool | delete_stream (const QString &station_name)=0 |
Delete a station from the database. More... | |
virtual bool | update_url (const QString &station_name, const QString &url)=0 |
Update the url of a station. More... | |
virtual bool | rename (const QString &old_name, const QString &new_name)=0 |
Rename station. More... | |
void | clear () |
Clears all station content. | |
void | stop () |
|
pure virtual |
This method should add a new station to database. If the station already exists, there should be a corresponding error handling.
station_name | station name |
url | url |
Implemented in StreamHandlerPodcasts, and StreamHandlerStreams.
|
pure virtual |
Delete a station from the database.
station_name | the station to be deleted |
Implemented in StreamHandlerPodcasts, and StreamHandlerStreams.
|
pure virtual |
This method should return all stations in database.
streams | target StreamMap |
Implemented in StreamHandlerPodcasts, and StreamHandlerStreams.
bool AbstractStreamHandler::parse_station | ( | const QString & | url, |
const QString & | station_name | ||
) |
Retrieves data from the station and tries to interprete it via the parse_content() method.
url | url to retrieve the data from |
station_name | the station name |
|
pure virtual |
Rename station.
old_name | old station name |
new_name | new station name |
Implemented in StreamHandlerPodcasts, and StreamHandlerStreams.
void AbstractStreamHandler::save | ( | const QString & | station_name, |
const QString & | url | ||
) |
Saves the station. Calls the add_stream() method.
station_name | The station name. |
url | the station url. |
|
pure virtual |
Update the url of a station.
station_name | the station to be updated |
url | the new url |
Implemented in StreamHandlerPodcasts, and StreamHandlerStreams.