ripping Class Reference

This abstract class uses streamripper to rip radio streams. More...

#include <ripping.h>

Inheritance diagram for ripping:

Inheritance graph
[legend]
Collaboration diagram for ripping:

Collaboration graph
[legend]

List of all members.

Public Types

enum  statusType {
  idle, is_starting,
  is_connecting, is_buffering,
  is_skipping, is_ripping,
  is_saving
}

Public Slots

void shutDown ()
virtual void startStreamripper ()

Signals

void bitrateChanged (void *index, PropertyValue newBitrate)
void dataSizeChanged (void *index, PropertyValue newDataSize)
void errorChanged (void *index, PropertyValue newError)
void metaIntervalChanged (void *index, PropertyValue newMetaInterval)
void metaInterval_milliSecondsChanged (void *index, PropertyValue newMetaInterval_milliSeconds)
void not_running ()
void relayPortChanged (void *index, PropertyValue newRelayPort)
void running ()
void serverNameChanged (void *index, PropertyValue newServerName)
void songChanged (void *index, PropertyValue newSong)
void statusChanged (void *index, PropertyValue newStatus)
void streamNameChanged (void *index, PropertyValue newStreamName)

Public Member Functions

 ripping (QObject *parent)
virtual ~ripping ()
virtual PropertyValue bitrate () const
virtual PropertyValue dataSize () const
bool doesTheUserWantsThatTheStreamIsRipping () const
virtual PropertyValue error () const
virtual bool isRunning () const
virtual PropertyValue metaInterval () const
virtual PropertyValue metaInterval_milliSeconds () const
virtual PropertyValue relayPort () const
virtual PropertyValue serverName () const
virtual PropertyValue song () const
virtual PropertyValue status () const
virtual PropertyValue streamName () const

Static Public Member Functions

static qint64 default_value_of_bitrate ()
static qint64 default_value_of_dataSize ()
static QString default_value_of_error ()
static bool default_value_of_isRunning ()
static qint64 default_value_of_metaInterval ()
static qint64 default_value_of_relayPort ()
static QString default_value_of_serverName ()
static QString default_value_of_song ()
static statusType default_value_of_status ()
static QString default_value_of_streamName ()
static bool doesTheUserWantsThatTheStreamIsRipping (const statusType theStatus)
static PropertyValue formatedBitrate (const qint64 theBitrate)
static PropertyValue formatedDataSize (const qint64 theDataSize)
static PropertyValue formatedError (const QString &theError)
static PropertyValue formatedMetaInterval (const qint64 theMetaInterval)
static PropertyValue formatedMetaInterval_milliSeconds (const qint64 theMetaInterval_milliSeconds)
static PropertyValue formatedRelayPort (const qint64 theRelayPort)
static PropertyValue formatedServerName (const QString &theServerName)
static PropertyValue formatedSong (const QString &theSong)
static PropertyValue formatedStatus (const statusType theStatus)
static PropertyValue formatedStreamName (const QString &theStreamName)

Protected Member Functions

virtual void interpretate_console_output (QStringList &stringList)
virtual QStringList parameterList () const
virtual void resetStreamripperProperties ()
virtual QString serverUri () const =0
virtual void setBitrate (const qint64 newBitrate)
virtual void setDataSize (const qint64 newDataSize)
virtual void setError (const QString &newError)
virtual void setMetaInterval (const qint64 newMetaInterval)
virtual void setRelayPort (const qint64 newRelayPort)
virtual void setServerName (const QString &newServerName)
virtual void setSong (const QString &newSong)
virtual void setStatus (const statusType newStatus)
virtual void setStreamName (const QString &newStreamName)
virtual QString streamripperCommand () const
virtual QString workingDirectory () const =0

Properties

PropertyValue bitrate
PropertyValue dataSize
PropertyValue error
bool isRunning
PropertyValue metaInterval
PropertyValue metaInterval_milliSeconds
PropertyValue relayPort
PropertyValue serverName
PropertyValue song
PropertyValue status
PropertyValue streamName

Private Slots

void emit_metaInterval_milliSecondsChanged ()
void errorOccured (const QProcess::ProcessError error)
void refreshRelayPort ()
void streamripperStateChange (const QProcess::ProcessState newState)

Private Member Functions

void helper_interpretate_metainfo_and_datasize (QString my_line)

Private Attributes

PropertyValue internal_bitrate
PropertyValue internal_dataSize
PropertyValue internal_error
bool internal_isRunning
PropertyValue internal_metaInterval
PropertyValue internal_relayPort
PropertyValue internal_serverName
PropertyValue internal_song
PropertyValue internal_status
PropertyValue internal_streamName
qint64 lastRecognizedRelayPort


Detailed Description

This abstract class uses streamripper to rip radio streams.

You can use the public slots virtual void startStreamripper() and void shutDown() to start and stop streamripper.

