radioStation Class Reference

This class rips radio streams and uses the options available from a config file. More...

#include <radiostation.h>

Inheritance diagram for radioStation:

Inheritance graph
[legend]
Collaboration diagram for radioStation:

Collaboration graph
[legend]

List of all members.

Reimplemented properties

These functions for property access are reimplemented. They read from and write to the file configFileName.

virtual PropertyValue bitrate () const
virtual PropertyValue metaInterval () const
virtual PropertyValue serverName () const
virtual PropertyValue streamName () const
virtual void setBitrate (qint64 bitrate)
virtual void setMetaInterval (qint64 metaInterval)
virtual void setServerName (const QString newServerName)
virtual void setStreamName (const QString newStreamName)

Public Slots

int execSettingsDialog ()
void showSettingsDialog ()

Public Member Functions

 radioStation (const QPointer< QObject > parent=0, const QPointer< QWidget > mainWidget=0, const QString &configFileName=QString())
 radioStation (const QPointer< QObject > parent, const QPointer< QWidget > mainWidget, const QString &configFileName, const qlonglong &index)
virtual ~radioStation ()
QString configFileName () const

Protected Member Functions

virtual QStringList parameterList () const
virtual QString serverUri () const

Protected Attributes

QPointer< settings_stream > config_skeleton
QPointer< QWidget > m_mainWidget
QPointer< settings_stream_dialogsettingsDialog

Properties

QString configFileName

Private Member Functions

void helper_setupConfigSystem (const QString &configFile)
int helper_displaySettingsDialog (bool returnImmediately)

Private Attributes

QString internal_configFileName
KSharedConfig::Ptr shared_config


Detailed Description

This class rips radio streams and uses the options available from a config file.

It uses via config_skeleton a config file (see property configFileName) to determinate the URI of the stream and further options for the record (pregrap, postgrab, user agent string...).

It provides the public slot void showSettingsDialog(), who shows a dialog that is a graphical interface to the config file.

Definition at line 35 of file radiostation.h.


Constructor & Destructor Documentation

radioStation::radioStation ( const QPointer< QObject >  parent = 0,
const QPointer< QWidget >  mainWidget = 0,
const QString &  configFileName = QString() 
) [explicit]

Constructor of the class.

Parameters:
parent Sets the parent of this object.
mainWidget When an options dialog gets displayed, this widget is used as parent and the dialog gets centerd to this Widget.
configFileName Here you can give a (local!) path to a configuration file. See class QFile::setName for details about which format is valid. If the file doesn't exist, the object tries to create it. If this isn't possible (for example if the path is invalid or you don't have the rights or you gave the name of a directory or if you didn't give any path), then a new configuration file is created in the appdata directory set in KDE, with the name stream_??????_rc with the six ? replaced by random letters. You can obtain the path of the really used file later trough the property configFileName.

Definition at line 32 of file radiostation.cpp.

References helper_setupConfigSystem(), and m_mainWidget.

Here is the call graph for this function:

radioStation::radioStation ( const QPointer< QObject >  parent,
const QPointer< QWidget >  mainWidget,
const QString &  configFileName,
const qlonglong &  index 
) [explicit]

Conveniance constructor of the class.

Parameters:
parent Sets the parent of this object.
mainWidget When an options dialog gets displayed, this widget is used as parent and the dialog gets centerd to this Widget.
configFileName Here you can give a (local!) path to a configuration file. See class QFile::setName for details about which format is valid. If the file doesn't exist, the object tries to create it. If this isn't possible (for example if the path is invalid or you don't have the rights or you gave the name of a directory or if you didn't give any path), then a new configuration file is created in the appdata directory set in KDE, with the name stream_??????_rc with the six ? replaced by random letters. You can obtain the path of the really used file later trough the property configFileName.
index Initializes the property index.

Definition at line 40 of file radiostation.cpp.

References helper_setupConfigSystem(), m_mainWidget, and streamripper_base::setIndex().

Here is the call graph for this function:

radioStation::~radioStation (  )  [virtual]

The destructor.

Definition at line 50 of file radiostation.cpp.

References config_skeleton, and settingsDialog.


Member Function Documentation

QString radioStation::configFileName (  )  const

See property configFileName.

PropertyValue radioStation::bitrate (  )  const [virtual]

Reimplemented virtual function that uses the file configFileName.

Reimplemented from ripping.

Definition at line 141 of file radiostation.cpp.

References config_skeleton, and ripping::formatedBitrate().

Here is the call graph for this function:

PropertyValue radioStation::metaInterval (  )  const [virtual]

Reimplemented virtual function that uses the file configFileName.

Reimplemented from ripping.

Definition at line 156 of file radiostation.cpp.

References config_skeleton, and ripping::formatedMetaInterval().

Here is the call graph for this function:

PropertyValue radioStation::serverName (  )  const [virtual]

Reimplemented virtual function that uses the file configFileName.

Reimplemented from ripping.

Definition at line 127 of file radiostation.cpp.

References config_skeleton, and ripping::formatedServerName().

Here is the call graph for this function:

PropertyValue radioStation::streamName (  )  const [virtual]

Reimplemented virtual function that uses the file configFileName.

Reimplemented from ripping.

Definition at line 113 of file radiostation.cpp.

References config_skeleton, and ripping::formatedStreamName().

Here is the call graph for this function:

void radioStation::setBitrate ( qint64  bitrate  )  [protected, virtual]

