ripping.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef RIPPING_H
00022 #define RIPPING_H
00023
00024 #include "streamripper_base.h"
00025 #include "propertyvalue.h"
00026
00042 class ripping : public streamripper_base
00043 {
00044
00045 Q_OBJECT
00046
00082 Q_PROPERTY(PropertyValue bitrate READ bitrate)
00083
00084
00111 Q_PROPERTY(PropertyValue dataSize READ dataSize)
00112
00137 Q_PROPERTY(PropertyValue error READ error)
00138
00182 Q_PROPERTY(bool isRunning READ isRunning)
00183
00217 Q_PROPERTY(PropertyValue metaInterval READ metaInterval)
00218
00245 Q_PROPERTY(PropertyValue relayPort READ relayPort)
00246
00265 Q_PROPERTY(PropertyValue serverName READ serverName)
00266
00283 Q_PROPERTY(PropertyValue song READ song)
00284
00299 Q_PROPERTY(PropertyValue status READ status)
00300
00319 Q_PROPERTY(PropertyValue streamName READ streamName)
00320
00321 public:
00322
00344 enum statusType {
00345 idle,
00346 is_starting,
00347 is_connecting,
00348 is_buffering,
00349 is_skipping,
00350 is_ripping,
00351 is_saving };
00352
00353
00356 ripping(const QPointer<QObject> parent);
00358 virtual ~ripping();
00359
00360
00362 virtual PropertyValue bitrate() const;
00364 virtual PropertyValue dataSize() const;
00368 bool doesTheUserWantsThatTheStreamIsRipping();
00370 virtual PropertyValue error() const;
00372 virtual bool isRunning() const;
00374 virtual PropertyValue metaInterval() const;
00376 virtual PropertyValue relayPort() const;
00378 virtual PropertyValue serverName() const;
00380 virtual PropertyValue song() const;
00382 virtual PropertyValue status() const;
00384 virtual PropertyValue streamName() const;
00385
00386
00388 static qint64 default_value_of_bitrate();
00390 static qint64 default_value_of_dataSize();
00392 static QString default_value_of_error();
00394 static bool default_value_of_isRunning();
00396 static qint64 default_value_of_metaInterval();
00398 static qint64 default_value_of_relayPort();
00400 static QString default_value_of_serverName();
00402 static QString default_value_of_song();
00404 static statusType default_value_of_status();
00406 static QString default_value_of_streamName();
00419 static bool doesTheUserWantsThatTheStreamIsRipping(const ripping::statusType theStatus);
00421 static PropertyValue formatedBitrate(const qint64 theBitrate);
00423 static PropertyValue formatedDataSize(const qint64 theDataSize);
00425 static PropertyValue formatedError(const QString theError);
00427 static PropertyValue formatedMetaInterval(const qint64 theMetaInterval);
00429 static PropertyValue formatedRelayPort(const qint64 theRelayPort);
00431 static PropertyValue formatedServerName(const QString theServerName);
00433 static PropertyValue formatedSong(const QString theSong);
00435 static PropertyValue formatedStatus(const statusType theStatus);
00437 static PropertyValue formatedStreamName(const QString theStreamName);
00438
00439 signals:
00440
00442 void bitrateChanged(qlonglong index, PropertyValue newBitrate);
00444 void dataSizeChanged(qlonglong index, PropertyValue newDataSize);
00446 void errorChanged(qlonglong index, PropertyValue newError);
00448 void metaIntervalChanged(qlonglong index, PropertyValue newMetaInterval);
00450 void not_running();
00452 void relayPortChanged(qlonglong index, PropertyValue newRelayPort);
00454 void running();
00456 void serverNameChanged(qlonglong index, PropertyValue newServerName);
00458 void songChanged(qlonglong index, PropertyValue newSong);
00460 void statusChanged(qlonglong index, PropertyValue newStatus);
00462 void streamNameChanged(qlonglong index, PropertyValue newStreamName);
00463
00464 public slots:
00468 void shutDown();
00474 virtual void startStreamripper();
00475
00476 protected:
00487 virtual void interpretate_console_output(QStringList &stringList);
00491 virtual QStringList parameterList() const;
00495 virtual void resetStreamripperProperties();
00498 virtual QString serverUri() const = 0;
00500 virtual void setBitrate(const qint64 newBitrate);
00502 virtual void setDataSize(const qint64 newDataSize);
00504 virtual void setError(const QString newError);
00506 virtual void setMetaInterval(const qint64 newMetaInterval);
00508 virtual void setRelayPort(const qint64 newRelayPort);
00510 virtual void setServerName(const QString newServerName);
00512 virtual void setSong(const QString newSong);
00514 virtual void setStatus(const statusType newStatus);
00516 virtual void setStreamName(const QString newStreamName);
00519 virtual QString streamripperCommand() const;
00520
00521
00522
00523 private:
00524
00531 void helper_interpretate_metainfo_and_datasize(QString my_line);
00532
00533
00535 PropertyValue internal_bitrate;
00537 PropertyValue internal_dataSize;
00539 PropertyValue internal_error;
00541 bool internal_isRunning;
00543 PropertyValue internal_metaInterval;
00545 PropertyValue internal_relayPort;
00547 PropertyValue internal_serverName;
00549 PropertyValue internal_song;
00551 PropertyValue internal_status;
00553 PropertyValue internal_streamName;
00554
00555 private slots:
00570 void errorOccured(QProcess::ProcessError error);
00583 void streamripperStateChange(QProcess::ProcessState newState);
00584 };
00585
00586 Q_DECLARE_METATYPE(ripping::statusType)
00587
00588 #endif