This class applies the options available through settings_general when calling streamripper (see virtual QStringList parameterList() const).

The actual state of the ripping process is available through a number of properties.

You have to implement virtual QString serverUri() const in inherited classes.

Furthermore this class provides the static functions static QString format_bitrate(long bitrate) and static QString format_metaInterval(long metaInterval).

Warning:
This class uses signals and slots internally. So don't disconnect generally all connections of this object!

Definition at line 46 of file ripping.h.


Member Enumeration Documentation

This enum can hold the actual status of streamripper.

  • idle: m_process is not running.
  • is_starting:
    1. m_process will be started immediately
    2. m_process is QProcess::Starting.
    3. m_process is QProcess::Running, but streamripper still hasn't reached the state ripping::is_connecting.
  • is_connecting: streamripper connects to the server.
  • is_buffering: streamripper is filling his buffer.
  • is_skipping: streamripper doesn't record the actual song (in splitted files).
  • is_ripping: streamripper is ripping the actual song.
  • is_saving: streamripper is shutting down. This takes usually some time, but only "shutting down" is an annoying message. The user will find it more useful if the status message describes something important. So it's called "saving files". This sounds important and also is true.
Enumerator:
idle 
is_starting 
is_connecting 
is_buffering 
is_skipping 
is_ripping 
is_saving 

Definition at line 403 of file ripping.h.


Constructor & Destructor Documentation

ripping::ripping ( QObject *  parent  ) 

Constructor of the class.

Parameters:
parent Sets the parent of this object.

Definition at line 34 of file ripping.cpp.

References bitrateChanged(), emit_metaInterval_milliSecondsChanged(), error(), errorOccured(), console_reader::internal_splitBehavior, console_reader::m_process, resetStreamripperProperties(), and streamripperStateChange().

Here is the call graph for this function:

ripping::~ripping (  )  [virtual]

The destructor.

Definition at line 76 of file ripping.cpp.


Member Function Documentation

virtual PropertyValue ripping::bitrate (  )  const [virtual]

See property bitrate.

void ripping::bitrateChanged ( void *  index,
PropertyValue  newBitrate 
) [signal]

See property bitrate.

Referenced by ripping(), setBitrate(), and radioStation::updateMetaData().

Here is the caller graph for this function:

virtual PropertyValue ripping::dataSize (  )  const [virtual]

See property dataSize.

Referenced by helper_interpretate_metainfo_and_datasize().

Here is the caller graph for this function:

void ripping::dataSizeChanged ( void *  index,
PropertyValue  newDataSize 
) [signal]

See property dataSize.

Referenced by setDataSize().

Here is the caller graph for this function:

qint64 ripping::default_value_of_bitrate (  )  [static]

Returns:
The default value of property bitrate.

Definition at line 842 of file ripping.cpp.

Referenced by settings_stream_widget_connection::delete_old_streamInfo_and_start_recognization(), resetStreamripperProperties(), and radioStation::setServerUri().

Here is the caller graph for this function:

qint64 ripping::default_value_of_dataSize (  )  [static]

Returns:
The default value of property dataSize.

Definition at line 702 of file ripping.cpp.

Referenced by interpretate_console_output(), resetStreamripperProperties(), and streamripperStateChange().

Here is the caller graph for this function:

QString ripping::default_value_of_error (  )  [static]

Returns:
The default value of property error.

Definition at line 609 of file ripping.cpp.

Referenced by resetStreamripperProperties().

Here is the caller graph for this function:

bool ripping::default_value_of_isRunning (  )  [static]

Returns:
The default value of property isRunning.

Definition at line 707 of file ripping.cpp.

qint64 ripping::default_value_of_metaInterval (  )  [static]

Returns:
The default value of property metaInterval.

Definition at line 890 of file ripping.cpp.

Referenced by settings_stream_widget_connection::delete_old_streamInfo_and_start_recognization(), resetStreamripperProperties(), and radioStation::setServerUri().

Here is the caller graph for this function:

qint64 ripping::default_value_of_relayPort (  )  [static]

Returns:
The default value of property relayPort.

Definition at line 776 of file ripping.cpp.

Referenced by resetStreamripperProperties(), and streamripperStateChange().

Here is the caller graph for this function:

QString ripping::default_value_of_serverName (  )  [static]

Returns:
The default value of property serverName.

Definition at line 393 of file ripping.cpp.

Referenced by settings_stream_widget_connection::delete_old_streamInfo_and_start_recognization(), resetStreamripperProperties(), and radioStation::setServerUri().

Here is the caller graph for this function:

QString ripping::default_value_of_song (  )  [static]

Returns:
The default value of property song.

Definition at line 645 of file ripping.cpp.

Referenced by interpretate_console_output(), resetStreamripperProperties(), and streamripperStateChange().

Here is the caller graph for this function:

ripping::statusType ripping::default_value_of_status (  )  [static]

Returns:
The default value of property status.

