get_stream_info.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2008-2010  Lukas Sommer < SommerLuk at gmail dot com >
00003 
00004     This program is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU General Public License as
00006     published by the Free Software Foundation; either version 2 of
00007     the License or (at your option) version 3 or any later version
00008     accepted by the membership of KDE e.V. (or its successor approved
00009     by the membership of KDE e.V.), which shall act as a proxy
00010     defined in Section 14 of version 3 of the license.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #include "get_stream_info.h"
00022 #define AND  &&
00023 #define OR  ||
00024 #define NOT  !
00025 #define EQUAL  ==
00026 
00027 get_stream_info::get_stream_info(QObject *parent) : ripping(parent)
00028 {
00029 }
00030 
00031 get_stream_info::~get_stream_info()
00032 {
00033   // Streamripper must be terminated here because it must be terminated earlier than
00034   // the temp directory is removed!
00035   m_process.kill();
00036   m_process.waitForFinished(-1);
00037 }
00038 
00039 QString get_stream_info::serverUri() const
00040 {
00041   return internal_serverUri;
00042 }
00043 
00044 void get_stream_info::setServerUri(const QString value)
00045 {
00046   if (NOT (value EQUAL internal_serverUri)) {
00047     abortStreamripper();
00048     internal_serverUri=value;
00049     resetStreamripperProperties();
00050   };
00051 }
00052 
00053 QStringList get_stream_info::parameterList() const
00054 {
00055   // variables
00056   QStringList parameters;
00057 
00058   //code
00059   // calculate all parameters
00060   parameters += ripping::parameterList();
00061 
00062   parameters.append(QString("-M"));
00063   parameters.append(QString("0"));  // stop after the stream starts
00064 
00065   parameters.append(QString("-A"));  // don't write any files...
00066 
00067   return parameters;
00068 }
00069 
00070 QString get_stream_info::workingDirectory() const
00071 {
00072   return m_tempDir.name();
00073 }

doxygen