Reimplemented virtual function that uses the file configFileName.

Reimplemented from ripping.

Definition at line 146 of file radiostation.cpp.

References config_skeleton, and ripping::setBitrate().

Here is the call graph for this function:

void radioStation::setMetaInterval ( qint64  metaInterval  )  [protected, virtual]

Reimplemented virtual function that uses the file configFileName.

Reimplemented from ripping.

Definition at line 161 of file radiostation.cpp.

References config_skeleton, and ripping::setMetaInterval().

Here is the call graph for this function:

void radioStation::setServerName ( const QString  newServerName  )  [protected, virtual]

Reimplemented virtual function that uses the file configFileName.

Reimplemented from ripping.

Definition at line 132 of file radiostation.cpp.

References config_skeleton, and ripping::setServerName().

Here is the call graph for this function:

void radioStation::setStreamName ( const QString  newStreamName  )  [protected, virtual]

Reimplemented virtual function that uses the file configFileName.

Reimplemented from ripping.

Definition at line 118 of file radiostation.cpp.

References config_skeleton, and ripping::setStreamName().

Here is the call graph for this function:

int radioStation::execSettingsDialog (  )  [slot]

Execs a configuration dialog.

See also:
helper_displaySettingsDialog()

Definition at line 266 of file radiostation.cpp.

References helper_displaySettingsDialog().

void radioStation::showSettingsDialog (  )  [slot]

Shows a configuration dialog.

See also:
helper_displaySettingsDialog()

Definition at line 261 of file radiostation.cpp.

References helper_displaySettingsDialog().

QStringList radioStation::parameterList (  )  const [protected, virtual]

This function provides the necessary parameters for calling streamripper. Uses ripping::parameterList() and adds the parameters readed from configFileName.

Reimplemented from ripping.

Definition at line 176 of file radiostation.cpp.

References config_skeleton, and ripping::parameterList().

Here is the call graph for this function:

QString radioStation::serverUri (  )  const [protected, virtual]

Returns:
The stream URI readed from configFileName.

Implements ripping.

Definition at line 171 of file radiostation.cpp.

References config_skeleton.

void radioStation::helper_setupConfigSystem ( const QString &  configFile  )  [inline, private]

A helper function used in the constructors.

Definition at line 67 of file radiostation.cpp.

References config_skeleton, internal_configFileName, and shared_config.

Referenced by radioStation().

Here is the caller graph for this function:

int radioStation::helper_displaySettingsDialog ( bool  returnImmediately  )  [private]

Displays a configuration dialog for the settings in the config file. The dialog is centered to m_mainWidget. When the dialog becomes closed, it will be deleted automatically.

Warning:
The parent of the dialog isn't this object (because it isn't a widget), but m_mainWidget. So the destructor must delete the dialog manually (if it still exists because it hasn't been closed).
Parameters:
returnImmediately If true, we show() the dialog. If false, we exec() the dialog.
Returns:
If using exec(), it returns the exit code (see QDialog::DialogCode). Else the return value is undefined.
See also:
settingsDialog

Definition at line 232 of file radiostation.cpp.

References config_skeleton, internal_configFileName, m_mainWidget, and settingsDialog.

Referenced by execSettingsDialog(), and showSettingsDialog().


Member Data Documentation

QPointer<settings_stream> radioStation::config_skeleton [protected]

Provides comfortable access to configuration file (for stream settings).

See also:
configFileName

shared_config (used internally to access configFileName)

Definition at line 137 of file radiostation.h.

Referenced by bitrate(), helper_displaySettingsDialog(), helper_setupConfigSystem(), metaInterval(), parameterList(), serverName(), serverUri(), setBitrate(), setMetaInterval(), setServerName(), setStreamName(), streamName(), and ~radioStation().

QPointer<QWidget> radioStation::m_mainWidget [protected]

Is set by the constructor. The settings dialog will be centered to this widget.

See also:
showSettingsDialog()

Definition at line 141 of file radiostation.h.

Referenced by helper_displaySettingsDialog(), and radioStation().

A pointer to the settings dialog (if actually exists one).

See also:
showSettingsDialog()

Definition at line 149 of file radiostation.h.

Referenced by helper_displaySettingsDialog(), and ~radioStation().

Used internally to store the property configFileName.

Definition at line 173 of file radiostation.h.

Referenced by helper_displaySettingsDialog(), and helper_setupConfigSystem().

KSharedConfig::Ptr radioStation::shared_config [private]

This points to a KSharedConfig object that uses configFileName. Use config_skeleton to get comfortable access all these things.

This is a KSharedConfig::Ptr (a KSharedPtr to a KSharedConfig object). The constructor will create a KSharedConfig object that uses configFileName - and this pointer will point on it. When the pointer is deleted (=when the radiostation object it belongs to becomes deleted), it will automatically delete also the KSharedConfig object it points to.

Definition at line 183 of file radiostation.h.

Referenced by helper_setupConfigSystem().


Property Documentation

QString radioStation::configFileName [read]

This property holds the path to the configuration file used by this object. You can determinate the path to the configuration file in the constructor (see there for further details). Once set there, it can't be changed anymore.

Use config_skeleton for comfortable access to the settings that are stored in the configuration file.
See also:
QString internal_configFileName

Definition at line 49 of file radiostation.h.


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

Generated on Sat May 2 10:43:56 2009 for kradioripper by  doxygen 1.5.6