Definition at line 502 of file ripping.cpp.

References idle.

Referenced by resetStreamripperProperties(), and streamripperStateChange().

Here is the caller graph for this function:

QString ripping::default_value_of_streamName (  )  [static]

Returns:
The default value of property streamName.

Definition at line 357 of file ripping.cpp.

Referenced by settings_stream_widget_connection::delete_old_streamInfo_and_start_recognization(), resetStreamripperProperties(), and radioStation::setServerUri().

Here is the caller graph for this function:

bool ripping::doesTheUserWantsThatTheStreamIsRipping ( const statusType  theStatus  )  [static]

Parameters:
theStatus the status for which you want to determinate if the user wants to rip the stream or not.
Returns:
  • false if the user wants that the stream is not ripping. This is assumed when the stream isn't running, (ripping::idle) or when the stream is running but the user has clicked on stop so that the stream is shutting down (ripping::is_saving).
  • true in all other cases.
See also:
doesTheUserWantsThatTheStreamIsRipping()

Definition at line 1090 of file ripping.cpp.

References idle, is_saving, and OR.

bool ripping::doesTheUserWantsThatTheStreamIsRipping (  )  const

Performs doesTheUserWantsThatTheStreamIsRipping(const ripping::statusType theStatus) with the status of this object - so it provides a sort of view to the propyerty status.

Definition at line 1095 of file ripping.cpp.

References internal_status, and PropertyValue::internalValue.

Referenced by stationlistWidget::reloadStatusOfStartAndStopActions().

Here is the caller graph for this function:

void ripping::emit_metaInterval_milliSecondsChanged (  )  [private, slot]

This function emits the signal metaInterval_milliSecondsChanged()

Definition at line 80 of file ripping.cpp.

References streamripper_base::index(), metaInterval_milliSeconds(), and metaInterval_milliSecondsChanged().

Referenced by ripping().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual PropertyValue ripping::error (  )  const [virtual]

See property error.

Referenced by refreshRelayPort(), and ripping().

Here is the caller graph for this function:

void ripping::errorChanged ( void *  index,
PropertyValue  newError 
) [signal]

See property error.

Referenced by setError().

Here is the caller graph for this function:

void ripping::errorOccured ( const QProcess::ProcessError  error  )  [private, slot]

This slot is to catch the signal QProcess::error(QProcess::ProcessError error) from m_process.

If the error is...

  • QProcess::FailedToStart: Make a test if either the invoked program is missing or you may have insufficient permissions to invoke the program. An appropriate error messessage is set in the property error.
  • QProcess::Crashed: An appropriate error messessage is set in the property error.
  • All other errors can safly be ignored because they don't mean that streamripper is terminated.
Parameters:
error The QProcess::ProcessError that has occurred.

Definition at line 954 of file ripping.cpp.

References setError().

Referenced by ripping().

Here is the call graph for this function:

Here is the caller graph for this function:

PropertyValue ripping::formatedBitrate ( const qint64  theBitrate  )  [static]

PropertyValue ripping::formatedDataSize ( const qint64  theDataSize  )  [static]

Returns:
A full-featured formateded version for the property dataSize.

Definition at line 655 of file ripping.cpp.

References PropertyValue::error, PropertyValue::formatedValue, PropertyValue::formatedValueAlignment, PropertyValue::internalValue, PropertyValue::toolTip, PropertyValue::type, PropertyValue::unset, PropertyValue::value, and PropertyValue::whatsThis.

Referenced by setDataSize().

Here is the caller graph for this function:

PropertyValue ripping::formatedError ( const QString &  theError  )  [static]

Returns:
A full-featured formateded version for the property error.

Definition at line 512 of file ripping.cpp.

References PropertyValue::formatedValue, PropertyValue::internalValue, PropertyValue::toolTip, PropertyValue::type, PropertyValue::unset, PropertyValue::value, and PropertyValue::whatsThis.

Referenced by setError().

Here is the caller graph for this function:

PropertyValue ripping::formatedMetaInterval ( const qint64  theMetaInterval  )  [static]

PropertyValue ripping::formatedMetaInterval_milliSeconds ( const qint64  theMetaInterval_milliSeconds  )  [static]

PropertyValue ripping::formatedRelayPort ( const qint64  theRelayPort  )  [static]

Returns:
A full-featured formateded version for the property relayPort.

Definition at line 722 of file ripping.cpp.

References PropertyValue::error, PropertyValue::formatedValue, PropertyValue::formatedValueAlignment, PropertyValue::internalValue, PropertyValue::toolTip, PropertyValue::type, PropertyValue::unset, PropertyValue::value, and PropertyValue::whatsThis.

Referenced by refreshRelayPort().

Here is the caller graph for this function:

PropertyValue ripping::formatedServerName ( const QString &  theServerName  )  [static]

PropertyValue ripping::formatedSong ( const QString &  theSong  )  [static]

