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 <AbstractStreamHandler.h>
|
|
void | sig_stopped () |
| |
|
void | sig_error () |
| |
|
void | sig_data_available () |
| |
|
void | sig_too_many_urls_found (int n_urls, int max_n_urls) |
| |
|
|
| 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...
|
| |
| bool | 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 () |
| |
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.
◆ add_stream()
| virtual bool AbstractStreamHandler::add_stream |
( |
const QString & |
station_name, |
|
|
const QString & |
url |
|
) |
| |
|
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 StreamHandlerPodcasts, and StreamHandlerStreams.
◆ delete_stream()
| virtual bool AbstractStreamHandler::delete_stream |
( |
const QString & |
station_name | ) |
|
|
pure virtual |
◆ get_all_streams()
| virtual bool AbstractStreamHandler::get_all_streams |
( |
StreamMap & |
streams | ) |
|
|
pure virtual |
◆ parse_station()
| 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.
- Parameters
-
| url | url to retrieve the data from |
| station_name | the station name |
- Returns
- true, if no other station is parsed atm, false else
◆ rename()
| virtual bool AbstractStreamHandler::rename |
( |
const QString & |
old_name, |
|
|
const QString & |
new_name |
|
) |
| |
|
pure virtual |
◆ save()
| bool AbstractStreamHandler::save |
( |
const QString & |
station_name, |
|
|
const QString & |
url |
|
) |
| |
Saves the station. Calls the add_stream() method.
- Parameters
-
| station_name | The station name. |
| url | the station url. |
◆ update_url()
| virtual bool AbstractStreamHandler::update_url |
( |
const QString & |
station_name, |
|
|
const QString & |
url |
|
) |
| |
|
pure virtual |