diff options
Diffstat (limited to 'src/kmplayerprocess.cpp')
-rw-r--r-- | src/kmplayerprocess.cpp | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/src/kmplayerprocess.cpp b/src/kmplayerprocess.cpp index 13b3309..ff230a9 100644 --- a/src/kmplayerprocess.cpp +++ b/src/kmplayerprocess.cpp @@ -99,7 +99,7 @@ TQString Process::menuName () const { void Process::initProcess (Viewer * viewer) { m_viewer = viewer; delete m_process; - m_process = new KProcess; + m_process = new TDEProcess; m_process->setUseShell (true); m_process->setEnvironment (TQString::fromLatin1 ("SESSION_MANAGER"), TQString::fromLatin1 ("")); if (m_source) m_source->setPosition (0); @@ -171,11 +171,11 @@ bool Process::quit () { signal(SIGTERM, oldhandler); } else m_process->kill (SIGTERM); - KProcessController::theKProcessController->waitForProcessExit (1); + TDEProcessController::theTDEProcessController->waitForProcessExit (1); if (!m_process->isRunning ()) break; m_process->kill (SIGKILL); - KProcessController::theKProcessController->waitForProcessExit (1); + TDEProcessController::theTDEProcessController->waitForProcessExit (1); if (m_process->isRunning ()) { KMessageBox::error (viewer (), i18n ("Failed to end player process."), i18n ("Error")); } @@ -267,7 +267,7 @@ static bool proxyForURL (const KURL& url, TQString& proxy) { KDE_NO_CDTOR_EXPORT MPlayerBase::MPlayerBase (TQObject * parent, Settings * settings, const char * n) : Process (parent, settings, n), m_use_slave (true) { - m_process = new KProcess; + m_process = new TDEProcess; } KDE_NO_CDTOR_EXPORT MPlayerBase::~MPlayerBase () { @@ -281,10 +281,10 @@ KDE_NO_EXPORT void MPlayerBase::initProcess (Viewer * viewer) { if (KProtocolManager::useProxy () && proxyForURL (url, proxy_url)) m_process->setEnvironment("http_proxy", proxy_url); } - connect (m_process, TQT_SIGNAL (wroteStdin (KProcess *)), - this, TQT_SLOT (dataWritten (KProcess *))); - connect (m_process, TQT_SIGNAL (processExited (KProcess *)), - this, TQT_SLOT (processStopped (KProcess *))); + connect (m_process, TQT_SIGNAL (wroteStdin (TDEProcess *)), + this, TQT_SLOT (dataWritten (TDEProcess *))); + connect (m_process, TQT_SIGNAL (processExited (TDEProcess *)), + this, TQT_SLOT (processStopped (TDEProcess *))); } KDE_NO_EXPORT bool MPlayerBase::sendCommand (const TQString & cmd) { @@ -309,8 +309,8 @@ KDE_NO_EXPORT bool MPlayerBase::stop () { KDE_NO_EXPORT bool MPlayerBase::quit () { if (playing ()) { stop (); - disconnect (m_process, TQT_SIGNAL (processExited (KProcess *)), - this, TQT_SLOT (processStopped (KProcess *))); + disconnect (m_process, TQT_SIGNAL (processExited (TDEProcess *)), + this, TQT_SLOT (processStopped (TDEProcess *))); if (!m_use_slave) { void (*oldhandler)(int) = signal(SIGTERM, SIG_IGN); ::kill (-1 * ::getpid (), SIGTERM); @@ -322,7 +322,7 @@ KDE_NO_EXPORT bool MPlayerBase::quit () { TQTime t; t.start (); do { - KProcessController::theKProcessController->waitForProcessExit (2); + TDEProcessController::theTDEProcessController->waitForProcessExit (2); } while (t.elapsed () < 2000 && m_process->isRunning ()); #endif if (m_process->isRunning ()) @@ -333,7 +333,7 @@ KDE_NO_EXPORT bool MPlayerBase::quit () { return Process::quit (); } -KDE_NO_EXPORT void MPlayerBase::dataWritten (KProcess *) { +KDE_NO_EXPORT void MPlayerBase::dataWritten (TDEProcess *) { if (!commands.size ()) return; kdDebug() << "eval done " << commands.last () << endl; commands.pop_back (); @@ -342,7 +342,7 @@ KDE_NO_EXPORT void MPlayerBase::dataWritten (KProcess *) { commands.last ().length ()); } -KDE_NO_EXPORT void MPlayerBase::processStopped (KProcess *) { +KDE_NO_EXPORT void MPlayerBase::processStopped (TDEProcess *) { kdDebug() << "process stopped" << endl; commands.clear (); setState (Ready); @@ -424,7 +424,7 @@ KDE_NO_EXPORT bool MPlayer::deMediafiedPlay () { m_url = TQString ("cdda://") + m_url.mid (6); } if (url.protocol () != TQString ("stdin")) - args += KProcess::quote (TQString (TQFile::encodeName (m_url))); + args += TDEProcess::quote (TQString (TQFile::encodeName (m_url))); } m_tmpURL.truncate (0); if (!m_source->identified () && !m_settings->mplayerpost090) { @@ -441,7 +441,7 @@ KDE_NO_EXPORT bool MPlayer::deMediafiedPlay () { const KURL & sub_url (m_source->subUrl ()); if (!sub_url.isEmpty ()) { TQString myurl (sub_url.isLocalFile () ? getPath (sub_url) : sub_url.url ()); - args += KProcess::quote (TQString (TQFile::encodeName (myurl))); + args += TDEProcess::quote (TQString (TQFile::encodeName (myurl))); } } } @@ -523,10 +523,10 @@ KDE_NO_EXPORT bool MPlayer::brightness (int val, bool /*absolute*/) { bool MPlayer::run (const char * args, const char * pipe) { //m_view->consoleOutput ()->clear (); m_process_output = TQString (); - connect (m_process, TQT_SIGNAL (receivedStdout (KProcess *, char *, int)), - this, TQT_SLOT (processOutput (KProcess *, char *, int))); - connect (m_process, TQT_SIGNAL (receivedStderr (KProcess *, char *, int)), - this, TQT_SLOT (processOutput (KProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (receivedStdout (TDEProcess *, char *, int)), + this, TQT_SLOT (processOutput (TDEProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (receivedStderr (TDEProcess *, char *, int)), + this, TQT_SLOT (processOutput (TDEProcess *, char *, int))); m_use_slave = !(pipe && pipe[0]); if (!m_use_slave) { fprintf (stderr, "%s | ", pipe); @@ -601,7 +601,7 @@ bool MPlayer::run (const char * args, const char * pipe) { if (!plops.isNull ()) { TQStringList sl = TQStringList::split (TQChar (' '), plops); for (int i = 0; i < sl.size (); ++i) { - TQString plop = KProcess::quote (sl[i]); + TQString plop = TDEProcess::quote (sl[i]); fprintf (stderr, " %s", plop.ascii ()); *m_process << " " << plop; } @@ -618,7 +618,7 @@ bool MPlayer::run (const char * args, const char * pipe) { for ( it = m_process->args().begin(); it != end; ++it ){ sMPArgs += (*it); } - m_process->start (KProcess::NotifyOnExit, KProcess::All); + m_process->start (TDEProcess::NotifyOnExit, TDEProcess::All); old_volume = viewer ()->view ()->controlPanel ()->volumeBar ()->value (); @@ -641,18 +641,18 @@ KDE_NO_EXPORT bool MPlayer::grabPicture (const KURL & url, int pos) { args += "-vo jpeg:outdir="; else args += "-vo jpeg -jpeg outdir="; - args += KProcess::quote (outdir); + args += TDEProcess::quote (outdir); args += TQString (" -frames 1 -nosound -quiet "); if (pos > 0) args += TQString ("-ss %1 ").arg (pos); - args += KProcess::quote (TQString (TQFile::encodeName (myurl))); + args += TDEProcess::quote (TQString (TQFile::encodeName (myurl))); *m_process << args; kdDebug () << args << endl; - m_process->start (KProcess::NotifyOnExit, KProcess::NoCommunication); + m_process->start (TDEProcess::NotifyOnExit, TDEProcess::NoCommunication); return m_process->isRunning (); } -KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { +KDE_NO_EXPORT void MPlayer::processOutput (TDEProcess *, char * str, int slen) { if (!viewer () || slen <= 0) return; View * v = viewer ()->view (); @@ -809,7 +809,7 @@ KDE_NO_EXPORT void MPlayer::processOutput (KProcess *, char * str, int slen) { } while (slen > 0); } -KDE_NO_EXPORT void MPlayer::processStopped (KProcess * p) { +KDE_NO_EXPORT void MPlayer::processStopped (TDEProcess * p) { if (p && !m_grabfile.isEmpty ()) { emit grabReady (m_grabfile); m_grabfile.truncate (0); @@ -1026,12 +1026,12 @@ bool MEncoder::deMediafiedPlay () { else if (!post090 && myurl.startsWith (TQString ("dvd://"))) args += myurl.replace (0, 6, TQString (" -dvd ")); else - args += ' ' + KProcess::quote (TQString (TQFile::encodeName (myurl))); + args += ' ' + TDEProcess::quote (TQString (TQFile::encodeName (myurl))); } - TQString outurl = KProcess::quote (TQString (TQFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ()))); + TQString outurl = TDEProcess::quote (TQString (TQFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ()))); kdDebug () << args << " -o " << outurl << endl; *m_process << args << " -o " << outurl; - m_process->start (KProcess::NotifyOnExit, KProcess::NoCommunication); + m_process->start (TDEProcess::NotifyOnExit, TDEProcess::NoCommunication); success = m_process->isRunning (); if (success) setState (Playing); @@ -1088,12 +1088,12 @@ bool MPlayerDumpstream::deMediafiedPlay () { else if (!post090 && myurl.startsWith (TQString ("dvd://"))) args += myurl.replace (0, 6, TQString (" -dvd ")); else - args += ' ' + KProcess::quote (TQString (TQFile::encodeName (myurl))); + args += ' ' + TDEProcess::quote (TQString (TQFile::encodeName (myurl))); } - TQString outurl = KProcess::quote (TQString (TQFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ()))); + TQString outurl = TDEProcess::quote (TQString (TQFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ()))); kdDebug () << args << " -dumpstream -dumpfile " << outurl << endl; *m_process << args << " -dumpstream -dumpfile " << outurl; - m_process->start (KProcess::NotifyOnExit, KProcess::NoCommunication); + m_process->start (TDEProcess::NotifyOnExit, TDEProcess::NoCommunication); success = m_process->isRunning (); if (success) setState (Playing); @@ -1349,7 +1349,7 @@ bool CallbackProcess::quit () { TQTime t; t.start (); do { - KProcessController::theKProcessController->waitForProcessExit (2); + TDEProcessController::theTDEProcessController->waitForProcessExit (2); } while (t.elapsed () < 1000 && m_process->isRunning ()); #endif } @@ -1427,20 +1427,20 @@ TQString CallbackProcess::dcopName () { void CallbackProcess::initProcess (Viewer * viewer) { Process::initProcess (viewer); - connect (m_process, TQT_SIGNAL (processExited (KProcess *)), - this, TQT_SLOT (processStopped (KProcess *))); - connect (m_process, TQT_SIGNAL (receivedStdout (KProcess *, char *, int)), - this, TQT_SLOT (processOutput (KProcess *, char *, int))); - connect (m_process, TQT_SIGNAL (receivedStderr (KProcess *, char *, int)), - this, TQT_SLOT (processOutput (KProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (processExited (TDEProcess *)), + this, TQT_SLOT (processStopped (TDEProcess *))); + connect (m_process, TQT_SIGNAL (receivedStdout (TDEProcess *, char *, int)), + this, TQT_SLOT (processOutput (TDEProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (receivedStderr (TDEProcess *, char *, int)), + this, TQT_SLOT (processOutput (TDEProcess *, char *, int))); } -KDE_NO_EXPORT void CallbackProcess::processOutput (KProcess *, char * str, int slen) { +KDE_NO_EXPORT void CallbackProcess::processOutput (TDEProcess *, char * str, int slen) { if (viewer () && slen > 0) viewer ()->view ()->addText (TQString::fromLocal8Bit (str, slen)); } -KDE_NO_EXPORT void CallbackProcess::processStopped (KProcess *) { +KDE_NO_EXPORT void CallbackProcess::processStopped (TDEProcess *) { if (m_source) ((PlayListNotify *) m_source)->setInfoMessage (TQString ()); delete m_backend; @@ -1694,7 +1694,7 @@ KDE_NO_CDTOR_EXPORT Xine::~Xine () {} bool Xine::ready (Viewer * viewer) { initProcess (viewer); viewer->changeProtocol (QXEmbed::XPLAIN); - TQString xine_config = KProcess::quote (TQString (TQFile::encodeName (locateLocal ("data", "kmplayer/") + TQString ("xine_config")))); + TQString xine_config = TDEProcess::quote (TQString (TQFile::encodeName (locateLocal ("data", "kmplayer/") + TQString ("xine_config")))); m_request_seek = -1; if (m_source && !m_source->pipeCmd ().isEmpty ()) { fprintf (stderr, "%s | ", m_source->pipeCmd ().ascii ()); @@ -1738,13 +1738,13 @@ bool Xine::ready (Viewer * viewer) { *m_process << " -vd " << m_source->videoDevice (); } if (!m_recordurl.isEmpty ()) { - TQString rf = KProcess::quote ( + TQString rf = TDEProcess::quote ( TQString (TQFile::encodeName (getPath (m_recordurl)))); fprintf (stderr, " -rec %s", rf.ascii ()); *m_process << " -rec " << rf; } fprintf (stderr, "\n"); - m_process->start (KProcess::NotifyOnExit, KProcess::All); + m_process->start (TDEProcess::NotifyOnExit, TDEProcess::All); return m_process->isRunning (); } @@ -1798,7 +1798,7 @@ KDE_NO_EXPORT bool GStreamer::ready (Viewer * viewer) { *m_process << " -vcd-device " << m_settings->vcddevice; } fprintf (stderr, "\n"); - m_process->start (KProcess::NotifyOnExit, KProcess::All); + m_process->start (TDEProcess::NotifyOnExit, TDEProcess::All); return m_process->isRunning (); } @@ -1822,8 +1822,8 @@ KDE_NO_EXPORT void FFMpeg::init () { bool FFMpeg::deMediafiedPlay () { initProcess (viewer ()); KURL url (m_url); - connect (m_process, TQT_SIGNAL (processExited (KProcess *)), - this, TQT_SLOT (processStopped (KProcess *))); + connect (m_process, TQT_SIGNAL (processExited (TDEProcess *)), + this, TQT_SLOT (processStopped (TDEProcess *))); TQString outurl = TQString (TQFile::encodeName (m_recordurl.isLocalFile () ? getPath (m_recordurl) : m_recordurl.url ())); if (m_recordurl.isLocalFile ()) TQFile (outurl).remove (); @@ -1838,30 +1838,30 @@ bool FFMpeg::deMediafiedPlay () { cmd += TQString (" -ad ") + m_source->audioDevice (); else cmd += TQString (" -an"); - KProcess process; + TDEProcess process; process.setUseShell (true); if (!m_source->videoNorm ().isEmpty ()) { process << "v4lctl -c " << m_source->videoDevice () << " setnorm " << m_source->videoNorm (); kdDebug () << "v4lctl -c " << m_source->videoDevice () << " setnorm " << m_source->videoNorm () << endl; - process.start (KProcess::Block); + process.start (TDEProcess::Block); cmd += TQString (" -tvstd ") + m_source->videoNorm (); } if (m_source->frequency () > 0) { process.clearArguments(); process << "v4lctl -c " << m_source->videoDevice () << " setfreq " << TQString::number (m_source->frequency ()); kdDebug () << "v4lctl -c " << m_source->videoDevice () << " setfreq " << m_source->frequency () << endl; - process.start (KProcess::Block); + process.start (TDEProcess::Block); } } else { - cmd += TQString ("-i ") + KProcess::quote (TQString (TQFile::encodeName (url.isLocalFile () ? getPath (url) : url.url ()))); + cmd += TQString ("-i ") + TDEProcess::quote (TQString (TQFile::encodeName (url.isLocalFile () ? getPath (url) : url.url ()))); } cmd += TQChar (' ') + m_settings->ffmpegarguments; - cmd += TQChar (' ') + KProcess::quote (TQString (TQFile::encodeName (outurl))); + cmd += TQChar (' ') + TDEProcess::quote (TQString (TQFile::encodeName (outurl))); fprintf (stderr, "%s\n", (const char *) cmd.local8Bit ()); *m_process << cmd; // FIXME if (m_player->source () == source) // ugly // m_player->stop (); - m_process->start (KProcess::NotifyOnExit, KProcess::All); + m_process->start (TDEProcess::NotifyOnExit, TDEProcess::All); if (m_process->isRunning ()) setState (Playing); return m_process->isRunning (); @@ -1881,12 +1881,12 @@ KDE_NO_EXPORT bool FFMpeg::quit () { TQTime t; t.start (); do { - KProcessController::theKProcessController->waitForProcessExit (2); + TDEProcessController::theTDEProcessController->waitForProcessExit (2); } while (t.elapsed () < 2000 && m_process->isRunning ()); return Process::quit (); } -KDE_NO_EXPORT void FFMpeg::processStopped (KProcess *) { +KDE_NO_EXPORT void FFMpeg::processStopped (TDEProcess *) { setState (NotRunning); } @@ -2116,14 +2116,14 @@ KDE_NO_EXPORT void NpPlayer::init () { KDE_NO_EXPORT void NpPlayer::initProcess (Viewer * viewer) { Process::initProcess (viewer); - connect (m_process, TQT_SIGNAL (processExited (KProcess *)), - this, TQT_SLOT (processStopped (KProcess *))); - connect (m_process, TQT_SIGNAL (receivedStdout (KProcess *, char *, int)), - this, TQT_SLOT (processOutput (KProcess *, char *, int))); - connect (m_process, TQT_SIGNAL (receivedStderr (KProcess *, char *, int)), - this, TQT_SLOT (processOutput (KProcess *, char *, int))); - connect (m_process, TQT_SIGNAL (wroteStdin (KProcess *)), - this, TQT_SLOT (wroteStdin (KProcess *))); + connect (m_process, TQT_SIGNAL (processExited (TDEProcess *)), + this, TQT_SLOT (processStopped (TDEProcess *))); + connect (m_process, TQT_SIGNAL (receivedStdout (TDEProcess *, char *, int)), + this, TQT_SLOT (processOutput (TDEProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (receivedStderr (TDEProcess *, char *, int)), + this, TQT_SLOT (processOutput (TDEProcess *, char *, int))); + connect (m_process, TQT_SIGNAL (wroteStdin (TDEProcess *)), + this, TQT_SLOT (wroteStdin (TDEProcess *))); if (!dbus_static) dbus_static = dbus_static_deleter.setObject (new DBusStatic ()); if (iface.isEmpty ()) { @@ -2263,7 +2263,7 @@ KDE_NO_EXPORT bool NpPlayer::ready (Viewer * viewer) { cmd += TQString::number (viewer->winId ()); fprintf (stderr, "%s\n", cmd.local8Bit ().data ()); *m_process << cmd; - m_process->start (KProcess::NotifyOnExit, KProcess::All); + m_process->start (TDEProcess::NotifyOnExit, TDEProcess::All); return m_process->isRunning (); } @@ -2392,19 +2392,19 @@ KDE_NO_EXPORT bool NpPlayer::quit () { TQTime t; t.start (); do { - KProcessController::theKProcessController->waitForProcessExit (2); + TDEProcessController::theTDEProcessController->waitForProcessExit (2); } while (t.elapsed () < 2000 && m_process->isRunning ()); return Process::quit (); } return true; } -KDE_NO_EXPORT void NpPlayer::processOutput (KProcess *, char * str, int slen) { +KDE_NO_EXPORT void NpPlayer::processOutput (TDEProcess *, char * str, int slen) { if (viewer () && slen > 0) viewer ()->view ()->addText (TQString::fromLocal8Bit (str, slen)); } -KDE_NO_EXPORT void NpPlayer::processStopped (KProcess *) { +KDE_NO_EXPORT void NpPlayer::processStopped (TDEProcess *) { terminateJobs (); if (m_source) ((PlayListNotify *) m_source)->setInfoMessage (TQString ()); @@ -2520,7 +2520,7 @@ KDE_NO_EXPORT void NpPlayer::processStreams () { } } -KDE_NO_EXPORT void NpPlayer::wroteStdin (KProcess *) { +KDE_NO_EXPORT void NpPlayer::wroteStdin (TDEProcess *) { write_in_progress = false; if (playing ()) processStreams (); @@ -2555,9 +2555,9 @@ KDE_NO_EXPORT void NpPlayer::setStarted (const TQString &) {} KDE_NO_EXPORT bool NpPlayer::stop () { return false; } KDE_NO_EXPORT bool NpPlayer::quit () { return false; } KDE_NO_EXPORT bool NpPlayer::ready (Viewer *) { return false; } -KDE_NO_EXPORT void NpPlayer::processOutput (KProcess *, char *, int) {} -KDE_NO_EXPORT void NpPlayer::processStopped (KProcess *) {} -KDE_NO_EXPORT void NpPlayer::wroteStdin (KProcess *) {} +KDE_NO_EXPORT void NpPlayer::processOutput (TDEProcess *, char *, int) {} +KDE_NO_EXPORT void NpPlayer::processStopped (TDEProcess *) {} +KDE_NO_EXPORT void NpPlayer::wroteStdin (TDEProcess *) {} KDE_NO_EXPORT void NpPlayer::streamStateChanged () {} KDE_NO_EXPORT void NpPlayer::streamRedirected (TQ_UINT32, const KURL &) {} KDE_NO_EXPORT void NpPlayer::terminateJobs () {} |