Returns:
A full-featured formateded version for the property song.

Definition at line 619 of file ripping.cpp.

References EQUAL, PropertyValue::formatedValue, PropertyValue::internalValue, OR, PropertyValue::type, PropertyValue::unset, and PropertyValue::value.

Referenced by setSong().

Here is the caller graph for this function:

PropertyValue ripping::formatedStatus ( const statusType  theStatus  )  [static]

Returns:
A full-featured formateded version for the property status.

Definition at line 403 of file ripping.cpp.

References PropertyValue::formatedValue, idle, PropertyValue::internalValue, is_buffering, is_connecting, is_ripping, is_saving, is_skipping, is_starting, PropertyValue::toolTip, PropertyValue::type, PropertyValue::unset, PropertyValue::value, and PropertyValue::whatsThis.

Referenced by setStatus().

Here is the caller graph for this function:

PropertyValue ripping::formatedStreamName ( const QString &  theStreamName  )  [static]

void ripping::helper_interpretate_metainfo_and_datasize ( QString  my_line  )  [private]

This internal helper function used in interpretate_console_output() interpretates a specific part of streamrippers output and sets the properties song and dataSize accordingly.

Parameters:
my_line A string of the form song title [ 1kb]. The units B, KB, K, MB and M are recognized for the data size (not case sensitive).

Definition at line 255 of file ripping.cpp.

References dataSize(), NOT, OR, setDataSize(), and setSong().

Referenced by interpretate_console_output().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::interpretate_console_output ( QStringList &  stringList  )  [protected, virtual]

This function reads the output of the streamripper process and interpretates it. It keeps the property of this class up to date - so when you want to use this information, use the properties.

Internally for performance reasons it uses from the many lines it can receive only the last available information of each type. (For example: When it receives 15 lines "[Ripping] song title [data size]" it uses only the last one to set status, song and dataSize properties - but controls all the lines before, to see if they contain data of other type like bitrate information or so on, and if so, it uses it.)

Implements console_reader.

Definition at line 98 of file ripping.cpp.

References default_value_of_dataSize(), default_value_of_song(), helper_interpretate_metainfo_and_datasize(), is_buffering, is_connecting, is_ripping, is_saving, is_skipping, NOT, setBitrate(), setDataSize(), setError(), setMetaInterval(), setRelayPort(), setServerName(), setSong(), setStatus(), and setStreamName().

Here is the call graph for this function:

virtual bool ripping::isRunning (  )  const [virtual]

See property isRunning.

virtual PropertyValue ripping::metaInterval (  )  const [virtual]

See property metaInterval.

virtual PropertyValue ripping::metaInterval_milliSeconds (  )  const [virtual]

See property metaInterval_milliSeconds.

Referenced by emit_metaInterval_milliSecondsChanged().

Here is the caller graph for this function:

void ripping::metaInterval_milliSecondsChanged ( void *  index,
PropertyValue  newMetaInterval_milliSeconds 
) [signal]

See property metaInterval_milliSeconds.

Referenced by emit_metaInterval_milliSecondsChanged().

Here is the caller graph for this function:

void ripping::metaIntervalChanged ( void *  index,
PropertyValue  newMetaInterval 
) [signal]

See property metaInterval.

Referenced by setMetaInterval(), and radioStation::updateMetaData().

Here is the caller graph for this function:

void ripping::not_running (  )  [signal]

See property isRunning.

Referenced by setStatus().

Here is the caller graph for this function:

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

This function provides the necessary parameters for calling streamripper as available from serverUri() and settings_general - and some extra parameter (like to don't override temporary files).

Implements streamripper_base.

Reimplemented in get_stream_info, and radioStation.

Definition at line 1004 of file ripping.cpp.

References proxyinfo::proxyserver(), and serverUri().

Here is the call graph for this function:

void ripping::refreshRelayPort (  )  [private, slot]

Recalculates internal_relayPort and emits the necessary signals.

See also:
lastRecognizedRelayPort

setError()

setStatus

setRelayPort()

Definition at line 756 of file ripping.cpp.

References error(), formatedRelayPort(), streamripper_base::index(), internal_relayPort, PropertyValue::internalValue, is_ripping, is_skipping, lastRecognizedRelayPort, relayPortChanged(), status(), PropertyValue::type, and PropertyValue::unset.

Referenced by setError(), setRelayPort(), and setStatus().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual PropertyValue ripping::relayPort (  )  const [virtual]

See property relayPort.

void ripping::relayPortChanged ( void *  index,
PropertyValue  newRelayPort 
) [signal]

See property relayPort.

Referenced by refreshRelayPort().

Here is the caller graph for this function:

void ripping::resetStreamripperProperties (  )  [protected, virtual]

This function resets all streamripper properties to it's default values (=unset). It uses the reset functions of the properties, so for all changes a notify signal will be emitted.

Definition at line 85 of file ripping.cpp.

References default_value_of_bitrate(), default_value_of_dataSize(), default_value_of_error(), default_value_of_metaInterval(), default_value_of_relayPort(), default_value_of_serverName(), default_value_of_song(), default_value_of_status(), default_value_of_streamName(), setBitrate(), setDataSize(), setError(), setMetaInterval(), setRelayPort(), setServerName(), setSong(), setStatus(), and setStreamName().

Referenced by ripping(), and get_stream_info::setServerUri().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::running (  )  [signal]

See property isRunning.

Referenced by setStatus().

Here is the caller graph for this function:

virtual PropertyValue ripping::serverName (  )  const [virtual]

See property serverName.

void ripping::serverNameChanged ( void *  index,
PropertyValue  newServerName 
) [signal]

See property serverName.

Referenced by setServerName(), and radioStation::updateMetaData().

Here is the caller graph for this function:

virtual QString ripping::serverUri (  )  const [protected, pure virtual]

This function provides the URI which should be ripped and is used by parameterList(). Implement it in inherited classes!

Implemented in get_stream_info, and radioStation.

Referenced by parameterList().

Here is the caller graph for this function:

void ripping::setBitrate ( const qint64  newBitrate  )  [protected, virtual]

Used internally to write the property bitrate.

Reimplemented in radioStation.

Definition at line 834 of file ripping.cpp.

References bitrateChanged(), formatedBitrate(), streamripper_base::index(), internal_bitrate, and PropertyValue::internalValue.

Referenced by interpretate_console_output(), and resetStreamripperProperties().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::setDataSize ( const qint64  newDataSize  )  [protected, virtual]

Used internally to write the property dataSize.

Definition at line 694 of file ripping.cpp.

References dataSizeChanged(), formatedDataSize(), streamripper_base::index(), internal_dataSize, and PropertyValue::internalValue.

Referenced by helper_interpretate_metainfo_and_datasize(), interpretate_console_output(), resetStreamripperProperties(), and streamripperStateChange().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::setError ( const QString &  newError  )  [protected, virtual]

Used internally to write the property error.

Definition at line 597 of file ripping.cpp.

References errorChanged(), formatedError(), streamripper_base::index(), internal_error, PropertyValue::internalValue, and refreshRelayPort().

Referenced by errorOccured(), interpretate_console_output(), resetStreamripperProperties(), and startStreamripper().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::setMetaInterval ( const qint64  newMetaInterval  )  [protected, virtual]

Used internally to write the property metaInterval.

Reimplemented in radioStation.

Definition at line 882 of file ripping.cpp.

References formatedMetaInterval(), streamripper_base::index(), internal_metaInterval, PropertyValue::internalValue, and metaIntervalChanged().

Referenced by interpretate_console_output(), and resetStreamripperProperties().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::setRelayPort ( const qint64  newRelayPort  )  [protected, virtual]

Used internally to write the property relayPort.

Definition at line 768 of file ripping.cpp.

References lastRecognizedRelayPort, and refreshRelayPort().

Referenced by interpretate_console_output(), resetStreamripperProperties(), and streamripperStateChange().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Used internally to write the property serverName.

Reimplemented in radioStation.

Definition at line 385 of file ripping.cpp.

References formatedServerName(), streamripper_base::index(), internal_serverName, PropertyValue::internalValue, and serverNameChanged().

Referenced by interpretate_console_output(), and resetStreamripperProperties().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::setSong ( const QString &  newSong  )  [protected, virtual]

Used internally to write the property song.

Definition at line 637 of file ripping.cpp.

References formatedSong(), streamripper_base::index(), internal_song, PropertyValue::internalValue, and songChanged().

Referenced by helper_interpretate_metainfo_and_datasize(), interpretate_console_output(), resetStreamripperProperties(), and streamripperStateChange().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::setStatus ( const statusType  newStatus  )  [protected, virtual]

Used internally to write the properties status and also isRunning.

Definition at line 468 of file ripping.cpp.

References formatedStatus(), idle, streamripper_base::index(), internal_isRunning, internal_status, PropertyValue::internalValue, not_running(), refreshRelayPort(), running(), and statusChanged().

Referenced by interpretate_console_output(), resetStreamripperProperties(), startStreamripper(), and streamripperStateChange().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Used internally to write the property streamName.

Reimplemented in radioStation.

Definition at line 349 of file ripping.cpp.

References formatedStreamName(), streamripper_base::index(), internal_streamName, PropertyValue::internalValue, and streamNameChanged().

Referenced by interpretate_console_output(), and resetStreamripperProperties().

Here is the call graph for this function:

Here is the caller graph for this function:

void ripping::shutDown (  )  [slot]

This slot sends the terminate signal to the streamripper instance running in m_process.

See also:
void not_running()

Definition at line 1083 of file ripping.cpp.

References console_reader::m_process.

Referenced by stationlistModel::stopRecording().

Here is the caller graph for this function:

virtual PropertyValue ripping::song (  )  const [virtual]

See property song.

void ripping::songChanged ( void *  index,
PropertyValue  newSong 
) [signal]

See property song.

Referenced by setSong().

Here is the caller graph for this function:

void ripping::startStreamripper (  )  [virtual, slot]

This function starts streamripper (using streamripper_base::startStreamripper()) if it isn't yet running. It uses workingDirectory() as working directory and if this directory doesn't exist, it is created automatically (if possible). It resets the property error and actualizes the property status.

See also:
void not_running()

Reimplemented from streamripper_base.

Definition at line 1048 of file ripping.cpp.

References idle, is_starting, console_reader::m_process, setError(), setStatus(), and workingDirectory().

Referenced by settings_stream_widget_connection::helper_setServerUri_connectMProcess_startRecognization(), and stationlistModel::record().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual PropertyValue ripping::status (  )  const [virtual]

See property status.

Referenced by refreshRelayPort().

Here is the caller graph for this function:

void ripping::statusChanged ( void *  index,
PropertyValue  newStatus 
) [signal]

See property status.

Referenced by setStatus().

Here is the caller graph for this function:

virtual PropertyValue ripping::streamName (  )  const [virtual]

See property streamName.

void ripping::streamNameChanged ( void *  index,
PropertyValue  newStreamName 
) [signal]

See property streamName.

Referenced by setStreamName(), and radioStation::updateMetaData().

Here is the caller graph for this function:

QString ripping::streamripperCommand (  )  const [protected, virtual]

This function provides the necessary command for invoking streamripper as available from settings_general::streamripperCommand.

Implements streamripper_base.

Definition at line 1043 of file ripping.cpp.

void ripping::streamripperStateChange ( const QProcess::ProcessState  newState  )  [private, slot]

This slot is to catch the signal QProcess::stateChanged(QProcess::ProcessState) from m_process.

  • When the state has changed to QProcess::NotRunning than the properties get adjusted.
  • When the state has changed to QProcess::Starting nothing happens because the properties get adjusted by the calling function.
  • When the state has changed to QProcess::Running nothing happens because the properties will get adjusted by interpretate_console_output().
Parameters:
newState The new QProcess::ProcessState that has occurred.

Definition at line 982 of file ripping.cpp.

References default_value_of_dataSize(), default_value_of_relayPort(), default_value_of_song(), default_value_of_status(), setDataSize(), setRelayPort(), setSong(), and setStatus().

Referenced by ripping().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual QString ripping::workingDirectory (  )  const [protected, pure virtual]

Provides the working directory for the Streamripper process.

Implemented in get_stream_info, and radioStation.

Referenced by startStreamripper().

Here is the caller graph for this function:


Member Data Documentation

Used internally to store the property bitrate.

Definition at line 604 of file ripping.h.

Referenced by setBitrate().

Used internally to store the property dataSize.

Definition at line 606 of file ripping.h.

Referenced by setDataSize().

Used internally to store the property error.

Definition at line 608 of file ripping.h.

Referenced by setError().

Used internally to store the property isRunning.

Definition at line 610 of file ripping.h.

Referenced by setStatus().

Used internally to store the property metaInterval.

Definition at line 612 of file ripping.h.

Referenced by setMetaInterval().

Used internally to store the property relayPort.

Definition at line 614 of file ripping.h.

Referenced by refreshRelayPort().

Used internally to store the property serverName.

Definition at line 616 of file ripping.h.

Referenced by setServerName().

Used internally to store the property song.

Definition at line 618 of file ripping.h.

Referenced by setSong().

Used internally to store the property status.

Definition at line 620 of file ripping.h.

Referenced by doesTheUserWantsThatTheStreamIsRipping(), and setStatus().

Used internally to store the property streamName.

Definition at line 622 of file ripping.h.

Referenced by setStreamName().

Here, the last recognized relay port is cached. This is necessary, because the property relayPort holds its value only when the status is is_skipping or is_ripping.

See also:
refreshRelayPort()

Definition at line 628 of file ripping.h.

Referenced by refreshRelayPort(), and setRelayPort().


Property Documentation

PropertyValue ripping::bitrate [read]

This property holds the bitrate of the stream in kbit/s (with SI prefix, which means 1000 bit per second, not 1024) that is recorded by streamripper. (This information is based on the information that the stream provides via the http header. This must not necessaryly be correct.)

Meaning of the internal value:

  • bitrate >= 1: The bitrate has been recognized. \ The property holds the bitrate.
  • (bitrate = 0) OR (bitrate = -1): An error occurred while recognizing the bitrate. (Maybe a streamripper error or maybe a KStreamRipper error while recognzing.)
  • bitrate <= -2: The property isn't defined. The bitrate has not (yet) been recognized.
Initialization value: -2

This property guards it's last value also when streamripper terminates.

Formated value:

  • If the parameter "bitrate" is >= 1, this is a nicly format QString version of bitrate in the form "23 kbit/s".
  • If the parameter is 0 or -1, then this is a message that there was an error while recognizing the bitrate.
  • If the parameter is < -1, then this is an empty string.
All returned strings are fully localised: They are translated and use the locally used number format.

See also:
 virtual void setBitrate(qint64 bitrate) 

 static qint64 default_value_of_bitrate() 

 static PropertyValue formatedBitrate(const qint64 theBitrate) 

Definition at line 87 of file ripping.h.

Referenced by stationlistModel::columnInfo().

PropertyValue ripping::dataSize [read]

This property holds the amount of data of the actual song in byte, that has been recorded by streamripper until now.

Warning:
The formated version contains the value in MiB (with binary prefix which means 1024 * 1024 byte, not 1000 * 1000 byte).
Meaning:
  • dataSize >= 0: The dataSize has been recognized. The property holds the dataSize.
  • dataSize = -1: An error occurred while recognizing the dataSize. (Maybe a streamripper error or maybe a KStreamRipper error while recognzing.)
  • dataSize <= -2: The property isn't defined. The dataSize has not (yet) been recognized.
Initialization value: -2

This property gets reseted when streamripper terminates.

See also:
 virtual void setDataSize(qint64 dataSize) 

 static qint64 default_value_of_dataSize() 

 static PropertyValue formatedDataSize(const qint64 theDataSize) 

Definition at line 116 of file ripping.h.

Referenced by stationlistModel::columnInfo().

PropertyValue ripping::error [read]

This property holds the error message of the last error that has occurred. It holds error messages from streamripper or an error messages from KStreamRipper (e.g. that the streamripper command wasn't found or the "save directory" isn't writable).

Formated error message:

  • If error doesn't start with "error -": The error message is left as is.
  • If error starts with "error -": The error is expected to be of the format "error -123 foo bar". 123 stands for the ID number of the bug.
    • If the ID is known: The formated error message is fully human readable and localised. The following bug description (here: foo bar) is ignored.
    • If the bug ID in unknown: A message of the form "Error 123: foo bar" is used. Error IDs < 1000 should be streamripper errors and error IDs >= 1000 should be KStreamRipper errors.

Meaning:

  • an empty string: No error since the last startStreamripper().
  • else: An error occurred since the last startStreamripper and the property holds the error message.
Initialization value: an empty string

This property guards it's last value also when streamripper terminates.

This property gets reseted when you startStreamripper().

See also:
 virtual void setError(const QString newError) 

 static QString default_value_of_error() 

 static PropertyValue formatedError(const QString theError) 

Definition at line 155 of file ripping.h.

Referenced by stationlistModel::columnInfo().

bool ripping::isRunning [read]

This property holds the status of streamripper in a simplified way: false when the status is ripping::idle, and true in all other cases.

Initialization value: false

  • read:
     virtual bool isRunning() const 
    
  • notify: There are 2 signals to which you can connect:
    •  void not_running() 
      
      This signal is emitted when isRunning changes to false.

      This means that this signal is emitted when the streamripper process enters in the state QProcess::NotRunning.

      This differs from QProcess:finished(), which is only emitted when the process was yet running. But not_running is also emitted after you've tried to start streamripper (m_process has yet entered in state QProcess::Starting) but the binary could than not be invoced (because is doesn't exit or the user hasn't execution rights or whatever).

    •  void running() 
      
      This signal is emitted when isRunning changes to true.

      This means that this signal is emitted when the streamripper process has entered in the state QProcess::Starting or immediately before it will enter.

      This differs from QProcess:started(), which is only emitted when the binary has been successfully invoced. But running is emitted after you start to try to invoce streamripper - still not knowing if this will work or not.

See also:
status

 virtual void setStatus(const statusType newStatus) 

 static QString default_value_of_isRunning() 

Definition at line 200 of file ripping.h.

Referenced by stationlistWidget::reloadStatusOfStartAndStopActions().

PropertyValue ripping::metaInterval [read]

This property holds the interval in byte in which metadata is send by the stream.

Meaning of the internal value:

  • metaInterval >= 1: The metaInterval has been recognized. The property holds the metaInterval.
  • (metaInterval = 0) OR (metaInterval = -1): An error occurred while recognizing the metaInterval. (Maybe a streamripper error or maybe a KStreamRipper error while recognzing.)
  • metaInterval <= -2: The property isn't defined. The metaInterval has not (yet) been recognized.
Initialization value: -2

This property guards it's last value also when streamripper terminates.

Formated value:

  • If the parameter "metaInterval" is >= 1, this is a nicly format QString version of metaInterval.
  • If the parameter is 0 or -1, then this is a message that there was an error while recognizing the meta data interval.
  • If the parameter is < -1, then this is an empty string.
All returned strings are fully localised: They are translated and use the locally used number format.

See also:
 virtual void setMetaInterval(qint64 newMetaInterval) 

 void resetMetaInterval() 

 static PropertyValue formatedMetaInterval(const qint64 theMetaInterval) 

Definition at line 235 of file ripping.h.

Referenced by stationlistModel::columnInfo().

PropertyValue ripping::metaInterval_milliSeconds [read]

This property holds the interval in milliseconds in which metadata is send by the stream. It doesn't exist on it's own, but is calculated from the properties metaInterval and bitrate.

Meaning of the internal value:

  • metaInterval_milliSeconds >= 1: The bitrate and the metaInterval have been recognized. The property holds the metaInterval in milliseconds.
  • (metaInterval_milliSeconds = 0) OR (metaInterval_milliSeconds = -1): An error occurred while recognizing the bitrate or the metaInterval. (Maybe a streamripper error or maybe a KStreamRipper error while recognzing.)
  • metaInterval_milliSeconds <= -2: The property isn't defined. The bitrate or the metaInterval has not (yet) been recognized.
Initialization value: depending on bitrate and metaInterval

This property guards it's last value also when streamripper terminates, as it depends on bitrate and metaInterval which guards it's values both.

Formated value:

  • If the parameter "metaInterval" is >= 1, this is a nicly format QString version of metaInterval.
  • If the parameter is 0 or -1, then this is a message that there was an error while recognizing the meta data interval.
  • If the parameter is < -1, then this is an empty string.
All returned strings are fully localised: They are translated and use the locally used number format.

See also:
 static PropertyValue formatedMetaInterval_milliSeconds(
   const qint64 theMetaInterval_milliSeconds) 

The constructor: There, the emitting of the notify signal is organized.

Definition at line 273 of file ripping.h.

Referenced by stationlistModel::columnInfo().

PropertyValue ripping::relayPort [read]

streamripper can start a local relay server which provides the stream that is actually recorded with some seconds of delay to the local network. This relay server is also used by KStreamRipper to implement to hear to the streams. This property holds the port of the relay server - but only if status is is_skipping or is_ripping.

Meaning:

  • relayPort >= 0: There exists a relay server. The property holds the port of the relay server.
  • relayPort = -1: An error occurred while recognizing the relay server port. (Maybe a streamripper error or maybe a KStreamRipper error while recognzing.)
  • relayPort <= -2: There doesn't exist a relay server.
Initialization value: -2

This property gets reseted when streamripper terminates.

See also:
 virtual void setRelayPort(qint64 newRelayPort) 

 static qint64 default_value_of_relayPort() 

 static PropertyValue formatedRelayPort(const qint64 theRelayPort) 

lastRecognizedRelayPort()

refreshRelayPort()

Definition at line 304 of file ripping.h.

Referenced by stationlistModel::columnInfo(), and listenSupport::setStation().

PropertyValue ripping::serverName [read]

This property holds the name of server from which the stream comes.

Meaning:

  • an empty string: The name of the server hasn't (yet) been recognized.
  • else: The name of the server has been recognized and the property holds it.
Initialization value: an empty string

This property guards it's last value also when streamripper terminates.

See also:
 virtual void settod_pudel_1920x1200ServerName(const QString newServerName) 

 static QString default_value_of_serverName() 

 static PropertyValue formatedServerName(const QString theServerName) 

Definition at line 324 of file ripping.h.

Referenced by stationlistModel::columnInfo().

PropertyValue ripping::song [read]

This property holds the name of the song that is actually recorded by streamripper.

Meaning:

  • an empty string: Actually streamripper isn't recordeding.
  • else: Actually streamripper is recordeding and the property holds the name of the song who's actually recorded.
Initialization value: an empty string

See also:
 virtual void setSong(const QString song) 

 static QString default_value_of_song() 

 static PropertyValue formatedSong(const QString theSong) 

Definition at line 342 of file ripping.h.

Referenced by stationlistModel::columnInfo().

PropertyValue ripping::status [read]

This property holds the status of streamripper (like "Buffering...", "Ripping...", "Shutting down..." ...).

Initialization value: ripping::idle

See also:
isRunning

 virtual void setStatus(const statusType newStatus) 

 static PropertyValue formatedStatus(const statusType theStatus) 

Definition at line 358 of file ripping.h.

Referenced by stationlistModel::columnInfo().

PropertyValue ripping::streamName [read]

This property holds the name of the stream that is recorded by streamripper.

Meaning:

  • an empty string: The name of the stream hasn't (yet) been recognized.
  • else: The name of the stream has been recognized and the property holds it.
Initialization value: an empty string

This property guards it's last value also when streamripper terminates.

See also:
 virtual void setStreamName(const QString newStreamName) 

 static QString default_value_of_streamName() 

 static PropertyValue formatedStreamName(const QString theStreamName) 

Definition at line 378 of file ripping.h.

Referenced by stationlistModel::columnInfo().


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

doxygen