TQt4 port kmplayer

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1238840 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 0a8af92185
commit 769e63d24a

@ -219,7 +219,7 @@ if test "$buildnpp" = "yes"; then
if test "x$have_dbus" = "xyes"; then
have_nspr=yes
AC_DEFINE(HAVE_DBUS, 1, [have DBus])
LIBQTDBUS="`$PKG_CONFIG --libs dbus-1` -ldbus-qt-1"
LIBQTDBUS="`$PKG_CONFIG --libs dbus-1` -ldbus-tqt-1"
LIBDBUS_CFLAGS="`$PKG_CONFIG --cflags dbus-1`"
AC_DEFINE(HAVE_NSPR, 1, [build Netscape plugin loader])
LIBNSPR_LIBS="`$PKG_CONFIG --libs gtk+-x11-2.0` `$PKG_CONFIG --libs dbus-glib-1` `$PKG_CONFIG --libs gthread-2.0`"

@ -154,7 +154,7 @@ if test "$buildnpp" = "yes"; then
if test "x$have_dbus" = "xyes"; then
have_nspr=yes
AC_DEFINE(HAVE_DBUS, 1, [have DBus])
LIBQTDBUS="`$PKG_CONFIG --libs dbus-1` -ldbus-qt-1"
LIBQTDBUS="`$PKG_CONFIG --libs dbus-1` -ldbus-tqt-1"
LIBDBUS_CFLAGS="`$PKG_CONFIG --cflags dbus-1`"
AC_DEFINE(HAVE_NSPR, 1, [build Netscape plugin loader])
LIBNSPR_LIBS="`$PKG_CONFIG --libs gtk+-x11-2.0` `$PKG_CONFIG --libs dbus-glib-1` `$PKG_CONFIG --libs gthread-2.0`"

@ -26,7 +26,7 @@ libkmplayerkofficepart_la_LIBADD= libkmplayercommon.la $(LIB_KOFFICE)
kdeinit_LTLIBRARIES=kmplayer.la
kmplayer_la_SOURCES= main.cpp kmplayerapp.cpp kmplayertvsource.cpp kmplayerbroadcast.cpp kmplayervdr.cpp
kmplayer_la_LIBADD= libkmplayercommon.la
kmplayer_la_LDFLAGS= -module $(KDE_PLUGIN)
kmplayer_la_LDFLAGS= -module $(KDE_PLUGIN) $(LIB_QT)
EXTRA_PROGRAMS = kxineplayer kxvplayer kgstplayer
if include_kxineplayer

@ -22,13 +22,13 @@
#include <math.h>
#include <config.h>
#include <dcopclient.h>
#include <qcstring.h>
#include <qtimer.h>
#include <qfile.h>
#include <qurl.h>
#include <qthread.h>
#include <qmutex.h>
#include <qdom.h>
#include <tqcstring.h>
#include <tqtimer.h>
#include <tqfile.h>
#include <tqurl.h>
#include <tqthread.h>
#include <tqmutex.h>
#include <tqdom.h>
#include "kmplayer_backend.h"
#include "kmplayer_callback_stub.h"
#include "kmplayer_callback.h"
@ -48,7 +48,7 @@ static Display *display;
static KGStreamerPlayer *gstapp;
static KMPlayer::Callback_stub * callback;
static Window wid;
static QMutex mutex (true);
static TQMutex mutex (true);
static bool window_created = true;
static bool wants_config;
static bool verbose;
@ -59,15 +59,15 @@ static int movie_height;
static int movie_length;
static int repeat_count;
static int screen;
static const int event_finished = QEvent::User;
static const int event_playing = QEvent::User + 1;
static const int event_size = QEvent::User + 2;
static const int event_eos = QEvent::User + 3;
static const int event_progress = QEvent::User + 4;
static const int event_error = QEvent::User + 5;
static const int event_video = QEvent::User + 6;
static QString mrl;
static QString sub_mrl;
static const int event_finished = TQEvent::User;
static const int event_playing = TQEvent::User + 1;
static const int event_size = TQEvent::User + 2;
static const int event_eos = TQEvent::User + 3;
static const int event_progress = TQEvent::User + 4;
static const int event_error = TQEvent::User + 5;
static const int event_video = TQEvent::User + 6;
static TQString mrl;
static TQString sub_mrl;
static const char *ao_driver;
static const char *vo_driver;
static const char *playbin_name = "player";
@ -75,24 +75,24 @@ static const char *dvd_device;
static const char *vcd_device;
static GstElement *gst_elm_play;
static GstBus *gst_bus;
static unsigned int /*GstMessageType*/ ignore_messages_mask;
static unsigned int /*GstMessageType*/ ignore_messages_tqmask;
static GstXOverlay *xoverlay;
static GstColorBalance *color_balance;
static gulong gst_bus_sync;
static gulong gst_bus_async;
static QString elmentry ("entry");
static QString elmitem ("item");
static QString attname ("NAME");
static QString atttype ("TYPE");
static QString attdefault ("DEFAULT");
static QString attvalue ("VALUE");
static QString attstart ("START");
static QString attend ("END");
static QString valrange ("range");
static QString valnum ("num");
static QString valbool ("bool");
static QString valenum ("enum");
static QString valstring ("string");
static TQString elmentry ("entry");
static TQString elmitem ("item");
static TQString attname ("NAME");
static TQString atttype ("TYPE");
static TQString attdefault ("DEFAULT");
static TQString attvalue ("VALUE");
static TQString attstart ("START");
static TQString attend ("END");
static TQString valrange ("range");
static TQString valnum ("num");
static TQString valbool ("bool");
static TQString valenum ("enum");
static TQString valstring ("string");
extern "C" {
// nothing yet
@ -111,7 +111,7 @@ cb_error (GstElement * play,
fprintf (stderr, "cb_error: %s %s\n", err->message, debug);
if (GST_STATE (play) == GST_STATE_PLAYING)
gst_element_set_state (play, GST_STATE_READY);
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type)event_finished));
TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type)event_finished));
}
// NULL -> READY -> PAUSED -> PLAYING
@ -124,7 +124,7 @@ gstCapsSet (GstPad *pad,
GstCaps *caps = gst_pad_get_negotiated_caps (pad);
if (!caps)
return;
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_video));
TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_video));
const GstStructure * s = gst_caps_get_structure (caps, 0);
if (s) {
const GValue *par;
@ -140,7 +140,7 @@ gstCapsSet (GstPad *pad,
else
movie_height = (int) ((float) den * movie_height / num);
}
QApplication::postEvent (gstapp, new GstSizeEvent (movie_length, movie_width, movie_height));
TQApplication::postEvent (gstapp, new GstSizeEvent (movie_length, movie_width, movie_height));
}
gst_caps_unref (caps);
}
@ -204,7 +204,7 @@ static void gstGetDuration () {
if (movie_length != len / (GST_MSECOND * 100)) {
movie_length = len / (GST_MSECOND * 100);
fprintf (stderr, "new length %d\n", movie_length);
QApplication::postEvent (gstapp, new GstSizeEvent (movie_length, movie_width, movie_height));
TQApplication::postEvent (gstapp, new GstSizeEvent (movie_length, movie_width, movie_height));
}
}
@ -217,12 +217,12 @@ static void gstTag (const GstTagList *, const gchar *tag, gpointer) {
static void gstBusMessage (GstBus *, GstMessage * message, gpointer) {
GstMessageType msg_type = GST_MESSAGE_TYPE (message);
/* somebody else is handling the message, probably in gstPolForStateChange*/
if (ignore_messages_mask & msg_type)
if (ignore_messages_tqmask & msg_type)
return;
switch (msg_type) {
case GST_MESSAGE_ERROR:
fprintf (stderr, "error msg\n");
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_error));
TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_error));
if (gst_elm_play) {
gst_element_set_state (gst_elm_play, GST_STATE_NULL);
//gstPollForStateChange (gst_elm_play, GST_STATE_NULL);
@ -246,7 +246,7 @@ static void gstBusMessage (GstBus *, GstMessage * message, gpointer) {
case GST_MESSAGE_BUFFERING: {
gint percent = 0;
gst_structure_get_int (message->structure, "buffer-percent", &percent);
QApplication::postEvent (gstapp, new GstProgressEvent (percent));
TQApplication::postEvent (gstapp, new GstProgressEvent (percent));
//fprintf (stderr, "Buffering message (%u%%)\n", percent);
break;
}
@ -266,7 +266,7 @@ static void gstBusMessage (GstBus *, GstMessage * message, gpointer) {
if (old_state == GST_STATE_PAUSED &&
new_state >= GST_STATE_PLAYING) {
gstGetDuration ();
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_playing));
TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_playing));
} else if (old_state >= GST_STATE_PAUSED &&
new_state <= GST_STATE_READY) {
if (repeat_count-- > 0 &&
@ -274,8 +274,8 @@ static void gstBusMessage (GstBus *, GstMessage * message, gpointer) {
gstPollForStateChange(gst_elm_play, GST_STATE_PAUSED)))
gst_element_set_state(gst_elm_play, GST_STATE_PLAYING);
else
QApplication::postEvent (gstapp,
new QEvent ((QEvent::Type) event_finished));
TQApplication::postEvent (gstapp,
new TQEvent ((TQEvent::Type) event_finished));
}
}
//g_free (src_name);
@ -310,14 +310,14 @@ static bool gstPollForStateChange (GstElement *element, GstState state, gint64 t
GError **error = 0L;
events = GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_ERROR | GST_MESSAGE_EOS;
saved_events = ignore_messages_mask;
saved_events = ignore_messages_tqmask;
if (element && element == gst_elm_play) {
/* we do want the main handler to process state changed messages for
* playbin as well, otherwise it won't hook up the timeout etc. */
ignore_messages_mask |= (events ^ GST_MESSAGE_STATE_CHANGED);
ignore_messages_tqmask |= (events ^ GST_MESSAGE_STATE_CHANGED);
} else {
ignore_messages_mask |= events;
ignore_messages_tqmask |= events;
}
while (true) {
@ -367,14 +367,14 @@ static bool gstPollForStateChange (GstElement *element, GstState state, gint64 t
success:
/* state change succeeded */
fprintf (stderr, "state change to %s succeeded\n", gst_element_state_get_name (state));
ignore_messages_mask = saved_events;
ignore_messages_tqmask = saved_events;
return true;
timed_out:
/* it's taking a long time to open -- just tell totem it was ok, this allows
* the user to stop the loading process with the normal stop button */
fprintf (stderr, "state change to %s timed out, returning success and handling errors asynchroneously\n", gst_element_state_get_name (state));
ignore_messages_mask = saved_events;
ignore_messages_tqmask = saved_events;
return true;
error:
@ -382,20 +382,20 @@ error:
gst_element_state_get_name (state),
(error && *error) ? (*error)->message : "unknown");
/* already set *error */
ignore_messages_mask = saved_events;
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_error));
ignore_messages_tqmask = saved_events;
TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_error));
return false;
}
//-----------------------------------------------------------------------------
GstSizeEvent::GstSizeEvent (int l, int w, int h)
: QEvent ((QEvent::Type) event_size),
: TQEvent ((TQEvent::Type) event_size),
length (l), width (w), height (h)
{}
GstProgressEvent::GstProgressEvent (const int p)
: QEvent ((QEvent::Type) event_progress), progress (p)
: TQEvent ((TQEvent::Type) event_progress), progress (p)
{}
//-----------------------------------------------------------------------------
@ -403,16 +403,16 @@ GstProgressEvent::GstProgressEvent (const int p)
using namespace KMPlayer;
Backend::Backend ()
: DCOPObject (QCString ("Backend")) {
: DCOPObject (TQCString ("Backend")) {
}
Backend::~Backend () {}
void Backend::setURL (QString url) {
void Backend::setURL (TQString url) {
mrl = url;
}
void Backend::setSubTitleURL (QString url) {
void Backend::setSubTitleURL (TQString url) {
sub_mrl = url;
}
@ -421,7 +421,7 @@ void Backend::play (int repeat) {
}
void Backend::stop () {
QTimer::singleShot (0, gstapp, SLOT (stop ()));
TQTimer::singleShot (0, gstapp, TQT_SLOT (stop ()));
}
void Backend::pause () {
@ -455,10 +455,10 @@ void Backend::volume (int v, bool) {
void Backend::frequency (int) {
}
void Backend::setAudioLang (int, QString) {
void Backend::setAudioLang (int, TQString) {
}
void Backend::setSubtitle (int, QString) {
void Backend::setSubtitle (int, TQString) {
}
void Backend::quit () {
@ -467,29 +467,29 @@ void Backend::quit () {
if (running)
stop ();
else
QTimer::singleShot (0, qApp, SLOT (quit ()));
TQTimer::singleShot (0, tqApp, TQT_SLOT (quit ()));
}
bool updateConfigEntry (const QString & name, const QString & value) {
bool updateConfigEntry (const TQString & name, const TQString & value) {
fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ());
return true;
}
void Backend::setConfig (QByteArray /*data*/) {
/*QString err;
void Backend::setConfig (TQByteArray /*data*/) {
/*TQString err;
int line, column;
QDomDocument dom;
TQDomDocument dom;
if (dom.setContent (data, false, &err, &line, &column)) {
if (dom.childNodes().length() == 1) {
for (QDomNode node = dom.firstChild().firstChild();
for (TQDomNode node = dom.firstChild().firstChild();
!node.isNull ();
node = node.nextSibling ()) {
QDomNamedNodeMap attr = node.attributes ();
TQDomNamedNodeMap attr = node.attributes ();
updateConfigEntry (attr.namedItem (attname).nodeValue (),
attr.namedItem (attvalue).nodeValue ());
}
} else
err = QString ("invalid data");
err = TQString ("invalid data");
}
if (callback)
callback->errorMessage (0, err);*/
@ -503,7 +503,7 @@ bool Backend::isPlaying () {
}
KGStreamerPlayer::KGStreamerPlayer (int _argc, char ** _argv)
: QApplication (_argc, _argv, false) {
: TQApplication (_argc, _argv, false) {
}
void KGStreamerPlayer::init () {
@ -540,11 +540,11 @@ KGStreamerPlayer::~KGStreamerPlayer () {
gstapp = 0L;
}
void getConfigEntries (QByteArray & buf) {
QDomDocument doc;
QDomElement root = doc.createElement (QString ("document"));
void getConfigEntries (TQByteArray & buf) {
TQDomDocument doc;
TQDomElement root = doc.createElement (TQString ("document"));
doc.appendChild (root);
QCString exp = doc.toCString ();
TQCString exp = doc.toCString ();
buf = exp;
buf.resize (exp.length ()); // strip terminating \0
}
@ -573,7 +573,7 @@ void KGStreamerPlayer::play (int repeat) {
fprintf (stderr, "couldn't create playbin\n");
goto fail;
}
ignore_messages_mask = 0;
ignore_messages_tqmask = 0;
gst_bus = gst_element_get_bus (gst_elm_play);
gst_bus_add_signal_watch (gst_bus);
@ -634,13 +634,13 @@ void KGStreamerPlayer::play (int repeat) {
if (GST_STATE (gst_elm_play) > GST_STATE_READY)
gst_element_set_state (gst_elm_play, GST_STATE_READY);
if (mrl.startsWith (QChar ('/')))
mrl = QString ("file://") + mrl;
if (mrl.startsWith (TQChar ('/')))
mrl = TQString ("file://") + mrl;
uri = g_strdup (mrl.local8Bit ());
g_object_set (gst_elm_play, "uri", uri, NULL);
if (!sub_mrl.isEmpty ()) {
if (sub_mrl.startsWith (QChar ('/')))
sub_mrl = QString ("file://") + sub_mrl;
if (sub_mrl.startsWith (TQChar ('/')))
sub_mrl = TQString ("file://") + sub_mrl;
sub_uri = g_strdup (sub_mrl.local8Bit ());
g_object_set (gst_elm_play, "suburi", sub_uri, NULL);
g_free (sub_uri);
@ -653,7 +653,7 @@ void KGStreamerPlayer::play (int repeat) {
gstPollForStateChange (gst_elm_play, GST_STATE_PLAYING);
}
g_free (uri);
QTimer::singleShot (500, this, SLOT (updatePosition ()));
TQTimer::singleShot (500, this, TQT_SLOT (updatePosition ()));
return;
fail:
if (videosink) {
@ -665,7 +665,7 @@ fail:
gst_object_unref (audiosink);
}
mutex.unlock ();
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type)event_finished));
TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type)event_finished));
}
void KGStreamerPlayer::pause () {
@ -697,11 +697,11 @@ void KGStreamerPlayer::stop () {
}
mutex.unlock ();
if (!gst_elm_play || (gst_elm_play && !notified_playing))
QApplication::postEvent (gstapp, new QEvent ((QEvent::Type) event_finished));
TQApplication::postEvent (gstapp, new TQEvent ((TQEvent::Type) event_finished));
}
void KGStreamerPlayer::finished () {
QTimer::singleShot (10, this, SLOT (stop ()));
TQTimer::singleShot (10, this, TQT_SLOT (stop ()));
}
static void adjustColorSetting (const char * channel, int val) {
@ -770,11 +770,11 @@ void KGStreamerPlayer::updatePosition () {
callback->moviePosition (int (val / (GST_MSECOND * 100)));
}
mutex.unlock ();
QTimer::singleShot (500, this, SLOT (updatePosition ()));
TQTimer::singleShot (500, this, TQT_SLOT (updatePosition ()));
}
}
bool KGStreamerPlayer::event (QEvent * e) {
bool KGStreamerPlayer::event (TQEvent * e) {
switch (e->type()) {
case event_finished: {
fprintf (stderr, "event_finished\n");
@ -797,7 +797,7 @@ bool KGStreamerPlayer::event (QEvent * e) {
if (callback)
callback->finished ();
else
QTimer::singleShot (0, this, SLOT (quit ()));
TQTimer::singleShot (0, this, TQT_SLOT (quit ()));
break;
}
//callback->movieParams (se->length/100, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0);
@ -806,7 +806,7 @@ bool KGStreamerPlayer::event (QEvent * e) {
fprintf (stderr, "movie parms: %d %d %d\n", se->length, se->width, se->height);
if (callback) {
if (se->length < 0) se->length = 0;
callback->movieParams (se->length, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0, QStringList (), QStringList ());
callback->movieParams (se->length, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0, TQStringList (), TQStringList ());
}
if (window_created && movie_width > 0 && movie_height > 0) {
XLockDisplay (display);
@ -832,7 +832,7 @@ bool KGStreamerPlayer::event (QEvent * e) {
break;
case event_video:
if (callback)
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, QString ());
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, TQString ());
break;
default:
return false;
@ -840,12 +840,12 @@ bool KGStreamerPlayer::event (QEvent * e) {
return true;
}
void KGStreamerPlayer::saveState (QSessionManager & sm) {
void KGStreamerPlayer::saveState (TQSessionManager & sm) {
if (callback)
sm.setRestartHint (QSessionManager::RestartNever);
sm.setRestartHint (TQSessionManager::RestartNever);
}
class XEventThread : public QThread {
class XEventThread : public TQThread {
protected:
void run () {
Time prev_click_time = 0;
@ -967,8 +967,8 @@ int main(int argc, char **argv) {
} else if (!strcmp (argv [i], "-loop") && i < argc - 1) {
repeat_count = atol (argv [++i]);
} else if (!strcmp (argv [i], "-cb")) {
QString str = argv [++i];
int pos = str.find ('/');
TQString str = argv [++i];
int pos = str.tqfind ('/');
if (pos > -1) {
fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ());
callback = new KMPlayer::Callback_stub
@ -979,7 +979,7 @@ int main(int argc, char **argv) {
delete gstapp;
return 1;
} else {
mrl = QString::fromLocal8Bit (argv[i]);
mrl = TQString::fromLocal8Bit (argv[i]);
}
}
@ -993,12 +993,12 @@ int main(int argc, char **argv) {
gstapp->init ();
if (callback) {
QByteArray buf;
TQByteArray buf;
if (wants_config)
getConfigEntries (buf);
callback->started (dcopclient.appId (), buf);
} else
QTimer::singleShot (10, gstapp, SLOT (play (int)));
TQTimer::singleShot (10, gstapp, TQT_SLOT (play (int)));
gstapp->exec ();

@ -20,24 +20,25 @@
#ifndef _K_GST_PLAYER_H_
#define _K_GST_PLAYER_H_
#include <qapplication.h>
#include <qstring.h>
#include <qsessionmanager.h>
#include <tqapplication.h>
#include <tqstring.h>
#include <tqsessionmanager.h>
struct GstSizeEvent : public QEvent {
struct GstSizeEvent : public TQEvent {
GstSizeEvent (int l, int w, int h);
int length;
int width;
int height;
};
struct GstProgressEvent : public QEvent {
struct GstProgressEvent : public TQEvent {
GstProgressEvent (int p);
int progress;
};
class KGStreamerPlayer : public QApplication {
class KGStreamerPlayer : public TQApplication {
Q_OBJECT
TQ_OBJECT
public:
KGStreamerPlayer (int argc, char ** argv);
~KGStreamerPlayer ();
@ -50,7 +51,7 @@ public:
void brightness (int val);
void volume (int val);
void seek (int val);
bool event (QEvent * e);
bool event (TQEvent * e);
public slots:
void play (int repeat_count);
void stop ();
@ -58,7 +59,7 @@ public slots:
void updatePosition ();
//void postFinished ();
protected:
void saveState (QSessionManager & sm);
void saveState (TQSessionManager & sm);
};
#endif //_K_GST_PLAYER_H_

@ -33,9 +33,9 @@
static const int id_status_msg = 1;
static const int id_status_timer = 2;
class QPopupMenu;
class QMenuItem;
class QListViewItem;
class TQPopupMenu;
class TQMenuItem;
class TQListViewItem;
class KProcess;
class KMPlayerBroadcastConfig;
class KMPlayerFFServerConfig;
@ -58,9 +58,10 @@ namespace KMPlayer {
class KMPlayerApp : public KMainWindow
{
Q_OBJECT
TQ_OBJECT
public:
KMPlayerApp (QWidget* parent=0, const char* name=0);
KMPlayerApp (TQWidget* tqparent=0, const char* name=0);
~KMPlayerApp ();
void openDocumentFile (const KURL& url=KURL());
void addURL (const KURL& url);
@ -97,7 +98,7 @@ public slots:
void slotViewToolBar ();
void slotViewStatusBar ();
void slotViewMenuBar ();
void slotStatusMsg (const QString &text);
void slotStatusMsg (const TQString &text);
void slotSourceChanged (KMPlayer::Source *, KMPlayer::Source *);
private slots:
void dvdNav ();
@ -126,8 +127,8 @@ private slots:
void slotConfigureToolbars ();
void slotClearHistory ();
void windowVideoConsoleToggled (int wt);
void playListItemSelected (QListViewItem *);
void playListItemDropped (QDropEvent * e, QListViewItem * after);
void playListItemSelected (TQListViewItem *);
void playListItemDropped (TQDropEvent * e, TQListViewItem * after);
void playListItemMoved ();
void menuDropInList ();
void menuDropInGroup ();
@ -135,10 +136,10 @@ private slots:
void menuDeleteNode ();
void menuMoveUpNode ();
void menuMoveDownNode ();
void preparePlaylistMenu (KMPlayer::PlayListItem *, QPopupMenu *);
void preparePlaylistMenu (KMPlayer::PlayListItem *, TQPopupMenu *);
private:
void menuItemClicked (QPopupMenu * menu, int id);
void menuItemClicked (TQPopupMenu * menu, int id);
void minimalMode (bool deco=true);
KConfig * config;
KSystemTray * m_systray;
@ -167,18 +168,18 @@ private:
KToggleAction * viewStatusBar;
KToggleAction * viewMenuBar;
KToggleAction * viewKeepRatio;
QMenuItem * m_sourcemenu;
QPopupMenu * m_dvdmenu;
QPopupMenu * m_dvdnavmenu;
QPopupMenu * m_vcdmenu;
QPopupMenu * m_audiocdmenu;
QPopupMenu * m_tvmenu;
QPopupMenu * m_dropmenu;
TQMenuItem * m_sourcemenu;
TQPopupMenu * m_dvdmenu;
TQPopupMenu * m_dvdnavmenu;
TQPopupMenu * m_vcdmenu;
TQPopupMenu * m_audiocdmenu;
TQPopupMenu * m_tvmenu;
TQPopupMenu * m_dropmenu;
KMPlayerFFServerConfig * m_ffserverconfig;
KMPlayerBroadcastConfig * m_broadcastconfig;
QCString m_dcopName;
TQCString m_dcopName;
KURL::List m_drop_list;
QListViewItem * m_drop_after;
TQListViewItem * m_drop_after;
int edit_tree_id;
int manip_tree_id;
int last_time_left;
@ -195,10 +196,10 @@ private:
class KMPLAYER_NO_EXPORT FileDocument : public KMPlayer::Document {
public:
FileDocument (short id, const QString &, KMPlayer::PlayListNotify * notify = 0L);
KMPlayer::NodePtr childFromTag (const QString & tag);
void readFromFile (const QString & file);
void writeToFile (const QString & file);
FileDocument (short id, const TQString &, KMPlayer::PlayListNotify * notify = 0L);
KMPlayer::NodePtr childFromTag (const TQString & tag);
void readFromFile (const TQString & file);
void writeToFile (const TQString & file);
};
#endif // KMPLAYER_H

@ -24,14 +24,14 @@
using namespace KMPlayer;
static QString getAsxAttribute (Element * e, const QString & attr) {
static TQString getAsxAttribute (Element * e, const TQString & attr) {
for (AttributePtr a = e->attributes ()->first (); a; a = a->nextSibling ())
if (attr == a->name ().toString ().lower ())
return a->value ();
return QString ();
return TQString ();
}
KDE_NO_EXPORT NodePtr ASX::Asx::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr ASX::Asx::childFromTag (const TQString & tag) {
const char * name = tag.latin1 ();
if (!strcasecmp (name, "entry"))
return new ASX::Entry (m_doc);
@ -59,7 +59,7 @@ KDE_NO_EXPORT Node::PlayType ASX::Asx::playType () {
//-----------------------------------------------------------------------------
KDE_NO_EXPORT NodePtr ASX::Entry::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr ASX::Entry::childFromTag (const TQString & tag) {
const char * name = tag.latin1 ();
if (!strcasecmp (name, "ref"))
return new ASX::Ref (m_doc);
@ -105,7 +105,7 @@ KDE_NO_EXPORT void ASX::Entry::activate () {
for (NodePtr e = firstChild (); e; e = e->nextSibling ())
if (e->id == id_node_param) {
Element * elm = convertNode <Element> (e);
if (getAsxAttribute(elm,"name").lower() == QString("clipsummary")) {
if (getAsxAttribute(elm,"name").lower() == TQString("clipsummary")) {
PlayListNotify * n = document ()->notify_listener;
if (n)
n->setInfoMessage (KURL::decode_string (
@ -119,7 +119,7 @@ KDE_NO_EXPORT void ASX::Entry::activate () {
KDE_NO_EXPORT void ASX::Entry::deactivate () {
PlayListNotify * n = document ()->notify_listener;
if (n)
n->setInfoMessage (QString ());
n->setInfoMessage (TQString ());
}
KDE_NO_EXPORT bool ASX::Entry::expose () const {

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_ASX_H_
#define _KMPLAYER_ASX_H_
#include <qstring.h>
#include <tqstring.h>
#include "kmplayerplaylist.h"
@ -45,7 +45,7 @@ const short id_node_duration = 408;
class KMPLAYER_NO_EXPORT Asx : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Asx (NodePtr & d) : Mrl (d, id_node_asx) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "ASX"; }
bool expose () const { return !pretty_name.isEmpty (); }
PlayType playType ();
@ -58,7 +58,7 @@ class KMPLAYER_NO_EXPORT Entry : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Entry (NodePtr & d)
: Mrl (d, id_node_entry), ref_child_count (0) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "Entry"; }
/**
* False, but since we might have a 'base' child, we can have a rel. src
@ -76,7 +76,7 @@ public:
class KMPLAYER_NO_EXPORT Ref : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Ref (NodePtr & d) : Mrl (d, id_node_ref) {}
//NodePtr childFromTag (const QString & tag);
//NodePtr childFromTag (const TQString & tag);
void opened ();
KDE_NO_EXPORT const char * nodeName () const { return "Ref"; }
bool expose () const;
@ -88,7 +88,7 @@ public:
class KMPLAYER_NO_EXPORT EntryRef : public Mrl {
public:
KDE_NO_CDTOR_EXPORT EntryRef (NodePtr & d) : Mrl (d, id_node_entryref) {}
//NodePtr childFromTag (const QString & tag);
//NodePtr childFromTag (const TQString & tag);
void opened ();
KDE_NO_EXPORT const char * nodeName () const { return "EntryRef"; }
};

@ -22,7 +22,7 @@
using namespace KMPlayer;
NodePtr ATOM::Feed::childFromTag (const QString & tag) {
NodePtr ATOM::Feed::childFromTag (const TQString & tag) {
if (!strcmp (tag.latin1 (), "entry"))
return new ATOM::Entry (m_doc);
else if (!strcmp (tag.latin1 (), "link"))
@ -40,7 +40,7 @@ void ATOM::Feed::closed () {
}
}
NodePtr ATOM::Entry::childFromTag (const QString & tag) {
NodePtr ATOM::Entry::childFromTag (const TQString & tag) {
if (!strcmp (tag.latin1 (), "link"))
return new ATOM::Link (m_doc);
else if (!strcmp (tag.latin1 (), "content"))
@ -65,8 +65,8 @@ Node::PlayType ATOM::Link::playType () {
}
void ATOM::Link::closed () {
QString href;
QString rel;
TQString href;
TQString rel;
for (AttributePtr a = attributes ()->first (); a; a = a->nextSibling ()) {
if (a->name () == StringPool::attr_href)
href = a->value ();
@ -75,7 +75,7 @@ void ATOM::Link::closed () {
else if (a->name () == "rel")
rel = a->value ();
}
if (!href.isEmpty () && rel == QString::fromLatin1 ("enclosure"))
if (!href.isEmpty () && rel == TQString::tqfromLatin1 ("enclosure"))
src = href;
else if (pretty_name.isEmpty ())
pretty_name = href;
@ -86,13 +86,13 @@ void ATOM::Content::closed () {
if (a->name () == StringPool::attr_src)
src = a->value ();
else if (a->name () == StringPool::attr_type) {
QString v = a->value ().lower ();
if (v == QString::fromLatin1 ("text"))
mimetype = QString::fromLatin1 ("text/plain");
else if (v == QString::fromLatin1 ("html"))
mimetype = QString::fromLatin1 ("text/html");
else if (v == QString::fromLatin1 ("xhtml"))
mimetype = QString::fromLatin1 ("application/xhtml+xml");
TQString v = a->value ().lower ();
if (v == TQString::tqfromLatin1 ("text"))
mimetype = TQString::tqfromLatin1 ("text/plain");
else if (v == TQString::tqfromLatin1 ("html"))
mimetype = TQString::tqfromLatin1 ("text/html");
else if (v == TQString::tqfromLatin1 ("xhtml"))
mimetype = TQString::tqfromLatin1 ("application/xhtml+xml");
else
mimetype = v;
}

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_ATOM_H_
#define _KMPLAYER_ATOM_H_
#include <qstringlist.h>
#include <tqstringlist.h>
#include "kmplayerplaylist.h"
@ -42,7 +42,7 @@ const short id_node_content = 305;
class KMPLAYER_NO_EXPORT Feed : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Feed (NodePtr & d) : Mrl (d, id_node_feed) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "feed"; }
void closed ();
bool expose () const { return !pretty_name.isEmpty (); }
@ -51,7 +51,7 @@ public:
class KMPLAYER_NO_EXPORT Entry : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Entry (NodePtr & d) : Mrl (d, id_node_entry) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "entry"; }
PlayType playType () { return play_type_none; }
void closed ();

@ -31,8 +31,8 @@ public:
Backend ();
virtual ~Backend ();
k_dcop:
virtual ASYNC setURL (QString url);
virtual ASYNC setSubTitleURL (QString url);
virtual ASYNC setURL (TQString url);
virtual ASYNC setSubTitleURL (TQString url);
virtual ASYNC play (int repeat_count);
virtual ASYNC stop ();
virtual ASYNC pause ();
@ -45,9 +45,9 @@ k_dcop:
virtual ASYNC volume (int v, bool absolute);
virtual ASYNC frequency (int f);
virtual ASYNC quit ();
virtual ASYNC setConfig (QByteArray);
virtual ASYNC setAudioLang (int, QString);
virtual ASYNC setSubtitle (int, QString);
virtual ASYNC setConfig (TQByteArray);
virtual ASYNC setAudioLang (int, TQString);
virtual ASYNC setSubtitle (int, TQString);
virtual bool isPlaying ();
private:
BackendPrivate * d;

@ -20,7 +20,7 @@
#define _KMPLAYER_CALLBACK_H_
#include <dcopobject.h>
#include <qstringlist.h>
#include <tqstringlist.h>
namespace KMPlayer {
@ -32,13 +32,13 @@ public:
enum StatusCode { stat_addurl = 0, stat_newtitle, stat_hasvideo };
Callback (CallbackProcess *);
k_dcop:
ASYNC statusMessage (int code, QString msg);
ASYNC errorMessage (int code, QString msg);
ASYNC subMrl (QString mrl, QString title);
ASYNC statusMessage (int code, TQString msg);
ASYNC errorMessage (int code, TQString msg);
ASYNC subMrl (TQString mrl, TQString title);
ASYNC finished ();
ASYNC playing ();
ASYNC started (QCString dcopname, QByteArray data);
ASYNC movieParams (int length, int width, int height, float aspect, QStringList alang, QStringList slang);
ASYNC started (TQCString dcopname, TQByteArray data);
ASYNC movieParams (int length, int width, int height, float aspect, TQStringList alang, TQStringList slang);
ASYNC moviePosition (int position);
ASYNC loadingProgress (int percentage);
ASYNC toggleFullScreen ();

@ -23,14 +23,14 @@
#include <sys/types.h>
#include <signal.h>
#include <qapplication.h>
#include <qcstring.h>
#include <qtimer.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
#include <qpopupmenu.h>
#include <qslider.h>
#include <qvaluelist.h>
#include <tqapplication.h>
#include <tqcstring.h>
#include <tqtimer.h>
#include <tqmultilineedit.h>
#include <tqpushbutton.h>
#include <tqpopupmenu.h>
#include <tqslider.h>
#include <tqvaluelist.h>
#include <kprocess.h>
#include <kmessagebox.h>
@ -48,11 +48,11 @@
#ifdef HAVE_KOFFICE
#include <qdom.h>
//#include <qmetaobject.h>
#include <qlayout.h>
#include <qptrlist.h>
#include <qpainter.h>
#include <tqdom.h>
//#include <tqmetaobject.h>
#include <tqlayout.h>
#include <tqptrlist.h>
#include <tqpainter.h>
#include <koFrame.h>
class KMPlayerFactory : public KParts::Factory {
@ -60,8 +60,8 @@ public:
KMPlayerFactory ();
virtual ~KMPlayerFactory ();
virtual KParts::Part *createPartObject
(QWidget *wparent, const char *wname, QObject *parent, const char *name,
const char *className, const QStringList &args);
(TQWidget *wtqparent, const char *wname, TQObject *tqparent, const char *name,
const char *className, const TQStringList &args);
static KInstance * instance () { return s_instance; }
private:
static KInstance * s_instance;
@ -80,21 +80,21 @@ KMPlayerFactory::~KMPlayerFactory () {
}
KParts::Part *KMPlayerFactory::createPartObject
(QWidget *wparent, const char *wname,
QObject *parent, const char * name,
const char * cls, const QStringList & args) {
(TQWidget *wtqparent, const char *wname,
TQObject *tqparent, const char * name,
const char * cls, const TQStringList & args) {
if (strstr (cls, "KoDocument"))
return new KOfficeMPlayer (wparent, wname, parent, name);
return new KOfficeMPlayer (wtqparent, wname, tqparent, name);
return 0L;
}
//-----------------------------------------------------------------------------
KOfficeMPlayer::KOfficeMPlayer (QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode)
: KoDocument (parentWidget, widgetName, parent, name, singleViewMode),
KOfficeMPlayer::KOfficeMPlayer (TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, bool singleViewMode)
: KoDocument (tqparentWidget, widgetName, tqparent, name, singleViewMode),
m_config (new KConfig ("kmplayerrc")),
m_player (new KMPlayer (parentWidget, 0L, 0L, 0L, m_config))
m_player (new KMPlayer (tqparentWidget, 0L, 0L, 0L, m_config))
{
setInstance (KMPlayerFactory::instance (), false);
setReadWrite (false);
@ -107,8 +107,8 @@ KOfficeMPlayer::~KOfficeMPlayer () {
kdDebug() << "KOfficeMPlayer::~KOfficeMPlayer" << /*kdBacktrace() <<*/ endl;
}
void KOfficeMPlayer::paintContent (QPainter& p, const QRect& r, bool, double, double) {
p.fillRect (r, QBrush (QColor (0, 0, 0)));
void KOfficeMPlayer::paintContent (TQPainter& p, const TQRect& r, bool, double, double) {
p.fillRect (r, TQBrush (TQColor (0, 0, 0)));
}
bool KOfficeMPlayer::initDoc() {
@ -116,8 +116,8 @@ bool KOfficeMPlayer::initDoc() {
return true;
}
bool KOfficeMPlayer::loadXML (QIODevice *, const QDomDocument & doc) {
QDomNode node = doc.firstChild ();
bool KOfficeMPlayer::loadXML (TQIODevice *, const TQDomDocument & doc) {
TQDomNode node = doc.firstChild ();
if (node.isNull ()) return true;
kdDebug() << "KOfficeMPlayer::loadXML " << node.nodeName () << endl;
node = node.firstChild ();
@ -129,39 +129,39 @@ bool KOfficeMPlayer::loadXML (QIODevice *, const QDomDocument & doc) {
return true;
}
bool KOfficeMPlayer::loadOasis (const QDomDocument &, KoOasisStyles &, const QDomDocument &, KoStore *) {
bool KOfficeMPlayer::loadOasis (const TQDomDocument &, KoOasisStyles &, const TQDomDocument &, KoStore *) {
return true;
}
QDomDocument KOfficeMPlayer::saveXML() {
QDomDocument doc = createDomDocument ("kmplayer", QString::number(1.0));
QDomElement docelm = doc.documentElement();
TQDomDocument KOfficeMPlayer::saveXML() {
TQDomDocument doc = createDomDocument ("kmplayer", TQString::number(1.0));
TQDomElement docelm = doc.documentElement();
docelm.setAttribute ("editor", "KMPlayer");
docelm.setAttribute ("mime", "application/x-kmplayer");
QDomElement url = doc.createElement ("url");
TQDomElement url = doc.createElement ("url");
url.appendChild (doc.createTextNode (m_player->url ().url ()));
doc.appendChild (url);
return doc;
}
KoView* KOfficeMPlayer::createViewInstance (QWidget* parent, const char* name) {
KoView* KOfficeMPlayer::createViewInstance (TQWidget* tqparent, const char* name) {
kdDebug() << "KOfficeMPlayer::createViewInstance" << endl;
return new KOfficeMPlayerView (this, parent);
return new KOfficeMPlayerView (this, tqparent);
}
KOfficeMPlayerView::KOfficeMPlayerView (KOfficeMPlayer* part, QWidget* parent, const char* name)
: KoView (part, parent, name),
KOfficeMPlayerView::KOfficeMPlayerView (KOfficeMPlayer* part, TQWidget* tqparent, const char* name)
: KoView (part, tqparent, name),
m_view (static_cast <KMPlayer::View*> (part->player ()->view ())) {
kdDebug() << "KOfficeMPlayerView::KOfficeMPlayerView this:" << this << " parent:" << parent << endl;
m_oldparent = static_cast <QWidget*> (m_view->parent());
m_view->reparent (this, QPoint (0, 0));
QVBoxLayout * box = new QVBoxLayout (this, 0, 0);
kdDebug() << "KOfficeMPlayerView::KOfficeMPlayerView this:" << this << " tqparent:" << tqparent << endl;
m_oldtqparent = static_cast <TQWidget*> (m_view->tqparent());
m_view->reparent (this, TQPoint (0, 0));
TQVBoxLayout * box = new TQVBoxLayout (this, 0, 0);
box->addWidget (m_view);
}
KOfficeMPlayerView::~KOfficeMPlayerView () {
kdDebug() << "KOfficeMPlayerView::~KOfficeMPlayerView this:" << this << endl;
m_view->reparent (m_oldparent, QPoint (0, 0));
m_view->reparent (m_oldtqparent, TQPoint (0, 0));
}
#include "kmplayer_koffice_part.moc"

@ -28,11 +28,11 @@
#include <koDocument.h>
#include <koView.h>
#endif //HAVE_KOFFICE
#include <qobject.h>
#include <qvaluelist.h>
#include <qstringlist.h>
#include <qguardedptr.h>
#include <qregexp.h>
#include <tqobject.h>
#include <tqvaluelist.h>
#include <tqstringlist.h>
#include <tqguardedptr.h>
#include <tqregexp.h>
#include "kmplayerview.h"
#include "kmplayersource.h"
@ -42,39 +42,41 @@ class KAboutData;
class KMPlayer;
class KInstance;
class KConfig;
class QIODevice;
class TQIODevice;
#ifdef HAVE_KOFFICE
class KOfficeMPlayer;
class KOfficeMPlayerView : public KoView {
Q_OBJECT
TQ_OBJECT
public:
KOfficeMPlayerView (KOfficeMPlayer* part, QWidget* parent, const char* name = 0 );
KOfficeMPlayerView (KOfficeMPlayer* part, TQWidget* tqparent, const char* name = 0 );
~KOfficeMPlayerView ();
void updateReadWrite(bool) {}
private:
KMPlayer::View * m_view;
QGuardedPtr <QWidget> m_oldparent;
TQGuardedPtr <TQWidget> m_oldtqparent;
};
class KOfficeMPlayer : public KoDocument {
Q_OBJECT
TQ_OBJECT
public:
KOfficeMPlayer (QWidget *parentWidget = 0, const char *widgetName = 0, QObject* parent = 0, const char* name = 0, bool singleViewMode = false);
KOfficeMPlayer (TQWidget *tqparentWidget = 0, const char *widgetName = 0, TQObject* tqparent = 0, const char* name = 0, bool singleViewMode = false);
~KOfficeMPlayer ();
virtual void paintContent (QPainter& painter, const QRect& rect,
virtual void paintContent (TQPainter& painter, const TQRect& rect,
bool transparent = false, double zoomX = 1.0, double zoomY = 1.0);
virtual bool initDoc ();
virtual bool loadXML (QIODevice *, const QDomDocument &);
virtual bool loadOasis (const QDomDocument &, KoOasisStyles &, const QDomDocument &, KoStore *);
virtual QDomDocument saveXML ();
virtual QCString mimeType() const { return "application/x-kmplayer"; }
virtual bool loadXML (TQIODevice *, const TQDomDocument &);
virtual bool loadOasis (const TQDomDocument &, KoOasisStyles &, const TQDomDocument &, KoStore *);
virtual TQDomDocument saveXML ();
virtual TQCString mimeType() const { return "application/x-kmplayer"; }
KMPlayer * player () const { return m_player; }
protected:
virtual KoView* createViewInstance (QWidget* parent, const char* name);
virtual KoView* createViewInstance (TQWidget* tqparent, const char* name);
private:
KConfig * m_config;
KMPlayer * m_player;

@ -23,10 +23,10 @@
#include <algorithm>
#include <config.h>
#include <qpopupmenu.h>
#include <qtimer.h>
#include <qpushbutton.h>
#include <qslider.h>
#include <tqpopupmenu.h>
#include <tqtimer.h>
#include <tqpushbutton.h>
#include <tqslider.h>
class KXMLGUIClient; // workaround for kde3.3 on sarge with gcc4, kactioncollection.h does not forward declare KXMLGUIClient
#include <klibloader.h>
@ -72,17 +72,17 @@ KDE_NO_CDTOR_EXPORT KMPlayerPartStatic::~KMPlayerPartStatic () {
struct KMPLAYER_NO_EXPORT GroupPredicate {
const KMPlayerPart * m_part;
const QString & m_group;
const TQString & m_group;
bool m_get_any;
GroupPredicate(const KMPlayerPart *part, const QString &group, bool b=false)
GroupPredicate(const KMPlayerPart *part, const TQString &group, bool b=false)
: m_part (part), m_group (group), m_get_any (b) {}
bool operator () (const KMPlayerPart * part) const {
return ((m_get_any && part != m_part &&
!part->master () && !part->url ().isEmpty ()) ||
(m_part->allowRedir (part->m_docbase) &&
(part->m_group == m_group ||
part->m_group == QString::fromLatin1("_master") ||
m_group == QString::fromLatin1("_master")) &&
part->m_group == TQString::tqfromLatin1("_master") ||
m_group == TQString::tqfromLatin1("_master")) &&
(part->m_features & KMPlayerPart::Feat_Viewer) !=
(m_part->m_features & KMPlayerPart::Feat_Viewer)));
}
@ -97,9 +97,9 @@ public:
KMPlayerFactory ();
virtual ~KMPlayerFactory ();
virtual KParts::Part *createPartObject
(QWidget *wparent, const char *wname,
QObject *parent, const char *name,
const char *className, const QStringList &args);
(TQWidget *wtqparent, const char *wname,
TQObject *tqparent, const char *name,
const char *className, const TQStringList &args);
static KInstance * instance () { return s_instance; }
private:
static KInstance * s_instance;
@ -118,27 +118,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerFactory::~KMPlayerFactory () {
}
KDE_NO_EXPORT KParts::Part *KMPlayerFactory::createPartObject
(QWidget *wparent, const char *wname,
QObject *parent, const char * name,
const char * cls, const QStringList & args) {
(TQWidget *wtqparent, const char *wname,
TQObject *tqparent, const char * name,
const char * cls, const TQStringList & args) {
kdDebug() << "KMPlayerFactory::createPartObject " << cls << endl;
return new KMPlayerPart (wparent, wname, parent, name, args);
return new KMPlayerPart (wtqparent, wname, tqparent, name, args);
}
//-----------------------------------------------------------------------------
static bool getBoolValue (const QString & value) {
return (value.lower() != QString::fromLatin1("false") &&
value.lower() != QString::fromLatin1("off") &&
value.lower() != QString::fromLatin1("0"));
static bool getBoolValue (const TQString & value) {
return (value.lower() != TQString::tqfromLatin1("false") &&
value.lower() != TQString::tqfromLatin1("off") &&
value.lower() != TQString::tqfromLatin1("0"));
}
#define SET_FEAT_ON(f) { m_features |= f; turned_off_features &= ~f; }
#define SET_FEAT_OFF(f) { m_features &= ~f; turned_off_features |= f; }
KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *wname,
QObject * parent, const char *name, const QStringList &args)
: PartBase (wparent, wname, parent, name, new KConfig ("kmplayerrc")),
KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (TQWidget * wtqparent, const char *wname,
TQObject * tqparent, const char *name, const TQStringList &args)
: PartBase (wtqparent, wname, tqparent, name, new KConfig ("kmplayerrc")),
m_master (0L),
m_browserextension (new KMPlayerBrowserExtension (this)),
m_liveconnectextension (new KMPlayerLiveConnectExtension (this)),
@ -154,27 +154,27 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
m_sources ["hrefsource"] = (new KMPlayerHRefSource (this));
#ifdef HAVE_NSPR
KMPlayer::NpPlayer *npp = (KMPlayer::NpPlayer *) players () ["npp"];
connect (npp, SIGNAL (evaluate (const QString &, QString &)),
m_liveconnectextension, SLOT (evaluate (const QString &, QString &)));
connect (npp, SIGNAL (openUrl (const KURL &, const QString &)),
connect (npp, TQT_SIGNAL (evaluate (const TQString &, TQString &)),
m_liveconnectextension, TQT_SLOT (evaluate (const TQString &, TQString &)));
connect (npp, TQT_SIGNAL (openUrl (const KURL &, const TQString &)),
m_browserextension,
SLOT (slotRequestOpenURL (const KURL &, const QString &)));
TQT_SLOT (slotRequestOpenURL (const KURL &, const TQString &)));
#endif
/*KAction *playact =*/ new KAction(i18n("P&lay"), QString ("player_play"), KShortcut (), this, SLOT(play ()), actionCollection (), "play");
/*KAction *pauseact =*/ new KAction(i18n("&Pause"), QString ("player_pause"), KShortcut (), this, SLOT(pause ()), actionCollection (), "pause");
/*KAction *stopact =*/ new KAction(i18n("&Stop"), QString ("player_stop"), KShortcut (), this, SLOT(stop ()), actionCollection (), "stop");
new KAction (i18n ("Increase Volume"), QString ("player_volume"), KShortcut (), this, SLOT (increaseVolume ()), actionCollection (), "edit_volume_up");
new KAction (i18n ("Decrease Volume"), QString ("player_volume"), KShortcut (), this, SLOT (decreaseVolume ()), actionCollection (), "edit_volume_down");
/*KAction *playact =*/ new KAction(i18n("P&lay"), TQString ("player_play"), KShortcut (), this, TQT_SLOT(play ()), actionCollection (), "play");
/*KAction *pauseact =*/ new KAction(i18n("&Pause"), TQString ("player_pause"), KShortcut (), this, TQT_SLOT(pause ()), actionCollection (), "pause");
/*KAction *stopact =*/ new KAction(i18n("&Stop"), TQString ("player_stop"), KShortcut (), this, TQT_SLOT(stop ()), actionCollection (), "stop");
new KAction (i18n ("Increase Volume"), TQString ("player_volume"), KShortcut (), this, TQT_SLOT (increaseVolume ()), actionCollection (), "edit_volume_up");
new KAction (i18n ("Decrease Volume"), TQString ("player_volume"), KShortcut (), this, TQT_SLOT (decreaseVolume ()), actionCollection (), "edit_volume_down");
Source * urlsource = m_sources ["urlsource"];
KMPlayer::ControlPanel * panel = m_view->controlPanel ();
QStringList::const_iterator it = args.begin ();
QStringList::const_iterator end = args.end ();
TQStringList::const_iterator it = args.begin ();
TQStringList::const_iterator end = args.end ();
int turned_off_features = 0;
for ( ; it != end; ++it) {
int equalPos = (*it).find("=");
int equalPos = (*it).tqfind("=");
if (equalPos > 0) {
QString name = (*it).left (equalPos).lower ();
QString value = (*it).right ((*it).length () - equalPos - 1);
TQString name = (*it).left (equalPos).lower ();
TQString value = (*it).right ((*it).length () - equalPos - 1);
if (value.at(0)=='\"')
value = value.right (value.length () - 1);
if (value.at (value.length () - 1) == '\"')
@ -184,121 +184,121 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
urlsource->setURL (KURL (value));
urlsource->setIdentified (false);
m_havehref = true;
} else if (name == QString::fromLatin1("width")) {
} else if (name == TQString::tqfromLatin1("width")) {
m_noresize = true;
} else if (name == QString::fromLatin1("height")) {
} else if (name == TQString::tqfromLatin1("height")) {
m_noresize = true;
} else if (name == QString::fromLatin1("type")) {
} else if (name == TQString::tqfromLatin1("type")) {
urlsource->document ()->mrl ()->mimetype = value;
} else if (name == QString::fromLatin1("controls")) {
} else if (name == TQString::tqfromLatin1("controls")) {
//http://service.real.com/help/library/guides/production8/realpgd.htm?src=noref,rnhmpg_080301,rnhmtn,nosrc
//http://service.real.com/help/library/guides/production8/htmfiles/control.htm
QStringList sl = QStringList::split (QChar (','), value);
QStringList::const_iterator it = sl.begin ();
const QStringList::const_iterator e = sl.end ();
for (QStringList::const_iterator i = sl.begin (); i != e; ++i) {
QString val_lower ((*i).lower ());
if (val_lower == QString::fromLatin1("imagewindow")) {
TQStringList sl = TQStringList::split (TQChar (','), value);
TQStringList::const_iterator it = sl.begin ();
const TQStringList::const_iterator e = sl.end ();
for (TQStringList::const_iterator i = sl.begin (); i != e; ++i) {
TQString val_lower ((*i).lower ());
if (val_lower == TQString::tqfromLatin1("imagewindow")) {
SET_FEAT_ON (Feat_ImageWindow | Feat_Viewer)
} else if (val_lower == QString::fromLatin1("all")) {
} else if (val_lower == TQString::tqfromLatin1("all")) {
m_features = (Feat_Controls | Feat_StatusBar);
} else if (val_lower == QString::fromLatin1("tacctrl")) {
} else if (val_lower == TQString::tqfromLatin1("tacctrl")) {
SET_FEAT_ON (Feat_Label)
} else if (val_lower == QString::fromLatin1("controlpanel")) {
} else if (val_lower == TQString::tqfromLatin1("controlpanel")) {
SET_FEAT_ON (Feat_Controls)
} else if (val_lower == QString::fromLatin1("infovolumepanel")){
} else if (val_lower == TQString::tqfromLatin1("infovolumepanel")){
SET_FEAT_ON (Feat_Controls) // TODO
} else if (val_lower == QString::fromLatin1("positionfield") ||
val_lower == QString::fromLatin1("positionslider")) {
} else if (val_lower == TQString::tqfromLatin1("positionfield") ||
val_lower == TQString::tqfromLatin1("positionslider")) {
setAutoControls (false);
panel->positionSlider ()->show ();
SET_FEAT_ON (Feat_Controls)
} else if ( val_lower == QString::fromLatin1("homectrl")) {
} else if ( val_lower == TQString::tqfromLatin1("homectrl")) {
setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_config)->show();
} else if (val_lower == QString::fromLatin1("mutectrl") ||
val_lower == QString::fromLatin1("mutevolume")) {
} else if (val_lower == TQString::tqfromLatin1("mutectrl") ||
val_lower == TQString::tqfromLatin1("mutevolume")) {
setAutoControls (false);
panel->volumeBar()->setMinimumSize (QSize (20, panel->volumeBar()->minimumSize ().height ()));
panel->volumeBar()->setMinimumSize (TQSize (20, panel->volumeBar()->tqminimumSize ().height ()));
panel->volumeBar()->show ();
SET_FEAT_ON (Feat_Controls)
} else if (val_lower == QString::fromLatin1("rwctrl")) {
} else if (val_lower == TQString::tqfromLatin1("rwctrl")) {
setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_back)->show (); // rewind ?
SET_FEAT_ON (Feat_Controls)
} else if ( val_lower == QString::fromLatin1("ffctrl")) {
} else if ( val_lower == TQString::tqfromLatin1("ffctrl")) {
setAutoControls (false);
panel->button(KMPlayer::ControlPanel::button_forward)->show();
m_features = Feat_Controls;
} else if ( val_lower ==QString::fromLatin1("stopbutton")) {
} else if ( val_lower ==TQString::tqfromLatin1("stopbutton")) {
setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_stop)->show ();
SET_FEAT_ON (Feat_Controls)
} else if (val_lower == QString::fromLatin1("playbutton") ||
val_lower ==QString::fromLatin1("playonlybutton")) {
} else if (val_lower == TQString::tqfromLatin1("playbutton") ||
val_lower ==TQString::tqfromLatin1("playonlybutton")) {
setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_play)->show ();
SET_FEAT_ON (Feat_Controls)
} else if (val_lower ==QString::fromLatin1("pausebutton")) {
} else if (val_lower ==TQString::tqfromLatin1("pausebutton")) {
setAutoControls (false);
panel->button (KMPlayer::ControlPanel::button_pause)->show ();
SET_FEAT_ON (Feat_Controls)
} else if (val_lower == QString::fromLatin1("statusbar") ||
val_lower == QString::fromLatin1("statusfield")) {
} else if (val_lower == TQString::tqfromLatin1("statusbar") ||
val_lower == TQString::tqfromLatin1("statusfield")) {
SET_FEAT_ON (Feat_StatusBar)
} else if (val_lower == QString::fromLatin1("infopanel")) {
} else if (val_lower == TQString::tqfromLatin1("infopanel")) {
SET_FEAT_ON (Feat_InfoPanel)
} else if (val_lower == QString::fromLatin1("playlist")) {
} else if (val_lower == TQString::tqfromLatin1("playlist")) {
SET_FEAT_ON (Feat_PlayList)
} else if (val_lower==QString::fromLatin1("volumeslider")) {
} else if (val_lower==TQString::tqfromLatin1("volumeslider")) {
SET_FEAT_ON (Feat_VolumeSlider)
setAutoControls (false);
panel->volumeBar()->show ();
panel->volumeBar()->setMinimumSize (QSize (20, panel->volumeBar()->minimumSize ().height ()));
panel->volumeBar()->setMinimumSize (TQSize (20, panel->volumeBar()->tqminimumSize ().height ()));
}
}
} else if (name == QString::fromLatin1("uimode")) {
QString val_lower (value.lower ());
if (val_lower == QString::fromLatin1("full"))
} else if (name == TQString::tqfromLatin1("uimode")) {
TQString val_lower (value.lower ());
if (val_lower == TQString::tqfromLatin1("full"))
SET_FEAT_ON (Feat_All & ~(Feat_PlayList | Feat_ImageWindow))
// TODO: invisible, none, mini
} else if (name == QString::fromLatin1("nolabels")) {
} else if (name == TQString::tqfromLatin1("nolabels")) {
SET_FEAT_OFF (Feat_Label)
} else if (name == QString::fromLatin1("nocontrols")) {
} else if (name == TQString::tqfromLatin1("nocontrols")) {
SET_FEAT_OFF (Feat_Controls | Feat_VolumeSlider)
} else if (name == QString::fromLatin1("showdisplay")) {
} else if (name == TQString::tqfromLatin1("showdisplay")) {
// the author name, the clip name, and the copyright information
if (getBoolValue (value))
SET_FEAT_ON (Feat_InfoPanel)
else
SET_FEAT_OFF (Feat_InfoPanel)
} else if (name == QString::fromLatin1("showcontrols")) {
} else if (name == TQString::tqfromLatin1("showcontrols")) {
if (getBoolValue (value))
SET_FEAT_ON (Feat_Viewer | Feat_Controls)
else
SET_FEAT_OFF (Feat_Controls | Feat_VolumeSlider)
} else if (name == QString::fromLatin1("showstatusbar")) {
} else if (name == TQString::tqfromLatin1("showstatusbar")) {
if (getBoolValue (value))
SET_FEAT_ON (Feat_Viewer | Feat_StatusBar)
else
SET_FEAT_OFF (Feat_StatusBar)
// else showcaptioning/showgotobar/showpositioncontrols/showtracker
} else if (name == QString::fromLatin1("console")) {
m_group = value.isEmpty() ? QString::fromLatin1("_anonymous") : value;
} else if (name == QString::fromLatin1("__khtml__pluginbaseurl")) {
} else if (name == TQString::tqfromLatin1("console")) {
m_group = value.isEmpty() ? TQString::tqfromLatin1("_anonymous") : value;
} else if (name == TQString::tqfromLatin1("__khtml__pluginbaseurl")) {
m_docbase = KURL (value);
} else if (name == QString::fromLatin1("src")) {
} else if (name == TQString::tqfromLatin1("src")) {
m_src_url = value;
} else if (name == QString::fromLatin1("filename")) {
} else if (name == TQString::tqfromLatin1("filename")) {
m_file_name = value;
} else if (name == QString::fromLatin1 ("fullscreenmode")) {
} else if (name == TQString::tqfromLatin1 ("fullscreenmode")) {
show_fullscreen = getBoolValue (value);
} else if (name == QString::fromLatin1 ("autostart")) {
} else if (name == TQString::tqfromLatin1 ("autostart")) {
urlsource->setAutoPlay (getBoolValue (value));
}
// volume/clicktoplay/transparentatstart/animationatstart
// autorewind/displaysize/border
if (name.startsWith (QString::fromLatin1 ("__khtml__")))
if (name.startsWith (TQString::tqfromLatin1 ("__khtml__")))
name = name.mid (9);
convertNode <KMPlayer::Element> (urlsource->document ())->setAttribute (name, value);
}
@ -311,11 +311,11 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
//KParts::Part::setWidget (m_view);
setXMLFile("kmplayerpartui.rc");
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom50,
this, SLOT (setMenuZoom (int)));
this, TQT_SLOT (setMenuZoom (int)));
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom100,
this, SLOT (setMenuZoom (int)));
this, TQT_SLOT (setMenuZoom (int)));
panel->zoomMenu ()->connectItem (KMPlayer::ControlPanel::menu_zoom150,
this, SLOT (setMenuZoom (int)));
this, TQT_SLOT (setMenuZoom (int)));
m_view->setNoInfoMessages (m_features != Feat_InfoPanel);
if (m_features == Feat_InfoPanel)
@ -332,7 +332,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
else
m_view->setControlPanelMode (KMPlayer::View::CP_AutoHide);
}
bool group_member = !m_group.isEmpty () && m_group != QString::fromLatin1("_unique") && m_features != Feat_Unknown;
bool group_member = !m_group.isEmpty () && m_group != TQString::tqfromLatin1("_unique") && m_features != Feat_Unknown;
if (!group_member || m_features & Feat_Viewer) {
// not part of a group or we're the viewer
setProcess ("mplayer");
@ -340,9 +340,9 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
connectPanel (m_view->controlPanel ());
if (m_features & Feat_StatusBar) {
last_time_left = 0;
connect (this, SIGNAL (positioned (int, int)),
this, SLOT (statusPosition (int, int)));
m_view->statusBar ()->insertItem (QString ("--:--"), 1, 0, true);
connect (this, TQT_SIGNAL (positioned (int, int)),
this, TQT_SLOT (statusPosition (int, int)));
m_view->statusBar ()->insertItem (TQString ("--:--"), 1, 0, true);
}
}
if (group_member) {
@ -362,7 +362,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerPart::KMPlayerPart (QWidget * wparent, const char *w
m_group.truncate (0);
kmplayerpart_static->partlist.push_back (this);
QWidget *pwidget = view ()->parentWidget ();
TQWidget *pwidget = view ()->tqparentWidget ();
if (pwidget) {
m_view->viewArea()->setPaletteBackgroundColor(pwidget->paletteBackgroundColor ());
m_view->viewer()->setBackgroundColor(pwidget->paletteBackgroundColor());
@ -397,7 +397,7 @@ KDE_NO_EXPORT void KMPlayerPart::setAutoControls (bool b) {
m_view->controlPanel ()->setAutoControls (b);
}
KDE_NO_EXPORT void KMPlayerPart::viewerPartDestroyed (QObject * o) {
KDE_NO_EXPORT void KMPlayerPart::viewerPartDestroyed (TQObject * o) {
if (o == m_master)
m_master = 0L;
kdDebug () << "KMPlayerPart(" << this << ")::viewerPartDestroyed" << endl;
@ -434,16 +434,16 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
url = KURL (m_docbase, m_file_name); // fix misdetected SRC attr
else if (_url != m_docbase) {
url = _url;
if (!m_file_name.isEmpty () && _url.url ().find (m_file_name) < 0) {
if (!m_file_name.isEmpty () && _url.url ().tqfind (m_file_name) < 0) {
KURL u (m_file_name);
if ((u.protocol () == QString ("mms")) ||
if ((u.protocol () == TQString ("mms")) ||
_url.protocol ().isEmpty ()) {
// see if we somehow have to merge these
int p = _url.port ();
if (p > 0)
u.setPort (p);
if (u.path ().isEmpty ())
u.setPath (QChar ('/') + _url.host ());
u.setPath (TQChar ('/') + _url.host ());
if (allowRedir (u)) {
url = u;
kdDebug () << "KMPlayerPart::openURL compose " << m_file_name << " " << _url.url() << " ->" << u.url() << endl;
@ -469,7 +469,7 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
if (url.isEmpty ()) {
if (!m_master && !(m_features & Feat_Viewer))
// no master set, wait for a viewer to attach or timeout
QTimer::singleShot (50, this, SLOT (waitForImageWindowTimeOut ()));
TQTimer::singleShot (50, this, TQT_SLOT (waitForImageWindowTimeOut ()));
return true;
}
if (!m_group.isEmpty () && !(m_features & Feat_Viewer)) {
@ -479,7 +479,7 @@ KDE_NO_EXPORT bool KMPlayerPart::openURL (const KURL & _url) {
i = std::find_if (++i, e, pred))
if ((*i)->url ().isEmpty ()) // image window created w/o url
return (*i)->openURL (_url);
QTimer::singleShot (50, this, SLOT (waitForImageWindowTimeOut ()));
TQTimer::singleShot (50, this, TQT_SLOT (waitForImageWindowTimeOut ()));
//kdError () << "Not the ImageWindow and no ImageWindow found" << endl;
return true;
}
@ -549,17 +549,17 @@ KDE_NO_EXPORT void KMPlayerPart::connectToPart (KMPlayerPart * m) {
if (m_features & Feat_InfoPanel)
m->connectInfoPanel (m_view->infoPanel ());
connectSource (m_source, m->source ());
connect (m, SIGNAL (destroyed (QObject *)),
this, SLOT (viewerPartDestroyed (QObject *)));
connect (m, SIGNAL (processChanged (const char *)),
this, SLOT (viewerPartProcessChanged (const char *)));
connect (m, SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)),
this, SLOT (viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *)));
connect (m, TQT_SIGNAL (destroyed (TQObject *)),
this, TQT_SLOT (viewerPartDestroyed (TQObject *)));
connect (m, TQT_SIGNAL (processChanged (const char *)),
this, TQT_SLOT (viewerPartProcessChanged (const char *)));
connect (m, TQT_SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)),
this, TQT_SLOT (viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *)));
if (m_features & Feat_StatusBar) {
last_time_left = 0;
connect (m, SIGNAL (positioned (int, int)),
this, SLOT (statusPosition (int, int)));
m_view->statusBar ()->insertItem (QString ("--:--"), 1, 0, true);
connect (m, TQT_SIGNAL (positioned (int, int)),
this, TQT_SLOT (statusPosition (int, int)));
m_view->statusBar ()->insertItem (TQString ("--:--"), 1, 0, true);
}
}
@ -568,7 +568,7 @@ KDE_NO_EXPORT void KMPlayerPart::setLoaded (int percentage) {
if (percentage < 100) {
m_browserextension->setLoadingProgress (percentage);
m_browserextension->infoMessage
(QString::number (percentage) + i18n ("% Cache fill"));
(TQString::number (percentage) + i18n ("% Cache fill"));
}
}
@ -631,7 +631,7 @@ KDE_NO_EXPORT void KMPlayerPart::statusPosition (int pos, int length) {
int left = (length - pos) / 10;
if (left != last_time_left) {
last_time_left = left;
QString text ("--:--");
TQString text ("--:--");
if (left > 0) {
int h = left / 3600;
int m = (left % 3600) / 60;
@ -647,11 +647,11 @@ KDE_NO_EXPORT void KMPlayerPart::statusPosition (int pos, int length) {
//---------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerBrowserExtension::KMPlayerBrowserExtension (KMPlayerPart * parent)
: KParts::BrowserExtension (parent, "KMPlayer Browser Extension") {
KDE_NO_CDTOR_EXPORT KMPlayerBrowserExtension::KMPlayerBrowserExtension (KMPlayerPart * tqparent)
: KParts::BrowserExtension (tqparent, "KMPlayer Browser Extension") {
}
KDE_NO_EXPORT void KMPlayerBrowserExtension::urlChanged (const QString & url) {
KDE_NO_EXPORT void KMPlayerBrowserExtension::urlChanged (const TQString & url) {
emit setLocationBarURL (url);
}
@ -659,25 +659,25 @@ KDE_NO_EXPORT void KMPlayerBrowserExtension::setLoadingProgress (int percentage)
emit loadingProgress (percentage);
}
KDE_NO_EXPORT void KMPlayerBrowserExtension::saveState (QDataStream & stream) {
stream << static_cast <PartBase *> (parent ())->url ().url ();
KDE_NO_EXPORT void KMPlayerBrowserExtension::saveState (TQDataStream & stream) {
stream << static_cast <PartBase *> (tqparent ())->url ().url ();
}
KDE_NO_EXPORT void KMPlayerBrowserExtension::restoreState (QDataStream & stream) {
QString url;
KDE_NO_EXPORT void KMPlayerBrowserExtension::restoreState (TQDataStream & stream) {
TQString url;
stream >> url;
static_cast <PartBase *> (parent ())->openURL (KURL(url));
static_cast <PartBase *> (tqparent ())->openURL (KURL(url));
}
KDE_NO_EXPORT void KMPlayerBrowserExtension::requestOpenURL (const KURL & url, const QString & target, const QString & service) {
KDE_NO_EXPORT void KMPlayerBrowserExtension::requestOpenURL (const KURL & url, const TQString & target, const TQString & service) {
KParts::URLArgs args;
args.frameName = target;
args.serviceType = service;
emit openURLRequest (url, args);
}
KDE_NO_EXPORT void KMPlayerBrowserExtension::slotRequestOpenURL (const KURL &url, const QString &target) {
requestOpenURL (url, target, QString ());
KDE_NO_EXPORT void KMPlayerBrowserExtension::slotRequestOpenURL (const KURL &url, const TQString &target) {
requestOpenURL (url, target, TQString ());
}
//---------------------------------------------------------------------
@ -746,14 +746,14 @@ static const JSCommandEntry JSCommandList [] = {
{ "GetEntryCopyright", notsupported, "(c)", KParts::LiveConnectExtension::TypeString },
{ "GetEntryTitle", notsupported, "title", KParts::LiveConnectExtension::TypeString },
{ "GetFullScreen", isfullscreen, 0L, KParts::LiveConnectExtension::TypeBool },
{ "GetImageStatus", notsupported, "false", KParts::LiveConnectExtension::TypeBool },
{ "GetImagetqStatus", notsupported, "false", KParts::LiveConnectExtension::TypeBool },
{ "GetLastErrorMoreInfoURL", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLastErrorRMACode", notsupported, "0", KParts::LiveConnectExtension::TypeNumber },
{ "GetLastErrorSeverity", notsupported, "6", KParts::LiveConnectExtension::TypeNumber },
{ "GetLastErrorUserCode", notsupported, "0", KParts::LiveConnectExtension::TypeNumber },
{ "GetLastErrorUserString", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLastMessage", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLastStatus", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLasttqStatus", notsupported, "no error", KParts::LiveConnectExtension::TypeString },
{ "GetLength", length, 0L, KParts::LiveConnectExtension::TypeNumber },
{ "GetLiveState", notsupported, "false", KParts::LiveConnectExtension::TypeBool },
{ "GetLoop", isloop, 0L, KParts::LiveConnectExtension::TypeBool },
@ -802,7 +802,7 @@ static const JSCommandEntry JSCommandList [] = {
{ "SetDoubleSize", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetFileName", setsource, 0L, KParts::LiveConnectExtension::TypeBool },
{ "SetFullScreen", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetImageStatus", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetImagetqStatus", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetLoop", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetMaintainAspect", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
{ "SetMute", notsupported, "true", KParts::LiveConnectExtension::TypeBool },
@ -847,13 +847,13 @@ static const JSCommandEntry * getJSCommandEntry (const char * name, int start =
return &JSCommandList[mid];
}
KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::KMPlayerLiveConnectExtension (KMPlayerPart * parent)
: KParts::LiveConnectExtension (parent), player (parent),
KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::KMPlayerLiveConnectExtension (KMPlayerPart * tqparent)
: KParts::LiveConnectExtension (tqparent), player (tqparent),
lastJSCommandEntry (0L),
m_started (false),
m_enablefinish (false),
m_evaluating (false) {
connect (parent, SIGNAL (started (KIO::Job *)), this, SLOT (started ()));
connect (tqparent, TQT_SIGNAL (started (KIO::Job *)), this, TQT_SLOT (started ()));
}
KDE_NO_CDTOR_EXPORT KMPlayerLiveConnectExtension::~KMPlayerLiveConnectExtension() {
@ -867,7 +867,7 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::started () {
KDE_NO_EXPORT void KMPlayerLiveConnectExtension::finished () {
if (m_started && m_enablefinish) {
KParts::LiveConnectExtension::ArgList args;
args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, QString("if (window.onFinished) onFinished();")));
args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, TQString("if (window.onFinished) onFinished();")));
emit partEvent (0, "eval", args);
m_started = true;
m_enablefinish = false;
@ -875,14 +875,14 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::finished () {
}
KDE_NO_EXPORT void KMPlayerLiveConnectExtension::evaluate (
const QString & scr, QString & result) {
QString script (scr);
const TQString & scr, TQString & result) {
TQString script (scr);
KParts::LiveConnectExtension::ArgList args;
script = script.replace ('\\', "\\\\");
script = script.replace ('\n', "\\n");
script = script.replace ('\r', "");
script = script.replace ('"', "\\\"");
script = QString ("this.__kmplayer__res=eval(\"%1\")").arg (script);
script = script.tqreplace ('\\', "\\\\");
script = script.tqreplace ('\n', "\\n");
script = script.tqreplace ('\r', "");
script = script.tqreplace ('"', "\\\"");
script = TQString ("this.__kmplayer__res=eval(\"%1\")").arg (script);
args.push_back(qMakePair(KParts::LiveConnectExtension::TypeString, script));
script_result = "undefined";
@ -893,9 +893,9 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::evaluate (
}
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get
(const unsigned long id, const QString & name,
(const unsigned long id, const TQString & name,
KParts::LiveConnectExtension::Type & type,
unsigned long & rid, QString & rval)
unsigned long & rid, TQString & rval)
{
if (name.startsWith ("__kmplayer__obj_")) {
if (m_evaluating)
@ -919,11 +919,11 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get
break;
case prop_volume:
if (player->view ())
rval = QString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value());
rval = TQString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value());
break;
case prop_error:
type = KParts::LiveConnectExtension::TypeNumber;
rval = QString::number (0);
rval = TQString::number (0);
break;
default:
lastJSCommandEntry = entry;
@ -933,7 +933,7 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::get
}
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::put
(const unsigned long, const QString & name, const QString & val) {
(const unsigned long, const TQString & name, const TQString & val) {
if (name == "__kmplayer__res") {
script_result = val;
return true;
@ -964,9 +964,9 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::put
}
KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call
(const unsigned long id, const QString & name,
const QStringList & args, KParts::LiveConnectExtension::Type & type,
unsigned long & rid, QString & rval) {
(const unsigned long id, const TQString & name,
const TQStringList & args, KParts::LiveConnectExtension::Type & type,
unsigned long & rid, TQString & rval) {
const JSCommandEntry * entry = lastJSCommandEntry;
const char * str = name.ascii ();
if (!entry || strcmp (entry->name, str))
@ -1017,8 +1017,8 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call
break;
case showcontrolpanel:
if (args.size () &&
(args.first () == QString::fromLatin1 ("0") ||
args.first () == QString::fromLatin1 ("false")))
(args.first () == TQString::tqfromLatin1 ("0") ||
args.first () == TQString::tqfromLatin1 ("false")))
static_cast <KMPlayer::View*> (player->view ())->setControlPanelMode (KMPlayer::View::CP_Hide);
else
static_cast <KMPlayer::View*> (player->view ())->setControlPanelMode (KMPlayer::View::CP_Show);
@ -1073,7 +1073,7 @@ KDE_NO_EXPORT bool KMPlayerLiveConnectExtension::call
break;
case volume:
if (player->view ())
rval = QString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value());
rval = TQString::number (player->process()->viewer ()->view()->controlPanel()->volumeBar()->value());
break;
default:
return false;
@ -1088,7 +1088,7 @@ KDE_NO_EXPORT void KMPlayerLiveConnectExtension::setSize (int w, int h) {
KMPlayer::View * view = static_cast <KMPlayer::View*> (player->view ());
if (view->controlPanelMode () == KMPlayer::View::CP_Show)
h += view->controlPanel()->height();
QString jscode;
TQString jscode;
jscode.sprintf("try { eval(\"this.setAttribute('WIDTH',%d);this.setAttribute('HEIGHT',%d)\"); } catch(e){}", w, h);
KParts::LiveConnectExtension::ArgList args;
args.push_back (qMakePair (KParts::LiveConnectExtension::TypeString, jscode));
@ -1115,7 +1115,7 @@ KDE_NO_EXPORT bool KMPlayerHRefSource::hasLength () {
return false;
}
KDE_NO_EXPORT bool KMPlayerHRefSource::processOutput (const QString & /*str*/) {
KDE_NO_EXPORT bool KMPlayerHRefSource::processOutput (const TQString & /*str*/) {
//return Source::processOutput (str);
return true;
}
@ -1131,7 +1131,7 @@ KDE_NO_EXPORT void KMPlayerHRefSource::setURL (const KURL & url) {
KDE_NO_EXPORT void KMPlayerHRefSource::play () {
kdDebug () << "KMPlayerHRefSource::play " << m_url.url() << endl;
Source * src = m_player->sources () ["urlsource"];
QString target = src->document ()->document ()->
TQString target = src->document ()->document ()->
getAttribute (StringPool::attr_target);
if (!target.isEmpty ()) {
KMPlayer::Mrl * mrl = src->document ()->mrl ();
@ -1143,17 +1143,17 @@ KDE_NO_EXPORT void KMPlayerHRefSource::play () {
KDE_NO_EXPORT void KMPlayerHRefSource::activate () {
m_player->stop ();
if (m_finished) {
QTimer::singleShot (0, this, SLOT (finished ()));
TQTimer::singleShot (0, this, TQT_SLOT (finished ()));
return;
}
init ();
m_player->setProcess ("mplayer");
if (m_player->process ()->grabPicture (m_url, 0))
connect (m_player->process (), SIGNAL (grabReady (const QString &)),
this, SLOT (grabReady (const QString &)));
connect (m_player->process (), TQT_SIGNAL (grabReady (const TQString &)),
this, TQT_SLOT (grabReady (const TQString &)));
else {
setURL (KURL ());
QTimer::singleShot (0, this, SLOT (play ()));
TQTimer::singleShot (0, this, TQT_SLOT (play ()));
}
}
@ -1161,7 +1161,7 @@ KDE_NO_EXPORT void KMPlayerHRefSource::clear () {
setURL (KURL ());
}
KDE_NO_EXPORT void KMPlayerHRefSource::grabReady (const QString & path) {
KDE_NO_EXPORT void KMPlayerHRefSource::grabReady (const TQString & path) {
kdDebug () << "KMPlayerHRefSource::grabReady(" << path << ")" << endl;
m_finished = true;
m_grabfile = path;
@ -1174,23 +1174,23 @@ KDE_NO_EXPORT void KMPlayerHRefSource::finished () {
if (!view) return;
if (!view->setPicture (m_grabfile)) {
clear ();
QTimer::singleShot (0, this, SLOT (play ()));
TQTimer::singleShot (0, this, TQT_SLOT (play ()));
return;
}
if (view->viewer ())
connect (view, SIGNAL (pictureClicked ()), this, SLOT (play ()));
connect (view, TQT_SIGNAL (pictureClicked ()), this, TQT_SLOT (play ()));
}
KDE_NO_EXPORT void KMPlayerHRefSource::deactivate () {
kdDebug () << "KMPlayerHRefSource::deactivate()" << endl;
KMPlayer::View * view = static_cast <KMPlayer::View*> (m_player->view ());
if (!view) return;
view->setPicture (QString ());
view->setPicture (TQString ());
if (view->viewer ())
disconnect (view, SIGNAL (pictureClicked ()), this, SLOT (play ()));
disconnect (view, TQT_SIGNAL (pictureClicked ()), this, TQT_SLOT (play ()));
}
KDE_NO_EXPORT QString KMPlayerHRefSource::prettyName () {
KDE_NO_EXPORT TQString KMPlayerHRefSource::prettyName () {
return i18n ("WEB");
}

@ -34,25 +34,26 @@ class JSCommandEntry;
*/
class KMPLAYER_NO_EXPORT KMPlayerHRefSource : public KMPlayer::Source {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerHRefSource (KMPlayer::PartBase * player);
virtual ~KMPlayerHRefSource ();
virtual bool processOutput (const QString & line);
virtual bool processOutput (const TQString & line);
virtual bool hasLength ();
void setURL (const KURL &);
void clear ();
virtual QString prettyName ();
virtual TQString prettyName ();
public slots:
virtual void init ();
virtual void activate ();
virtual void deactivate ();
void finished ();
private slots:
void grabReady (const QString & path);
void grabReady (const TQString & path);
void play ();
private:
QString m_grabfile;
TQString m_grabfile;
bool m_finished;
};
@ -62,17 +63,18 @@ private:
*/
class KMPLAYER_NO_EXPORT KMPlayerBrowserExtension : public KParts::BrowserExtension {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerBrowserExtension(KMPlayerPart *parent);
KMPlayerBrowserExtension(KMPlayerPart *tqparent);
KDE_NO_CDTOR_EXPORT ~KMPlayerBrowserExtension () {}
void urlChanged (const QString & url);
void urlChanged (const TQString & url);
void setLoadingProgress (int percentage);
void saveState (QDataStream & stream);
void restoreState (QDataStream & stream);
void requestOpenURL (const KURL & url, const QString & target, const QString & service);
void saveState (TQDataStream & stream);
void restoreState (TQDataStream & stream);
void requestOpenURL (const KURL & url, const TQString & target, const TQString & service);
public slots:
void slotRequestOpenURL (const KURL & url, const QString & target);
void slotRequestOpenURL (const KURL & url, const TQString & target);
};
/*
@ -80,34 +82,35 @@ public slots:
*/
class KMPLAYER_NO_EXPORT KMPlayerLiveConnectExtension : public KParts::LiveConnectExtension {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerLiveConnectExtension (KMPlayerPart * parent);
KMPlayerLiveConnectExtension (KMPlayerPart * tqparent);
~KMPlayerLiveConnectExtension ();
// LiveConnect interface
bool get (const unsigned long, const QString &,
KParts::LiveConnectExtension::Type &, unsigned long &, QString &);
bool put (const unsigned long, const QString &, const QString &);
bool call (const unsigned long, const QString &,
const QStringList &, KParts::LiveConnectExtension::Type &,
unsigned long &, QString &);
bool get (const unsigned long, const TQString &,
KParts::LiveConnectExtension::Type &, unsigned long &, TQString &);
bool put (const unsigned long, const TQString &, const TQString &);
bool call (const unsigned long, const TQString &,
const TQStringList &, KParts::LiveConnectExtension::Type &,
unsigned long &, TQString &);
void unregister (const unsigned long);
void sendEvent(const unsigned long objid, const QString & event, const KParts::LiveConnectExtension::ArgList & args ) {
void sendEvent(const unsigned long objid, const TQString & event, const KParts::LiveConnectExtension::ArgList & args ) {
emit partEvent(objid, event, args);
}
void enableFinishEvent (bool b = true) { m_enablefinish = b; }
signals:
void partEvent (const unsigned long, const QString &,
void partEvent (const unsigned long, const TQString &,
const KParts::LiveConnectExtension::ArgList &);
public slots:
void setSize (int w, int h);
void started ();
void finished ();
void evaluate (const QString & script, QString & result);
void evaluate (const TQString & script, TQString & result);
private:
KMPlayerPart * player;
QString script_result;
TQString script_result;
const JSCommandEntry * lastJSCommandEntry;
bool m_started;
bool m_enablefinish;
@ -120,6 +123,7 @@ private:
*/
class KMPLAYER_NO_EXPORT KMPlayerPart : public KMPlayer::PartBase {
Q_OBJECT
TQ_OBJECT
friend struct GroupPredicate;
public:
enum Features {
@ -129,8 +133,8 @@ public:
Feat_InfoPanel = 0x10, Feat_VolumeSlider = 0x20, Feat_PlayList = 0x40,
Feat_ImageWindow = 0x80, Feat_All = 0xff
};
KMPlayerPart (QWidget * wparent, const char * wname,
QObject * parent, const char * name, const QStringList &args);
KMPlayerPart (TQWidget * wtqparent, const char * wname,
TQObject * tqparent, const char * name, const TQStringList &args);
~KMPlayerPart ();
KDE_NO_EXPORT KMPlayerBrowserExtension * browserextension() const
@ -151,7 +155,7 @@ public slots:
protected slots:
virtual void playingStarted ();
virtual void playingStopped ();
void viewerPartDestroyed (QObject *);
void viewerPartDestroyed (TQObject *);
void viewerPartProcessChanged (const char *);
void viewerPartSourceChanged (KMPlayer::Source *, KMPlayer::Source *);
void waitForImageWindowTimeOut ();
@ -161,10 +165,10 @@ private:
KMPlayerPart * m_master;
KMPlayerBrowserExtension * m_browserextension;
KMPlayerLiveConnectExtension * m_liveconnectextension;
QString m_group;
TQString m_group;
KURL m_docbase;
QString m_src_url;
QString m_file_name;
TQString m_src_url;
TQString m_file_name;
int m_features;
int last_time_left;
bool m_started_emited : 1;

@ -18,9 +18,9 @@
#include <config.h>
#include <qcolor.h>
#include <qimage.h>
#include <qtimer.h>
#include <tqcolor.h>
#include <tqimage.h>
#include <tqtimer.h>
#include <kdebug.h>
@ -162,7 +162,7 @@ KDE_NO_EXPORT Surface *RP::Imfl::surface () {
return rp_surface.ptr ();
}
KDE_NO_EXPORT NodePtr RP::Imfl::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr RP::Imfl::childFromTag (const TQString & tag) {
const char * ctag = tag.latin1 ();
if (!strcmp (ctag, "head"))
return new DarkNode (m_doc, "head", RP::id_node_head);
@ -183,11 +183,11 @@ KDE_NO_EXPORT NodePtr RP::Imfl::childFromTag (const QString & tag) {
return 0L;
}
KDE_NO_EXPORT void RP::Imfl::repaint () {
KDE_NO_EXPORT void RP::Imfl::tqrepaint () {
if (!active ())
kdWarning () << "Spurious Imfl repaint" << endl;
kdWarning () << "Spurious Imfl tqrepaint" << endl;
else if (surface () && width > 0 && height > 0)
rp_surface->repaint (SRect (0, 0, width, height));
rp_surface->tqrepaint (SRect (0, 0, width, height));
}
KDE_NO_CDTOR_EXPORT RP::Image::Image (NodePtr & doc)
@ -219,7 +219,7 @@ KDE_NO_EXPORT void RP::Image::begin () {
}
KDE_NO_EXPORT void RP::Image::deactivate () {
cached_img.setUrl (QString ());
cached_img.setUrl (TQString ());
if (img_surface) {
img_surface->remove ();
img_surface = NULL;
@ -229,10 +229,10 @@ KDE_NO_EXPORT void RP::Image::deactivate () {
}
KDE_NO_EXPORT void RP::Image::remoteReady (QByteArray & data) {
KDE_NO_EXPORT void RP::Image::remoteReady (TQByteArray & data) {
kdDebug () << "RP::Image::remoteReady" << endl;
if (!data.isEmpty () && cached_img.isEmpty ()) {
QImage * img = new QImage (data);
TQImage * img = new TQImage (data);
if (!img->isNull ()) {
cached_img.data->image = img;
width = img->width ();
@ -252,7 +252,7 @@ KDE_NO_EXPORT bool RP::Image::isReady (bool postpone_if_not) {
KDE_NO_EXPORT Surface *RP::Image::surface () {
if (!img_surface && !cached_img.isEmpty ()) {
Node * p = parentNode ().ptr ();
Node * p = tqparentNode ().ptr ();
if (p && p->id == RP::id_node_imfl) {
Surface *ps = static_cast <RP::Imfl *> (p)->surface ();
if (ps)
@ -272,7 +272,7 @@ KDE_NO_EXPORT void RP::TimingsBase::activate () {
srcx = srcy = srcw = srch = 0;
for (Attribute * a= attributes ()->first ().ptr (); a; a = a->nextSibling ().ptr ()) {
if (a->name () == StringPool::attr_target) {
for (NodePtr n = parentNode()->firstChild(); n; n= n->nextSibling())
for (NodePtr n = tqparentNode()->firstChild(); n; n= n->nextSibling())
if (convertNode <Element> (n)->
getAttribute ("handle") == a->value ())
target = n;
@ -351,9 +351,9 @@ KDE_NO_EXPORT void RP::TimingsBase::begin () {
KDE_NO_EXPORT void RP::TimingsBase::update (int percentage) {
progress = percentage;
Node * p = parentNode ().ptr ();
Node * p = tqparentNode ().ptr ();
if (p->id == RP::id_node_imfl)
static_cast <RP::Imfl *> (p)->repaint ();
static_cast <RP::Imfl *> (p)->tqrepaint ();
}
KDE_NO_EXPORT void RP::TimingsBase::finish () {
@ -416,7 +416,7 @@ KDE_NO_EXPORT void RP::Fadein::accept (Visitor * v) {
}
KDE_NO_EXPORT void RP::Fadeout::activate () {
to_color = QColor (getAttribute ("color")).rgb ();
to_color = TQColor (getAttribute ("color")).rgb ();
TimingsBase::activate ();
}
@ -430,7 +430,7 @@ KDE_NO_EXPORT void RP::Fadeout::accept (Visitor * v) {
}
KDE_NO_EXPORT void RP::Fill::activate () {
color = QColor (getAttribute ("color")).rgb ();
color = TQColor (getAttribute ("color")).rgb ();
TimingsBase::activate ();
}
@ -445,13 +445,13 @@ KDE_NO_EXPORT void RP::Fill::accept (Visitor * v) {
KDE_NO_EXPORT void RP::Wipe::activate () {
//TODO implement 'type="push"'
QString dir = getAttribute ("direction").lower ();
TQString dir = getAttribute ("direction").lower ();
direction = dir_right;
if (dir == QString::fromLatin1 ("left"))
if (dir == TQString::tqfromLatin1 ("left"))
direction = dir_left;
else if (dir == QString::fromLatin1 ("up"))
else if (dir == TQString::tqfromLatin1 ("up"))
direction = dir_up;
else if (dir == QString::fromLatin1 ("down"))
else if (dir == TQString::tqfromLatin1 ("down"))
direction = dir_down;
TimingsBase::activate ();
}
@ -479,14 +479,14 @@ KDE_NO_EXPORT void RP::ViewChange::activate () {
KDE_NO_EXPORT void RP::ViewChange::begin () {
kdDebug () << "RP::ViewChange::begin" << endl;
setState (state_began);
Node * p = parentNode ().ptr ();
Node * p = tqparentNode ().ptr ();
if (p->id == RP::id_node_imfl)
static_cast <RP::Imfl *> (p)->needs_scene_img++;
update (0);
}
KDE_NO_EXPORT void RP::ViewChange::finish () {
Node * p = parentNode ().ptr ();
Node * p = tqparentNode ().ptr ();
if (p && p->id == RP::id_node_imfl)
static_cast <RP::Imfl *> (p)->needs_scene_img--;
TimingsBase::finish ();

@ -21,8 +21,8 @@
#ifndef _KMPLAYER_RP_H_
#define _KMPLAYER_RP_H_
#include <qobject.h>
#include <qstring.h>
#include <tqobject.h>
#include <tqstring.h>
#include "kmplayerplaylist.h"
#include "kmplayer_smil.h"
@ -54,7 +54,7 @@ public:
Imfl (NodePtr & d);
~Imfl ();
KDE_NO_EXPORT virtual const char * nodeName () const { return "imfl"; }
virtual NodePtr childFromTag (const QString & tag);
virtual NodePtr childFromTag (const TQString & tag);
virtual void closed ();
virtual void defer (); // start loading the images if not yet done
virtual void activate (); // start timings, handle paint events
@ -66,8 +66,8 @@ public:
virtual bool handleEvent (EventPtr event);
virtual void accept (Visitor *);
Surface *surface ();
void repaint (); // called whenever something changes on image
Fit fit; // how to layout images
void tqrepaint (); // called whenever something changes on image
Fit fit; // how to tqlayout images
unsigned int duration; // cached attributes of head
TimerInfoPtrW duration_timer;
SurfacePtrW rp_surface;
@ -182,7 +182,7 @@ public:
CachedImage cached_img;
bool expose () const { return false; }
protected:
virtual void remoteReady (QByteArray & data);
virtual void remoteReady (TQByteArray & data);
};
} // RP namespace

@ -22,13 +22,13 @@
using namespace KMPlayer;
KDE_NO_EXPORT NodePtr RSS::Rss::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr RSS::Rss::childFromTag (const TQString & tag) {
if (!strcmp (tag.latin1 (), "channel"))
return new RSS::Channel (m_doc);
return 0L;
}
KDE_NO_EXPORT NodePtr RSS::Channel::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr RSS::Channel::childFromTag (const TQString & tag) {
const char *ctag = tag.ascii ();
if (!strcmp (ctag, "item"))
return new RSS::Item (m_doc);
@ -50,7 +50,7 @@ KDE_NO_EXPORT bool RSS::Channel::expose () const {
previousSibling () || nextSibling ();
}
KDE_NO_EXPORT NodePtr RSS::Item::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr RSS::Item::childFromTag (const TQString & tag) {
const char *ctag = tag.ascii ();
if (!strcmp (ctag, "enclosure"))
return new RSS::Enclosure (m_doc);
@ -92,7 +92,7 @@ KDE_NO_EXPORT void RSS::Item::activate () {
if (n) {
for (NodePtr c = firstChild (); c; c = c->nextSibling ())
if (c->id == id_node_description) {
QString s = c->innerText ();
TQString s = c->innerText ();
n->setInfoMessage (s);
if (!enclosure && !s.isEmpty ()) {
setState (state_activated);
@ -113,7 +113,7 @@ KDE_NO_EXPORT void RSS::Item::deactivate () {
}
PlayListNotify * n = document()->notify_listener;
if (n)
n->setInfoMessage (QString ());
n->setInfoMessage (TQString ());
Mrl::deactivate ();
}

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_RSS_H_
#define _KMPLAYER_RSS_H_
#include <qstring.h>
#include <tqstring.h>
#include "kmplayerplaylist.h"
@ -42,7 +42,7 @@ const short id_node_enclosure = 205;
class KMPLAYER_NO_EXPORT Rss : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Rss (NodePtr & d) : Mrl (d, id_node_rss) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "rss"; }
bool expose () const { return false; }
};
@ -50,7 +50,7 @@ public:
class KMPLAYER_NO_EXPORT Channel : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Channel (NodePtr & d) : Mrl (d, id_node_channel) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "channel"; }
PlayType playType () { return play_type_none; }
void closed ();
@ -60,7 +60,7 @@ public:
class KMPLAYER_NO_EXPORT Item : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Item (NodePtr & d) : Mrl (d, id_node_item) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "item"; }
PlayType playType () { return cached_play_type; }
Mrl * linkNode ();

File diff suppressed because it is too large Load Diff

@ -22,15 +22,15 @@
#define _KMPLAYER_SMILL_H_
#include <config.h>
#include <qobject.h>
#include <qstring.h>
#include <qstringlist.h>
#include <tqobject.h>
#include <tqstring.h>
#include <tqstringlist.h>
#include "kmplayerplaylist.h"
class QTextStream;
class QImage;
class QPainter;
class TQTextStream;
class TQImage;
class TQPainter;
namespace KIO {
class Job;
@ -41,18 +41,18 @@ struct TransTypeInfo;
namespace KMPlayer {
struct KMPLAYER_NO_EXPORT ImageData {
ImageData( const QString & img);
ImageData( const TQString & img);
~ImageData();
QImage *image;
TQImage *image;
private:
QString url;
TQString url;
};
typedef SharedPtr <ImageData> ImageDataPtr;
typedef WeakPtr <ImageData> ImageDataPtrW;
struct KMPLAYER_NO_EXPORT CachedImage {
void setUrl (const QString & url);
void setUrl (const TQString & url);
bool isEmpty ();
ImageDataPtr data;
};
@ -61,7 +61,7 @@ class TextRuntimePrivate;
/*
* Event signaled before the actual starting takes place. Use by SMIL::Excl
* to stop possible other children
* to stop possible other tqchildren
*/
class ToBeStartedEvent : public Event {
public:
@ -75,9 +75,9 @@ public:
class KMPLAYER_NO_EXPORT SizeType {
public:
SizeType ();
SizeType (const QString & s);
SizeType (const TQString & s);
void reset ();
SizeType & operator = (const QString & s);
SizeType & operator = (const TQString & s);
SizeType & operator += (const SizeType & s);
SizeType & operator -= (const SizeType & s);
SizeType & operator /= (const int i)
@ -106,8 +106,8 @@ public:
bool applyRegPoints (Node *, Single w, Single h,
Single & xoff, Single & yoff, Single & w1, Single & h1);
SizeType left, top, width, height, right, bottom;
QString reg_point, reg_align;
bool setSizeParam (const TrieString &name, const QString &value, bool &dim);
TQString reg_point, reg_align;
bool setSizeParam (const TrieString &name, const TQString &value, bool &dim);
void move (const SizeType &x, const SizeType &y);
};
@ -136,7 +136,7 @@ public:
* Reset all data, called from end() and init()
*/
virtual void reset ();
virtual bool parseParam (const TrieString & name, const QString & value);
virtual bool parseParam (const TrieString & name, const TQString & value);
TimingState state () const { return timingstate; }
void propagateStop (bool forced);
void propagateStart ();
@ -156,7 +156,7 @@ public:
KDE_NO_EXPORT DurationItem & durTime () { return durations[duration_time]; }
KDE_NO_EXPORT DurationItem & endTime () { return durations [end_time]; }
private:
void setDurationItem (DurationTime item, const QString & val);
void setDurationItem (DurationTime item, const TQString & val);
public:
TimingState timingstate;
protected:
@ -190,32 +190,33 @@ class KMPLAYER_NO_EXPORT AudioVideoData : public MediaTypeRuntime {
public:
AudioVideoData (NodePtr e);
virtual bool isAudioVideo ();
virtual bool parseParam (const TrieString & name, const QString & value);
virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void started ();
virtual void postpone (bool b);
virtual void clipStart ();
virtual void clipStop ();
};
class KMPLAYER_NO_EXPORT ImageRuntime : public QObject,public MediaTypeRuntime {
class KMPLAYER_NO_EXPORT ImageRuntime : public TQObject,public MediaTypeRuntime {
Q_OBJECT
TQ_OBJECT
public:
ImageRuntime (NodePtr e);
~ImageRuntime ();
virtual bool parseParam (const TrieString & name, const QString & value);
virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void postpone (bool b);
virtual void clipStart ();
virtual void clipStop ();
QMovie * img_movie;
TQMovie * img_movie;
CachedImage cached_img;
int frame_nr;
protected:
virtual void started ();
virtual void remoteReady (QByteArray &);
virtual void remoteReady (TQByteArray &);
private slots:
void movieUpdated (const QRect &);
void movieStatus (int);
void movieResize (const QSize &);
void movieUpdated (const TQRect &);
void movietqStatus (int);
void movieResize (const TQSize &);
};
/**
@ -226,17 +227,17 @@ public:
TextRuntime (NodePtr e);
~TextRuntime ();
void reset ();
virtual bool parseParam (const TrieString & name, const QString & value);
virtual bool parseParam (const TrieString & name, const TQString & value);
int font_size;
unsigned int font_color;
unsigned int background_color;
int bg_opacity;
enum { align_left, align_center, align_right } halign;
QString text;
TQString text;
TextRuntimePrivate * d;
protected:
virtual void started ();
virtual void remoteReady (QByteArray &);
virtual void remoteReady (TQByteArray &);
};
/**
@ -245,14 +246,14 @@ protected:
class KMPLAYER_NO_EXPORT AnimateGroupData : public Runtime {
public:
KDE_NO_CDTOR_EXPORT ~AnimateGroupData () {}
virtual bool parseParam (const TrieString & name, const QString & value);
virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void reset ();
protected:
void restoreModification ();
AnimateGroupData (NodePtr e);
NodePtrW target_element;
TrieString changed_attribute;
QString change_to;
TQString change_to;
int modification_id;
protected:
virtual void stopped ();
@ -276,7 +277,7 @@ class KMPLAYER_NO_EXPORT AnimateData : public AnimateGroupData {
public:
AnimateData (NodePtr e);
KDE_NO_CDTOR_EXPORT ~AnimateData () {}
virtual bool parseParam (const TrieString & name, const QString & value);
virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void reset ();
virtual void started ();
virtual void stopped ();
@ -285,14 +286,14 @@ private:
void applyStep ();
TimerInfoPtrW anim_timer;
enum { acc_none, acc_sum } accumulate;
enum { add_replace, add_sum } additive;
enum { add_tqreplace, add_sum } additive;
int change_by;
enum { calc_discrete, calc_linear, calc_paced, calc_spline } calcMode;
QString change_from;
QStringList change_values;
TQString change_from;
TQStringList change_values;
int steps;
float change_delta, change_to_val, change_from_val;
QString change_from_unit;
TQString change_from_unit;
};
/**
@ -302,7 +303,7 @@ class KMPLAYER_NO_EXPORT AnimateMotionData : public AnimateGroupData {
public:
AnimateMotionData (NodePtr e);
~AnimateMotionData ();
virtual bool parseParam (const TrieString & name, const QString & value);
virtual bool parseParam (const TrieString & name, const TQString & value);
virtual void reset ();
virtual void started ();
virtual void stopped ();
@ -311,17 +312,17 @@ private:
bool checkTarget (Node *n);
bool setInterval ();
void applyStep ();
bool getCoordinates (const QString &coord, SizeType &x, SizeType &y);
bool getCoordinates (const TQString &coord, SizeType &x, SizeType &y);
TimerInfoPtrW anim_timer;
enum { acc_none, acc_sum } accumulate;
enum { add_replace, add_sum } additive;
enum { add_tqreplace, add_sum } additive;
enum { calc_discrete, calc_linear, calc_paced, calc_spline } calcMode;
QString change_from;
QString change_by;
QStringList values;
TQString change_from;
TQString change_by;
TQStringList values;
float *keytimes;
int keytime_count;
QStringList splines;
TQStringList splines;
float control_point[4];
unsigned int steps;
unsigned int cur_step;
@ -347,7 +348,7 @@ public:
/**
* Translates string to deci-seconds or 'special' high number
*/
bool parseTime (const QString & val, int & dur /*,const QString & dateformat*/);
bool parseTime (const TQString & val, int & dur /*,const TQString & dateformat*/);
//-----------------------------------------------------------------------------
@ -392,7 +393,7 @@ const short id_node_last = 200; // reserve 100 ids
class Smil : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Smil (NodePtr & d) : Mrl (d, id_node_smil) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "smil"; }
PlayType playType () { return play_type_video; }
void activate ();
@ -402,7 +403,7 @@ public:
bool expose () const;
bool handleEvent (EventPtr event);
void accept (Visitor *);
void jump (const QString & id);
void jump (const TQString & id);
static Smil * findSmilNode (Node * node);
/**
* Hack to mark the currently playing MediaType as finished
@ -410,7 +411,7 @@ public:
*/
Mrl * linkNode ();
NodePtrW current_av_media_type;
NodePtrW layout_node;
NodePtrW tqlayout_node;
};
/**
@ -420,7 +421,7 @@ public:
class KMPLAYER_NO_EXPORT Head : public Element {
public:
KDE_NO_CDTOR_EXPORT Head (NodePtr & d) : Element (d, id_node_head) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "head"; }
void closed ();
void childDone (NodePtr child);
@ -439,19 +440,19 @@ public:
void activate ();
void childDone (NodePtr child);
void deactivate ();
virtual void parseParam (const TrieString & name, const QString & value);
virtual void parseParam (const TrieString & name, const TQString & value);
/**
* repaints region, calls scheduleRepaint(x,y,w,h) on view
* tqrepaints region, calls scheduleRepaint(x,y,w,h) on view
*/
void repaint ();
void repaint (const SRect & rect);
void tqrepaint ();
void tqrepaint (const SRect & rect);
/**
* calculate the relative x,y,w,h on the child region elements
* given this element's w and h value
* and child's left/top/right/width/height/bottom attributes
*/
virtual void updateDimensions ();
void boundsUpdate (); // recalculates and repaint old and new bounds
void boundsUpdate (); // recalculates and tqrepaint old and new bounds
virtual Surface *surface ();
SurfacePtrW region_surface;
@ -461,22 +462,22 @@ public:
Single x, y, w, h; // unscaled values
int z_order;
unsigned int background_color;
QString background_image;
TQString background_image;
ShowBackground show_background;
protected:
RegionBase (NodePtr & d, short id);
PostponePtr postpone_lock; // pause while loading bg image
virtual void remoteReady (QByteArray &); // image downloaded
virtual void remoteReady (TQByteArray &); // image downloaded
};
/**
* Defines region layout, should reside below 'head' element
* Defines region tqlayout, should reside below 'head' element
*/
class KMPLAYER_NO_EXPORT Layout : public RegionBase {
public:
Layout (NodePtr & d);
NodePtr childFromTag (const QString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "layout"; }
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "tqlayout"; }
void activate ();
void closed ();
virtual void accept (Visitor *);
@ -496,7 +497,7 @@ class KMPLAYER_NO_EXPORT Region : public RegionBase {
public:
Region (NodePtr & d);
KDE_NO_EXPORT const char * nodeName () const { return "region"; }
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
void calculateBounds (Single w, Single h);
virtual NodeRefListPtr listeners (unsigned int event_id);
virtual void accept (Visitor *);
@ -516,11 +517,11 @@ class KMPLAYER_NO_EXPORT RootLayout : public RegionBase {
public:
KDE_NO_CDTOR_EXPORT RootLayout (NodePtr & d)
: RegionBase (d, id_node_root_layout) {}
KDE_NO_EXPORT const char * nodeName () const { return "root-layout"; }
KDE_NO_EXPORT const char * nodeName () const { return "root-tqlayout"; }
};
/**
* Represents a regPoint element for alignment inside regions
* Represents a regPoint element for tqalignment inside regions
*/
class KMPLAYER_NO_EXPORT RegPoint : public Element {
public:
@ -528,7 +529,7 @@ public:
KDE_NO_CDTOR_EXPORT ~RegPoint () {}
KDE_NO_EXPORT const char * nodeName () const { return "regPoint"; }
KDE_NO_EXPORT bool expose () const { return false; }
void parseParam (const TrieString & name, const QString & value);
void parseParam (const TrieString & name, const TQString & value);
CalculatedSizer sizes;
};
@ -570,7 +571,7 @@ public:
void activate ();
KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); }
KDE_NO_EXPORT const char * nodeName () const { return "transition"; }
void parseParam (const TrieString & name, const QString & value);
void parseParam (const TrieString & name, const TQString & value);
KDE_NO_EXPORT bool expose () const { return false; }
bool supported ();
TransType type;
@ -605,7 +606,7 @@ public:
virtual NodeRefListPtr listeners (unsigned int event_id);
KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); }
void init ();
virtual void parseParam (const TrieString &, const QString &);
virtual void parseParam (const TrieString &, const TQString &);
Runtime * runtime ();
static Runtime::DurationItem * getDuration (NodePtr n);
static bool isTimedMrl (const Node *n);
@ -644,7 +645,7 @@ KDE_NO_EXPORT inline bool TimedMrl::isTimedMrl (const Node *n) {
class KMPLAYER_NO_EXPORT GroupBase : public TimedMrl {
public:
KDE_NO_CDTOR_EXPORT ~GroupBase () {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
PlayType playType () { return play_type_none; }
void finish ();
void deactivate ();
@ -655,7 +656,7 @@ protected:
};
/**
* A Par represents parallel processing of all its children
* A Par represents parallel processing of all its tqchildren
*/
class KMPLAYER_NO_EXPORT Par : public GroupBase {
public:
@ -667,7 +668,7 @@ public:
};
/**
* A Seq represents sequential processing of all its children
* A Seq represents sequential processing of all its tqchildren
*/
class KMPLAYER_NO_EXPORT Seq : public GroupBase {
public:
@ -690,7 +691,7 @@ public:
};
/**
* An Excl represents exclusive processing of one of its children
* An Excl represents exclusive processing of one of its tqchildren
*/
class KMPLAYER_NO_EXPORT Excl : public GroupBase {
public:
@ -725,11 +726,11 @@ public:
KDE_NO_CDTOR_EXPORT ~LinkingBase () {}
void deactivate ();
KDE_NO_EXPORT bool expose () const { return false; }
void parseParam (const TrieString & name, const QString & value);
void parseParam (const TrieString & name, const TQString & value);
ConnectionPtr mediatype_activated;
ConnectionPtr mediatype_attach;
QString href;
enum { show_new, show_replace } show;
TQString href;
enum { show_new, show_tqreplace } show;
protected:
LinkingBase (NodePtr & d, short id);
};
@ -741,22 +742,22 @@ public:
void activate ();
void childDone (NodePtr child);
KDE_NO_EXPORT const char * nodeName () const { return "a"; }
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); }
};
class KMPLAYER_NO_EXPORT Area : public LinkingBase {
public:
Area (NodePtr & d, const QString & tag);
Area (NodePtr & d, const TQString & tag);
~Area ();
void activate ();
KDE_NO_EXPORT const char * nodeName () const { return tag.ascii (); }
KDE_NO_EXPORT void accept (Visitor * v) { v->visit (this); }
void parseParam (const TrieString & name, const QString & value);
void parseParam (const TrieString & name, const TQString & value);
NodeRefListPtr listeners (unsigned int event_id);
SizeType * coords;
int nr_coords;
const QString tag;
const TQString tag;
MouseListeners mouse_listeners;
};
@ -765,8 +766,8 @@ public:
*/
class KMPLAYER_NO_EXPORT MediaType : public TimedMrl {
public:
MediaType (NodePtr & d, const QString & t, short id);
NodePtr childFromTag (const QString & tag);
MediaType (NodePtr & d, const TQString & t, short id);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return m_type.latin1 (); }
void closed ();
void activate ();
@ -779,8 +780,8 @@ public:
Surface *surface ();
void resetSurface ();
SRect calculateBounds ();
void boundsUpdate (); // recalculates and repaint old and new bounds
virtual void parseParam (const TrieString & name, const QString & value);
void boundsUpdate (); // recalculates and tqrepaint old and new bounds
virtual void parseParam (const TrieString & name, const TQString & value);
virtual bool handleEvent (EventPtr event);
NodeRefListPtr listeners (unsigned int event_id);
bool needsVideoWidget (); // for 'video' and 'ref' nodes
@ -790,7 +791,7 @@ public:
NodePtrW trans_out;
NodePtrW active_trans;
NodePtrW region_node;
QString m_type;
TQString m_type;
CalculatedSizer sizes;
Fit fit;
int opacity;
@ -813,8 +814,8 @@ protected:
class KMPLAYER_NO_EXPORT AVMediaType : public MediaType {
public:
AVMediaType (NodePtr & d, const QString & t);
NodePtr childFromTag (const QString & tag);
AVMediaType (NodePtr & d, const TQString & t);
NodePtr childFromTag (const TQString & tag);
virtual Runtime * getNewRuntime ();
virtual void defer ();
virtual void undefer ();
@ -827,7 +828,7 @@ class KMPLAYER_NO_EXPORT ImageMediaType : public MediaType {
public:
ImageMediaType (NodePtr & d);
Runtime * getNewRuntime ();
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
PlayType playType () { return play_type_image; }
virtual void accept (Visitor *);
};

@ -25,7 +25,7 @@
using namespace KMPlayer;
KDE_NO_EXPORT NodePtr XSPF::Playlist::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr XSPF::Playlist::childFromTag (const TQString & tag) {
const char * name = tag.latin1 ();
if (!strcasecmp (name, "tracklist"))
return new Tracklist (m_doc);
@ -69,7 +69,7 @@ KDE_NO_EXPORT void XSPF::Playlist::closed () {
//-----------------------------------------------------------------------------
KDE_NO_EXPORT NodePtr XSPF::Tracklist::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr XSPF::Tracklist::childFromTag (const TQString & tag) {
const char * name = tag.latin1 ();
if (!strcasecmp (name, "track"))
return new XSPF::Track (m_doc);
@ -78,7 +78,7 @@ KDE_NO_EXPORT NodePtr XSPF::Tracklist::childFromTag (const QString & tag) {
//-----------------------------------------------------------------------------
KDE_NO_EXPORT NodePtr XSPF::Track::childFromTag (const QString & tag) {
KDE_NO_EXPORT NodePtr XSPF::Track::childFromTag (const TQString & tag) {
const char * name = tag.latin1 ();
if (!strcasecmp (name, "location"))
return new Location (m_doc);

@ -21,7 +21,7 @@
#ifndef _KMPLAYER_XSPF_H_
#define _KMPLAYER_XSPF_H_
#include <qstring.h>
#include <tqstring.h>
#include "kmplayerplaylist.h"
@ -52,7 +52,7 @@ const short id_node_link = 518;
class KMPLAYER_NO_EXPORT Playlist : public Mrl {
public:
KDE_NO_CDTOR_EXPORT Playlist (NodePtr & d) : Mrl (d, id_node_playlist) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "playlist"; }
bool expose () const { return !pretty_name.isEmpty (); }
void closed ();
@ -61,7 +61,7 @@ public:
class KMPLAYER_NO_EXPORT Tracklist : public Element {
public:
KDE_NO_CDTOR_EXPORT Tracklist (NodePtr & d) : Element (d, id_node_tracklist) {}
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "tracklist"; }
bool expose () const { return false; }
};
@ -74,7 +74,7 @@ public:
PlayType playType ();
Mrl * linkNode ();
KDE_NO_EXPORT const char * nodeName () const { return "track"; }
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
NodePtrW location;
};

File diff suppressed because it is too large Load Diff

@ -23,7 +23,7 @@
#include <config.h>
#endif
#include <qframe.h>
#include <tqframe.h>
#include <kurl.h>
@ -33,10 +33,10 @@
class KMPlayerApp;
class KURLRequester;
class QPopupMenu;
class QMenuItem;
class QCheckBox;
class QLineEdit;
class TQPopupMenu;
class TQMenuItem;
class TQCheckBox;
class TQLineEdit;
class TVInput;
class TVChannel;
@ -45,25 +45,27 @@ class TVChannel;
*/
class KMPLAYER_NO_EXPORT KMPlayerMenuSource : public KMPlayer::Source {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerMenuSource (const QString & n, KMPlayerApp * app, QPopupMenu * m, const char * src);
KMPlayerMenuSource (const TQString & n, KMPlayerApp * app, TQPopupMenu * m, const char * src);
virtual ~KMPlayerMenuSource ();
protected:
void menuItemClicked (QPopupMenu * menu, int id);
QPopupMenu * m_menu;
void menuItemClicked (TQPopupMenu * menu, int id);
TQPopupMenu * m_menu;
KMPlayerApp * m_app;
};
/*
* Preference page for DVD
*/
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageDVD : public QFrame {
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageDVD : public TQFrame {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerPrefSourcePageDVD (QWidget * parent);
KMPlayerPrefSourcePageDVD (TQWidget * tqparent);
~KMPlayerPrefSourcePageDVD () {}
QCheckBox * autoPlayDVD;
TQCheckBox * autoPlayDVD;
KURLRequester * dvddevice;
};
@ -72,18 +74,19 @@ public:
*/
class KMPLAYER_NO_EXPORT KMPlayerDVDSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerDVDSource (KMPlayerApp * app, QPopupMenu * m);
KMPlayerDVDSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerDVDSource ();
virtual bool processOutput (const QString & line);
virtual QString filterOptions ();
virtual bool processOutput (const TQString & line);
virtual TQString filterOptions ();
virtual void setIdentified (bool b = true);
virtual QString prettyName ();
virtual TQString prettyName ();
virtual void write (KConfig *);
virtual void read (KConfig *);
virtual void sync (bool);
virtual void prefLocation (QString & item, QString & icon, QString & tab);
virtual QFrame * prefPage (QWidget * parent);
virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual TQFrame * prefPage (TQWidget * tqparent);
public slots:
virtual void activate ();
virtual void deactivate ();
@ -95,10 +98,10 @@ public slots:
private:
void buildArguments ();
void play ();
QPopupMenu * m_dvdtitlemenu;
QPopupMenu * m_dvdchaptermenu;
QPopupMenu * m_dvdlanguagemenu;
QPopupMenu * m_dvdsubtitlemenu;
TQPopupMenu * m_dvdtitlemenu;
TQPopupMenu * m_dvdchaptermenu;
TQPopupMenu * m_dvdlanguagemenu;
TQPopupMenu * m_dvdsubtitlemenu;
KMPlayer::NodePtr disks;
KMPlayerPrefSourcePageDVD * m_configpage;
int m_current_title;
@ -111,10 +114,11 @@ private:
*/
class KMPLAYER_NO_EXPORT KMPlayerDVDNavSource : public KMPlayerMenuSource {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerDVDNavSource (KMPlayerApp * app, QPopupMenu * m);
KMPlayerDVDNavSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerDVDNavSource ();
virtual QString prettyName ();
virtual TQString prettyName ();
public slots:
virtual void activate ();
virtual void deactivate ();
@ -128,13 +132,14 @@ public slots:
/*
* Preference page for VCD
*/
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageVCD : public QFrame {
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageVCD : public TQFrame {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerPrefSourcePageVCD (QWidget * parent);
KMPlayerPrefSourcePageVCD (TQWidget * tqparent);
~KMPlayerPrefSourcePageVCD () {}
KURLRequester * vcddevice;
QCheckBox *autoPlayVCD;
TQCheckBox *autoPlayVCD;
};
@ -143,17 +148,18 @@ public:
*/
class KMPLAYER_NO_EXPORT KMPlayerVCDSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerVCDSource (KMPlayerApp * app, QPopupMenu * m);
KMPlayerVCDSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerVCDSource ();
virtual bool processOutput (const QString & line);
virtual bool processOutput (const TQString & line);
virtual void setIdentified (bool b = true);
virtual QString prettyName ();
virtual TQString prettyName ();
virtual void write (KConfig *);
virtual void read (KConfig *);
virtual void sync (bool);
virtual void prefLocation (QString & item, QString & icon, QString & tab);
virtual QFrame * prefPage (QWidget * parent);
virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual TQFrame * prefPage (TQWidget * tqparent);
public slots:
virtual void activate ();
virtual void deactivate ();
@ -169,12 +175,13 @@ private:
*/
class KMPLAYER_NO_EXPORT KMPlayerAudioCDSource : public KMPlayerMenuSource {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerAudioCDSource (KMPlayerApp * app, QPopupMenu * m);
KMPlayerAudioCDSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerAudioCDSource ();
virtual bool processOutput (const QString & line);
virtual bool processOutput (const TQString & line);
virtual void setIdentified (bool b = true);
virtual QString prettyName ();
virtual TQString prettyName ();
public slots:
virtual void activate ();
virtual void deactivate ();
@ -188,13 +195,14 @@ private:
*/
class KMPLAYER_NO_EXPORT KMPlayerPipeSource : public KMPlayer::Source {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerPipeSource (KMPlayerApp * app);
virtual ~KMPlayerPipeSource ();
virtual bool hasLength ();
virtual bool isSeekable ();
void setCommand (const QString & cmd);
virtual QString prettyName ();
void setCommand (const TQString & cmd);
virtual TQString prettyName ();
public slots:
virtual void activate ();
virtual void deactivate ();

@ -18,20 +18,20 @@
*/
#include <algorithm>
#include <qlayout.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qtable.h>
#include <qstringlist.h>
#include <qcombobox.h>
#include <qlistbox.h>
#include <qlineedit.h>
#include <qwhatsthis.h>
#include <qtabwidget.h>
#include <qcursor.h>
#include <qdir.h>
#include <qfile.h>
#include <qtimer.h>
#include <tqlayout.h>
#include <tqlabel.h>
#include <tqpushbutton.h>
#include <tqtable.h>
#include <tqstringlist.h>
#include <tqcombobox.h>
#include <tqlistbox.h>
#include <tqlineedit.h>
#include <tqwhatsthis.h>
#include <tqtabwidget.h>
#include <tqcursor.h>
#include <tqdir.h>
#include <tqfile.h>
#include <tqtimer.h>
#include <klocale.h>
#include <kdebug.h>
@ -58,17 +58,17 @@ static const char * strFFServerCustomSetting = "Custom Setting";
static const char * strFFServerProfiles = "Profiles";
KDE_NO_CDTOR_EXPORT FFServerSetting::FFServerSetting (int i, const QString & n, const QString & f, const QString & ac, int abr, int asr, const QString & vc, int vbr, int q, int fr, int gs, int w, int h)
KDE_NO_CDTOR_EXPORT FFServerSetting::FFServerSetting (int i, const TQString & n, const TQString & f, const TQString & ac, int abr, int asr, const TQString & vc, int vbr, int q, int fr, int gs, int w, int h)
: index (i), name (n), format (f), audiocodec (ac),
audiobitrate (abr > 0 ? QString::number (abr) : QString ()),
audiosamplerate (asr > 0 ? QString::number (asr) : QString ()),
audiobitrate (abr > 0 ? TQString::number (abr) : TQString ()),
audiosamplerate (asr > 0 ? TQString::number (asr) : TQString ()),
videocodec (vc),
videobitrate (vbr > 0 ? QString::number (vbr) : QString ()),
quality (q > 0 ? QString::number (q) : QString ()),
framerate (fr > 0 ? QString::number (fr) : QString ()),
gopsize (gs > 0 ? QString::number (gs) : QString ()),
width (w > 0 ? QString::number (w) : QString ()),
height (h > 0 ? QString::number (h) : QString ()) {}
videobitrate (vbr > 0 ? TQString::number (vbr) : TQString ()),
quality (q > 0 ? TQString::number (q) : TQString ()),
framerate (fr > 0 ? TQString::number (fr) : TQString ()),
gopsize (gs > 0 ? TQString::number (gs) : TQString ()),
width (w > 0 ? TQString::number (w) : TQString ()),
height (h > 0 ? TQString::number (h) : TQString ()) {}
KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const FFServerSetting & fs) {
format = fs.format;
@ -85,11 +85,11 @@ KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const FFServerSetti
return *this;
}
KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const QStringList & sl) {
KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const TQStringList & sl) {
if (sl.count () < 11) {
return *this;
}
QStringList::const_iterator it = sl.begin ();
TQStringList::const_iterator it = sl.begin ();
format = *it++;
audiocodec = *it++;
audiobitrate = *it++;
@ -102,38 +102,38 @@ KDE_NO_EXPORT FFServerSetting & FFServerSetting::operator = (const QStringList &
width = *it++;
height = *it++;
acl.clear ();
QStringList::const_iterator end( sl.end() );
TQStringList::const_iterator end( sl.end() );
for (; it != end; ++it)
acl.push_back (*it);
return *this;
}
KDE_NO_EXPORT QString & FFServerSetting::ffconfig (QString & buf) {
QString nl ("\n");
buf = QString ("Format ") + format + nl;
KDE_NO_EXPORT TQString & FFServerSetting::ffconfig (TQString & buf) {
TQString nl ("\n");
buf = TQString ("Format ") + format + nl;
if (!audiocodec.isEmpty ())
buf += QString ("AudioCodec ") + audiocodec + nl;
buf += TQString ("AudioCodec ") + audiocodec + nl;
if (!audiobitrate.isEmpty ())
buf += QString ("AudioBitRate ") + audiobitrate + nl;
buf += TQString ("AudioBitRate ") + audiobitrate + nl;
if (!audiosamplerate.isEmpty () > 0)
buf += QString ("AudioSampleRate ") + audiosamplerate + nl;
buf += TQString ("AudioSampleRate ") + audiosamplerate + nl;
if (!videocodec.isEmpty ())
buf += QString ("VideoCodec ") + videocodec + nl;
buf += TQString ("VideoCodec ") + videocodec + nl;
if (!videobitrate.isEmpty ())
buf += QString ("VideoBitRate ") + videobitrate + nl;
buf += TQString ("VideoBitRate ") + videobitrate + nl;
if (!quality.isEmpty ())
buf += QString ("VideoQMin ") + quality + nl;
buf += TQString ("VideoTQMin ") + quality + nl;
if (!framerate.isEmpty ())
buf += QString ("VideoFrameRate ") + framerate + nl;
buf += TQString ("VideoFrameRate ") + framerate + nl;
if (!gopsize.isEmpty ())
buf += QString ("VideoGopSize ") + gopsize + nl;
buf += TQString ("VideoGopSize ") + gopsize + nl;
if (!width.isEmpty () && !height.isEmpty ())
buf += QString ("VideoSize ") + width + QString ("x") + height + nl;
buf += TQString ("VideoSize ") + width + TQString ("x") + height + nl;
return buf;
}
KDE_NO_EXPORT const QStringList FFServerSetting::list () {
QStringList sl;
KDE_NO_EXPORT const TQStringList FFServerSetting::list () {
TQStringList sl;
sl.push_back (format);
sl.push_back (audiocodec);
sl.push_back (audiobitrate);
@ -145,8 +145,8 @@ KDE_NO_EXPORT const QStringList FFServerSetting::list () {
sl.push_back (gopsize);
sl.push_back (width);
sl.push_back (height);
QStringList::const_iterator it = acl.begin ();
QStringList::const_iterator end( acl.end () );
TQStringList::const_iterator it = acl.begin ();
TQStringList::const_iterator end( acl.end () );
for (; it != end; ++it)
sl.push_back (*it);
return sl;
@ -154,134 +154,130 @@ KDE_NO_EXPORT const QStringList FFServerSetting::list () {
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastPage::KMPlayerPrefBroadcastPage (QWidget *parent) : QFrame (parent) {
QVBoxLayout *layout = new QVBoxLayout (this, 5);
QGridLayout *gridlayout = new QGridLayout (layout, 6, 2, 2);
QLabel *label = new QLabel (i18n ("Bind address:"), this);
bindaddress = new QLineEdit ("", this);
QWhatsThis::add (bindaddress, i18n ("If you have multiple network devices, you can limit access"));
gridlayout->addWidget (label, 0, 0);
gridlayout->addWidget (bindaddress, 0, 1);
label = new QLabel (i18n ("Listen port:"), this);
port = new QLineEdit ("", this);
gridlayout->addWidget (label, 1, 0);
gridlayout->addWidget (port, 1, 1);
label = new QLabel (i18n ("Maximum connections:"), this);
maxclients = new QLineEdit ("", this);
gridlayout->addWidget (label, 2, 0);
gridlayout->addWidget (maxclients, 2, 1);
label = new QLabel (i18n ("Maximum bandwidth (kbit):"), this);
maxbandwidth = new QLineEdit ("", this);
gridlayout->addWidget (label, 3, 0);
gridlayout->addWidget (maxbandwidth, 3, 1);
label = new QLabel (i18n ("Temporary feed file:"), this);
feedfile = new QLineEdit ("", this);
gridlayout->addWidget (label, 4, 0);
gridlayout->addWidget (feedfile, 4, 1);
label = new QLabel (i18n ("Feed file size (kB):"), this);
feedfilesize = new QLineEdit ("", this);
gridlayout->addWidget (label, 5, 0);
gridlayout->addWidget (feedfilesize, 5, 1);
layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastPage::KMPlayerPrefBroadcastPage (TQWidget *tqparent) : TQFrame (tqparent) {
TQVBoxLayout *tqlayout = new TQVBoxLayout (this, 5);
TQGridLayout *gridtqlayout = new TQGridLayout (tqlayout, 6, 2, 2);
TQLabel *label = new TQLabel (i18n ("Bind address:"), this);
bindaddress = new TQLineEdit ("", this);
TQWhatsThis::add (bindaddress, i18n ("If you have multiple network devices, you can limit access"));
gridtqlayout->addWidget (label, 0, 0);
gridtqlayout->addWidget (bindaddress, 0, 1);
label = new TQLabel (i18n ("Listen port:"), this);
port = new TQLineEdit ("", this);
gridtqlayout->addWidget (label, 1, 0);
gridtqlayout->addWidget (port, 1, 1);
label = new TQLabel (i18n ("Maximum connections:"), this);
maxclients = new TQLineEdit ("", this);
gridtqlayout->addWidget (label, 2, 0);
gridtqlayout->addWidget (maxclients, 2, 1);
label = new TQLabel (i18n ("Maximum bandwidth (kbit):"), this);
maxbandwidth = new TQLineEdit ("", this);
gridtqlayout->addWidget (label, 3, 0);
gridtqlayout->addWidget (maxbandwidth, 3, 1);
label = new TQLabel (i18n ("Temporary feed file:"), this);
feedfile = new TQLineEdit ("", this);
gridtqlayout->addWidget (label, 4, 0);
gridtqlayout->addWidget (feedfile, 4, 1);
label = new TQLabel (i18n ("Feed file size (kB):"), this);
feedfilesize = new TQLineEdit ("", this);
gridtqlayout->addWidget (label, 5, 0);
gridtqlayout->addWidget (feedfilesize, 5, 1);
tqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
}
//-----------------------------------------------------------------------------
#undef ADDPROPERTY
#define ADDPROPERTY(label,qedit,gridlayout,row,parent) \
qedit = new QLineEdit ("", parent); \
gridlayout->addWidget (new QLabel (qedit, label, parent), row, 0); \
gridlayout->addWidget (qedit, row, 1);
#define ADDPROPERTY(label,qedit,gridtqlayout,row,tqparent) \
qedit = new TQLineEdit ("", tqparent); \
gridtqlayout->addWidget (new TQLabel (qedit, label, tqparent), row, 0); \
gridtqlayout->addWidget (qedit, row, 1);
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastFormatPage::KMPlayerPrefBroadcastFormatPage (QWidget *parent, FFServerSettingList & ffs) : QFrame (parent, "BroadcastPage"), profiles (ffs)
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastFormatPage::KMPlayerPrefBroadcastFormatPage (TQWidget *tqparent, FFServerSettingList & ffs) : TQFrame (tqparent, "BroadcastPage"), profiles (ffs)
{
QHBoxLayout *layout = new QHBoxLayout (this, 5);
QGridLayout *formatlayout = new QGridLayout (11, 2, 2);
formatlayout->setAlignment (Qt::AlignTop);
QVBoxLayout *leftlayout = new QVBoxLayout (15);
QHBoxLayout *ledlayout = new QHBoxLayout (5);
format = new QComboBox (this);
QLabel * label = new QLabel (format, i18n ("Format:"), this);
TQHBoxLayout *tqlayout = new TQHBoxLayout (this, 5);
TQGridLayout *formattqlayout = new TQGridLayout (11, 2, 2);
formattqlayout->tqsetAlignment (TQt::AlignTop);
TQVBoxLayout *lefttqlayout = new TQVBoxLayout (15);
TQHBoxLayout *ledtqlayout = new TQHBoxLayout (5);
format = new TQComboBox (this);
TQLabel * label = new TQLabel (format, i18n ("Format:"), this);
format->clear ();
format->insertItem (QString ("asf"));
format->insertItem (QString ("avi"));
format->insertItem (QString ("mpjpeg"));
format->insertItem (QString ("mpeg"));
format->insertItem (QString ("rm"));
format->insertItem (QString ("swf"));
QWhatsThis::add (format, i18n ("Only avi, mpeg and rm work for mplayer playback"));
formatlayout->addWidget (label, 0, 0);
formatlayout->addWidget (format, 0, 1);
ADDPROPERTY (i18n ("Audio codec:"), audiocodec, formatlayout, 1, this);
ADDPROPERTY (i18n ("Audio bit rate (kbit):"), audiobitrate, formatlayout, 2, this);
ADDPROPERTY (i18n ("Audio sample rate (Hz):"), audiosamplerate, formatlayout, 3, this);
ADDPROPERTY (i18n ("Video codec:"), videocodec, formatlayout, 4, this);
ADDPROPERTY (i18n ("Video bit rate (kbit):"), videobitrate, formatlayout, 5, this);
ADDPROPERTY (i18n ("Quality (1-31):"), quality, formatlayout, 6, this);
ADDPROPERTY (i18n ("Frame rate (Hz):"), framerate, formatlayout, 7, this);
ADDPROPERTY (i18n ("Gop size:"), gopsize, formatlayout, 8, this);
ADDPROPERTY (i18n ("Width (pixels):"), moviewidth, formatlayout, 9, this);
ADDPROPERTY (i18n ("Height (pixels):"), movieheight, formatlayout, 10, this);
label = new QLabel (i18n ("Allow access from:"), this);
accesslist = new QTable (40, 1, this);
format->insertItem (TQString ("asf"));
format->insertItem (TQString ("avi"));
format->insertItem (TQString ("mpjpeg"));
format->insertItem (TQString ("mpeg"));
format->insertItem (TQString ("rm"));
format->insertItem (TQString ("swf"));
TQWhatsThis::add (format, i18n ("Only avi, mpeg and rm work for mplayer playback"));
formattqlayout->addWidget (label, 0, 0);
formattqlayout->addWidget (format, 0, 1);
ADDPROPERTY (i18n ("Audio codec:"), audiocodec, formattqlayout, 1, this);
ADDPROPERTY (i18n ("Audio bit rate (kbit):"), audiobitrate, formattqlayout, 2, this);
ADDPROPERTY (i18n ("Audio sample rate (Hz):"), audiosamplerate, formattqlayout, 3, this);
ADDPROPERTY (i18n ("Video codec:"), videocodec, formattqlayout, 4, this);
ADDPROPERTY (i18n ("Video bit rate (kbit):"), videobitrate, formattqlayout, 5, this);
ADDPROPERTY (i18n ("Quality (1-31):"), quality, formattqlayout, 6, this);
ADDPROPERTY (i18n ("Frame rate (Hz):"), framerate, formattqlayout, 7, this);
ADDPROPERTY (i18n ("Gop size:"), gopsize, formattqlayout, 8, this);
ADDPROPERTY (i18n ("Width (pixels):"), moviewidth, formattqlayout, 9, this);
ADDPROPERTY (i18n ("Height (pixels):"), movieheight, formattqlayout, 10, this);
label = new TQLabel (i18n ("Allow access from:"), this);
accesslist = new TQTable (40, 1, this);
accesslist->verticalHeader ()->hide ();
accesslist->setLeftMargin (0);
accesslist->setColumnWidth (0, 250);
QWhatsThis::add (accesslist, i18n ("'Single IP' or 'start-IP end-IP' for IP ranges"));
QHeader *header = accesslist->horizontalHeader ();
TQWhatsThis::add (accesslist, i18n ("'Single IP' or 'start-IP end-IP' for IP ranges"));
TQHeader *header = accesslist->horizontalHeader ();
header->setLabel (0, i18n ("Host/IP or IP Range"));
QFrame *profileframe = new QFrame (this);
QGridLayout *profileslayout = new QGridLayout (profileframe, 5, 2, 2);
profile = new QLineEdit ("", profileframe);
connect (profile, SIGNAL(textChanged (const QString &)),
this, SLOT (slotTextChanged (const QString &)));
profilelist = new QListBox (profileframe);
TQFrame *profileframe = new TQFrame (this);
TQGridLayout *profilestqlayout = new TQGridLayout (profileframe, 5, 2, 2);
profile = new TQLineEdit ("", profileframe);
connect (profile, TQT_SIGNAL(textChanged (const TQString &)),
this, TQT_SLOT (slotTextChanged (const TQString &)));
profilelist = new TQListBox (profileframe);
for (int i = 0; i < (int) profiles.size (); i++)
profilelist->insertItem (profiles[i]->name, i);
connect (profilelist, SIGNAL (selected (int)),
this, SLOT (slotIndexChanged (int)));
connect (profilelist, SIGNAL (highlighted (int)),
this, SLOT (slotItemHighlighted (int)));
load = new QPushButton (i18n ("Load"), profileframe);
save = new QPushButton (i18n ("Save"), profileframe);
del = new QPushButton (i18n ("Delete"), profileframe);
connect (profilelist, TQT_SIGNAL (selected (int)),
this, TQT_SLOT (slotIndexChanged (int)));
connect (profilelist, TQT_SIGNAL (highlighted (int)),
this, TQT_SLOT (slotItemHighlighted (int)));
load = new TQPushButton (i18n ("Load"), profileframe);
save = new TQPushButton (i18n ("Save"), profileframe);
del = new TQPushButton (i18n ("Delete"), profileframe);
load->setEnabled (false);
save->setEnabled (false);
del->setEnabled (false);
connect (load, SIGNAL (clicked ()), this, SLOT (slotLoad ()));
connect (save, SIGNAL (clicked ()), this, SLOT (slotSave ()));
connect (del, SIGNAL (clicked ()), this, SLOT (slotDelete ()));
profileslayout->addWidget (profile, 0, 0);
#if (QT_VERSION < 0x030200)
profileslayout->addRowSpacing (4, 60);
#else
profileslayout->setRowSpacing (4, 60);
#endif
profileslayout->addMultiCellWidget (profilelist, 1, 4, 0, 0);
profileslayout->addWidget (load, 1, 1);
profileslayout->addWidget (save, 2, 1);
profileslayout->addWidget (del, 3, 1);
leftlayout->addWidget (profileframe);
startbutton = new QPushButton (i18n ("Start"), this);
serverled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
feedled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
ledlayout->addWidget (startbutton);
ledlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
ledlayout->addWidget (serverled);
ledlayout->addWidget (feedled);
leftlayout->addLayout (ledlayout);
QFrame * line = new QFrame (this);
line->setFrameShape (QFrame::HLine);
leftlayout->addWidget (line);
leftlayout->addWidget (label);
leftlayout->addWidget (accesslist);
leftlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
layout->addLayout (leftlayout);
line = new QFrame (this);
line->setFrameShape (QFrame::VLine);
layout->addWidget (line);
layout->addLayout (formatlayout);
layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
connect (load, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotLoad ()));
connect (save, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotSave ()));
connect (del, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotDelete ()));
profilestqlayout->addWidget (profile, 0, 0);
profilestqlayout->setRowSpacing (4, 60);
profilestqlayout->addMultiCellWidget (profilelist, 1, 4, 0, 0);
profilestqlayout->addWidget (load, 1, 1);
profilestqlayout->addWidget (save, 2, 1);
profilestqlayout->addWidget (del, 3, 1);
lefttqlayout->addWidget (profileframe);
startbutton = new TQPushButton (i18n ("Start"), this);
serverled = new KLed (TQt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
feedled = new KLed (TQt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
ledtqlayout->addWidget (startbutton);
ledtqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
ledtqlayout->addWidget (serverled);
ledtqlayout->addWidget (feedled);
lefttqlayout->addLayout (ledtqlayout);
TQFrame * line = new TQFrame (this);
line->setFrameShape (TQFrame::HLine);
lefttqlayout->addWidget (line);
lefttqlayout->addWidget (label);
lefttqlayout->addWidget (accesslist);
lefttqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
tqlayout->addLayout (lefttqlayout);
line = new TQFrame (this);
line->setFrameShape (TQFrame::VLine);
tqlayout->addWidget (line);
tqlayout->addLayout (formattqlayout);
tqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
}
#undef ADDPROPERTY
@ -301,10 +297,10 @@ KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::setSettings (const FFServerS
movieheight->setText (fs.height);
accesslist->setNumRows (0);
accesslist->setNumRows (50);
QStringList::const_iterator it = fs.acl.begin ();
QStringList::const_iterator end( fs.acl.end () );
TQStringList::const_iterator it = fs.acl.begin ();
TQStringList::const_iterator end( fs.acl.end () );
for (int i = 0; it != end; ++i, ++it)
accesslist->setItem (i, 0, new QTableItem (accesslist, QTableItem::Always, *it));
accesslist->setItem (i, 0, new TQTableItem (accesslist, TQTableItem::Always, *it));
}
KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::getSettings (FFServerSetting & fs) {
@ -332,7 +328,7 @@ KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::slotIndexChanged (int index)
setSettings (*profiles[index]);
}
KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::slotTextChanged (const QString & txt) {
KDE_NO_EXPORT void KMPlayerPrefBroadcastFormatPage::slotTextChanged (const TQString & txt) {
save->setEnabled (txt.length ());
}
@ -419,10 +415,10 @@ KDE_NO_CDTOR_EXPORT KMPlayerBroadcastConfig::~KMPlayerBroadcastConfig () {
KDE_NO_EXPORT void KMPlayerBroadcastConfig::write (KConfig * config) {
config->setGroup (strBroadcast);
config->writeEntry (strFFServerCustomSetting, ffserversettings.list (), ';');
QStringList sl;
TQStringList sl;
for (int i = 0; i < (int) ffserversettingprofiles.size (); i++) {
sl.push_back (ffserversettingprofiles[i]->name);
config->writeEntry (QString ("Profile_") + ffserversettingprofiles[i]->name, ffserversettingprofiles[i]->list(), ';');
config->writeEntry (TQString ("Profile_") + ffserversettingprofiles[i]->name, ffserversettingprofiles[i]->list(), ';');
}
config->writeEntry (strFFServerProfiles, sl, ';');
}
@ -432,11 +428,11 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::read (KConfig * config) {
ffserversettingprofiles.clear ();
config->setGroup (strBroadcast);
ffserversettings = config->readListEntry (strFFServerCustomSetting, ';');
QStringList profiles = config->readListEntry (strFFServerProfiles, ';');
QStringList::iterator pr_it = profiles.begin ();
QStringList::iterator pr_end( profiles.end () );
TQStringList profiles = config->readListEntry (strFFServerProfiles, ';');
TQStringList::iterator pr_it = profiles.begin ();
TQStringList::iterator pr_end( profiles.end () );
for (; pr_it != pr_end; ++pr_it) {
QStringList sl = config->readListEntry (QString ("Profile_") + *pr_it, ';');
TQStringList sl = config->readListEntry (TQString ("Profile_") + *pr_it, ';');
if (sl.size () > 10) {
FFServerSetting * ffs = new FFServerSetting (sl);
ffs->name = *pr_it;
@ -450,21 +446,21 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::sync (bool fromUI) {
m_configpage->getSettings(ffserversettings);
} else {
m_configpage->setSettings (ffserversettings);
m_configpage->profile->setText (QString ());
m_configpage->profile->setText (TQString ());
}
}
KDE_NO_EXPORT void KMPlayerBroadcastConfig::prefLocation (QString & item, QString & icon, QString & tab) {
KDE_NO_EXPORT void KMPlayerBroadcastConfig::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Broadcasting");
icon = QString ("share");
icon = TQString ("share");
tab = i18n ("Profiles");
}
QFrame * KMPlayerBroadcastConfig::prefPage (QWidget * parent) {
TQFrame * KMPlayerBroadcastConfig::prefPage (TQWidget * tqparent) {
if (!m_configpage) {
m_configpage = new KMPlayerPrefBroadcastFormatPage (parent, ffserversettingprofiles);
connect (m_configpage->startbutton, SIGNAL (clicked ()), this, SLOT (startServer ()));
connect (m_player, SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)), this, SLOT (sourceChanged (KMPlayer::Source *,KMPlayer::Source *)));
m_configpage = new KMPlayerPrefBroadcastFormatPage (tqparent, ffserversettingprofiles);
connect (m_configpage->startbutton, TQT_SIGNAL (clicked ()), this, TQT_SLOT (startServer ()));
connect (m_player, TQT_SIGNAL (sourceChanged (KMPlayer::Source *, KMPlayer::Source *)), this, TQT_SLOT (sourceChanged (KMPlayer::Source *,KMPlayer::Source *)));
m_configpage->startbutton->setEnabled
(!m_player->source ()->videoDevice ().isEmpty ());
}
@ -489,25 +485,25 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::startServer () {
stopServer ();
return;
}
m_configpage->setCursor (QCursor (Qt::WaitCursor));
m_configpage->setCursor (TQCursor (TQt::WaitCursor));
m_ffserver_process = new KProcess;
m_ffserver_process->setUseShell (true);
connect (m_ffserver_process, SIGNAL (processExited (KProcess *)),
this, SLOT (processStopped (KProcess *)));
QString conffile = locateLocal ("data", "kmplayer/ffserver.conf");
connect (m_ffserver_process, TQT_SIGNAL (processExited (KProcess *)),
this, TQT_SLOT (processStopped (KProcess *)));
TQString conffile = locateLocal ("data", "kmplayer/ffserver.conf");
const char * noaudio = m_player->source ()->audioDevice ().isEmpty () ? "NoAudio" : "";
FFServerSetting ffs;
m_configpage->getSettings (ffs);
QString acl;
QStringList::iterator it = ffs.acl.begin ();
QStringList::iterator end( ffs.acl.end () );
TQString acl;
TQStringList::iterator it = ffs.acl.begin ();
TQStringList::iterator end( ffs.acl.end () );
for (; it != end; ++it)
acl += QString ("ACL allow ") + *it + QString ("\n");
acl += TQString ("ACL allow ") + *it + TQString ("\n");
unlink (m_ffserverconfig->feedfile.ascii ());
QFile qfile (conffile);
TQFile qfile (conffile);
qfile.open (IO_WriteOnly);
QString configdata;
QString buf;
TQString configdata;
TQString buf;
configdata.sprintf (ffserverconf, m_ffserverconfig->ffserverport, m_ffserverconfig->bindaddress.ascii (), m_ffserverconfig->maxclients, m_ffserverconfig->maxbandwidth, m_ffserverconfig->feedfile.ascii (), m_ffserverconfig->feedfilesize, ffs.format.ascii (), acl.ascii (), ffs.ffconfig (buf).ascii (), noaudio);
qfile.writeBlock (configdata.ascii (), configdata.length ());
qfile.close ();
@ -516,15 +512,15 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::startServer () {
*m_ffserver_process << "ffserver -f " << conffile;
m_ffserver_out.truncate (0);
connect (m_ffserver_process,
SIGNAL (receivedStderr (KProcess *, char *, int)),
this, SLOT (processOutput (KProcess *, char *, int)));
TQT_SIGNAL (receivedStderr (KProcess *, char *, int)),
this, TQT_SLOT (processOutput (KProcess *, char *, int)));
m_ffserver_process->start (KProcess::NotifyOnExit, KProcess::Stderr);
if (m_ffserver_process->isRunning ()) {
m_configpage->startbutton->setText (i18n ("Stop"));
m_configpage->serverled->setState (KLed::On);
emit broadcastStarted ();
}
QTimer::singleShot (500, this, SLOT (startFeed ()));
TQTimer::singleShot (500, this, TQT_SLOT (startFeed ()));
}
KDE_NO_EXPORT void KMPlayerBroadcastConfig::stopServer () {
@ -537,7 +533,7 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::stopServer () {
KDE_NO_EXPORT void KMPlayerBroadcastConfig::processOutput (KProcess * p, char * s, int) {
if (p == m_ffserver_process)
m_ffserver_out += QString (s);
m_ffserver_out += TQString (s);
}
KDE_NO_EXPORT void KMPlayerBroadcastConfig::startFeed () {
@ -547,18 +543,18 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::startFeed () {
}
FFServerSetting ffs;
m_configpage->getSettings (ffs);
QString ffurl;
TQString ffurl;
if (!m_ffserver_process || !m_ffserver_process->isRunning ()) {
KMessageBox::error (m_configpage, i18n ("Failed to start ffserver.\n") + m_ffserver_out, i18n ("Error"));
goto bail_out;
}
disconnect (m_ffserver_process, SIGNAL (receivedStderr (KProcess *, char *, int)),
this, SLOT (processOutput (KProcess *, char *, int)));
disconnect (m_ffserver_process, TQT_SIGNAL (receivedStderr (KProcess *, char *, int)),
this, TQT_SLOT (processOutput (KProcess *, char *, int)));
if (m_ffmpeg_process)
m_ffmpeg_process->stop ();
delete m_ffmpeg_process;
m_ffmpeg_process = new KMPlayer::FFMpeg (m_player, m_player->settings ());
connect (m_ffmpeg_process, SIGNAL (stateChange (KMPlayer::Process::State, KMPlayer::Process::State)), this, SLOT (stateChange (KMPlayer::Process::State, KMPlayer::Process::State)));
connect (m_ffmpeg_process, TQT_SIGNAL (stateChange (KMPlayer::Process::State, KMPlayer::Process::State)), this, TQT_SLOT (stateChange (KMPlayer::Process::State, KMPlayer::Process::State)));
ffurl.sprintf ("http://localhost:%d/kmplayer.ffm", m_ffserverconfig->ffserverport);
m_ffmpeg_process->setURL (KURL(ffurl));
if (!m_ffmpeg_process->play (m_player->source (), KMPlayer::NodePtr())) {
@ -574,7 +570,7 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::startFeed () {
} else
stopServer ();
bail_out:
m_configpage->setCursor (QCursor (Qt::ArrowCursor));
m_configpage->setCursor (TQCursor (TQt::ArrowCursor));
}
KDE_NO_EXPORT void KMPlayerBroadcastConfig::stateChange (KMPlayer::Process::State old, KMPlayer::Process::State state) {
@ -586,8 +582,8 @@ KDE_NO_EXPORT void KMPlayerBroadcastConfig::stateChange (KMPlayer::Process::Stat
kdDebug () << "ffmpeg process stopped " << m_endserver << endl;
if (m_endserver && !stopProcess (m_ffserver_process)) {
disconnect (m_ffserver_process,
SIGNAL (receivedStderr (KProcess *, char *, int)),
this, SLOT (processOutput (KProcess *, char *, int)));
TQT_SIGNAL (receivedStderr (KProcess *, char *, int)),
this, TQT_SLOT (processOutput (KProcess *, char *, int)));
KMessageBox::error (m_configpage, i18n ("Failed to end ffserver process."), i18n ("Error"));
processStopped (0L);
}
@ -646,23 +642,23 @@ KDE_NO_EXPORT void KMPlayerFFServerConfig::sync (bool fromUI) {
feedfilesize = m_configpage->feedfilesize->text ().toInt();
} else {
m_configpage->bindaddress->setText (bindaddress);
m_configpage->port->setText (QString::number (ffserverport));
m_configpage->maxclients->setText (QString::number (maxclients));
m_configpage->maxbandwidth->setText (QString::number (maxbandwidth));
m_configpage->port->setText (TQString::number (ffserverport));
m_configpage->maxclients->setText (TQString::number (maxclients));
m_configpage->maxbandwidth->setText (TQString::number (maxbandwidth));
m_configpage->feedfile->setText (feedfile);
m_configpage->feedfilesize->setText (QString::number (feedfilesize));
m_configpage->feedfilesize->setText (TQString::number (feedfilesize));
}
}
KDE_NO_EXPORT void KMPlayerFFServerConfig::prefLocation (QString & item, QString & icon, QString & tab) {
KDE_NO_EXPORT void KMPlayerFFServerConfig::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Broadcasting");
icon = QString ("share");
icon = TQString ("share");
tab = i18n ("FFServer");
}
KDE_NO_EXPORT QFrame *KMPlayerFFServerConfig::prefPage (QWidget * parent) {
KDE_NO_EXPORT TQFrame *KMPlayerFFServerConfig::prefPage (TQWidget * tqparent) {
if (!m_configpage)
m_configpage = new KMPlayerPrefBroadcastPage (parent);
m_configpage = new KMPlayerPrefBroadcastPage (tqparent);
return m_configpage;
}

@ -23,8 +23,8 @@
#include <list>
#include <vector>
#include <qframe.h>
#include <qguardedptr.h>
#include <tqframe.h>
#include <tqguardedptr.h>
#include "kmplayerappsource.h"
#include "kmplayerprocess.h"
@ -32,11 +32,11 @@
class KMPlayerPrefBroadcastPage; // broadcast
class KMPlayerPrefBroadcastFormatPage; // broadcast format
class QListBox;
class QComboBox;
class QLineEdit;
class QTable;
class QPushButton;
class TQListBox;
class TQComboBox;
class TQLineEdit;
class TQTable;
class TQPushButton;
class KLed;
namespace KMPlayer {
@ -46,66 +46,68 @@ namespace KMPlayer {
class KMPLAYER_NO_EXPORT FFServerSetting {
public:
KDE_NO_CDTOR_EXPORT FFServerSetting () {}
FFServerSetting (int i, const QString & n, const QString & f, const QString & ac, int abr, int asr, const QString & vc, int vbr, int q, int fr, int gs, int w, int h);
KDE_NO_CDTOR_EXPORT FFServerSetting (const QStringList & sl) { *this = sl; }
FFServerSetting (int i, const TQString & n, const TQString & f, const TQString & ac, int abr, int asr, const TQString & vc, int vbr, int q, int fr, int gs, int w, int h);
KDE_NO_CDTOR_EXPORT FFServerSetting (const TQStringList & sl) { *this = sl; }
KDE_NO_CDTOR_EXPORT ~FFServerSetting () {}
int index;
QString name;
QString format;
QString audiocodec;
QString audiobitrate;
QString audiosamplerate;
QString videocodec;
QString videobitrate;
QString quality;
QString framerate;
QString gopsize;
QString width;
QString height;
QStringList acl;
FFServerSetting & operator = (const QStringList &);
TQString name;
TQString format;
TQString audiocodec;
TQString audiobitrate;
TQString audiosamplerate;
TQString videocodec;
TQString videobitrate;
TQString quality;
TQString framerate;
TQString gopsize;
TQString width;
TQString height;
TQStringList acl;
FFServerSetting & operator = (const TQStringList &);
FFServerSetting & operator = (const FFServerSetting & fs);
const QStringList list ();
QString & ffconfig (QString & buf);
const TQStringList list ();
TQString & ffconfig (TQString & buf);
};
typedef std::vector <FFServerSetting *> FFServerSettingList;
class KMPLAYER_NO_EXPORT KMPlayerPrefBroadcastPage : public QFrame {
class KMPLAYER_NO_EXPORT KMPlayerPrefBroadcastPage : public TQFrame {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerPrefBroadcastPage (QWidget * parent);
KMPlayerPrefBroadcastPage (TQWidget * tqparent);
KDE_NO_CDTOR_EXPORT ~KMPlayerPrefBroadcastPage () {}
QLineEdit * bindaddress;
QLineEdit * port;
QLineEdit * maxclients;
QLineEdit * maxbandwidth;
QLineEdit * feedfile;
QLineEdit * feedfilesize;
TQLineEdit * bindaddress;
TQLineEdit * port;
TQLineEdit * maxclients;
TQLineEdit * maxbandwidth;
TQLineEdit * feedfile;
TQLineEdit * feedfilesize;
};
class KMPLAYER_NO_EXPORT KMPlayerPrefBroadcastFormatPage : public QFrame {
class KMPLAYER_NO_EXPORT KMPlayerPrefBroadcastFormatPage : public TQFrame {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerPrefBroadcastFormatPage (QWidget * parent, FFServerSettingList &);
KMPlayerPrefBroadcastFormatPage (TQWidget * tqparent, FFServerSettingList &);
KDE_NO_CDTOR_EXPORT ~KMPlayerPrefBroadcastFormatPage () {}
QListBox * profilelist;
QComboBox * format;
QLineEdit * audiocodec;
QLineEdit * audiobitrate;
QLineEdit * audiosamplerate;
QLineEdit * videocodec;
QLineEdit * videobitrate;
QLineEdit * quality;
QLineEdit * framerate;
QLineEdit * gopsize;
QLineEdit * moviewidth;
QLineEdit * movieheight;
QLineEdit * profile;
QPushButton * startbutton;
TQListBox * profilelist;
TQComboBox * format;
TQLineEdit * audiocodec;
TQLineEdit * audiobitrate;
TQLineEdit * audiosamplerate;
TQLineEdit * videocodec;
TQLineEdit * videobitrate;
TQLineEdit * quality;
TQLineEdit * framerate;
TQLineEdit * gopsize;
TQLineEdit * moviewidth;
TQLineEdit * movieheight;
TQLineEdit * profile;
TQPushButton * startbutton;
KLed * serverled;
KLed * feedled;
void setSettings (const FFServerSetting &);
@ -113,15 +115,15 @@ public:
private slots:
void slotIndexChanged (int index);
void slotItemHighlighted (int index);
void slotTextChanged (const QString &);
void slotTextChanged (const TQString &);
void slotLoad ();
void slotSave ();
void slotDelete ();
private:
QTable * accesslist;
QPushButton * load;
QPushButton * save;
QPushButton * del;
TQTable * accesslist;
TQPushButton * load;
TQPushButton * save;
TQPushButton * del;
FFServerSettingList & profiles;
};
@ -136,23 +138,24 @@ public:
virtual void write (KConfig *);
virtual void read (KConfig *);
virtual void sync (bool fromUI);
virtual void prefLocation (QString & item, QString & icon, QString & tab);
virtual QFrame * prefPage (QWidget * parent);
virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual TQFrame * prefPage (TQWidget * tqparent);
int ffserverport;
int maxclients;
int maxbandwidth;
QString feedfile;
TQString feedfile;
int feedfilesize;
QString bindaddress;
TQString bindaddress;
private:
QGuardedPtr <KMPlayerPrefBroadcastPage> m_configpage;
TQGuardedPtr <KMPlayerPrefBroadcastPage> m_configpage;
};
/*
* Preference page for ffserver
*/
class KMPLAYER_NO_EXPORT KMPlayerBroadcastConfig : public QObject, public KMPlayer::PreferencesPage {
class KMPLAYER_NO_EXPORT KMPlayerBroadcastConfig : public TQObject, public KMPlayer::PreferencesPage {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerBroadcastConfig (KMPlayer::PartBase * player, KMPlayerFFServerConfig * fsc);
KDE_NO_CDTOR_EXPORT ~KMPlayerBroadcastConfig ();
@ -160,12 +163,12 @@ public:
virtual void write (KConfig *);
virtual void read (KConfig *);
virtual void sync (bool fromUI);
virtual void prefLocation (QString & item, QString & icon, QString & tab);
virtual QFrame * prefPage (QWidget * parent);
virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual TQFrame * prefPage (TQWidget * tqparent);
bool broadcasting () const;
void stopServer ();
KDE_NO_EXPORT const QString & serverURL () const { return m_ffserver_url; }
KDE_NO_EXPORT const TQString & serverURL () const { return m_ffserver_url; }
FFServerSetting ffserversettings;
FFServerSettingList ffserversettingprofiles;
@ -182,12 +185,12 @@ private slots:
private:
KMPlayer::PartBase * m_player;
KMPlayerFFServerConfig * m_ffserverconfig;
QGuardedPtr <KMPlayerPrefBroadcastFormatPage> m_configpage;
TQGuardedPtr <KMPlayerPrefBroadcastFormatPage> m_configpage;
KMPlayer::FFMpeg * m_ffmpeg_process;
KProcess * m_ffserver_process;
bool m_endserver;
QString m_ffserver_out;
QString m_ffserver_url;
TQString m_ffserver_out;
TQString m_ffserver_url;
};

@ -19,16 +19,16 @@
#include <algorithm>
#include <functional>
#include <config.h>
#include <qcheckbox.h>
#include <qtextedit.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qtabwidget.h>
#include <qslider.h>
#include <qspinbox.h>
#include <qlabel.h>
#include <qbuttongroup.h>
#include <qfileinfo.h>
#include <tqcheckbox.h>
#include <tqtextedit.h>
#include <tqpushbutton.h>
#include <tqradiobutton.h>
#include <tqtabwidget.h>
#include <tqslider.h>
#include <tqspinbox.h>
#include <tqlabel.h>
#include <tqbuttongroup.h>
#include <tqfileinfo.h>
#include <kurlrequester.h>
#include <klineedit.h>
@ -65,7 +65,7 @@ static OutputDriver _ads[] = {
{ "alsa5", i18n ("Advanced Linux Sound Architecture v0.5") },
{ "alsa9", i18n ("Advanced Linux Sound Architecture v0.9") },
{ "", i18n ("Use back-end defaults") },
{ 0, QString () }
{ 0, TQString () }
};
static OutputDriver _vds [] = {
@ -77,7 +77,7 @@ static OutputDriver _vds [] = {
{ "gl", i18n ("OpenGL") },
{ "gl2", i18n ("OpenGL MT") },
{ "xv", i18n ("XVideo") },
{ 0, QString () }
{ 0, TQString () }
};
static const int ADRIVER_ARTS_INDEX = 4;
@ -98,16 +98,16 @@ KDE_NO_CDTOR_EXPORT Settings::Settings (PartBase * player, KConfig * config)
colors [ColorSetting::playlist_active].option = "PlaylistActive";
colors [ColorSetting::playlist_active].color = KGlobalSettings::linkColor();
colors [ColorSetting::console_background].option = "ConsoleBackground";
colors [ColorSetting::console_background].color = QColor (0, 0, 0);
colors [ColorSetting::console_background].color = TQColor (0, 0, 0);
colors [ColorSetting::console_foreground].title = i18n ("Console foreground");
colors [ColorSetting::console_foreground].option = "ConsoleForeground";
colors [ColorSetting::console_foreground].color = QColor (0xB2, 0xB2, 0xB2);
colors [ColorSetting::console_foreground].color = TQColor (0xB2, 0xB2, 0xB2);
colors [ColorSetting::video_background].title = i18n ("Video background");
colors [ColorSetting::video_background].option = "VideoBackground";
colors [ColorSetting::video_background].color = QColor (0, 0, 0);
colors [ColorSetting::video_background].color = TQColor (0, 0, 0);
colors [ColorSetting::area_background].title = i18n ("Viewing area background");
colors [ColorSetting::area_background].option = "ViewingAreaBackground";
colors [ColorSetting::area_background].color = QColor (0, 0, 0);
colors [ColorSetting::area_background].color = TQColor (0, 0, 0);
colors [ColorSetting::infowindow_background].title = i18n ("Info window background");
colors [ColorSetting::infowindow_background].option ="InfoWindowBackground";
colors [ColorSetting::infowindow_background].color = KGlobalSettings::baseColor ();
@ -223,7 +223,7 @@ KDE_NO_EXPORT void Settings::applyColorSetting (bool only_changed_ones) {
view->playList()->setActiveForegroundColor (colors[i].color);
break;
case ColorSetting::console_background:
view->console()->setPaper (QBrush (colors[i].color));
view->console()->setPaper (TQBrush (colors[i].color));
break;
case ColorSetting::console_foreground:
view->console()->setColor(colors[i].color);
@ -235,7 +235,7 @@ KDE_NO_EXPORT void Settings::applyColorSetting (bool only_changed_ones) {
view->viewArea()->setPaletteBackgroundColor(colors[i].color);
break;
case ColorSetting::infowindow_background:
view->infoPanel ()->setPaper (QBrush (colors[i].color));
view->infoPanel ()->setPaper (TQBrush (colors[i].color));
break;
case ColorSetting::infowindow_foreground:
view->infoPanel()->setPaletteForegroundColor(colors[i].color);
@ -277,8 +277,8 @@ KDE_NO_EXPORT void Settings::readConfig () {
brightness = m_config->readNumEntry (strBrightness, 0);
hue = m_config->readNumEntry (strHue, 0);
saturation = m_config->readNumEntry (strSaturation, 0);
const QMap <QString, Source*>::const_iterator e = m_player->sources ().end ();
QMap <QString, Source *>::const_iterator i = m_player->sources().begin ();
const TQMap <TQString, Source*>::const_iterator e = m_player->sources ().end ();
TQMap <TQString, Source *>::const_iterator i = m_player->sources().begin ();
for (; i != e; ++i)
backends[i.data()->name ()] = m_config->readEntry (i.data()->name ());
for (int i = 0; i < int (ColorSetting::last_target); i++)
@ -311,7 +311,7 @@ KDE_NO_EXPORT void Settings::readConfig () {
m_config->setGroup (strRecordingGroup);
mencoderarguments = m_config->readEntry (strMencoderArgs, "-oac mp3lame -ovc lavc");
ffmpegarguments = m_config->readEntry (strFFMpegArgs, "-f avi -acodec mp3 -vcodec mpeg4");
recordfile = m_config->readPathEntry(strRecordingFile, QDir::homeDirPath () + "/record.avi");
recordfile = m_config->readPathEntry(strRecordingFile, TQDir::homeDirPath () + "/record.avi");
recorder = Recorder (m_config->readNumEntry (strRecorder, int (MEncoder)));
replayoption = ReplayOption (m_config->readNumEntry (strAutoPlayAfterRecording, ReplayFinished));
replaytime = m_config->readNumEntry (strAutoPlayAfterTime, 60);
@ -363,15 +363,15 @@ KDE_NO_EXPORT bool Settings::createDialog () {
for (PartBase::ProcessMap::const_iterator i = m_player->players ().begin(); i != e; ++i) {
Process * p = i.data ();
if (p->supports ("urlsource"))
configdialog->m_SourcePageURL->backend->insertItem (p->menuName ().remove (QChar ('&')), id++);
configdialog->m_SourcePageURL->backend->insertItem (p->menuName ().remove (TQChar ('&')), id++);
}
connect (configdialog, SIGNAL (okClicked ()),
this, SLOT (okPressed ()));
connect (configdialog, SIGNAL (applyClicked ()),
this, SLOT (okPressed ()));
connect (configdialog, TQT_SIGNAL (okClicked ()),
this, TQT_SLOT (okPressed ()));
connect (configdialog, TQT_SIGNAL (applyClicked ()),
this, TQT_SLOT (okPressed ()));
if (KApplication::kApplication())
connect (configdialog, SIGNAL (helpClicked ()),
this, SLOT (getHelp ()));
connect (configdialog, TQT_SIGNAL (helpClicked ()),
this, TQT_SLOT (getHelp ()));
return true;
}
@ -429,18 +429,18 @@ void Settings::show (const char * pagename) {
configdialog->m_SourcePageURL->sub_urllist->insertStringList (sub_urllist);
configdialog->m_SourcePageURL->sub_urllist->setCurrentText (m_player->source ()->subUrl ().prettyURL ());
configdialog->m_SourcePageURL->changed = false;
configdialog->m_SourcePageURL->prefBitRate->setText (QString::number (prefbitrate));
configdialog->m_SourcePageURL->maxBitRate->setText (QString::number (maxbitrate));
configdialog->m_SourcePageURL->prefBitRate->setText (TQString::number (prefbitrate));
configdialog->m_SourcePageURL->maxBitRate->setText (TQString::number (maxbitrate));
configdialog->m_GeneralPageOutput->videoDriver->setCurrentItem (videodriver);
configdialog->m_GeneralPageOutput->audioDriver->setCurrentItem (audiodriver);
configdialog->m_SourcePageURL->backend->setCurrentItem (configdialog->m_SourcePageURL->backend->findItem (backends["urlsource"]));
configdialog->m_SourcePageURL->backend->setCurrentItem (configdialog->m_SourcePageURL->backend->tqfindItem (backends["urlsource"]));
int id = 0;
const PartBase::ProcessMap::const_iterator e = m_player->players ().end ();
for (PartBase::ProcessMap::const_iterator i = m_player->players ().begin(); i != e; ++i) {
Process * p = i.data ();
if (p->supports ("urlsource")) {
if (backends["urlsource"] == QString (p->name()))
if (backends["urlsource"] == TQString (p->name()))
configdialog->m_SourcePageURL->backend->setCurrentItem (id);
id++;
}
@ -484,7 +484,7 @@ void Settings::show (const char * pagename) {
configdialog->m_RecordPage->recorder->setButton (int (recorder));
configdialog->m_RecordPage->replayClicked (int (replayoption));
configdialog->m_RecordPage->recorderClicked (int (recorder));
configdialog->m_RecordPage->replaytime->setText (QString::number (replaytime));
configdialog->m_RecordPage->replaytime->setText (TQString::number (replaytime));
configdialog->m_MEncoderPage->arguments->setText (mencoderarguments);
configdialog->m_MEncoderPage->format->setButton (recordcopy ? 0 : 1);
configdialog->m_MEncoderPage->formatClicked (recordcopy ? 0 : 1);
@ -497,7 +497,7 @@ void Settings::show (const char * pagename) {
if (pagename)
configDialog ()->setPage (pagename);
if (created)
configdialog->resize (configdialog->minimumSize ());
configdialog->resize (configdialog->tqminimumSize ());
configdialog->show ();
}
@ -512,8 +512,8 @@ void Settings::writeConfig () {
m_config->writeEntry (strBrightness, brightness);
m_config->writeEntry (strHue, hue);
m_config->writeEntry (strSaturation, saturation);
const QMap<QString,QString>::iterator b_end = backends.end ();
for (QMap<QString,QString>::iterator i = backends.begin(); i != b_end; ++i)
const TQMap<TQString,TQString>::iterator b_end = backends.end ();
for (TQMap<TQString,TQString>::iterator i = backends.begin(); i != b_end; ++i)
m_config->writeEntry (i.key (), i.data ());
for (int i = 0; i < int (ColorSetting::last_target); i++)
m_config->writeEntry (colors[i].option, colors[i].color);
@ -598,13 +598,13 @@ void Settings::okPressed () {
else {
if (KURL::fromPathOrURL (configdialog->m_SourcePageURL->url->url ()).isLocalFile () ||
KURL::isRelativeURL (configdialog->m_SourcePageURL->url->url ())) {
QFileInfo fi (configdialog->m_SourcePageURL->url->url ());
int hpos = configdialog->m_SourcePageURL->url->url ().findRev ('#');
QString xine_directives ("");
TQFileInfo fi (configdialog->m_SourcePageURL->url->url ());
int hpos = configdialog->m_SourcePageURL->url->url ().tqfindRev ('#');
TQString xine_directives ("");
while (!fi.exists () && hpos > -1) {
xine_directives = configdialog->m_SourcePageURL->url->url ().mid (hpos);
fi.setFile (configdialog->m_SourcePageURL->url->url ().left (hpos));
hpos = configdialog->m_SourcePageURL->url->url ().findRev ('#', hpos-1);
hpos = configdialog->m_SourcePageURL->url->url ().tqfindRev ('#', hpos-1);
}
if (!fi.exists ()) {
urlchanged = false;
@ -616,10 +616,10 @@ void Settings::okPressed () {
!configdialog->m_SourcePageURL->sub_url->url ().isEmpty () &&
(KURL::fromPathOrURL (configdialog->m_SourcePageURL->sub_url->url ()).isLocalFile () ||
KURL::isRelativeURL (configdialog->m_SourcePageURL->sub_url->url ()))) {
QFileInfo sfi (configdialog->m_SourcePageURL->sub_url->url ());
TQFileInfo sfi (configdialog->m_SourcePageURL->sub_url->url ());
if (!sfi.exists ()) {
KMessageBox::error (m_player->view (), i18n ("Sub title file %1 does not exist.").arg (configdialog->m_SourcePageURL->sub_url->url ()), i18n ("Error"));
configdialog->m_SourcePageURL->sub_url->setURL (QString ());
configdialog->m_SourcePageURL->sub_url->setURL (TQString ());
} else
configdialog->m_SourcePageURL->sub_url->setURL (sfi.absFilePath ());
}
@ -628,10 +628,10 @@ void Settings::okPressed () {
if (urlchanged) {
KURL url = KURL::fromPathOrURL (configdialog->m_SourcePageURL->url->url ());
m_player->setURL (url);
if (urllist.find (url.prettyURL ()) == urllist.end ())
if (urllist.tqfind (url.prettyURL ()) == urllist.end ())
configdialog->m_SourcePageURL->urllist->insertItem (url.prettyURL (), 0);
KURL sub_url = KURL::fromPathOrURL (configdialog->m_SourcePageURL->sub_url->url ());
if (sub_urllist.find (sub_url.prettyURL ()) == sub_urllist.end ())
if (sub_urllist.tqfind (sub_url.prettyURL ()) == sub_urllist.end ())
configdialog->m_SourcePageURL->sub_urllist->insertItem (sub_url.prettyURL (), 0);
}
urllist.clear ();
@ -709,21 +709,13 @@ void Settings::okPressed () {
pp_med_int = configdialog->m_OPPagePostproc->MedianDeinterlacer->isChecked();
pp_ffmpeg_int = configdialog->m_OPPagePostproc->FfmpegDeinterlacer->isChecked();
// recording
#if (QT_VERSION < 0x030200)
recorder = Recorder (configdialog->m_RecordPage->recorder->id (configdialog->m_RecordPage->recorder->selected ()));
#else
recorder = Recorder (configdialog->m_RecordPage->recorder->selectedId ());
#endif
replaytime = configdialog->m_RecordPage->replaytime->text ().toInt ();
configdialog->m_RecordPage->replaytime->setText (QString::number (replaytime));
configdialog->m_RecordPage->replaytime->setText (TQString::number (replaytime));
recordfile = configdialog->m_RecordPage->url->lineEdit()->text ();
mencoderarguments = configdialog->m_MEncoderPage->arguments->text ();
ffmpegarguments = configdialog->m_FFMpegPage->arguments->text ();
#if (QT_VERSION < 0x030200)
recordcopy = !configdialog->m_MEncoderPage->format->id (configdialog->m_MEncoderPage->format->selected ());
#else
recordcopy = !configdialog->m_MEncoderPage->format->selectedId ();
#endif
//dynamic stuff
for (PreferencesPage * p = pagelist; p; p = p->next)

@ -23,9 +23,9 @@
#include <config.h>
#endif
#include <qobject.h>
#include <qstringlist.h>
#include <qmap.h>
#include <tqobject.h>
#include <tqstringlist.h>
#include <tqmap.h>
#include <kurl.h>
@ -40,15 +40,15 @@ class View;
class OutputDriver {
public:
const char * driver;
const QString description;
const TQString description;
};
class ColorSetting {
public:
QString title;
QString option;
QColor color;
QColor newcolor;
TQString title;
TQString option;
TQColor color;
TQColor newcolor;
enum Target {
playlist_background = 0, playlist_foreground, playlist_active,
console_background, console_foreground,
@ -60,10 +60,10 @@ public:
class FontSetting {
public:
QString title;
QString option; // for ini file
QFont font;
QFont newfont;
TQString title;
TQString option; // for ini file
TQFont font;
TQFont newfont;
enum Target {
playlist, infowindow, last_target
} target;
@ -85,16 +85,17 @@ public:
virtual void write (KConfig *) = 0;
virtual void read (KConfig *) = 0;
virtual void sync (bool fromUI) = 0;
virtual void prefLocation (QString & item, QString & icon, QString & tab) = 0;
virtual QFrame * prefPage (QWidget * parent) = 0;
virtual void prefLocation (TQString & item, TQString & icon, TQString & tab) = 0;
virtual TQFrame * prefPage (TQWidget * tqparent) = 0;
PreferencesPage * next;
};
/*
* Class for storing all actual settings and reading/writing them
*/
class KMPLAYER_EXPORT Settings : public QObject {
class KMPLAYER_EXPORT Settings : public TQObject {
Q_OBJECT
TQ_OBJECT
public:
Settings (PartBase *, KConfig * part);
~Settings ();
@ -107,8 +108,8 @@ public:
View * defaultView ();
KConfig * kconfig () { return m_config; }
QStringList urllist;
QStringList sub_urllist;
TQStringList urllist;
TQStringList sub_urllist;
int volume;
int contrast;
int brightness;
@ -171,9 +172,9 @@ public:
enum ReplayOption { ReplayNo = 0, ReplayFinished, ReplayAfter };
ReplayOption replayoption;
int replaytime;
QString mencoderarguments;
QString ffmpegarguments;
QString recordfile;
TQString mencoderarguments;
TQString ffmpegarguments;
TQString recordfile;
int seektime;
int videodriver;
int audiodriver;
@ -181,9 +182,9 @@ public:
OutputDriver * videodrivers;
ColorSetting colors [ColorSetting::last_target];
FontSetting fonts [FontSetting::last_target];
QString dvddevice;
QString vcddevice;
QMap <QString, QString> backends;
TQString dvddevice;
TQString vcddevice;
TQMap <TQString, TQString> backends;
PreferencesPage * pagelist;
signals:
void configChanged ();

@ -16,13 +16,13 @@
* Boston, MA 02110-1301, USA.
**/
#include <qlayout.h>
#include <qpixmap.h>
#include <qslider.h>
#include <qlabel.h>
#include <qtooltip.h>
#include <qpainter.h>
#include <qstringlist.h>
#include <tqlayout.h>
#include <tqpixmap.h>
#include <tqslider.h>
#include <tqlabel.h>
#include <tqtooltip.h>
#include <tqpainter.h>
#include <tqstringlist.h>
#include <kiconloader.h>
#include <klocale.h>
@ -255,46 +255,46 @@ static const char * blue_xpm[] = {
//-----------------------------------------------------------------------------
static QPushButton * ctrlButton (QWidget * w, QBoxLayout * l, const char ** p, int key = 0) {
QPushButton * b = new QPushButton (QIconSet (QPixmap(p)), QString (), w);
b->setFocusPolicy (QWidget::NoFocus);
static TQPushButton * ctrlButton (TQWidget * w, TQBoxLayout * l, const char ** p, int key = 0) {
TQPushButton * b = new TQPushButton (TQIconSet (TQPixmap(p)), TQString (), w);
b->setFocusPolicy (TQ_NoFocus);
b->setFlat (true);
if (key)
b->setAccel (QKeySequence (key));
b->setAccel (TQKeySequence (key));
l->addWidget (b);
return b;
}
KDE_NO_CDTOR_EXPORT
KMPlayerMenuButton::KMPlayerMenuButton (QWidget * parent, QBoxLayout * l, const char ** p, int key)
: QPushButton (QIconSet (QPixmap(p)), QString (), parent, "kde_kmplayer_control_button") {
setFocusPolicy (QWidget::NoFocus);
KMPlayerMenuButton::KMPlayerMenuButton (TQWidget * tqparent, TQBoxLayout * l, const char ** p, int key)
: TQPushButton (TQIconSet (TQPixmap(p)), TQString (), tqparent, "kde_kmplayer_control_button") {
setFocusPolicy (TQ_NoFocus);
setFlat (true);
if (key)
setAccel (QKeySequence (key));
setAccel (TQKeySequence (key));
l->addWidget (this);
}
KDE_NO_EXPORT void KMPlayerMenuButton::enterEvent (QEvent *) {
KDE_NO_EXPORT void KMPlayerMenuButton::enterEvent (TQEvent *) {
emit mouseEntered ();
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerPopupMenu::KMPlayerPopupMenu (QWidget * parent)
: KPopupMenu (parent, "kde_kmplayer_popupmenu") {}
KDE_NO_CDTOR_EXPORT KMPlayerPopupMenu::KMPlayerPopupMenu (TQWidget * tqparent)
: KPopupMenu (tqparent, "kde_kmplayer_popupmenu") {}
KDE_NO_EXPORT void KMPlayerPopupMenu::leaveEvent (QEvent *) {
KDE_NO_EXPORT void KMPlayerPopupMenu::leaveEvent (TQEvent *) {
emit mouseLeft ();
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT VolumeBar::VolumeBar (QWidget * parent, View * view)
: QWidget (parent), m_view (view), m_value (100) {
setSizePolicy( QSizePolicy (QSizePolicy::Minimum, QSizePolicy::Fixed));
setMinimumSize (QSize (51, button_height_only_buttons + 2));
QToolTip::add (this, i18n ("Volume is %1").arg (m_value));
KDE_NO_CDTOR_EXPORT VolumeBar::VolumeBar (TQWidget * tqparent, View * view)
: TQWidget (tqparent), m_view (view), m_value (100) {
tqsetSizePolicy( TQSizePolicy (TQSizePolicy::Minimum, TQSizePolicy::Fixed));
setMinimumSize (TQSize (51, button_height_only_buttons + 2));
TQToolTip::add (this, i18n ("Volume is %1").arg (m_value));
}
KDE_NO_CDTOR_EXPORT VolumeBar::~VolumeBar () {
@ -304,22 +304,22 @@ void VolumeBar::setValue (int v) {
m_value = v;
if (m_value < 0) m_value = 0;
if (m_value > 100) m_value = 100;
QToolTip::remove (this);
QToolTip::add (this, i18n ("Volume is %1").arg (m_value));
repaint (true);
TQToolTip::remove (this);
TQToolTip::add (this, i18n ("Volume is %1").arg (m_value));
tqrepaint (true);
emit volumeChanged (m_value);
}
void VolumeBar::wheelEvent (QWheelEvent * e) {
void VolumeBar::wheelEvent (TQWheelEvent * e) {
setValue (m_value + (e->delta () > 0 ? 2 : -2));
e->accept ();
}
void VolumeBar::paintEvent (QPaintEvent * e) {
QWidget::paintEvent (e);
QPainter p;
void VolumeBar::paintEvent (TQPaintEvent * e) {
TQWidget::paintEvent (e);
TQPainter p;
p.begin (this);
QColor color = paletteForegroundColor ();
TQColor color = paletteForegroundColor ();
p.setPen (color);
int w = width () - 6;
int vx = m_value * w / 100;
@ -329,20 +329,20 @@ void VolumeBar::paintEvent (QPaintEvent * e) {
//kdDebug () << "w=" << w << " vx=" << vx << endl;
}
void VolumeBar::mousePressEvent (QMouseEvent * e) {
void VolumeBar::mousePressEvent (TQMouseEvent * e) {
setValue (100 * (e->x () - 3) / (width () - 6));
e->accept ();
}
void VolumeBar::mouseMoveEvent (QMouseEvent * e) {
void VolumeBar::mouseMoveEvent (TQMouseEvent * e) {
setValue (100 * (e->x () - 3) / (width () - 6));
e->accept ();
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(QWidget * parent, View * view)
: QWidget (parent),
KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(TQWidget * tqparent, View * view)
: TQWidget (tqparent),
m_progress_mode (progress_playing),
m_progress_length (0),
m_popup_timer (0),
@ -350,17 +350,17 @@ KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(QWidget * parent, View * view)
m_view (view),
m_auto_controls (true),
m_popup_clicked (false) {
m_buttonbox = new QHBoxLayout (this, 5, 4);
QColor c = paletteForegroundColor ();
strncpy (xpm_fg_color, QString().sprintf(". c #%02x%02x%02x", c.red(), c.green(),c.blue()).ascii(), 31);
m_buttonbox = new TQHBoxLayout (this, 5, 4);
TQColor c = paletteForegroundColor ();
strncpy (xpm_fg_color, TQString(TQString().sprintf(". c #%02x%02x%02x", c.red(), c.green(),c.blue())).ascii(), 31);
xpm_fg_color[31] = 0;
m_buttons[button_config] = new KMPlayerMenuButton (this, m_buttonbox, config_xpm);
m_buttons[button_playlist] = ctrlButton (this, m_buttonbox, playlist_xpm);
m_buttons[button_back] = ctrlButton (this, m_buttonbox, back_xpm);
m_buttons[button_play] = ctrlButton(this, m_buttonbox, play_xpm, Qt::Key_R);
m_buttons[button_play] = ctrlButton(this, m_buttonbox, play_xpm, TQt::Key_R);
m_buttons[button_forward] = ctrlButton (this, m_buttonbox, forward_xpm);
m_buttons[button_stop] = ctrlButton(this, m_buttonbox, stop_xpm, Qt::Key_S);
m_buttons[button_pause]=ctrlButton(this, m_buttonbox, pause_xpm, Qt::Key_P);
m_buttons[button_stop] = ctrlButton(this, m_buttonbox, stop_xpm, TQt::Key_S);
m_buttons[button_pause]=ctrlButton(this, m_buttonbox, pause_xpm, TQt::Key_P);
m_buttons[button_record] = ctrlButton (this, m_buttonbox, record_xpm);
m_buttons[button_broadcast] = ctrlButton (this, m_buttonbox, broadcast_xpm);
m_buttons[button_language] = new KMPlayerMenuButton (this, m_buttonbox, language_xpm);
@ -372,7 +372,7 @@ KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(QWidget * parent, View * view)
m_buttons[button_stop]->setToggleButton (true);
m_buttons[button_record]->setToggleButton (true);
m_buttons[button_broadcast]->setToggleButton (true);
m_posSlider = new QSlider (0, 100, 1, 0, Qt::Horizontal, this);
m_posSlider = new TQSlider (0, 100, 1, 0, Qt::Horizontal, this);
m_posSlider->setEnabled (false);
m_buttonbox->addWidget (m_posSlider);
setupPositionSlider (true);
@ -383,81 +383,81 @@ KDE_NO_CDTOR_EXPORT ControlPanel::ControlPanel(QWidget * parent, View * view)
m_popupMenu->insertItem (i18n ("&Play with"), m_playerMenu, menu_player);
m_bookmarkMenu = new KMPlayerPopupMenu (this);
m_popupMenu->insertItem (i18n("&Bookmarks"), m_bookmarkMenu, menu_bookmark);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("konsole"), KIcon::Small, 0, true), i18n ("Con&sole"), menu_video);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("player_playlist"), KIcon::Small, 0, true), i18n ("Play&list"), menu_playlist);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("konsole"), KIcon::Small, 0, true), i18n ("Con&sole"), menu_video);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("player_playlist"), KIcon::Small, 0, true), i18n ("Play&list"), menu_playlist);
m_zoomMenu = new KMPlayerPopupMenu (this);
m_zoomMenu->insertItem (i18n ("50%"), menu_zoom50);
m_zoomMenu->insertItem (i18n ("100%"), menu_zoom100);
m_zoomMenu->insertItem (i18n ("150%"), menu_zoom150);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("viewmag"), KIcon::Small, 0, false), i18n ("&Zoom"), m_zoomMenu, menu_zoom);
m_popupMenu->insertItem (KGlobal::iconLoader()->loadIconSet (QString ("window_fullscreen"), KIcon::Small, 0, true), i18n ("&Full Screen"), menu_fullscreen);
m_popupMenu->setAccel (QKeySequence (Qt::Key_F), menu_fullscreen);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("viewmag"), KIcon::Small, 0, false), i18n ("&Zoom"), m_zoomMenu, menu_zoom);
m_popupMenu->insertItem (KGlobal::iconLoader()->loadIconSet (TQString ("window_fullscreen"), KIcon::Small, 0, true), i18n ("&Full Screen"), menu_fullscreen);
m_popupMenu->setAccel (TQKeySequence (TQt::Key_F), menu_fullscreen);
m_popupMenu->insertSeparator ();
m_colorMenu = new KMPlayerPopupMenu (this);
m_languageMenu = new KMPlayerPopupMenu (this);
m_audioMenu = new KMPlayerPopupMenu (this);
m_subtitleMenu = new KMPlayerPopupMenu (this);
m_languageMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("mime-sound"), KIcon::Small, 0, true), i18n ("&Audio languages"), m_audioMenu);
m_languageMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("view_text"), KIcon::Small, 0, true), i18n ("&Subtitles"), m_subtitleMenu);
QLabel * label = new QLabel (i18n ("Contrast:"), m_colorMenu);
m_languageMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("mime-sound"), KIcon::Small, 0, true), i18n ("&Audio languages"), m_audioMenu);
m_languageMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("view_text"), KIcon::Small, 0, true), i18n ("&Subtitles"), m_subtitleMenu);
TQLabel * label = new TQLabel (i18n ("Contrast:"), m_colorMenu);
m_colorMenu->insertItem (label);
m_contrastSlider = new QSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_contrastSlider = new TQSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_colorMenu->insertItem (m_contrastSlider);
label = new QLabel (i18n ("Brightness:"), m_colorMenu);
label = new TQLabel (i18n ("Brightness:"), m_colorMenu);
m_colorMenu->insertItem (label);
m_brightnessSlider = new QSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_brightnessSlider = new TQSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_colorMenu->insertItem (m_brightnessSlider);
label = new QLabel (i18n ("Hue:"), m_colorMenu);
label = new TQLabel (i18n ("Hue:"), m_colorMenu);
m_colorMenu->insertItem (label);
m_hueSlider = new QSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_hueSlider = new TQSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_colorMenu->insertItem (m_hueSlider);
label = new QLabel (i18n ("Saturation:"), m_colorMenu);
label = new TQLabel (i18n ("Saturation:"), m_colorMenu);
m_colorMenu->insertItem (label);
m_saturationSlider = new QSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_saturationSlider = new TQSlider (-100, 100, 10, 0, Qt::Horizontal, m_colorMenu);
m_colorMenu->insertItem (m_saturationSlider);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("colorize"), KIcon::Small, 0, true), i18n ("Co&lors"), m_colorMenu);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("colorize"), KIcon::Small, 0, true), i18n ("Co&lors"), m_colorMenu);
m_popupMenu->insertSeparator ();
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (QString ("configure"), KIcon::Small, 0, true), i18n ("&Configure KMPlayer..."), menu_config);
m_popupMenu->insertItem (KGlobal::iconLoader ()->loadIconSet (TQString ("configure"), KIcon::Small, 0, true), i18n ("&Configure KMPlayer..."), menu_config);
setAutoControls (true);
connect (m_buttons [button_config], SIGNAL (clicked ()),
this, SLOT (buttonClicked ()));
connect (m_buttons [button_language], SIGNAL (clicked ()),
this, SLOT (buttonClicked ()));
connect (m_buttons [button_config], SIGNAL (mouseEntered ()),
this, SLOT (buttonMouseEntered ()));
connect (m_buttons [button_language], SIGNAL (mouseEntered ()),
this, SLOT (buttonMouseEntered ()));
connect (m_popupMenu, SIGNAL (mouseLeft ()), this, SLOT (menuMouseLeft ()));
connect (m_playerMenu, SIGNAL (mouseLeft ()), this, SLOT(menuMouseLeft ()));
connect (m_zoomMenu, SIGNAL (mouseLeft ()), this, SLOT (menuMouseLeft ()));
connect (m_colorMenu, SIGNAL (mouseLeft ()), this, SLOT (menuMouseLeft ()));
connect (m_languageMenu, SIGNAL(mouseLeft ()), this, SLOT(menuMouseLeft()));
connect (m_subtitleMenu, SIGNAL(mouseLeft ()), this, SLOT(menuMouseLeft()));
connect (m_audioMenu, SIGNAL (mouseLeft ()), this, SLOT (menuMouseLeft ()));
}
KDE_NO_EXPORT void ControlPanel::setPalette (const QPalette & pal) {
QWidget::setPalette (pal);
QColor c = paletteForegroundColor ();
strncpy (xpm_fg_color, QString().sprintf(". c #%02x%02x%02x", c.red(), c.green(),c.blue()).ascii(), 31);
connect (m_buttons [button_config], TQT_SIGNAL (clicked ()),
this, TQT_SLOT (buttonClicked ()));
connect (m_buttons [button_language], TQT_SIGNAL (clicked ()),
this, TQT_SLOT (buttonClicked ()));
connect (m_buttons [button_config], TQT_SIGNAL (mouseEntered ()),
this, TQT_SLOT (buttonMouseEntered ()));
connect (m_buttons [button_language], TQT_SIGNAL (mouseEntered ()),
this, TQT_SLOT (buttonMouseEntered ()));
connect (m_popupMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT (menuMouseLeft ()));
connect (m_playerMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT(menuMouseLeft ()));
connect (m_zoomMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT (menuMouseLeft ()));
connect (m_colorMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT (menuMouseLeft ()));
connect (m_languageMenu, TQT_SIGNAL(mouseLeft ()), this, TQT_SLOT(menuMouseLeft()));
connect (m_subtitleMenu, TQT_SIGNAL(mouseLeft ()), this, TQT_SLOT(menuMouseLeft()));
connect (m_audioMenu, TQT_SIGNAL (mouseLeft ()), this, TQT_SLOT (menuMouseLeft ()));
}
KDE_NO_EXPORT void ControlPanel::setPalette (const TQPalette & pal) {
TQWidget::setPalette (pal);
TQColor c = paletteForegroundColor ();
strncpy (xpm_fg_color, TQString(TQString().sprintf(". c #%02x%02x%02x", c.red(), c.green(),c.blue())).ascii(), 31);
xpm_fg_color[31] = 0;
m_buttons[button_config]->setIconSet (QIconSet (QPixmap (config_xpm)));
m_buttons[button_playlist]->setIconSet (QIconSet (QPixmap (playlist_xpm)));
m_buttons[button_back]->setIconSet (QIconSet (QPixmap (back_xpm)));
m_buttons[button_play]->setIconSet (QIconSet (QPixmap (play_xpm)));
m_buttons[button_forward]->setIconSet (QIconSet (QPixmap (forward_xpm)));
m_buttons[button_stop]->setIconSet (QIconSet (QPixmap (stop_xpm)));
m_buttons[button_pause]->setIconSet (QIconSet (QPixmap (pause_xpm)));
m_buttons[button_record]->setIconSet (QIconSet (QPixmap (record_xpm)));
m_buttons[button_broadcast]->setIconSet (QIconSet (QPixmap (broadcast_xpm)));
m_buttons[button_language]->setIconSet (QIconSet (QPixmap (language_xpm)));
m_buttons[button_red]->setIconSet (QIconSet (QPixmap (red_xpm)));
m_buttons[button_green]->setIconSet (QIconSet (QPixmap (green_xpm)));
m_buttons[button_yellow]->setIconSet (QIconSet (QPixmap (yellow_xpm)));
m_buttons[button_blue]->setIconSet (QIconSet (QPixmap (blue_xpm)));
}
KDE_NO_EXPORT void ControlPanel::timerEvent (QTimerEvent * e) {
m_buttons[button_config]->setIconSet (TQIconSet (TQPixmap (config_xpm)));
m_buttons[button_playlist]->setIconSet (TQIconSet (TQPixmap (playlist_xpm)));
m_buttons[button_back]->setIconSet (TQIconSet (TQPixmap (back_xpm)));
m_buttons[button_play]->setIconSet (TQIconSet (TQPixmap (play_xpm)));
m_buttons[button_forward]->setIconSet (TQIconSet (TQPixmap (forward_xpm)));
m_buttons[button_stop]->setIconSet (TQIconSet (TQPixmap (stop_xpm)));
m_buttons[button_pause]->setIconSet (TQIconSet (TQPixmap (pause_xpm)));
m_buttons[button_record]->setIconSet (TQIconSet (TQPixmap (record_xpm)));
m_buttons[button_broadcast]->setIconSet (TQIconSet (TQPixmap (broadcast_xpm)));
m_buttons[button_language]->setIconSet (TQIconSet (TQPixmap (language_xpm)));
m_buttons[button_red]->setIconSet (TQIconSet (TQPixmap (red_xpm)));
m_buttons[button_green]->setIconSet (TQIconSet (TQPixmap (green_xpm)));
m_buttons[button_yellow]->setIconSet (TQIconSet (TQPixmap (yellow_xpm)));
m_buttons[button_blue]->setIconSet (TQIconSet (TQPixmap (blue_xpm)));
}
KDE_NO_EXPORT void ControlPanel::timerEvent (TQTimerEvent * e) {
if (e->timerId () == m_popup_timer) {
m_popup_timer = 0;
if (m_button_monitored == button_config) {
@ -477,7 +477,7 @@ KDE_NO_EXPORT void ControlPanel::timerEvent (QTimerEvent * e) {
!m_colorMenu->hasMouse () &&
!m_bookmarkMenu->hasMouse ()) {
if (!(m_bookmarkMenu->isVisible () &&
static_cast <QWidget *> (m_bookmarkMenu) != QWidget::keyboardGrabber ())) {
static_cast <TQWidget *> (m_bookmarkMenu) != TQWidget::keyboardGrabber ())) {
// not if user entered the bookmark sub menu or if I forgot one
m_popupMenu->hide ();
if (m_buttons [button_config]->isOn ())
@ -517,11 +517,11 @@ void ControlPanel::setAutoControls (bool b) {
KDE_NO_EXPORT void ControlPanel::showPopupMenu () {
m_view->updateVolume ();
m_popupMenu->exec (m_buttons [button_config]->mapToGlobal (QPoint (0, maximumSize ().height ())));
m_popupMenu->exec (m_buttons [button_config]->mapToGlobal (TQPoint (0, tqmaximumSize ().height ())));
}
KDE_NO_EXPORT void ControlPanel::showLanguageMenu () {
m_languageMenu->exec (m_buttons [button_language]->mapToGlobal (QPoint (0, maximumSize ().height ())));
m_languageMenu->exec (m_buttons [button_language]->mapToGlobal (TQPoint (0, tqmaximumSize ().height ())));
}
void ControlPanel::showPositionSlider (bool show) {
@ -540,12 +540,12 @@ KDE_NO_EXPORT void ControlPanel::setupPositionSlider (bool show) {
m_posSlider->show ();
m_buttonbox->setMargin (4);
m_buttonbox->setSpacing (4);
setEraseColor (m_view->topLevelWidget ()->paletteBackgroundColor ());
setEraseColor (m_view->tqtopLevelWidget ()->paletteBackgroundColor ());
} else {
m_posSlider->hide ();
m_buttonbox->setMargin (1);
m_buttonbox->setSpacing (1);
setEraseColor (QColor (0, 0, 0));
setEraseColor (TQColor (0, 0, 0));
}
for (int i = 0; i < (int) button_last; i++) {
m_buttons[i]->setMinimumSize (15, h-1);
@ -656,7 +656,7 @@ KDE_NO_EXPORT void ControlPanel::menuMouseLeft () {
m_popdown_timer = startTimer (400);
}
KDE_NO_EXPORT void ControlPanel::setLanguages (const QStringList & alang, const QStringList & slang) {
KDE_NO_EXPORT void ControlPanel::setLanguages (const TQStringList & alang, const TQStringList & slang) {
int sz = (int) alang.size ();
bool showbutton = (sz > 0);
m_audioMenu->clear ();

@ -23,15 +23,15 @@
#include <config.h>
#endif
#include <qwidget.h>
#include <qpushbutton.h>
#include <tqwidget.h>
#include <tqpushbutton.h>
#include <kpopupmenu.h>
class QSlider;
//class QPushButton;
class QBoxLayout;
class QStringList;
class TQSlider;
//class TQPushButton;
class TQBoxLayout;
class TQStringList;
class KPopupMenu;
namespace KMPlayer {
@ -41,15 +41,16 @@ class View;
/*
* A button from the controlpanel
*/
class KMPLAYER_NO_EXPORT KMPlayerMenuButton : public QPushButton {
class KMPLAYER_NO_EXPORT KMPlayerMenuButton : public TQPushButton {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerMenuButton (QWidget *, QBoxLayout *, const char **, int = 0);
KMPlayerMenuButton (TQWidget *, TQBoxLayout *, const char **, int = 0);
KDE_NO_CDTOR_EXPORT ~KMPlayerMenuButton () {}
signals:
void mouseEntered ();
protected:
void enterEvent (QEvent *);
void enterEvent (TQEvent *);
};
/*
@ -57,32 +58,34 @@ protected:
*/
class KMPLAYER_EXPORT KMPlayerPopupMenu : public KPopupMenu {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerPopupMenu (QWidget *);
KMPlayerPopupMenu (TQWidget *);
KDE_NO_CDTOR_EXPORT ~KMPlayerPopupMenu () {}
signals:
void mouseLeft ();
protected:
void leaveEvent (QEvent *);
void leaveEvent (TQEvent *);
};
/*
* The volume bar from the controlpanel
*/
class KMPLAYER_EXPORT VolumeBar : public QWidget {
class KMPLAYER_EXPORT VolumeBar : public TQWidget {
Q_OBJECT
TQ_OBJECT
public:
VolumeBar (QWidget * parent, View * view);
VolumeBar (TQWidget * tqparent, View * view);
~VolumeBar ();
KDE_NO_EXPORT int value () const { return m_value; }
void setValue (int v);
signals:
void volumeChanged (int); // 0 - 100
protected:
void wheelEvent (QWheelEvent * e);
void paintEvent (QPaintEvent *);
void mousePressEvent (QMouseEvent * e);
void mouseMoveEvent (QMouseEvent * e);
void wheelEvent (TQWheelEvent * e);
void paintEvent (TQPaintEvent *);
void mousePressEvent (TQMouseEvent * e);
void mouseMoveEvent (TQMouseEvent * e);
private:
View * m_view;
int m_value;
@ -91,8 +94,9 @@ private:
/*
* The controlpanel GUI
*/
class KMPLAYER_EXPORT ControlPanel : public QWidget {
class KMPLAYER_EXPORT ControlPanel : public TQWidget {
Q_OBJECT
TQ_OBJECT
public:
enum MenuID {
menu_config = 0, menu_player, menu_fullscreen, menu_volume,
@ -107,7 +111,7 @@ public:
button_red, button_green, button_yellow, button_blue,
button_last
};
ControlPanel (QWidget * parent, View * view);
ControlPanel (TQWidget * tqparent, View * view);
KDE_NO_CDTOR_EXPORT ~ControlPanel () {}
void showPositionSlider (bool show);
void enableSeekButtons (bool enable);
@ -115,27 +119,27 @@ public:
void setPlaying (bool play);
void setRecording (bool record);
void setAutoControls (bool b);
void setPalette (const QPalette &);
void setPalette (const TQPalette &);
int preferedHeight ();
KDE_NO_EXPORT bool autoControls () const { return m_auto_controls; }
KDE_NO_EXPORT QSlider * positionSlider () const { return m_posSlider; }
KDE_NO_EXPORT QSlider * contrastSlider () const { return m_contrastSlider; }
KDE_NO_EXPORT QSlider * brightnessSlider () const { return m_brightnessSlider; }
KDE_NO_EXPORT QSlider * hueSlider () const { return m_hueSlider; }
KDE_NO_EXPORT QSlider * saturationSlider () const { return m_saturationSlider; }
QPushButton * button (Button b) const { return m_buttons [(int) b]; }
KDE_NO_EXPORT QPushButton * broadcastButton () const { return m_buttons[button_broadcast]; }
KDE_NO_EXPORT TQSlider * positionSlider () const { return m_posSlider; }
KDE_NO_EXPORT TQSlider * contrastSlider () const { return m_contrastSlider; }
KDE_NO_EXPORT TQSlider * brightnessSlider () const { return m_brightnessSlider; }
KDE_NO_EXPORT TQSlider * hueSlider () const { return m_hueSlider; }
KDE_NO_EXPORT TQSlider * saturationSlider () const { return m_saturationSlider; }
TQPushButton * button (Button b) const { return m_buttons [(int) b]; }
KDE_NO_EXPORT TQPushButton * broadcastButton () const { return m_buttons[button_broadcast]; }
KDE_NO_EXPORT VolumeBar * volumeBar () const { return m_volume; }
KDE_NO_EXPORT KMPlayerPopupMenu * popupMenu () const { return m_popupMenu; }
KDE_NO_EXPORT KPopupMenu * bookmarkMenu () const { return m_bookmarkMenu; }
KDE_NO_EXPORT QPopupMenu * zoomMenu () const { return m_zoomMenu; }
KDE_NO_EXPORT QPopupMenu * playerMenu () const { return m_playerMenu; }
KDE_NO_EXPORT QPopupMenu * colorMenu () const { return m_colorMenu; }
KDE_NO_EXPORT QPopupMenu * audioMenu () const { return m_audioMenu; }
KDE_NO_EXPORT QPopupMenu * subtitleMenu () const { return m_subtitleMenu; }
KDE_NO_EXPORT TQPopupMenu * zoomMenu () const { return m_zoomMenu; }
KDE_NO_EXPORT TQPopupMenu * playerMenu () const { return m_playerMenu; }
KDE_NO_EXPORT TQPopupMenu * colorMenu () const { return m_colorMenu; }
KDE_NO_EXPORT TQPopupMenu * audioMenu () const { return m_audioMenu; }
KDE_NO_EXPORT TQPopupMenu * subtitleMenu () const { return m_subtitleMenu; }
KDE_NO_EXPORT View * view () const { return m_view; }
public slots:
void setLanguages (const QStringList & al, const QStringList & sl);
void setLanguages (const TQStringList & al, const TQStringList & sl);
void selectSubtitle (int id);
void selectAudioLanguage (int id);
void showPopupMenu ();
@ -143,7 +147,7 @@ public slots:
void setPlayingProgress (int position, int length);
void setLoadingProgress (int pos);
protected:
void timerEvent (QTimerEvent * e);
void timerEvent (TQTimerEvent * e);
void setupPositionSlider (bool show);
private slots:
void buttonMouseEntered ();
@ -156,13 +160,13 @@ private:
int m_popdown_timer;
int m_button_monitored;
View * m_view;
QBoxLayout * m_buttonbox;
QSlider * m_posSlider;
QSlider * m_contrastSlider;
QSlider * m_brightnessSlider;
QSlider * m_hueSlider;
QSlider * m_saturationSlider;
QPushButton * m_buttons [button_last];
TQBoxLayout * m_buttonbox;
TQSlider * m_posSlider;
TQSlider * m_contrastSlider;
TQSlider * m_brightnessSlider;
TQSlider * m_hueSlider;
TQSlider * m_saturationSlider;
TQPushButton * m_buttons [button_last];
VolumeBar * m_volume;
KMPlayerPopupMenu * m_popupMenu;
KMPlayerPopupMenu * m_bookmarkMenu;

File diff suppressed because it is too large Load Diff

@ -23,10 +23,10 @@
#include "kmplayer_def.h"
#include <qobject.h>
#include <qguardedptr.h>
#include <qstringlist.h>
#include <qmap.h>
#include <tqobject.h>
#include <tqguardedptr.h>
#include <tqstringlist.h>
#include <tqmap.h>
#include <dcopobject.h>
#include <kmediaplayer/player.h>
@ -41,9 +41,9 @@ class KInstance;
class KActionCollection;
class KBookmarkMenu;
class KConfig;
class QIODevice;
class QTextStream;
class QListViewItem;
class TQIODevice;
class TQTextStream;
class TQListViewItem;
namespace KIO {
class Job;
@ -67,13 +67,14 @@ class Settings;
*/
class KMPLAYER_EXPORT URLSource : public Source {
Q_OBJECT
// TQ_OBJECT
public:
URLSource (PartBase * player, const KURL & url = KURL ());
virtual ~URLSource ();
virtual void dimensions (int & w, int & h);
virtual bool hasLength ();
virtual QString prettyName ();
virtual TQString prettyName ();
virtual void reset ();
virtual void setURL (const KURL & url);
public slots:
@ -86,21 +87,21 @@ public slots:
virtual void jump (NodePtr e);
void play ();
private slots:
void kioData (KIO::Job *, const QByteArray &);
void kioMimetype (KIO::Job *, const QString &);
void kioData (KIO::Job *, const TQByteArray &);
void kioMimetype (KIO::Job *, const TQString &);
void kioResult (KIO::Job *);
protected:
virtual bool requestPlayURL (NodePtr mrl);
virtual bool resolveURL (NodePtr mrl);
private:
void read (NodePtr mrl, QTextStream &);
void read (NodePtr mrl, TQTextStream &);
void stopResolving ();
struct ResolveInfo {
ResolveInfo (NodePtr mrl, KIO::Job * j, SharedPtr <ResolveInfo> & n)
: resolving_mrl (mrl), job (j), progress (0), next (n) {}
NodePtrW resolving_mrl;
KIO::Job * job;
QByteArray data;
TQByteArray data;
int progress;
SharedPtr <ResolveInfo> next;
};
@ -113,10 +114,11 @@ private:
*/
class KMPLAYER_EXPORT PartBase : public KMediaPlayer::Player {
Q_OBJECT
// TQ_OBJECT
K_DCOP
public:
typedef QMap <QString, Process *> ProcessMap;
PartBase (QWidget * parent, const char * wname,QObject * objectParent, const char * name, KConfig *);
typedef TQMap <TQString, Process *> ProcessMap;
PartBase (TQWidget * tqparent, const char * wname,TQObject * objectParent, const char * name, KConfig *);
~PartBase ();
void init (KActionCollection * = 0L);
virtual KMediaPlayer::View* view ();
@ -143,23 +145,23 @@ public:
Process * process () const { return m_process; }
Process * recorder () const { return m_recorder; }
Source * source () const { return m_source; }
QMap <QString, Process *> & players () { return m_players; }
QMap <QString, Process *> & recorders () { return m_recorders; }
QMap <QString, Source *> & sources () { return m_sources; }
TQMap <TQString, Process *> & players () { return m_players; }
TQMap <TQString, Process *> & recorders () { return m_recorders; }
TQMap <TQString, Source *> & sources () { return m_sources; }
KConfig * config () const { return m_config; }
bool mayResize () const { return !m_noresize; }
void updatePlayerMenu (ControlPanel *);
void updateInfo (const QString & msg);
void updateStatus (const QString & msg);
void updateInfo (const TQString & msg);
void updatetqStatus (const TQString & msg);
#ifdef HAVE_DBUS
void setServiceName (const QString & srv) { m_service = srv; }
QString serviceName () const { return m_service; }
void setServiceName (const TQString & srv) { m_service = srv; }
TQString serviceName () const { return m_service; }
#endif
// these are called from Process
void changeURL (const QString & url);
void changeURL (const TQString & url);
void updateTree (bool full=true, bool force=false);
void setLanguages (const QStringList & alang, const QStringList & slang);
void setLanguages (const TQStringList & alang, const TQStringList & slang);
public slots:
virtual bool openURL (const KURL & url);
virtual bool openURL (const KURL::List & urls);
@ -176,7 +178,7 @@ public slots:
void slotPlayerMenu (int);
void back ();
void forward ();
void addBookMark (const QString & title, const QString & url);
void addBookMark (const TQString & title, const TQString & url);
void volumeChanged (int);
void increaseVolume ();
void decreaseVolume ();
@ -194,20 +196,20 @@ signals:
void sourceChanged (KMPlayer::Source * old, KMPlayer::Source * nw);
void sourceDimensionChanged ();
void loading (int percentage);
void urlAdded (const QString & url);
void urlChanged (const QString & url);
void urlAdded (const TQString & url);
void urlChanged (const TQString & url);
void processChanged (const char *);
void treeChanged (int id, NodePtr root, NodePtr, bool select, bool open);
void treeUpdated ();
void infoUpdated (const QString & msg);
void statusUpdated (const QString & msg);
void languagesUpdated(const QStringList & alang, const QStringList & slang);
void infoUpdated (const TQString & msg);
void statusUpdated (const TQString & msg);
void languagesUpdated(const TQStringList & alang, const TQStringList & slang);
void audioIsSelected (int id);
void subtitleIsSelected (int id);
void positioned (int pos, int length);
protected:
bool openFile();
virtual void timerEvent (QTimerEvent *);
virtual void timerEvent (TQTimerEvent *);
protected slots:
void posSliderPressed ();
void posSliderReleased ();
@ -218,8 +220,8 @@ protected slots:
void saturationValueChanged (int val);
void sourceHasChangedAspects ();
void fullScreen ();
void playListItemClicked (QListViewItem *);
void playListItemExecuted (QListViewItem *);
void playListItemClicked (TQListViewItem *);
void playListItemExecuted (TQListViewItem *);
virtual void playingStarted ();
virtual void playingStopped ();
void recordingStarted ();
@ -229,20 +231,20 @@ protected slots:
void subtitleSelected (int);
protected:
KConfig * m_config;
QGuardedPtr <View> m_view;
QMap <QString, QString> temp_backends;
TQGuardedPtr <View> m_view;
TQMap <TQString, TQString> temp_backends;
Settings * m_settings;
Process * m_process;
Process * m_recorder;
Source * m_source;
ProcessMap m_players;
ProcessMap m_recorders;
QMap <QString, Source *> m_sources;
TQMap <TQString, Source *> m_sources;
BookmarkManager * m_bookmark_manager;
BookmarkOwner * m_bookmark_owner;
KBookmarkMenu * m_bookmark_menu;
#ifdef HAVE_DBUS
QString m_service;
TQString m_service;
#endif
int m_record_timer;
int m_update_tree_timer;
@ -254,40 +256,42 @@ protected:
bool m_update_tree_full : 1;
};
class KMPLAYER_NO_EXPORT DataCache : public QObject {
class KMPLAYER_NO_EXPORT DataCache : public TQObject {
Q_OBJECT
typedef QMap <QString, QByteArray> DataMap;
typedef QMap <QString, bool> PreserveMap;
// TQ_OBJECT
typedef TQMap <TQString, TQByteArray> DataMap;
typedef TQMap <TQString, bool> PreserveMap;
DataMap cache_map;
PreserveMap preserve_map;
public:
DataCache () {}
~DataCache () {}
void add (const QString &, const QByteArray &);
bool get (const QString &, QByteArray &);
bool preserve (const QString &);
bool unpreserve (const QString &);
bool isPreserved (const QString &);
void add (const TQString &, const TQByteArray &);
bool get (const TQString &, TQByteArray &);
bool preserve (const TQString &);
bool unpreserve (const TQString &);
bool isPreserved (const TQString &);
signals:
void preserveRemoved (const QString &); // ready or canceled
void preserveRemoved (const TQString &); // ready or canceled
};
class KMPLAYER_NO_EXPORT RemoteObjectPrivate : public QObject {
class KMPLAYER_NO_EXPORT RemoteObjectPrivate : public TQObject {
Q_OBJECT
// TQ_OBJECT
public:
RemoteObjectPrivate (RemoteObject * r);
~RemoteObjectPrivate ();
bool download (const QString &);
bool download (const TQString &);
void clear ();
KIO::Job * job;
QString url;
QByteArray data;
QString mime;
TQString url;
TQByteArray data;
TQString mime;
private slots:
void slotResult (KIO::Job*);
void slotData (KIO::Job*, const QByteArray& qb);
void slotMimetype (KIO::Job * job, const QString & mimestr);
void cachePreserveRemoved (const QString &);
void slotData (KIO::Job*, const TQByteArray& qb);
void slotMimetype (KIO::Job * job, const TQString & mimestr);
void cachePreserveRemoved (const TQString &);
private:
RemoteObject * remote_object;
bool preserve_wait;

@ -19,7 +19,7 @@
#include <config.h>
#include <time.h>
#include <qtextstream.h>
#include <tqtextstream.h>
#include <kdebug.h>
#include <kurl.h>
#ifdef HAVE_EXPAT
@ -45,7 +45,7 @@ using namespace KMPlayer;
//-----------------------------------------------------------------------------
namespace KMPlayer {
Node * fromXMLDocumentTag (NodePtr & d, const QString & tag) {
Node * fromXMLDocumentTag (NodePtr & d, const TQString & tag) {
const char * const name = tag.latin1 ();
if (!strcmp (name, "smil"))
return new SMIL::Smil (d);
@ -60,7 +60,7 @@ namespace KMPlayer {
else if (!strcasecmp (name, "playlist"))
return new XSPF::Playlist (d);
else if (!strcasecmp (name, "url"))
return new GenericURL (d, QString ());
return new GenericURL (d, TQString ());
else if (!strcasecmp (name, "mrl") ||
!strcasecmp (name, "document"))
return new GenericMrl (d);
@ -70,21 +70,21 @@ namespace KMPlayer {
//-----------------------------------------------------------------------------
struct XMLStringlet {
const QString str;
XMLStringlet (const QString & s) : str (s) {}
const TQString str;
XMLStringlet (const TQString & s) : str (s) {}
};
} // namespace
QTextStream & operator << (QTextStream & out, const XMLStringlet & txt) {
TQTextStream & operator << (TQTextStream & out, const XMLStringlet & txt) {
int len = int (txt.str.length ());
for (int i = 0; i < len; ++i) {
if (txt.str [i] == QChar ('<')) {
if (txt.str [i] == TQChar ('<')) {
out << "&lt;";
} else if (txt.str [i] == QChar ('>')) {
} else if (txt.str [i] == TQChar ('>')) {
out << "&gt;";
} else if (txt.str [i] == QChar ('"')) {
} else if (txt.str [i] == TQChar ('"')) {
out << "&quot;";
} else if (txt.str [i] == QChar ('&')) {
} else if (txt.str [i] == TQChar ('&')) {
out << "&amp;";
} else
out << txt.str [i];
@ -296,7 +296,7 @@ void Node::clearChildren () {
if (m_doc)
document()->m_tree_version++;
while (m_first_child != m_last_child) {
// avoid stack abuse with 10k children derefing each other
// avoid stack abuse with 10k tqchildren derefing each other
m_last_child->m_parent = 0L;
m_last_child = m_last_child->m_prev;
m_last_child->m_next = 0L;
@ -308,7 +308,7 @@ void Node::clearChildren () {
void Node::appendChild (NodePtr c) {
document()->m_tree_version++;
ASSERT (!c->parentNode ());
ASSERT (!c->tqparentNode ());
TreeNode<Node>::appendChild (c);
}
@ -316,7 +316,7 @@ void Node::insertBefore (NodePtr c, NodePtr b) {
if (!b) {
appendChild (c);
} else {
ASSERT (!c->parentNode ());
ASSERT (!c->tqparentNode ());
document()->m_tree_version++;
if (b->m_prev) {
b->m_prev->m_next = c;
@ -358,11 +358,11 @@ KDE_NO_EXPORT void Node::replaceChild (NodePtr _new, NodePtr old) {
old->m_parent = 0L;
}
NodePtr Node::childFromTag (const QString &) {
NodePtr Node::childFromTag (const TQString &) {
return NodePtr ();
}
KDE_NO_EXPORT void Node::characterData (const QString & s) {
KDE_NO_EXPORT void Node::characterData (const TQString & s) {
document()->m_tree_version++;
if (!m_last_child || m_last_child->id != id_node_text)
appendChild (new TextNode (m_doc, s));
@ -375,7 +375,7 @@ void Node::normalize () {
while (e) {
NodePtr tmp = e->nextSibling ();
if (!e->isElementNode () && e->id == id_node_text) {
QString val = e->nodeValue ().simplifyWhiteSpace ();
TQString val = e->nodeValue ().simplifyWhiteSpace ();
if (val.isEmpty ())
removeChild (e);
else
@ -386,7 +386,7 @@ void Node::normalize () {
}
}
static void getInnerText (const NodePtr p, QTextOStream & out) {
static void getInnerText (const NodePtr p, TQTextOStream & out) {
for (NodePtr e = p->firstChild (); e; e = e->nextSibling ()) {
if (e->id == id_node_text || e->id == id_node_cdata)
out << e->nodeValue ();
@ -395,48 +395,48 @@ static void getInnerText (const NodePtr p, QTextOStream & out) {
}
}
QString Node::innerText () const {
QString buf;
QTextOStream out (&buf);
TQString Node::innerText () const {
TQString buf;
TQTextOStream out (&buf);
getInnerText (m_self, out);
return buf;
}
static void getOuterXML (const NodePtr p, QTextOStream & out, int depth) {
static void getOuterXML (const NodePtr p, TQTextOStream & out, int depth) {
if (!p->isElementNode ()) { // #text or #cdata
if (p->id == id_node_cdata)
out << "<![CDATA[" << p->nodeValue () << "]]>" << QChar ('\n');
out << "<![CDATA[" << p->nodeValue () << "]]>" << TQChar ('\n');
else
out << XMLStringlet (p->nodeValue ()) << QChar ('\n');
out << XMLStringlet (p->nodeValue ()) << TQChar ('\n');
} else {
Element * e = convertNode <Element> (p);
QString indent (QString ().fill (QChar (' '), depth));
out << indent << QChar ('<') << XMLStringlet (e->nodeName ());
TQString indent (TQString ().fill (TQChar (' '), depth));
out << indent << TQChar ('<') << XMLStringlet (e->nodeName ());
for (AttributePtr a = e->attributes()->first(); a; a = a->nextSibling())
out << " " << XMLStringlet (a->name ().toString ()) <<
"=\"" << XMLStringlet (a->value ()) << "\"";
if (e->hasChildNodes ()) {
out << QChar ('>') << QChar ('\n');
out << TQChar ('>') << TQChar ('\n');
for (NodePtr c = e->firstChild (); c; c = c->nextSibling ())
getOuterXML (c, out, depth + 1);
out << indent << QString("</") << XMLStringlet (e->nodeName()) <<
QChar ('>') << QChar ('\n');
out << indent << TQString("</") << XMLStringlet (e->nodeName()) <<
TQChar ('>') << TQChar ('\n');
} else
out << QString ("/>") << QChar ('\n');
out << TQString ("/>") << TQChar ('\n');
}
}
QString Node::innerXML () const {
QString buf;
QTextOStream out (&buf);
TQString Node::innerXML () const {
TQString buf;
TQTextOStream out (&buf);
for (NodePtr e = firstChild (); e; e = e->nextSibling ())
getOuterXML (e, out, 0);
return buf;
}
QString Node::outerXML () const {
QString buf;
QTextOStream out (&buf);
TQString Node::outerXML () const {
TQString buf;
TQTextOStream out (&buf);
getOuterXML (m_self, out, 0);
return buf;
}
@ -475,8 +475,8 @@ ConnectionPtr Node::connectTo (NodePtr node, unsigned int evt_id) {
return ConnectionPtr ();
}
QString Node::nodeValue () const {
return QString ();
TQString Node::nodeValue () const {
return TQString ();
}
SurfacePtr Node::getSurface (NodePtr) {
@ -493,21 +493,21 @@ RefNode::RefNode (NodePtr & d, NodePtr ref)
void RefNode::setRefNode (const NodePtr ref) {
ref_node = ref;
if (ref_node)
tag_name = QString ("&%1").arg (ref_node->nodeName ());
tag_name = TQString ("&%1").arg (ref_node->nodeName ());
}
//-----------------------------------------------------------------------------
namespace KMPlayer {
struct KMPLAYER_NO_EXPORT ParamValue {
QString val;
QStringList * modifications;
ParamValue (const QString & v) : val (v), modifications (0L) {}
TQString val;
TQStringList * modifications;
ParamValue (const TQString & v) : val (v), modifications (0L) {}
~ParamValue () { delete modifications; }
QString value ();
void setValue (const QString & v) { val = v; }
TQString value ();
void setValue (const TQString & v) { val = v; }
};
typedef QMap <TrieString, ParamValue *> ParamMap;
typedef TQMap <TrieString, ParamValue *> ParamMap;
class KMPLAYER_NO_EXPORT ElementPrivate {
public:
~ElementPrivate ();
@ -516,7 +516,7 @@ namespace KMPlayer {
};
}
KDE_NO_EXPORT QString ParamValue::value () {
KDE_NO_EXPORT TQString ParamValue::value () {
return modifications && modifications->size ()
? modifications->back () : val;
}
@ -539,15 +539,15 @@ Element::~Element () {
delete d;
}
void Element::setParam (const TrieString &param, const QString &val, int *mid) {
void Element::setParam (const TrieString &param, const TQString &val, int *mid) {
ParamValue * pv = d->params [param];
if (!pv) {
pv = new ParamValue (mid ? QString() : val);
pv = new ParamValue (mid ? TQString() : val);
d->params.insert (param, pv);
}
if (mid) {
if (!pv->modifications)
pv->modifications = new QStringList;
pv->modifications = new TQStringList;
if (*mid >= 0 && *mid < int (pv->modifications->size ())) {
(*pv->modifications) [*mid] = val;
} else {
@ -559,23 +559,23 @@ void Element::setParam (const TrieString &param, const QString &val, int *mid) {
parseParam (param, val);
}
QString Element::param (const TrieString & name) {
TQString Element::param (const TrieString & name) {
ParamValue * pv = d->params [name];
if (pv)
return pv->value ();
return QString ();
return TQString ();
}
void Element::resetParam (const TrieString & param, int mid) {
ParamValue * pv = d->params [param];
if (pv && pv->modifications) {
if (int (pv->modifications->size ()) > mid && mid > -1) {
(*pv->modifications) [mid] = QString ();
(*pv->modifications) [mid] = TQString ();
while (pv->modifications->size () > 0 &&
pv->modifications->back ().isNull ())
pv->modifications->pop_back ();
}
QString val = pv->value ();
TQString val = pv->value ();
if (pv->modifications->size () == 0) {
delete pv->modifications;
pv->modifications = 0L;
@ -590,7 +590,7 @@ void Element::resetParam (const TrieString & param, int mid) {
kdError () << "resetting " << param.toString() << " that doesn't exists" << endl;
}
void Element::setAttribute (const TrieString & name, const QString & value) {
void Element::setAttribute (const TrieString & name, const TQString & value) {
for (AttributePtr a = m_attributes->first (); a; a = a->nextSibling ())
if (name == a->name ()) {
a->setValue (value);
@ -599,11 +599,11 @@ void Element::setAttribute (const TrieString & name, const QString & value) {
m_attributes->append (new Attribute (name, value));
}
QString Element::getAttribute (const TrieString & name) {
TQString Element::getAttribute (const TrieString & name) {
for (AttributePtr a = m_attributes->first (); a; a = a->nextSibling ())
if (name == a->name ())
return a->value ();
return QString ();
return TQString ();
}
void Element::init () {
@ -629,14 +629,14 @@ void Element::setAttributes (AttributeListPtr attrs) {
//-----------------------------------------------------------------------------
Attribute::Attribute (const TrieString & n, const QString & v)
Attribute::Attribute (const TrieString & n, const TQString & v)
: m_name (n), m_value (v) {}
void Attribute::setName (const TrieString & n) {
m_name = n;
}
void Attribute::setValue (const QString & v) {
void Attribute::setValue (const TQString & v) {
m_value = v;
}
@ -666,10 +666,10 @@ Node::PlayType Mrl::playType () {
return cached_play_type;
}
QString Mrl::absolutePath () {
QString path = src;
TQString Mrl::absolutePath () {
TQString path = src;
if (!path.isEmpty()) {
for (NodePtr e = parentNode (); e; e = e->parentNode ()) {
for (NodePtr e = tqparentNode (); e; e = e->tqparentNode ()) {
Mrl * mrl = e->mrl ();
if (mrl && !mrl->src.isEmpty () && mrl->src != src) {
path = KURL (mrl->absolutePath (), src).url ();
@ -680,7 +680,7 @@ QString Mrl::absolutePath () {
return path;
}
NodePtr Mrl::childFromTag (const QString & tag) {
NodePtr Mrl::childFromTag (const TQString & tag) {
Node * elm = fromXMLDocumentTag (m_doc, tag);
if (elm)
return elm;
@ -737,7 +737,7 @@ void Mrl::begin () {
}
SurfacePtr Mrl::getSurface (NodePtr node) {
for (NodePtr p = parentNode (); p; p = p->parentNode ())
for (NodePtr p = tqparentNode (); p; p = p->tqparentNode ())
if (p->mrl ())
return p->getSurface (node);
return 0L;
@ -747,9 +747,9 @@ bool Mrl::handleEvent (EventPtr) {
return false;
}
void Mrl::parseParam (const TrieString & para, const QString & val) {
void Mrl::parseParam (const TrieString & para, const TQString & val) {
if (para == StringPool::attr_src && !src.startsWith ("#")) {
QString abs = absolutePath ();
TQString abs = absolutePath ();
if (abs != src)
src = val;
else
@ -782,7 +782,7 @@ Surface::~Surface() {
}
void Surface::remove () {
Surface *sp = parentNode ().ptr ();
Surface *sp = tqparentNode ().ptr ();
if (sp) {
sp->markDirty ();
sp->removeChild (this);
@ -790,7 +790,7 @@ void Surface::remove () {
}
void Surface::markDirty () {
for (Surface *s = this; s; s = s->parentNode ().ptr ())
for (Surface *s = this; s; s = s->tqparentNode ().ptr ())
s->dirty = true;
}
@ -812,7 +812,7 @@ namespace KMPlayer {
static NodePtr dummy_element;
}
Document::Document (const QString & s, PlayListNotify * n)
Document::Document (const TQString & s, PlayListNotify * n)
: Mrl (dummy_element, id_node_document),
notify_listener (n),
m_tree_version (0),
@ -827,7 +827,7 @@ Document::~Document () {
kdDebug () << "~Document" << endl;
}
static NodePtr getElementByIdImpl (NodePtr n, const QString & id, bool inter) {
static NodePtr getElementByIdImpl (NodePtr n, const TQString & id, bool inter) {
NodePtr elm;
if (!n->isElementNode ())
return elm;
@ -843,15 +843,15 @@ static NodePtr getElementByIdImpl (NodePtr n, const QString & id, bool inter) {
return elm;
}
NodePtr Document::getElementById (const QString & id) {
NodePtr Document::getElementById (const TQString & id) {
return getElementByIdImpl (this, id, true);
}
NodePtr Document::getElementById (NodePtr n, const QString & id, bool inter) {
NodePtr Document::getElementById (NodePtr n, const TQString & id, bool inter) {
return getElementByIdImpl (n, id, inter);
}
NodePtr Document::childFromTag (const QString & tag) {
NodePtr Document::childFromTag (const TQString & tag) {
Node * elm = fromXMLDocumentTag (m_doc, tag);
if (elm)
return elm;
@ -1066,14 +1066,14 @@ NodeRefListPtr Document::listeners (unsigned int id) {
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TextNode::TextNode (NodePtr & d, const QString & s, short i)
KDE_NO_CDTOR_EXPORT TextNode::TextNode (NodePtr & d, const TQString & s, short i)
: Node (d, i), text (s) {}
void TextNode::appendText (const QString & s) {
void TextNode::appendText (const TQString & s) {
text += s;
}
QString TextNode::nodeValue () const {
TQString TextNode::nodeValue () const {
return text;
}
@ -1083,16 +1083,16 @@ KDE_NO_EXPORT bool TextNode::expose () const {
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT CData::CData (NodePtr & d, const QString & s)
KDE_NO_CDTOR_EXPORT CData::CData (NodePtr & d, const TQString & s)
: TextNode (d, s, id_node_cdata) {}
//-----------------------------------------------------------------------------
DarkNode::DarkNode (NodePtr & d, const QString & n, short id)
DarkNode::DarkNode (NodePtr & d, const TQString & n, short id)
: Element (d, id), name (n) {
}
NodePtr DarkNode::childFromTag (const QString & tag) {
NodePtr DarkNode::childFromTag (const TQString & tag) {
return new DarkNode (m_doc, tag);
}
@ -1102,7 +1102,7 @@ KDE_NO_EXPORT bool DarkNode::expose () const {
//-----------------------------------------------------------------------------
GenericURL::GenericURL (NodePtr & d, const QString & s, const QString & name)
GenericURL::GenericURL (NodePtr & d, const TQString & s, const TQString & name)
: Mrl (d, id_node_playlist_item) {
src = s;
if (!src.isEmpty ())
@ -1117,7 +1117,7 @@ KDE_NO_EXPORT void GenericURL::closed () {
//-----------------------------------------------------------------------------
GenericMrl::GenericMrl (NodePtr & d, const QString & s, const QString & name, const QString & tag)
GenericMrl::GenericMrl (NodePtr & d, const TQString & s, const TQString & name, const TQString & tag)
: Mrl (d, id_node_playlist_item), node_name (tag) {
src = s;
if (!src.isEmpty ())
@ -1155,16 +1155,16 @@ class KMPLAYER_NO_EXPORT DocumentBuilder {
public:
DocumentBuilder (NodePtr d, bool set_opener);
~DocumentBuilder () {}
bool startTag (const QString & tag, AttributeListPtr attr);
bool endTag (const QString & tag);
bool characterData (const QString & data);
bool cdataData (const QString & data);
bool startTag (const TQString & tag, AttributeListPtr attr);
bool endTag (const TQString & tag);
bool characterData (const TQString & data);
bool cdataData (const TQString & data);
#ifdef HAVE_EXPAT
void cdataStart ();
void cdataEnd ();
private:
bool in_cdata;
QString cdata;
TQString cdata;
#endif
};
@ -1178,7 +1178,7 @@ DocumentBuilder::DocumentBuilder (NodePtr d, bool set_opener)
#endif
{}
bool DocumentBuilder::startTag(const QString &tag, AttributeListPtr attr) {
bool DocumentBuilder::startTag(const TQString &tag, AttributeListPtr attr) {
if (m_ignore_depth) {
m_ignore_depth++;
//kdDebug () << "Warning: ignored tag " << tag.latin1 () << " ignore depth = " << m_ignore_depth << endl;
@ -1207,7 +1207,7 @@ bool DocumentBuilder::startTag(const QString &tag, AttributeListPtr attr) {
return true;
}
bool DocumentBuilder::endTag (const QString & tag) {
bool DocumentBuilder::endTag (const TQString & tag) {
if (m_ignore_depth) { // endtag to ignore
m_ignore_depth--;
kdDebug () << "Warning: ignored end tag " << " ignore depth = " << m_ignore_depth << endl;
@ -1218,10 +1218,10 @@ bool DocumentBuilder::endTag (const QString & tag) {
(m_root_is_first || n != m_root)) {
while (n != m_node) {
kdWarning() << m_node->nodeName () << " not closed" << endl;
if (m_root == m_node->parentNode ())
if (m_root == m_node->tqparentNode ())
break;
m_node->closed ();
m_node = m_node->parentNode ();
m_node = m_node->tqparentNode ();
}
break;
}
@ -1234,16 +1234,16 @@ bool DocumentBuilder::endTag (const QString & tag) {
break;
} else
kdWarning () << "tag " << tag << " not " << n->nodeName () << endl;
n = n ->parentNode ();
n = n ->tqparentNode ();
}
//kdDebug () << "end tag " << tag << endl;
m_node->closed ();
m_node = m_node->parentNode ();
m_node = m_node->tqparentNode ();
}
return true;
}
bool DocumentBuilder::characterData (const QString & data) {
bool DocumentBuilder::characterData (const TQString & data) {
if (!m_ignore_depth) {
#ifdef HAVE_EXPAT
if (in_cdata)
@ -1256,7 +1256,7 @@ bool DocumentBuilder::characterData (const QString & data) {
return true;
}
bool DocumentBuilder::cdataData (const QString & data) {
bool DocumentBuilder::cdataData (const TQString & data) {
if (!m_ignore_depth) {
NodePtr d = m_node->document ();
m_node->appendChild (new CData (d, data));
@ -1283,14 +1283,14 @@ static void startTag (void *data, const char * tag, const char **attr) {
AttributeListPtr attributes = new AttributeList;
if (attr && attr [0]) {
for (int i = 0; attr[i]; i += 2)
attributes->append (new Attribute (QString::fromUtf8 (attr [i]), QString::fromUtf8 (attr [i+1])));
attributes->append (new Attribute (TQString::fromUtf8 (attr [i]), TQString::fromUtf8 (attr [i+1])));
}
builder->startTag (QString::fromUtf8 (tag), attributes);
builder->startTag (TQString::fromUtf8 (tag), attributes);
}
static void endTag (void *data, const char * tag) {
DocumentBuilder * builder = static_cast <DocumentBuilder *> (data);
builder->endTag (QString::fromUtf8 (tag));
builder->endTag (TQString::fromUtf8 (tag));
}
static void characterData (void *data, const char *s, int len) {
@ -1298,7 +1298,7 @@ static void characterData (void *data, const char *s, int len) {
char * buf = new char [len + 1];
strncpy (buf, s, len);
buf[len] = 0;
builder->characterData (QString::fromUtf8 (buf));
builder->characterData (TQString::fromUtf8 (buf));
delete [] buf;
}
@ -1315,7 +1315,7 @@ static void cdataEnd (void *data) {
namespace KMPlayer {
KMPLAYER_EXPORT
void readXML (NodePtr root, QTextStream & in, const QString & firstline, bool set_opener) {
void readXML (NodePtr root, TQTextStream & in, const TQString & firstline, bool set_opener) {
bool ok = true;
DocumentBuilder builder (root, set_opener);
XML_Parser parser = XML_ParserCreate (0L);
@ -1324,14 +1324,14 @@ void readXML (NodePtr root, QTextStream & in, const QString & firstline, bool se
XML_SetCharacterDataHandler (parser, characterData);
XML_SetCdataSectionHandler (parser, cdataStart, cdataEnd);
if (!firstline.isEmpty ()) {
QString str (firstline + QChar ('\n'));
QCString buf = str.utf8 ();
TQString str (firstline + TQChar ('\n'));
TQCString buf = str.utf8 ();
ok = XML_Parse(parser, buf, strlen (buf), false) != XML_STATUS_ERROR;
if (!ok)
kdWarning () << XML_ErrorString(XML_GetErrorCode(parser)) << " at " << XML_GetCurrentLineNumber(parser) << " col " << XML_GetCurrentColumnNumber(parser) << endl;
}
if (ok && !in.atEnd ()) {
QCString buf = in.read ().utf8 ();
TQCString buf = in.read ().utf8 ();
ok = XML_Parse(parser, buf, strlen (buf), true) != XML_STATUS_ERROR;
if (!ok)
kdWarning () << XML_ErrorString(XML_GetErrorCode(parser)) << " at " << XML_GetCurrentLineNumber(parser) << " col " << XML_GetCurrentColumnNumber(parser) << endl;
@ -1352,12 +1352,12 @@ class KMPLAYER_NO_EXPORT SimpleSAXParser {
public:
SimpleSAXParser (DocumentBuilder & b) : builder (b), position (0), m_attributes (new AttributeList), equal_seen (false), in_dbl_quote (false), in_sngl_quote (false), have_error (false), no_entitity_look_ahead (false), have_next_char (false) {}
virtual ~SimpleSAXParser () {};
bool parse (QTextStream & d);
bool parse (TQTextStream & d);
private:
QTextStream * data;
TQTextStream * data;
DocumentBuilder & builder;
int position;
QChar next_char;
TQChar next_char;
enum Token { tok_empty, tok_text, tok_white_space, tok_angle_open,
tok_equal, tok_double_quote, tok_single_quote, tok_angle_close,
tok_slash, tok_exclamation, tok_amp, tok_hash, tok_semi_colon,
@ -1368,23 +1368,23 @@ private:
struct TokenInfo {
TokenInfo () : token (tok_empty) {}
Token token;
QString string;
TQString string;
SharedPtr <TokenInfo> next;
};
typedef SharedPtr <TokenInfo> TokenInfoPtr;
struct StateInfo {
StateInfo (State s, SharedPtr <StateInfo> n) : state (s), next (n) {}
State state;
QString data;
TQString data;
SharedPtr <StateInfo> next;
};
SharedPtr <StateInfo> m_state;
TokenInfoPtr next_token, token, prev_token;
// for element reading
QString tagname;
TQString tagname;
AttributeListPtr m_attributes;
QString attr_name, attr_value;
QString cdata;
TQString attr_name, attr_value;
TQString cdata;
bool equal_seen;
bool in_dbl_quote;
bool in_sngl_quote;
@ -1407,17 +1407,17 @@ private:
} // namespace
KMPLAYER_EXPORT
void KMPlayer::readXML (NodePtr root, QTextStream & in, const QString & firstline, bool set_opener) {
void KMPlayer::readXML (NodePtr root, TQTextStream & in, const TQString & firstline, bool set_opener) {
DocumentBuilder builder (root, set_opener);
SimpleSAXParser parser (builder);
if (!firstline.isEmpty ()) {
QString str (firstline + QChar ('\n'));
QTextStream fl_in (&str, IO_ReadOnly);
TQString str (firstline + TQChar ('\n'));
TQTextStream fl_in (&str, IO_ReadOnly);
parser.parse (fl_in);
}
if (!in.atEnd ())
parser.parse (in);
for (NodePtr e = root; e; e = e->parentNode ())
for (NodePtr e = root; e; e = e->tqparentNode ())
e->closed ();
//doc->normalize ();
//kdDebug () << root->outerXML ();
@ -1455,39 +1455,39 @@ bool SimpleSAXParser::nextToken () {
push ();
next_token->token = tok_white_space;
} else if (!next_char.isLetterOrNumber ()) {
if (next_char == QChar ('#')) {
if (next_char == TQChar ('#')) {
//if (next_token->token == tok_empty) { // check last item on stack &
push ();
next_token->token = tok_hash;
//}
} else if (next_char == QChar ('/')) {
} else if (next_char == TQChar ('/')) {
push ();
next_token->token = tok_slash;
} else if (next_char == QChar ('!')) {
} else if (next_char == TQChar ('!')) {
push ();
next_token->token = tok_exclamation;
} else if (next_char == QChar ('?')) {
} else if (next_char == TQChar ('?')) {
push ();
next_token->token = tok_question_mark;
} else if (next_char == QChar ('<')) {
} else if (next_char == TQChar ('<')) {
push ();
next_token->token = tok_angle_open;
} else if (next_char == QChar ('>')) {
} else if (next_char == TQChar ('>')) {
push ();
next_token->token = tok_angle_close;
} else if (next_char == QChar (';')) {
} else if (next_char == TQChar (';')) {
push ();
next_token->token = tok_semi_colon;
} else if (next_char == QChar ('=')) {
} else if (next_char == TQChar ('=')) {
push ();
next_token->token = tok_equal;
} else if (next_char == QChar ('"')) {
} else if (next_char == TQChar ('"')) {
push ();
next_token->token = tok_double_quote;
} else if (next_char == QChar ('\'')) {
} else if (next_char == TQChar ('\'')) {
push ();
next_token->token = tok_single_quote;
} else if (next_char == QChar ('&')) {
} else if (next_char == TQChar ('&')) {
push ();
if (no_entitity_look_ahead) {
have_next_char = true;
@ -1499,20 +1499,20 @@ bool SimpleSAXParser::nextToken () {
TokenInfoPtr prev_tmp = prev_token;
if (nextToken () && token->token == tok_text &&
nextToken () && token->token == tok_semi_colon) {
if (prev_token->string == QString ("amp"))
token->string = QChar ('&');
else if (prev_token->string == QString ("lt"))
token->string = QChar ('<');
else if (prev_token->string == QString ("gt"))
token->string = QChar ('>');
else if (prev_token->string == QString ("quot"))
token->string = QChar ('"');
else if (prev_token->string == QString ("apos"))
token->string = QChar ('\'');
else if (prev_token->string == QString ("copy"))
token->string = QChar (169);
if (prev_token->string == TQString ("amp"))
token->string = TQChar ('&');
else if (prev_token->string == TQString ("lt"))
token->string = TQChar ('<');
else if (prev_token->string == TQString ("gt"))
token->string = TQChar ('>');
else if (prev_token->string == TQString ("quot"))
token->string = TQChar ('"');
else if (prev_token->string == TQString ("apos"))
token->string = TQChar ('\'');
else if (prev_token->string == TQString ("copy"))
token->string = TQChar (169);
else
token->string = QChar ('?');// TODO lookup more ..
token->string = TQChar ('?');// TODO lookup more ..
token->token = tok_text;
if (tmp) { // cut out the & xxx ; tokens
tmp->next = token;
@ -1524,10 +1524,10 @@ bool SimpleSAXParser::nextToken () {
nextToken () && token->token == tok_semi_colon) {
//kdDebug () << "char entity found " << prev_token->string << prev_token->string.toInt (0L, 16) << endl;
token->token = tok_text;
if (!prev_token->string.startsWith (QChar ('x')))
token->string = QChar (prev_token->string.toInt ());
if (!prev_token->string.startsWith (TQChar ('x')))
token->string = TQChar (prev_token->string.toInt ());
else
token->string = QChar (prev_token->string.mid (1).toInt (0L, 16));
token->string = TQChar (prev_token->string.mid (1).toInt (0L, 16));
if (tmp) { // cut out the '& # xxx ;' tokens
tmp->next = token;
token = tmp;
@ -1536,7 +1536,7 @@ bool SimpleSAXParser::nextToken () {
token = tmp; // restore and insert the lost & token
tmp = TokenInfoPtr (new TokenInfo);
tmp->token = tok_amp;
tmp->string += QChar ('&');
tmp->string += TQChar ('&');
tmp->next = token->next;
if (token)
token->next = tmp;
@ -1556,7 +1556,7 @@ bool SimpleSAXParser::nextToken () {
if (append_char)
next_token->string += next_char;
if (next_token->token == tok_text &&
next_char == QChar ('[' ) && next_token->string == "[CDATA[") {
next_char == TQChar ('[' ) && next_token->string == "[CDATA[") {
next_token->token = tok_cdata_start;
break;
}
@ -1639,7 +1639,7 @@ bool SimpleSAXParser::readAttributes () {
}
m_state = m_state->next;
if (m_state->state == InPITag) {
if (tagname == QString ("xml")) {
if (tagname == TQString ("xml")) {
/*const AttributeMap::const_iterator e = attr.end ();
for (AttributeMap::const_iterator i = attr.begin (); i != e; ++i)
if (!strcasecmp (i.key ().latin1 (), "encoding"))
@ -1674,7 +1674,7 @@ bool SimpleSAXParser::readPI () {
bool SimpleSAXParser::readDTD () {
//TODO: <!ENTITY ..>
if (!nextToken ()) return false;
if (token->token == tok_text && token->string.startsWith (QString ("--"))) {
if (token->token == tok_text && token->string.startsWith (TQString ("--"))) {
m_state = new StateInfo (InComment, m_state->next); // note: pop DTD
return readComment ();
}
@ -1702,7 +1702,7 @@ bool SimpleSAXParser::readDTD () {
bool SimpleSAXParser::readCDATA () {
while (!data->atEnd ()) {
*data >> next_char;
if (next_char == QChar ('>') && cdata.endsWith (QString ("]]"))) {
if (next_char == TQChar ('>') && cdata.endsWith (TQString ("]]"))) {
cdata.truncate (cdata.length () - 2);
m_state = m_state->next;
if (m_state->state == InContent)
@ -1724,7 +1724,7 @@ bool SimpleSAXParser::readCDATA () {
bool SimpleSAXParser::readComment () {
while (nextToken ()) {
if (token->token == tok_angle_close && prev_token)
if (prev_token->string.endsWith (QString ("--"))) {
if (prev_token->string.endsWith (TQString ("--"))) {
m_state = m_state->next;
return true;
}
@ -1773,7 +1773,7 @@ bool SimpleSAXParser::readTag () {
return readAttributes ();
}
bool SimpleSAXParser::parse (QTextStream & d) {
bool SimpleSAXParser::parse (TQTextStream & d) {
data = &d;
if (!next_token) {
next_token = TokenInfoPtr (new TokenInfo);
@ -1781,7 +1781,7 @@ bool SimpleSAXParser::parse (QTextStream & d) {
}
bool ok = true;
bool in_character_data = false;
QString white_space;
TQString white_space;
while (ok) {
switch (m_state->state) {
case InTag:
@ -1821,7 +1821,7 @@ bool SimpleSAXParser::parse (QTextStream & d) {
} else {
if (!white_space.isEmpty ()) {
if (!in_character_data) {
int pos = white_space.findRev (QChar ('\n'));
int pos = white_space.tqfindRev (TQChar ('\n'));
if (pos > -1)
white_space = white_space.mid (pos + 1);
}

@ -26,7 +26,7 @@
#include <config.h>
#include <sys/time.h>
#include <qstring.h>
#include <tqstring.h>
#include "kmplayer_def.h"
#include "kmplayertypes.h"
@ -34,7 +34,7 @@
typedef struct _cairo_surface cairo_surface_t;
class QTextStream;
class TQTextStream;
namespace KMPlayer {
@ -164,8 +164,8 @@ public:
};
/*
* Base class for double linked tree nodes having parent/siblings/children.
* The linkage is a shared firstChild and weak parentNode.
* Base class for double linked tree nodes having tqparent/siblings/tqchildren.
* The linkage is a shared firstChild and weak tqparentNode.
*/
template <class T>
class KMPLAYER_EXPORT TreeNode : public ListNodeBase <T> {
@ -176,7 +176,7 @@ public:
virtual void removeChild (typename Item<T>::SharedType c);
bool hasChildNodes () const { return m_first_child != 0L; }
typename Item<T>::SharedType parentNode () const { return m_parent; }
typename Item<T>::SharedType tqparentNode () const { return m_parent; }
typename Item<T>::SharedType firstChild () const { return m_first_child; }
typename Item<T>::SharedType lastChild () const { return m_last_child; }
@ -193,15 +193,15 @@ protected:
class KMPLAYER_EXPORT Attribute : public ListNodeBase <Attribute> {
public:
KDE_NO_CDTOR_EXPORT Attribute () {}
Attribute (const TrieString & n, const QString & v);
Attribute (const TrieString & n, const TQString & v);
KDE_NO_CDTOR_EXPORT ~Attribute () {}
TrieString name () const { return m_name; }
QString value () const { return m_value; }
TQString value () const { return m_value; }
void setName (const TrieString &);
void setValue (const QString &);
void setValue (const TQString &);
protected:
TrieString m_name;
QString m_value;
TQString m_value;
};
ITEM_AS_POINTER(KMPlayer::Attribute)
@ -246,7 +246,7 @@ typedef Item<Node>::WeakType NodePtrW;
typedef Item<Attribute>::SharedType AttributePtr;
typedef Item<Attribute>::WeakType AttributePtrW;
typedef Item<Event>::SharedType EventPtr;
typedef List<Node> NodeList; // eg. for Node's children
typedef List<Node> NodeList; // eg. for Node's tqchildren
typedef Item<NodeList>::SharedType NodeListPtr;
typedef Item<NodeList>::WeakType NodeListPtrW;
ITEM_AS_POINTER(KMPlayer::NodeList)
@ -312,14 +312,14 @@ public:
virtual ~Node ();
Document * document ();
virtual Mrl * mrl ();
virtual NodePtr childFromTag (const QString & tag);
void characterData (const QString & s);
QString innerText () const;
QString innerXML () const;
QString outerXML () const;
virtual NodePtr childFromTag (const TQString & tag);
void characterData (const TQString & s);
TQString innerText () const;
TQString innerXML () const;
TQString outerXML () const;
virtual const char * nodeName () const;
virtual QString nodeValue () const;
virtual void setNodeName (const QString &) {}
virtual TQString nodeValue () const;
virtual void setNodeName (const TQString &) {}
/**
* If this is a derived Mrl object and has a SRC attribute
@ -397,12 +397,12 @@ public:
virtual void begin ();
/**
* Sets state to state_finish when >= state_activated.
* Notifies parent with a childDone call.
* Notifies tqparent with a childDone call.
*/
virtual void finish ();
/**
* Stops element, sets state to state_deactivated. Calls deactivate() on
* activated/deferred children. May call childDone() when active() and not
* activated/deferred tqchildren. May call childDone() when active() and not
* finished yet.
*/
virtual void deactivate ();
@ -440,7 +440,7 @@ public:
*/
virtual void opened ();
/*
* Close tag is found by parser, children are appended
* Close tag is found by parser, tqchildren are appended
*/
virtual void closed ();
protected:
@ -475,8 +475,8 @@ class KMPLAYER_EXPORT Element : public Node {
public:
~Element ();
void setAttributes (AttributeListPtr attrs);
void setAttribute (const TrieString & name, const QString & value);
QString getAttribute (const TrieString & name);
void setAttribute (const TrieString & name, const TQString & value);
TQString getAttribute (const TrieString & name);
KDE_NO_EXPORT AttributeListPtr attributes () const { return m_attributes; }
virtual void init ();
virtual void reset ();
@ -487,13 +487,13 @@ public:
* pass a modification id, that it can use to restore the old value.
* Param will be auto removed on deactivate
*/
void setParam (const TrieString &para, const QString &val, int * mod_id=0L);
QString param (const TrieString & para);
void setParam (const TrieString &para, const TQString &val, int * mod_id=0L);
TQString param (const TrieString & para);
void resetParam (const TrieString & para, int mod_id);
/**
* Called from (re)setParam for specialized interpretation of params
**/
virtual void parseParam (const TrieString &, const QString &) {}
virtual void parseParam (const TrieString &, const TQString &) {}
protected:
Element (NodePtr & d, short id=0);
AttributeListPtr m_attributes;
@ -512,7 +512,7 @@ public:
void setRefNode (const NodePtr ref);
protected:
NodePtrW ref_node;
QString tag_name;
TQString tag_name;
};
template <class T>
@ -526,8 +526,8 @@ inline KDE_NO_EXPORT T * convertNode (NodePtr e) {
class KMPLAYER_EXPORT Mrl : public Element {
protected:
Mrl (NodePtr & d, short id=0);
NodePtr childFromTag (const QString & tag);
void parseParam (const TrieString &, const QString &);
NodePtr childFromTag (const TQString & tag);
void parseParam (const TrieString &, const TQString &);
unsigned int cached_ismrl_version;
PlayType cached_play_type;
public:
@ -539,7 +539,7 @@ public:
virtual Mrl * linkNode ();
virtual Mrl * mrl ();
virtual void endOfFile ();
QString absolutePath ();
TQString absolutePath ();
/*
* Reimplement to callback with requestPlayURL if isPlayable()
*/
@ -553,12 +553,12 @@ public:
/**
* If this Mrl is top node of external document, opener has the
* location in SCR. Typically that's the parent of this node.
* location in SCR. Typically that's the tqparent of this node.
*/
NodePtrW opener; //if this node is top node of external document,
QString src;
QString pretty_name;
QString mimetype;
TQString src;
TQString pretty_name;
TQString mimetype;
Single width;
Single height;
float aspect;
@ -594,7 +594,7 @@ public:
/**
* Request to show msg for informing the user
*/
virtual void setInfoMessage (const QString & msg) = 0;
virtual void setInfoMessage (const TQString & msg) = 0;
/**
* Ask for connection bitrates settings
*/
@ -613,12 +613,12 @@ class KMPLAYER_NO_EXPORT RemoteObject {
public:
RemoteObject ();
virtual ~RemoteObject ();
bool wget (const QString & url);
bool wget (const TQString & url);
void killWGet ();
void clear ();
QString mimetype ();
TQString mimetype ();
protected:
KDE_NO_EXPORT virtual void remoteReady (QByteArray &) {}
KDE_NO_EXPORT virtual void remoteReady (TQByteArray &) {}
bool downloading () const;
private:
RemoteObjectPrivate *d;
@ -632,14 +632,14 @@ public:
virtual SurfacePtr createSurface (NodePtr owner, const SRect & rect) = 0;
virtual IRect toScreen (Single x, Single y, Single w, Single h) = 0;
virtual void resize (const SRect & rect) = 0;
virtual void repaint () = 0;
virtual void repaint (const SRect &rect) = 0;
virtual void tqrepaint () = 0;
virtual void tqrepaint (const SRect &rect) = 0;
virtual void video () = 0;
void remove (); // remove from parent, mark ancestors dirty
void remove (); // remove from tqparent, mark ancestors dirty
void markDirty (); // mark this and ancestors dirty
NodePtrW node;
SRect bounds; // bounds in in parent coord.
SRect bounds; // bounds in in tqparent coord.
float xscale, yscale; // internal scaling
unsigned int background_color; // rgba background color
bool dirty; // a decendant is removed
@ -710,15 +710,15 @@ typedef WeakPtr <Postpone> PostponePtrW;
class KMPLAYER_EXPORT Document : public Mrl {
friend class Postpone;
public:
Document (const QString &, PlayListNotify * notify = 0L);
Document (const TQString &, PlayListNotify * notify = 0L);
~Document ();
NodePtr getElementById (const QString & id);
NodePtr getElementById (NodePtr start, const QString & id, bool inter_doc);
NodePtr getElementById (const TQString & id);
NodePtr getElementById (NodePtr start, const TQString & id, bool inter_doc);
/** All nodes have shared pointers to Document,
* so explicitly dispose it (calls clear and set m_doc to 0L)
* */
void dispose ();
virtual NodePtr childFromTag (const QString & tag);
virtual NodePtr childFromTag (const TQString & tag);
KDE_NO_EXPORT const char * nodeName () const { return "document"; }
virtual void activate ();
virtual void defer ();
@ -765,15 +765,15 @@ private:
*/
class KMPLAYER_EXPORT TextNode : public Node {
public:
TextNode (NodePtr & d, const QString & s, short _id = id_node_text);
TextNode (NodePtr & d, const TQString & s, short _id = id_node_text);
KDE_NO_CDTOR_EXPORT ~TextNode () {}
void appendText (const QString & s);
void setText (const QString & txt) { text = txt; }
void appendText (const TQString & s);
void setText (const TQString & txt) { text = txt; }
const char * nodeName () const { return "#text"; }
QString nodeValue () const;
TQString nodeValue () const;
bool expose () const;
protected:
QString text;
TQString text;
};
/**
@ -781,23 +781,23 @@ protected:
*/
class KMPLAYER_EXPORT CData : public TextNode {
public:
CData (NodePtr & d, const QString & s);
CData (NodePtr & d, const TQString & s);
KDE_NO_CDTOR_EXPORT ~CData () {}
const char * nodeName () const { return "#cdata"; }
};
/**
* Unrecognized tag by parent element or just some auxiliary node
* Unrecognized tag by tqparent element or just some auxiliary node
*/
class KMPLAYER_EXPORT DarkNode : public Element {
public:
DarkNode (NodePtr & d, const QString & n, short id=0);
DarkNode (NodePtr & d, const TQString & n, short id=0);
KDE_NO_CDTOR_EXPORT ~DarkNode () {}
const char * nodeName () const { return name.ascii (); }
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
virtual bool expose () const;
protected:
QString name;
TQString name;
};
namespace SMIL {
@ -860,7 +860,7 @@ public:
*/
class KMPLAYER_EXPORT GenericURL : public Mrl {
public:
GenericURL(NodePtr &d, const QString &s, const QString &n=QString ());
GenericURL(NodePtr &d, const TQString &s, const TQString &n=TQString ());
KDE_NO_EXPORT const char * nodeName () const { return "url"; }
void closed ();
};
@ -871,16 +871,16 @@ public:
class KMPLAYER_EXPORT GenericMrl : public Mrl {
public:
KDE_NO_CDTOR_EXPORT GenericMrl (NodePtr & d) : Mrl (d), node_name ("mrl") {}
GenericMrl(NodePtr &d, const QString &s, const QString & name=QString (), const QString &tag=QString ("mrl"));
GenericMrl(NodePtr &d, const TQString &s, const TQString & name=TQString (), const TQString &tag=TQString ("mrl"));
KDE_NO_EXPORT const char * nodeName () const { return node_name.ascii (); }
void closed ();
bool expose () const;
QString node_name;
TQString node_name;
};
KMPLAYER_EXPORT
void readXML (NodePtr root, QTextStream & in, const QString & firstline, bool set_opener=true);
KMPLAYER_EXPORT Node * fromXMLDocumentTag (NodePtr & d, const QString & tag);
void readXML (NodePtr root, TQTextStream & in, const TQString & firstline, bool set_opener=true);
KMPLAYER_EXPORT Node * fromXMLDocumentTag (NodePtr & d, const TQString & tag);
template <class T>
inline Item<T>::Item () : m_self (static_cast <T*> (this), true) {}

File diff suppressed because it is too large Load Diff

@ -21,12 +21,12 @@
#ifndef _KMPLAYERPROCESS_H_
#define _KMPLAYERPROCESS_H_
#include <qobject.h>
#include <qguardedptr.h>
#include <qstring.h>
#include <qcstring.h>
#include <qstringlist.h>
#include <qregexp.h>
#include <tqobject.h>
#include <tqguardedptr.h>
#include <tqstring.h>
#include <tqcstring.h>
#include <tqstringlist.h>
#include <tqregexp.h>
#include <kurl.h>
#include <kio/global.h>
@ -34,7 +34,7 @@
#include "kmplayerconfig.h"
#include "kmplayersource.h"
class QWidget;
class TQWidget;
class KProcess;
namespace KIO {
@ -53,19 +53,20 @@ class Backend_stub;
/*
* Base class for all backend processes
*/
class KMPLAYER_EXPORT Process : public QObject {
class KMPLAYER_EXPORT Process : public TQObject {
Q_OBJECT
TQ_OBJECT
public:
enum State {
NotRunning = 0, Ready, Buffering, Playing
};
Process (QObject * parent, Settings * settings, const char * n);
Process (TQObject * tqparent, Settings * settings, const char * n);
virtual ~Process ();
virtual void init ();
virtual void initProcess (Viewer *);
virtual QString menuName () const;
virtual void setAudioLang (int, const QString &);
virtual void setSubtitle (int, const QString &);
virtual TQString menuName () const;
virtual void setAudioLang (int, const TQString &);
virtual void setSubtitle (int, const TQString &);
bool playing () const;
KDE_NO_EXPORT KProcess * process () const { return m_process; }
KDE_NO_EXPORT Source * source () const { return m_source; }
@ -77,7 +78,7 @@ public:
State state () const { return m_state; }
NodePtr mrl () const { return m_mrl; }
signals:
void grabReady (const QString & path);
void grabReady (const TQString & path);
public slots:
virtual bool ready (Viewer *);
bool play (Source *, NodePtr mrl);
@ -107,11 +108,11 @@ protected:
State m_old_state;
KProcess * m_process;
KIO::Job * m_job;
QString m_url;
TQString m_url;
int m_request_seek;
const char ** m_supported_sources;
private:
QGuardedPtr <Viewer> m_viewer;
TQGuardedPtr <Viewer> m_viewer;
};
/*
@ -119,16 +120,17 @@ private:
*/
class MPlayerBase : public Process {
Q_OBJECT
TQ_OBJECT
public:
MPlayerBase (QObject * parent, Settings * settings, const char * n);
MPlayerBase (TQObject * tqparent, Settings * settings, const char * n);
~MPlayerBase ();
void initProcess (Viewer *);
public slots:
virtual bool stop ();
virtual bool quit ();
protected:
bool sendCommand (const QString &);
QStringList commands;
bool sendCommand (const TQString &);
TQStringList commands;
bool m_use_slave : 1;
protected slots:
virtual void processStopped (KProcess *);
@ -144,15 +146,16 @@ class MPlayerPreferencesFrame;
*/
class KDE_EXPORT MPlayer : public MPlayerBase {
Q_OBJECT
TQ_OBJECT
public:
MPlayer (QObject * parent, Settings * settings);
MPlayer (TQObject * tqparent, Settings * settings);
~MPlayer ();
virtual void init ();
virtual QString menuName () const;
virtual TQString menuName () const;
virtual WId widget ();
virtual bool grabPicture (const KURL & url, int pos);
virtual void setAudioLang (int, const QString &);
virtual void setSubtitle (int, const QString &);
virtual void setAudioLang (int, const TQString &);
virtual void setSubtitle (int, const TQString &);
bool run (const char * args, const char * pipe = 0L);
public slots:
virtual bool deMediafiedPlay ();
@ -171,14 +174,14 @@ protected slots:
private slots:
void processOutput (KProcess *, char *, int);
private:
QString m_process_output;
QString m_grabfile;
QWidget * m_widget;
TQString m_process_output;
TQString m_grabfile;
TQWidget * m_widget;
MPlayerPreferencesPage * m_configpage;
QString m_tmpURL;
TQString m_tmpURL;
struct LangInfo {
LangInfo (int i, const QString & n) : id (i), name (n) {}
int id; QString name; SharedPtr <LangInfo> next;
LangInfo (int i, const TQString & n) : id (i), name (n) {}
int id; TQString name; SharedPtr <LangInfo> next;
};
SharedPtr <LangInfo> alanglist;
WeakPtr <LangInfo> alanglist_end;
@ -206,12 +209,12 @@ public:
void write (KConfig *);
void read (KConfig *);
void sync (bool fromUI);
void prefLocation (QString & item, QString & icon, QString & tab);
QFrame * prefPage (QWidget * parent);
QRegExp m_patterns[pat_last];
void prefLocation (TQString & item, TQString & icon, TQString & tab);
TQFrame * prefPage (TQWidget * tqparent);
TQRegExp m_patterns[pat_last];
int cachesize;
QString mplayer_path;
QString additionalarguments;
TQString mplayer_path;
TQString additionalarguments;
bool alwaysbuildindex;
private:
MPlayer * m_process;
@ -234,8 +237,9 @@ protected:
*/
class MEncoder : public MPlayerBase, public Recorder {
Q_OBJECT
TQ_OBJECT
public:
MEncoder (QObject * parent, Settings * settings);
MEncoder (TQObject * tqparent, Settings * settings);
~MEncoder ();
virtual void init ();
virtual bool deMediafiedPlay ();
@ -249,8 +253,9 @@ public slots:
class KMPLAYER_NO_EXPORT MPlayerDumpstream
: public MPlayerBase, public Recorder {
Q_OBJECT
TQ_OBJECT
public:
MPlayerDumpstream (QObject * parent, Settings * settings);
MPlayerDumpstream (TQObject * tqparent, Settings * settings);
~MPlayerDumpstream ();
virtual void init ();
virtual bool deMediafiedPlay ();
@ -266,27 +271,28 @@ class XMLPreferencesFrame;
*/
class KMPLAYER_EXPORT CallbackProcess : public Process {
Q_OBJECT
TQ_OBJECT
friend class Callback;
public:
CallbackProcess (QObject * parent, Settings * settings, const char * n, const QString & menu);
CallbackProcess (TQObject * tqparent, Settings * settings, const char * n, const TQString & menu);
~CallbackProcess ();
virtual void setStatusMessage (const QString & msg);
virtual void setErrorMessage (int code, const QString & msg);
virtual void setStatusMessage (const TQString & msg);
virtual void setErrorMessage (int code, const TQString & msg);
virtual void setFinished ();
virtual void setPlaying ();
virtual void setStarted (QCString dcopname, QByteArray & data);
virtual void setMovieParams (int length, int width, int height, float aspect, const QStringList & alang, const QStringList & slang);
virtual void setStarted (TQCString dcopname, TQByteArray & data);
virtual void setMovieParams (int length, int width, int height, float aspect, const TQStringList & alang, const TQStringList & slang);
virtual void setMoviePosition (int position);
virtual void setLoadingProgress (int percentage);
virtual void setAudioLang (int, const QString &);
virtual void setSubtitle (int, const QString &);
virtual QString menuName () const;
virtual void setAudioLang (int, const TQString &);
virtual void setSubtitle (int, const TQString &);
virtual TQString menuName () const;
virtual WId widget ();
KDE_NO_EXPORT QByteArray & configData () { return m_configdata; }
KDE_NO_EXPORT TQByteArray & configData () { return m_configdata; }
KDE_NO_EXPORT bool haveConfig () { return m_have_config == config_yes; }
bool getConfigData ();
void setChangedData (const QByteArray &);
QString dcopName ();
void setChangedData (const TQByteArray &);
TQString dcopName ();
NodePtr configDocument () { return configdoc; }
void initProcess (Viewer *);
virtual bool deMediafiedPlay ();
@ -308,9 +314,9 @@ protected slots:
protected:
Callback * m_callback;
Backend_stub * m_backend;
QString m_menuname;
QByteArray m_configdata;
QByteArray m_changeddata;
TQString m_menuname;
TQByteArray m_configdata;
TQByteArray m_changeddata;
XMLPreferencesPage * m_configpage;
NodePtr configdoc;
bool in_gui_update;
@ -324,30 +330,30 @@ protected:
struct KMPLAYER_NO_EXPORT ConfigDocument : public Document {
ConfigDocument ();
~ConfigDocument ();
NodePtr childFromTag (const QString & tag);
NodePtr childFromTag (const TQString & tag);
};
/*
* Element for ConfigDocument
*/
struct KMPLAYER_NO_EXPORT ConfigNode : public DarkNode {
ConfigNode (NodePtr & d, const QString & tag);
ConfigNode (NodePtr & d, const TQString & tag);
KDE_NO_CDTOR_EXPORT ~ConfigNode () {}
NodePtr childFromTag (const QString & tag);
QWidget * w;
NodePtr childFromTag (const TQString & tag);
TQWidget * w;
};
/*
* Element for ConfigDocument, defining type of config item
*/
struct KMPLAYER_NO_EXPORT TypeNode : public ConfigNode {
TypeNode (NodePtr & d, const QString & t);
TypeNode (NodePtr & d, const TQString & t);
KDE_NO_CDTOR_EXPORT ~TypeNode () {}
NodePtr childFromTag (const QString & tag);
void changedXML (QTextStream & out);
QWidget * createWidget (QWidget * parent);
NodePtr childFromTag (const TQString & tag);
void changedXML (TQTextStream & out);
TQWidget * createWidget (TQWidget * tqparent);
const char * nodeName () const { return tag.ascii (); }
QString tag;
TQString tag;
};
/*
@ -360,8 +366,8 @@ public:
void write (KConfig *);
void read (KConfig *);
void sync (bool fromUI);
void prefLocation (QString & item, QString & icon, QString & tab);
QFrame * prefPage (QWidget * parent);
void prefLocation (TQString & item, TQString & icon, TQString & tab);
TQFrame * prefPage (TQWidget * tqparent);
private:
CallbackProcess * m_process;
XMLPreferencesFrame * m_configframe;
@ -372,8 +378,9 @@ private:
*/
class KMPLAYER_NO_EXPORT Xine : public CallbackProcess, public Recorder {
Q_OBJECT
TQ_OBJECT
public:
Xine (QObject * parent, Settings * settings);
Xine (TQObject * tqparent, Settings * settings);
~Xine ();
public slots:
bool ready (Viewer *);
@ -384,8 +391,9 @@ public slots:
*/
class KMPLAYER_NO_EXPORT GStreamer : public CallbackProcess {
Q_OBJECT
TQ_OBJECT
public:
GStreamer (QObject * parent, Settings * settings);
GStreamer (TQObject * tqparent, Settings * settings);
~GStreamer ();
public slots:
virtual bool ready (Viewer *);
@ -396,8 +404,9 @@ public slots:
*/
class KMPLAYER_EXPORT FFMpeg : public Process, public Recorder {
Q_OBJECT
TQ_OBJECT
public:
FFMpeg (QObject * parent, Settings * settings);
FFMpeg (TQObject * tqparent, Settings * settings);
~FFMpeg ();
virtual void init ();
virtual bool deMediafiedPlay ();
@ -412,61 +421,63 @@ private slots:
* npplayer backend
*/
class KMPLAYER_NO_EXPORT NpStream : public QObject {
class KMPLAYER_NO_EXPORT NpStream : public TQObject {
Q_OBJECT
TQ_OBJECT
public:
enum Reason {
NoReason = -1,
BecauseDone = 0, BecauseError = 1, BecauseStopped = 2
};
NpStream (QObject *parent, Q_UINT32 stream_id, const KURL & url);
NpStream (TQObject *tqparent, TQ_UINT32 stream_id, const KURL & url);
~NpStream ();
void open ();
void close ();
KURL url;
QByteArray pending_buf;
TQByteArray pending_buf;
KIO::TransferJob *job;
timeval data_arrival;
Q_UINT32 bytes;
Q_UINT32 stream_id;
Q_UINT32 content_length;
TQ_UINT32 bytes;
TQ_UINT32 stream_id;
TQ_UINT32 content_length;
Reason finish_reason;
QString mimetype;
TQString mimetype;
signals:
void stateChanged ();
void redirected (Q_UINT32, const KURL &);
void redirected (TQ_UINT32, const KURL &);
private slots:
void slotResult (KIO::Job*);
void slotData (KIO::Job*, const QByteArray& qb);
void slotData (KIO::Job*, const TQByteArray& qb);
void redirection (KIO::Job *, const KURL &url);
void slotMimetype (KIO::Job *, const QString &mime);
void slotMimetype (KIO::Job *, const TQString &mime);
void slotTotalSize (KIO::Job *, KIO::filesize_t sz);
};
class KMPLAYER_NO_EXPORT NpPlayer : public Process {
Q_OBJECT
TQ_OBJECT
public:
NpPlayer (QObject * parent, Settings * settings, const QString & srv);
NpPlayer (TQObject * tqparent, Settings * settings, const TQString & srv);
~NpPlayer ();
virtual void init ();
virtual bool deMediafiedPlay ();
virtual void initProcess (Viewer * viewer);
virtual QString menuName () const;
virtual TQString menuName () const;
void setStarted (const QString & srv);
void requestStream (const QString & path, const QString & url, const QString & target);
void destroyStream (const QString & path);
void setStarted (const TQString & srv);
void requestStream (const TQString & path, const TQString & url, const TQString & target);
void destroyStream (const TQString & path);
KDE_NO_EXPORT const QString & destination () const { return service; }
KDE_NO_EXPORT const QString & interface () const { return iface; }
KDE_NO_EXPORT QString objectPath () const { return path; }
QString evaluateScript (const QString & scr);
KDE_NO_EXPORT const TQString & destination () const { return service; }
KDE_NO_EXPORT const TQString & interface () const { return iface; }
KDE_NO_EXPORT TQString objectPath () const { return path; }
TQString evaluateScript (const TQString & scr);
signals:
void evaluate (const QString & scr, QString & result);
void openUrl (const KURL & url, const QString & target);
void evaluate (const TQString & scr, TQString & result);
void openUrl (const KURL & url, const TQString & target);
public slots:
virtual bool stop ();
virtual bool quit ();
@ -477,21 +488,21 @@ private slots:
void processStopped (KProcess *);
void wroteStdin (KProcess *);
void streamStateChanged ();
void streamRedirected (Q_UINT32, const KURL &);
void streamRedirected (TQ_UINT32, const KURL &);
protected:
virtual void terminateJobs ();
private:
void sendFinish (Q_UINT32 sid, Q_UINT32 total, NpStream::Reason because);
void sendFinish (TQ_UINT32 sid, TQ_UINT32 total, NpStream::Reason because);
void processStreams ();
QString service;
QString iface;
QString path;
QString filter;
QString m_base_url;
typedef QMap <Q_UINT32, NpStream *> StreamMap;
TQString service;
TQString iface;
TQString path;
TQString filter;
TQString m_base_url;
typedef TQMap <TQ_UINT32, NpStream *> StreamMap;
StreamMap streams;
QString remote_service;
QByteArray send_buf;
TQString remote_service;
TQByteArray send_buf;
bool write_in_progress;
};

@ -21,16 +21,16 @@
#ifndef KMPLAYERSOURCE_H
#define KMPLAYERSOURCE_H
#include <qobject.h>
#include <qstring.h>
#include <tqobject.h>
#include <tqstring.h>
#include <kurl.h>
#include "kmplayerplaylist.h"
#include "kmplayerprocess.h"
class KConfig;
class QWidget;
class QFrame;
class TQWidget;
class TQFrame;
namespace KMPlayer {
@ -39,13 +39,14 @@ class PartBase;
/**
* Class for a certain media, like URL, DVD, TV etc
*/
class KMPLAYER_EXPORT Source : public QObject, public PlayListNotify {
class KMPLAYER_EXPORT Source : public TQObject, public PlayListNotify {
Q_OBJECT
TQ_OBJECT
public:
Source (const QString & name, PartBase * player, const char * src);
Source (const TQString & name, PartBase * player, const char * src);
virtual ~Source ();
virtual void init ();
virtual bool processOutput (const QString & line);
virtual bool processOutput (const TQString & line);
bool identified () const { return m_identified; }
virtual bool hasLength ();
@ -63,28 +64,28 @@ public:
KDE_NO_EXPORT const KURL & subUrl () const { return m_sub_url; }
PartBase * player () { return m_player; }
virtual void reset ();
QString currentMrl ();
KDE_NO_EXPORT const QString & audioDevice () const { return m_audiodevice; }
KDE_NO_EXPORT const QString & videoDevice () const { return m_videodevice; }
KDE_NO_EXPORT const QString & videoNorm () const { return m_videonorm; }
TQString currentMrl ();
KDE_NO_EXPORT const TQString & audioDevice () const { return m_audiodevice; }
KDE_NO_EXPORT const TQString & videoDevice () const { return m_videodevice; }
KDE_NO_EXPORT const TQString & videoNorm () const { return m_videonorm; }
/* frequency() if set, returns frequency in kHz */
KDE_NO_EXPORT int frequency () const { return m_frequency; }
KDE_NO_EXPORT int xvPort () const { return m_xvport; }
KDE_NO_EXPORT int xvEncoding () const { return m_xvencoding; }
KDE_NO_EXPORT const QString & pipeCmd () const { return m_pipecmd; }
KDE_NO_EXPORT const QString & options () const { return m_options; }
KDE_NO_EXPORT const QString & recordCmd () const { return m_recordcmd; }
KDE_NO_EXPORT const QString & tuner () const { return m_tuner; }
KDE_NO_EXPORT const TQString & pipeCmd () const { return m_pipecmd; }
KDE_NO_EXPORT const TQString & options () const { return m_options; }
KDE_NO_EXPORT const TQString & recordCmd () const { return m_recordcmd; }
KDE_NO_EXPORT const TQString & tuner () const { return m_tuner; }
KDE_NO_EXPORT NodePtr current () const { return m_current; }
QString plugin (const QString &mime) const;
TQString plugin (const TQString &mime) const;
virtual NodePtr document ();
virtual NodePtr root ();
virtual QString filterOptions ();
virtual TQString filterOptions ();
virtual void setURL (const KURL & url);
void insertURL (NodePtr mrl, const QString & url, const QString & title=QString());
void insertURL (NodePtr mrl, const TQString & url, const TQString & title=TQString());
KDE_NO_EXPORT void setSubURL (const KURL & url) { m_sub_url = url; }
void setLanguages (const QStringList & alang, const QStringList & slang);
void setLanguages (const TQStringList & alang, const TQStringList & slang);
KDE_NO_EXPORT void setWidth (int w) { m_width = w; }
KDE_NO_EXPORT void setHeight (int h) { m_height = h; }
virtual void setDimensions (NodePtr, int w, int h);
@ -98,11 +99,11 @@ public:
virtual void stateChange (Process *, Process::State os, Process::State ns);
KDE_NO_EXPORT void setAutoPlay (bool b) { m_auto_play = b; }
KDE_NO_EXPORT bool autoPlay () const { return m_auto_play; }
void setTitle (const QString & title);
void setTitle (const TQString & title);
void setLoading (int percentage);
bool setCurrent (NodePtr mrl);
virtual QString prettyName ();
virtual TQString prettyName ();
signals:
void startPlaying ();
void stopPlaying ();
@ -113,7 +114,7 @@ signals:
*/
void endOfPlayItems ();
void dimensionsChanged ();
void titleChanged (const QString & title);
void titleChanged (const TQString & title);
public slots:
virtual void activate () = 0;
virtual void deactivate () = 0;
@ -130,7 +131,7 @@ public slots:
void setAudioLang (int);
void setSubtitle (int);
protected:
void timerEvent (QTimerEvent *);
void timerEvent (TQTimerEvent *);
/**
* PlayListNotify implementation
*/
@ -138,30 +139,30 @@ protected:
bool resolveURL (NodePtr mrl);
void stateElementChanged (Node * element, Node::State os, Node::State ns);
SurfacePtr getSurface (NodePtr node);
void setInfoMessage (const QString & msg);
void setInfoMessage (const TQString & msg);
void bitRates (int & preferred, int & maximal);
void setTimeout (int ms);
NodePtr m_document;
NodePtrW m_current;
NodePtrW m_back_request;
QString m_name;
TQString m_name;
PartBase * m_player;
QString m_recordcmd;
TQString m_recordcmd;
bool m_identified;
bool m_auto_play;
KURL m_url;
KURL m_sub_url;
QString m_audiodevice;
QString m_videodevice;
QString m_videonorm;
QString m_tuner;
TQString m_audiodevice;
TQString m_videodevice;
TQString m_videonorm;
TQString m_tuner;
int m_frequency;
int m_xvport;
int m_xvencoding;
QString m_pipecmd;
QString m_options;
QString m_plugin;
TQString m_pipecmd;
TQString m_options;
TQString m_plugin;
private:
int m_width;
int m_height;

@ -17,21 +17,21 @@
Boston, MA 02110-1301, USA.
*/
#include <qlayout.h>
#include <qlabel.h>
#include <qtimer.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qtable.h>
#include <qstringlist.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qgroupbox.h>
#include <qwhatsthis.h>
#include <qtabwidget.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qfontmetrics.h>
#include <tqlayout.h>
#include <tqlabel.h>
#include <tqtimer.h>
#include <tqpushbutton.h>
#include <tqcheckbox.h>
#include <tqtable.h>
#include <tqstringlist.h>
#include <tqcombobox.h>
#include <tqlineedit.h>
#include <tqgroupbox.h>
#include <tqwhatsthis.h>
#include <tqtabwidget.h>
#include <tqmessagebox.h>
#include <tqpopupmenu.h>
#include <tqfontmetrics.h>
#include <klocale.h>
#include <kdebug.h>
@ -55,84 +55,84 @@ static const char * strTV = "TV";
static const char * strTVDriver = "Driver";
KDE_NO_CDTOR_EXPORT TVDevicePage::TVDevicePage (QWidget *parent, KMPlayer::NodePtr dev)
: QFrame (parent, "PageTVDevice"), device_doc (dev) {
KDE_NO_CDTOR_EXPORT TVDevicePage::TVDevicePage (TQWidget *tqparent, KMPlayer::NodePtr dev)
: TQFrame (tqparent, "PageTVDevice"), device_doc (dev) {
TVDevice * device = KMPlayer::convertNode <TVDevice> (device_doc);
QVBoxLayout *layout = new QVBoxLayout (this, 5, 2);
QLabel * deviceLabel = new QLabel (i18n ("Video device:") + device->src, this, 0);
layout->addWidget (deviceLabel);
QGridLayout *gridlayout = new QGridLayout (layout, 3, 4);
QLabel * audioLabel = new QLabel (i18n ("Audio device:"), this);
TQVBoxLayout *tqlayout = new TQVBoxLayout (this, 5, 2);
TQLabel * deviceLabel = new TQLabel (i18n ("Video device:") + device->src, this, 0);
tqlayout->addWidget (deviceLabel);
TQGridLayout *gridtqlayout = new TQGridLayout (tqlayout, 3, 4);
TQLabel * audioLabel = new TQLabel (i18n ("Audio device:"), this);
audiodevice = new KURLRequester (device->getAttribute ("audio"), this);
QLabel * nameLabel = new QLabel (i18n ("Name:"), this, 0);
name = new QLineEdit (device->pretty_name, this, 0);
QLabel *sizewidthLabel = new QLabel (i18n ("Width:"), this, 0);
sizewidth = new QLineEdit (device->getAttribute (KMPlayer::StringPool::attr_width), this, 0);
QLabel *sizeheightLabel = new QLabel (i18n ("Height:"), this, 0);
sizeheight = new QLineEdit (device->getAttribute (KMPlayer::StringPool::attr_height), this, 0);
noplayback = new QCheckBox (i18n ("Do not immediately play"), this);
TQLabel * nameLabel = new TQLabel (i18n ("Name:"), this, 0);
name = new TQLineEdit (device->pretty_name, this, 0);
TQLabel *sizewidthLabel = new TQLabel (i18n ("Width:"), this, 0);
sizewidth = new TQLineEdit (device->getAttribute (KMPlayer::StringPool::attr_width), this, 0);
TQLabel *sizeheightLabel = new TQLabel (i18n ("Height:"), this, 0);
sizeheight = new TQLineEdit (device->getAttribute (KMPlayer::StringPool::attr_height), this, 0);
noplayback = new TQCheckBox (i18n ("Do not immediately play"), this);
noplayback->setChecked (!device->getAttribute ("playback").toInt ());
QWhatsThis::add (noplayback, i18n ("Only start playing after clicking the play button"));
inputsTab = new QTabWidget (this);
TQWhatsThis::add (noplayback, i18n ("Only start playing after clicking the play button"));
inputsTab = new TQTabWidget (this);
for (KMPlayer::NodePtr ip = device->firstChild (); ip; ip = ip->nextSibling ()) {
if (ip->id != id_node_tv_input)
continue;
TVInput * input = KMPlayer::convertNode <TVInput> (ip);
QWidget * widget = new QWidget (this);
QHBoxLayout *tablayout = new QHBoxLayout (widget, 5, 2);
TQWidget * widget = new TQWidget (this);
TQHBoxLayout *tabtqlayout = new TQHBoxLayout (widget, 5, 2);
if (!input->getAttribute ("tuner").isEmpty ()) {
QHBoxLayout *horzlayout = new QHBoxLayout ();
QVBoxLayout *vertlayout = new QVBoxLayout ();
horzlayout->addWidget (new QLabel (i18n ("Norm:"), widget));
QComboBox * norms = new QComboBox (widget, "PageTVNorm");
norms->insertItem (QString ("NTSC"), 0);
norms->insertItem (QString ("PAL"), 1);
norms->insertItem (QString ("SECAM"), 2);
TQHBoxLayout *horztqlayout = new TQHBoxLayout ();
TQVBoxLayout *verttqlayout = new TQVBoxLayout ();
horztqlayout->addWidget (new TQLabel (i18n ("Norm:"), widget));
TQComboBox * norms = new TQComboBox (widget, "PageTVNorm");
norms->insertItem (TQString ("NTSC"), 0);
norms->insertItem (TQString ("PAL"), 1);
norms->insertItem (TQString ("SECAM"), 2);
norms->setCurrentText (input->getAttribute ("norm"));
horzlayout->addWidget (norms);
vertlayout->addLayout (horzlayout);
vertlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
QTable * table = new QTable (90, 2, widget, "PageTVChannels");
QFontMetrics metrics (table->font ());
QHeader *header = table->horizontalHeader();
horztqlayout->addWidget (norms);
verttqlayout->addLayout (horztqlayout);
verttqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
TQTable * table = new TQTable (90, 2, widget, "PageTVChannels");
TQFontMetrics metrics (table->font ());
TQHeader *header = table->horizontalHeader();
header->setLabel (0, i18n ("Channel"));
header->setLabel (1, i18n ("Frequency (MHz)"));
int index = 0;
int first_column_width = QFontMetrics (header->font ()).boundingRect (header->label (0)).width () + 20;
int first_column_width = TQFontMetrics (header->font ()).boundingRect (header->label (0)).width () + 20;
for (KMPlayer::NodePtr c=input->firstChild();c;c=c->nextSibling()) {
if (c->id != id_node_tv_channel)
continue;
int strwid = metrics.boundingRect (c->mrl ()->pretty_name).width ();
if (strwid > first_column_width)
first_column_width = strwid + 4;
table->setItem (index, 0, new QTableItem (table, QTableItem::Always, c->mrl ()->pretty_name));
table->setItem (index++, 1, new QTableItem (table, QTableItem::Always, KMPlayer::convertNode<TVChannel>(c)->getAttribute ("frequency")));
table->setItem (index, 0, new TQTableItem (table, TQTableItem::Always, c->mrl ()->pretty_name));
table->setItem (index++, 1, new TQTableItem (table, TQTableItem::Always, KMPlayer::convertNode<TVChannel>(c)->getAttribute ("frequency")));
}
table->setColumnWidth (0, first_column_width);
table->setColumnStretchable (1, true);
tablayout->addWidget (table);
tablayout->addLayout (vertlayout);
tabtqlayout->addWidget (table);
tabtqlayout->addLayout (verttqlayout);
}
inputsTab->addTab (widget, input->mrl ()->pretty_name);
}
QPushButton * delButton = new QPushButton (i18n ("Delete"), this);
connect (delButton, SIGNAL (clicked ()), this, SLOT (slotDelete ()));
gridlayout->addWidget (audioLabel, 0, 0);
gridlayout->addMultiCellWidget (audiodevice, 0, 0, 1, 3);
gridlayout->addWidget (nameLabel, 1, 0);
gridlayout->addMultiCellWidget (name, 1, 1, 1, 3);
gridlayout->addWidget (sizewidthLabel, 2, 0);
gridlayout->addWidget (sizewidth, 2, 1);
gridlayout->addWidget (sizeheightLabel, 2, 2);
gridlayout->addWidget (sizeheight, 2, 3);
layout->addWidget (inputsTab);
layout->addSpacing (5);
layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
QHBoxLayout *buttonlayout = new QHBoxLayout ();
buttonlayout->addWidget (noplayback);
buttonlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
buttonlayout->addWidget (delButton);
layout->addLayout (buttonlayout);
TQPushButton * delButton = new TQPushButton (i18n ("Delete"), this);
connect (delButton, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotDelete ()));
gridtqlayout->addWidget (audioLabel, 0, 0);
gridtqlayout->addMultiCellWidget (audiodevice, 0, 0, 1, 3);
gridtqlayout->addWidget (nameLabel, 1, 0);
gridtqlayout->addMultiCellWidget (name, 1, 1, 1, 3);
gridtqlayout->addWidget (sizewidthLabel, 2, 0);
gridtqlayout->addWidget (sizewidth, 2, 1);
gridtqlayout->addWidget (sizeheightLabel, 2, 2);
gridtqlayout->addWidget (sizeheight, 2, 3);
tqlayout->addWidget (inputsTab);
tqlayout->addSpacing (5);
tqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Minimum));
TQHBoxLayout *buttontqlayout = new TQHBoxLayout ();
buttontqlayout->addWidget (noplayback);
buttontqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
buttontqlayout->addWidget (delButton);
tqlayout->addLayout (buttontqlayout);
}
KDE_NO_EXPORT void TVDevicePage::slotDelete () {
@ -142,58 +142,58 @@ KDE_NO_EXPORT void TVDevicePage::slotDelete () {
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageTV::KMPlayerPrefSourcePageTV (QWidget *parent, KMPlayerTVSource * tvsource)
: QFrame (parent), m_tvsource (tvsource) {
QVBoxLayout * mainlayout = new QVBoxLayout (this, 5);
notebook = new QTabWidget (this);
notebook->setTabPosition (QTabWidget::Bottom);
mainlayout->addWidget (notebook);
QWidget * general = new QWidget (notebook);
QVBoxLayout *layout = new QVBoxLayout (general);
QGridLayout *gridlayout = new QGridLayout (layout, 2, 2, 2);
QLabel *driverLabel = new QLabel (i18n ("Driver:"), general, 0);
driver = new QLineEdit ("", general, 0);
QWhatsThis::add (driver, i18n ("dummy, v4l or bsdbt848"));
QLabel *deviceLabel = new QLabel (i18n ("Device:"), general, 0);
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageTV::KMPlayerPrefSourcePageTV (TQWidget *tqparent, KMPlayerTVSource * tvsource)
: TQFrame (tqparent), m_tvsource (tvsource) {
TQVBoxLayout * maintqlayout = new TQVBoxLayout (this, 5);
notebook = new TQTabWidget (this);
notebook->setTabPosition (TQTabWidget::Bottom);
maintqlayout->addWidget (notebook);
TQWidget * general = new TQWidget (notebook);
TQVBoxLayout *tqlayout = new TQVBoxLayout (general);
TQGridLayout *gridtqlayout = new TQGridLayout (tqlayout, 2, 2, 2);
TQLabel *driverLabel = new TQLabel (i18n ("Driver:"), general, 0);
driver = new TQLineEdit ("", general, 0);
TQWhatsThis::add (driver, i18n ("dummy, v4l or bsdbt848"));
TQLabel *deviceLabel = new TQLabel (i18n ("Device:"), general, 0);
device = new KURLRequester ("/dev/video", general);
QWhatsThis::add(device, i18n("Path to your video device, eg. /dev/video0"));
scan = new QPushButton (i18n ("Scan..."), general);
gridlayout->addWidget (driverLabel, 0, 0);
gridlayout->addWidget (driver, 0, 1);
gridlayout->addWidget (deviceLabel, 1, 0);
gridlayout->addWidget (device, 1, 1);
QHBoxLayout *buttonlayout = new QHBoxLayout ();
buttonlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum));
buttonlayout->addWidget (scan);
layout->addLayout (buttonlayout);
layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
TQWhatsThis::add(device, i18n("Path to your video device, eg. /dev/video0"));
scan = new TQPushButton (i18n ("Scan..."), general);
gridtqlayout->addWidget (driverLabel, 0, 0);
gridtqlayout->addWidget (driver, 0, 1);
gridtqlayout->addWidget (deviceLabel, 1, 0);
gridtqlayout->addWidget (device, 1, 1);
TQHBoxLayout *buttontqlayout = new TQHBoxLayout ();
buttontqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Minimum));
buttontqlayout->addWidget (scan);
tqlayout->addLayout (buttontqlayout);
tqlayout->addItem (new TQSpacerItem (0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
notebook->insertTab (general, i18n ("General"));
}
KDE_NO_EXPORT void KMPlayerPrefSourcePageTV::showEvent (QShowEvent *) {
KDE_NO_EXPORT void KMPlayerPrefSourcePageTV::showEvent (TQShowEvent *) {
m_tvsource->readXML ();
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TVNode::TVNode (KMPlayer::NodePtr &d, const QString & s, const char * t, short id, const QString & n) : KMPlayer::GenericMrl (d, s, n, t) {
KDE_NO_CDTOR_EXPORT TVNode::TVNode (KMPlayer::NodePtr &d, const TQString & s, const char * t, short id, const TQString & n) : KMPlayer::GenericMrl (d, s, n, t) {
this->id = id;
editable = true;
}
KDE_NO_EXPORT void TVNode::setNodeName (const QString & nn) {
KDE_NO_EXPORT void TVNode::setNodeName (const TQString & nn) {
pretty_name = nn;
setAttribute (KMPlayer::StringPool::attr_name, nn);
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d, const QString & n, double freq) : TVNode (d, QString ("tv://"), "channel", id_node_tv_channel, n) {
KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d, const TQString & n, double freq) : TVNode (d, TQString ("tv://"), "channel", id_node_tv_channel, n) {
setAttribute (KMPlayer::StringPool::attr_name, n);
setAttribute ("frequency", QString::number (freq, 'f', 2));
setAttribute ("frequency", TQString::number (freq, 'f', 2));
}
KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d) : TVNode (d, QString ("tv://"), "channel", id_node_tv_channel) {
KDE_NO_CDTOR_EXPORT TVChannel::TVChannel (KMPlayer::NodePtr & d) : TVNode (d, TQString ("tv://"), "channel", id_node_tv_channel) {
}
KDE_NO_EXPORT void TVChannel::closed () {
@ -202,18 +202,18 @@ KDE_NO_EXPORT void TVChannel::closed () {
//-----------------------------------------------------------------------------
TVInput::TVInput (KMPlayer::NodePtr & d, const QString & n, int id)
: TVNode (d, QString ("tv://"), "input", id_node_tv_input, n) {
TVInput::TVInput (KMPlayer::NodePtr & d, const TQString & n, int id)
: TVNode (d, TQString ("tv://"), "input", id_node_tv_input, n) {
setAttribute (KMPlayer::StringPool::attr_name, n);
setAttribute (KMPlayer::StringPool::attr_id, QString::number (id));
setAttribute (KMPlayer::StringPool::attr_id, TQString::number (id));
}
KDE_NO_CDTOR_EXPORT TVInput::TVInput (KMPlayer::NodePtr & d) : TVNode (d, QString ("tv://"), "input", id_node_tv_input) {
KDE_NO_CDTOR_EXPORT TVInput::TVInput (KMPlayer::NodePtr & d) : TVNode (d, TQString ("tv://"), "input", id_node_tv_input) {
}
KDE_NO_EXPORT KMPlayer::NodePtr TVInput::childFromTag (const QString & tag) {
KDE_NO_EXPORT KMPlayer::NodePtr TVInput::childFromTag (const TQString & tag) {
// kdDebug () << nodeName () << " childFromTag " << tag << endl;
if (tag == QString::fromLatin1 ("channel")) {
if (tag == TQString::tqfromLatin1 ("channel")) {
return new TVChannel (m_doc);
} else
return 0L;
@ -223,21 +223,21 @@ KDE_NO_EXPORT void TVInput::closed () {
//pretty_name = getAttribute (KMPlayer::StringPool::attr_name);
}
KDE_NO_EXPORT void TVInput::setNodeName (const QString & name) {
Node * p = parentNode ().ptr ();
QString nm (name);
KDE_NO_EXPORT void TVInput::setNodeName (const TQString & name) {
Node * p = tqparentNode ().ptr ();
TQString nm (name);
if (p && p->id == id_node_tv_device) {
int pos = name.find (QString (" - ") + p->mrl ()->pretty_name);
int pos = name.tqfind (TQString (" - ") + p->mrl ()->pretty_name);
if (pos > -1)
nm.truncate (pos);
}
pretty_name = nm + QString (" - ") + pretty_name;
pretty_name = nm + TQString (" - ") + pretty_name;
TVNode::setNodeName (nm);
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TVDevice::TVDevice (KMPlayer::NodePtr & doc, const QString & d) : TVNode (doc, d, "device", id_node_tv_device), zombie (false) {
KDE_NO_CDTOR_EXPORT TVDevice::TVDevice (KMPlayer::NodePtr & doc, const TQString & d) : TVNode (doc, d, "device", id_node_tv_device), zombie (false) {
setAttribute ("path", d);
}
@ -250,9 +250,9 @@ KDE_NO_CDTOR_EXPORT TVDevice::~TVDevice () {
device_page->deleteLater ();
}
KDE_NO_EXPORT KMPlayer::NodePtr TVDevice::childFromTag (const QString & tag) {
KDE_NO_EXPORT KMPlayer::NodePtr TVDevice::childFromTag (const TQString & tag) {
// kdDebug () << nodeName () << " childFromTag " << tag << endl;
if (tag == QString::fromLatin1 ("input"))
if (tag == TQString::tqfromLatin1 ("input"))
return new TVInput (m_doc);
return 0L;
}
@ -265,7 +265,7 @@ KDE_NO_EXPORT void TVDevice::childDone (KMPlayer::NodePtr) {
finish ();
}
KDE_NO_EXPORT void TVDevice::setNodeName (const QString & name) {
KDE_NO_EXPORT void TVDevice::setNodeName (const TQString & name) {
TVNode::setNodeName (name);
updateNodeName ();
}
@ -277,7 +277,7 @@ KDE_NO_EXPORT void TVDevice::updateNodeName () {
if (c->id == id_node_tv_input) {
TVInput * i = static_cast <TVInput *> (c.ptr ());
i->pretty_name = i->getAttribute (KMPlayer::StringPool::attr_name) +
QString (" - ") + pretty_name;
TQString (" - ") + pretty_name;
}
}
@ -297,15 +297,15 @@ KDE_NO_EXPORT void TVDevice::updateDevicePage () {
TVInput * input = KMPlayer::convertNode <TVInput> (ip);
bool ok;
if (input->getAttribute ("tuner").toInt (&ok) && ok) {
QWidget * widget = device_page->inputsTab->page (i);
QTable * table = static_cast <QTable *> (widget->child ("PageTVChannels", "QTable"));
TQWidget * widget = device_page->inputsTab->page (i);
TQTable * table = static_cast <TQTable *> (TQT_TQWIDGET(widget->child ("PageTVChannels", TQTABLE_OBJECT_NAME_STRING)));
if (table) {
input->clearChildren ();
for (int j = 0; j<table->numRows() && table->item (j, 1); ++j) {
input->appendChild (new TVChannel (m_doc, table->item (j, 0)->text (), table->item (j, 1)->text ().toDouble ()));
}
}
QComboBox * norms = static_cast <QComboBox *> (widget->child ("PageTVNorm", "QComboBox"));
TQComboBox * norms = static_cast <TQComboBox *> (TQT_TQWIDGET(widget->child ("PageTVNorm", TQCOMBOBOX_OBJECT_NAME_STRING)));
if (norms) {
input->setAttribute ("norm", norms->currentText ());
}
@ -321,9 +321,9 @@ TVDocument::TVDocument (KMPlayerTVSource * source)
pretty_name = i18n ("Television");
}
KDE_NO_EXPORT KMPlayer::NodePtr TVDocument::childFromTag (const QString & tag) {
KDE_NO_EXPORT KMPlayer::NodePtr TVDocument::childFromTag (const TQString & tag) {
// kdDebug () << nodeName () << " childFromTag " << tag << endl;
if (tag == QString::fromLatin1 ("device"))
if (tag == TQString::tqfromLatin1 ("device"))
return new TVDevice (m_doc);
return FileDocument::childFromTag (tag);
}
@ -341,11 +341,11 @@ KDE_NO_EXPORT void TVDocument::defer () {
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerTVSource::KMPlayerTVSource (KMPlayerApp * a, QPopupMenu * m)
KDE_NO_CDTOR_EXPORT KMPlayerTVSource::KMPlayerTVSource (KMPlayerApp * a, TQPopupMenu * m)
: KMPlayerMenuSource (i18n ("TV"), a, m, "tvsource"), m_configpage (0L), scanner (0L), config_read (false) {
m_url = "tv://";
m_menu->insertTearOffHandle ();
connect (m_menu, SIGNAL (aboutToShow ()), this, SLOT (menuAboutToShow ()));
connect (m_menu, TQT_SIGNAL (aboutToShow ()), this, TQT_SLOT (menuAboutToShow ()));
m_document = new TVDocument (this);
m_player->settings ()->addPage (this);
tree_id = static_cast <KMPlayer::View*>(m_player->view ())->playList ()->addTree (m_document, "tvsource", "tv", KMPlayer::PlayListView::TreeEdit | KMPlayer::PlayListView::Moveable | KMPlayer::PlayListView::Deleteable);
@ -377,9 +377,9 @@ KDE_NO_EXPORT void KMPlayerTVSource::activate () {
KMPlayer::Source::reset ();
buildArguments ();
if (m_cur_tvdevice) {
QString playback = static_cast <KMPlayer::Element *> (m_cur_tvdevice.ptr ())->getAttribute (QString::fromLatin1 ("playback"));
TQString playback = static_cast <KMPlayer::Element *> (m_cur_tvdevice.ptr ())->getAttribute (TQString::tqfromLatin1 ("playback"));
if (playback.isEmpty () || playback.toInt ())
QTimer::singleShot (0, m_player, SLOT (play ()));
TQTimer::singleShot (0, m_player, TQT_SLOT (play ()));
}
}
/* TODO: playback by
@ -397,7 +397,7 @@ KDE_NO_EXPORT void KMPlayerTVSource::buildMenu () {
int counter = 0;
for (KMPlayer::NodePtr dp = m_document->firstChild (); dp; dp = dp->nextSibling ())
if (dp->id == id_node_tv_device)
m_menu->insertItem (KMPlayer::convertNode <TVDevice> (dp)->pretty_name, this, SLOT (menuClicked (int)), 0, counter++);
m_menu->insertItem (KMPlayer::convertNode <TVDevice> (dp)->pretty_name, this, TQT_SLOT (menuClicked (int)), 0, counter++);
}
KDE_NO_EXPORT void KMPlayerTVSource::menuAboutToShow () {
@ -409,7 +409,7 @@ void KMPlayerTVSource::jump (KMPlayer::NodePtr e) {
readXML ();
} else {
m_current = e;
for (; e; e = e->parentNode ()) {
for (; e; e = e->tqparentNode ()) {
if (e->id == id_node_tv_device) {
m_cur_tvdevice = e;
break;
@ -436,14 +436,14 @@ KDE_NO_EXPORT void KMPlayerTVSource::buildArguments () {
KMPlayer::NodePtr elm = m_current;
if (elm && elm->id == id_node_tv_channel) {
channel = KMPlayer::convertNode <TVChannel> (elm);
elm = elm->parentNode ();
elm = elm->tqparentNode ();
}
if (elm && elm->id == id_node_tv_input)
input = KMPlayer::convertNode <TVInput> (elm);
if (!(channel || (input && input->getAttribute ("tuner").isEmpty ())))
return;
m_cur_tvinput = input;
m_cur_tvdevice = input->parentNode ();
m_cur_tvdevice = input->tqparentNode ();
static_cast <KMPlayer::View*>(m_player->view ())->playList ()->updateTree (0, m_cur_tvinput, m_current, true, false);
if (m_cur_tvdevice->id != id_node_tv_device) {
return;
@ -454,39 +454,39 @@ KDE_NO_EXPORT void KMPlayerTVSource::buildArguments () {
m_videodevice = tvdevice->src;
m_videonorm = input->getAttribute ("norm");
m_tuner = input->getAttribute (KMPlayer::StringPool::attr_name);
QString xvport = tvdevice->getAttribute ("xvport");
TQString xvport = tvdevice->getAttribute ("xvport");
if (!xvport.isEmpty ())
m_xvport = xvport.toInt ();
QString xvenc = input->getAttribute ("xvenc");
TQString xvenc = input->getAttribute ("xvenc");
if (!xvenc.isEmpty ())
m_xvencoding = xvenc.toInt ();
QString command;
TQString command;
command.sprintf ("device=%s:input=%s",
tvdevice->src.ascii (),
input->getAttribute (KMPlayer::StringPool::attr_id).ascii ());
if (channel) {
QString freq = channel->getAttribute ("frequency");
TQString freq = channel->getAttribute ("frequency");
m_frequency = (int)(1000 * freq.toDouble ());
command += QString (":freq=%1").arg (freq);
command += TQString (":freq=%1").arg (freq);
} else
m_frequency = 0;
if (!m_videonorm.isEmpty ())
command += QString (":norm=%1").arg (m_videonorm);
command += TQString (":norm=%1").arg (m_videonorm);
m_app->setCaption (i18n ("TV: ") + (channel ? channel->mrl ()->pretty_name : input->mrl ()->pretty_name), false);
setDimensions (m_cur_tvdevice,
tvdevice->getAttribute (KMPlayer::StringPool::attr_width).toInt (),
tvdevice->getAttribute (KMPlayer::StringPool::attr_height).toInt ());
m_options.sprintf ("-tv noaudio:driver=%s:%s:width=%d:height=%d -slave -nocache -quiet", tvdriver.ascii (), command.ascii (), width (), height ());
if (m_player->settings ()->mplayerpost090)
m_recordcmd.sprintf ("-tv %s:driver=%s:%s:width=%d:height=%d", m_audiodevice.isEmpty () ? "noaudio" : (QString ("forceaudio:adevice=") + m_audiodevice).ascii(), tvdriver.ascii (), command.ascii (), width (), height ());
m_recordcmd.sprintf ("-tv %s:driver=%s:%s:width=%d:height=%d", m_audiodevice.isEmpty () ? "noaudio" : (TQString ("forceaudio:adevice=") + m_audiodevice).ascii(), tvdriver.ascii (), command.ascii (), width (), height ());
else
m_recordcmd.sprintf ("-tv on:%s:driver=%s:%s:width=%d:height=%d", m_audiodevice.isEmpty () ? "noaudio" : (QString ("forceaudio:adevice=") + m_audiodevice).ascii(), tvdriver.ascii (), command.ascii (), width (), height ());
m_recordcmd.sprintf ("-tv on:%s:driver=%s:%s:width=%d:height=%d", m_audiodevice.isEmpty () ? "noaudio" : (TQString ("forceaudio:adevice=") + m_audiodevice).ascii(), tvdriver.ascii (), command.ascii (), width (), height ());
}
KDE_NO_EXPORT void KMPlayerTVSource::playCurrent () {
buildArguments ();
if (m_app->broadcasting ())
QTimer::singleShot (0, m_app->broadcastConfig (), SLOT (startFeed ()));
TQTimer::singleShot (0, m_app->broadcastConfig (), TQT_SLOT (startFeed ()));
else
KMPlayer::Source::playCurrent ();
}
@ -501,10 +501,10 @@ KDE_NO_EXPORT void KMPlayerTVSource::menuClicked (int id) {
m_player->setSource (this);
}
KDE_NO_EXPORT QString KMPlayerTVSource::filterOptions () {
KDE_NO_EXPORT TQString KMPlayerTVSource::filterOptions () {
if (! m_player->settings ()->disableppauto)
return KMPlayer::Source::filterOptions ();
return QString ("-vf pp=lb");
return TQString ("-vf pp=lb");
}
KDE_NO_EXPORT bool KMPlayerTVSource::hasLength () {
@ -515,8 +515,8 @@ KDE_NO_EXPORT bool KMPlayerTVSource::isSeekable () {
return true;
}
KDE_NO_EXPORT QString KMPlayerTVSource::prettyName () {
QString name (i18n ("TV"));
KDE_NO_EXPORT TQString KMPlayerTVSource::prettyName () {
TQString name (i18n ("TV"));
//if (m_tvsource)
// name += ' ' + m_tvsource->title;
return name;
@ -565,22 +565,22 @@ KDE_NO_EXPORT void KMPlayerTVSource::sync (bool fromUI) {
}
}
KDE_NO_EXPORT void KMPlayerTVSource::prefLocation (QString & item, QString & icon, QString & tab) {
KDE_NO_EXPORT void KMPlayerTVSource::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Source");
icon = QString ("source");
icon = TQString ("source");
tab = i18n ("TV");
}
KDE_NO_EXPORT QFrame * KMPlayerTVSource::prefPage (QWidget * parent) {
KDE_NO_EXPORT TQFrame * KMPlayerTVSource::prefPage (TQWidget * tqparent) {
if (!m_configpage) {
m_configpage = new KMPlayerPrefSourcePageTV (parent, this);
m_configpage = new KMPlayerPrefSourcePageTV (tqparent, this);
scanner = new TVDeviceScannerSource (this);
connect (m_configpage->scan, SIGNAL(clicked()), this, SLOT(slotScan()));
connect (m_configpage->scan, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotScan()));
}
return m_configpage;
}
static bool hasTVDevice (KMPlayer::NodePtr doc, const QString & devstr) {
static bool hasTVDevice (KMPlayer::NodePtr doc, const TQString & devstr) {
for (KMPlayer::NodePtr e = doc->firstChild (); e; e = e->nextSibling ())
if (e->id == id_node_tv_device &&
KMPlayer::convertNode <TVDevice> (e)->src == devstr)
@ -589,19 +589,19 @@ static bool hasTVDevice (KMPlayer::NodePtr doc, const QString & devstr) {
}
KDE_NO_EXPORT void KMPlayerTVSource::slotScan () {
QString devstr = m_configpage->device->lineEdit()->text ();
TQString devstr = m_configpage->device->lineEdit()->text ();
if (!hasTVDevice(m_document, devstr)) {
scanner->scan (devstr, m_configpage->driver->text());
connect (scanner, SIGNAL (scanFinished (TVDevice *)),
this, SLOT (slotScanFinished (TVDevice *)));
connect (scanner, TQT_SIGNAL (scanFinished (TVDevice *)),
this, TQT_SLOT (slotScanFinished (TVDevice *)));
} else
KMessageBox::error (m_configpage, i18n ("Device already present."),
i18n ("Error"));
}
KDE_NO_EXPORT void KMPlayerTVSource::slotScanFinished (TVDevice * tvdevice) {
disconnect (scanner, SIGNAL (scanFinished (TVDevice *)),
this, SLOT (slotScanFinished (TVDevice *)));
disconnect (scanner, TQT_SIGNAL (scanFinished (TVDevice *)),
this, TQT_SLOT (slotScanFinished (TVDevice *)));
if (tvdevice) {
tvdevice->zombie = false;
addTVDevicePage (tvdevice, true);
@ -614,8 +614,8 @@ KDE_NO_EXPORT void KMPlayerTVSource::addTVDevicePage(TVDevice *dev, bool show) {
dev->device_page->deleteLater ();
dev->device_page = new TVDevicePage (m_configpage->notebook, dev);
m_configpage->notebook->insertTab (dev->device_page, dev->pretty_name);
connect (dev->device_page, SIGNAL (deleted (TVDevicePage *)),
this, SLOT (slotDeviceDeleted (TVDevicePage *)));
connect (dev->device_page, TQT_SIGNAL (deleted (TVDevicePage *)),
this, TQT_SLOT (slotDeviceDeleted (TVDevicePage *)));
if (show)
m_configpage->notebook->setCurrentPage (m_configpage->notebook->count ()-1);
}
@ -634,7 +634,7 @@ KDE_NO_CDTOR_EXPORT TVDeviceScannerSource::TVDeviceScannerSource (KMPlayerTVSour
KDE_NO_EXPORT void TVDeviceScannerSource::init () {
}
KDE_NO_EXPORT bool TVDeviceScannerSource::processOutput (const QString & line) {
KDE_NO_EXPORT bool TVDeviceScannerSource::processOutput (const TQString & line) {
if (m_nameRegExp.search (line) > -1) {
m_tvdevice->pretty_name = m_nameRegExp.cap (1);
m_tvdevice->setAttribute(KMPlayer::StringPool::attr_name,m_tvdevice->pretty_name);
@ -661,8 +661,8 @@ KDE_NO_EXPORT bool TVDeviceScannerSource::processOutput (const QString & line) {
return true;
}
KDE_NO_EXPORT QString TVDeviceScannerSource::filterOptions () {
return QString ("");
KDE_NO_EXPORT TQString TVDeviceScannerSource::filterOptions () {
return TQString ("");
}
KDE_NO_EXPORT bool TVDeviceScannerSource::hasLength () {
@ -673,7 +673,7 @@ KDE_NO_EXPORT bool TVDeviceScannerSource::isSeekable () {
return false;
}
KDE_NO_EXPORT bool TVDeviceScannerSource::scan (const QString & dev, const QString & dri) {
KDE_NO_EXPORT bool TVDeviceScannerSource::scan (const TQString & dev, const TQString & dri) {
if (m_tvdevice)
return false;
setURL (KURL ("tv://"));
@ -698,8 +698,8 @@ KDE_NO_EXPORT void TVDeviceScannerSource::activate () {
KDE_NO_EXPORT void TVDeviceScannerSource::deactivate () {
kdDebug () << "TVDeviceScannerSource::deactivate" << endl;
if (m_tvdevice) {
if (m_tvdevice->parentNode ())
m_tvdevice->parentNode ()->removeChild (m_tvdevice);
if (m_tvdevice->tqparentNode ())
m_tvdevice->tqparentNode ()->removeChild (m_tvdevice);
m_tvdevice = 0L;
emit scanFinished (m_tvdevice);
}
@ -708,7 +708,7 @@ KDE_NO_EXPORT void TVDeviceScannerSource::deactivate () {
KDE_NO_EXPORT void TVDeviceScannerSource::play () {
if (!m_tvdevice)
return;
QString args;
TQString args;
args.sprintf ("tv:// -tv driver=%s:device=%s -identify -frames 0", m_driver.ascii (), m_tvdevice->src.ascii ());
m_tvsource->player ()->stop ();
m_tvsource->player ()->process ()->initProcess (m_player->settings ()->defaultView ()->viewer ());

@ -20,9 +20,9 @@
#ifndef _KMPLAYER_TV_SOURCE_H_
#define _KMPLAYER_TV_SOURCE_H_
#include <qguardedptr.h>
#include <qstring.h>
#include <qframe.h>
#include <tqguardedptr.h>
#include <tqstring.h>
#include <tqframe.h>
#include "kmplayerappsource.h"
#include "kmplayerconfig.h"
@ -39,26 +39,27 @@ class KMPlayerTVSource;
class KURLRequester;
class KHistoryCombo;
class KMPlayerApp;
class QTabWidget;
class QGroupBox;
class QLineEdit;
class QCheckBox;
class TQTabWidget;
class TQGroupBox;
class TQLineEdit;
class TQCheckBox;
class KComboBox;
class KConfig;
class KMPLAYER_NO_EXPORT TVDevicePage : public QFrame {
class KMPLAYER_NO_EXPORT TVDevicePage : public TQFrame {
Q_OBJECT
TQ_OBJECT
public:
TVDevicePage (QWidget *parent, KMPlayer::NodePtr dev);
TVDevicePage (TQWidget *tqparent, KMPlayer::NodePtr dev);
KDE_NO_CDTOR_EXPORT ~TVDevicePage () {}
QLineEdit * name;
TQLineEdit * name;
KURLRequester * audiodevice;
QLineEdit * sizewidth;
QLineEdit * sizeheight;
QCheckBox * noplayback;
QTabWidget * inputsTab;
TQLineEdit * sizewidth;
TQLineEdit * sizeheight;
TQCheckBox * noplayback;
TQTabWidget * inputsTab;
KMPlayer::NodePtrW device_doc;
signals:
void deleted (TVDevicePage *);
@ -66,24 +67,25 @@ private slots:
void slotDelete ();
};
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageTV : public QFrame {
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageTV : public TQFrame {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerPrefSourcePageTV (QWidget *parent, KMPlayerTVSource *);
KMPlayerPrefSourcePageTV (TQWidget *tqparent, KMPlayerTVSource *);
KDE_NO_CDTOR_EXPORT ~KMPlayerPrefSourcePageTV () {}
QLineEdit * driver;
TQLineEdit * driver;
KURLRequester * device;
QPushButton * scan;
QTabWidget * notebook;
TQPushButton * scan;
TQTabWidget * notebook;
protected:
void showEvent (QShowEvent *);
void showEvent (TQShowEvent *);
KMPlayerTVSource * m_tvsource;
};
class KMPLAYER_NO_EXPORT TVNode : public KMPlayer::GenericMrl {
public:
TVNode (KMPlayer::NodePtr &d, const QString &s, const char * t, short id, const QString &n=QString ());
virtual void setNodeName (const QString &);
TVNode (KMPlayer::NodePtr &d, const TQString &s, const char * t, short id, const TQString &n=TQString ());
virtual void setNodeName (const TQString &);
};
/*
@ -91,7 +93,7 @@ public:
*/
class KMPLAYER_NO_EXPORT TVChannel : public TVNode {
public:
TVChannel (KMPlayer::NodePtr & d, const QString & n, double f);
TVChannel (KMPlayer::NodePtr & d, const TQString & n, double f);
TVChannel (KMPlayer::NodePtr & d);
KDE_NO_CDTOR_EXPORT ~TVChannel () {}
void closed ();
@ -102,11 +104,11 @@ public:
*/
class KMPLAYER_NO_EXPORT TVInput : public TVNode {
public:
TVInput (KMPlayer::NodePtr & d, const QString & n, int id);
TVInput (KMPlayer::NodePtr & d, const TQString & n, int id);
TVInput (KMPlayer::NodePtr & d);
KDE_NO_CDTOR_EXPORT ~TVInput () {}
KMPlayer::NodePtr childFromTag (const QString &);
void setNodeName (const QString &);
KMPlayer::NodePtr childFromTag (const TQString &);
void setNodeName (const TQString &);
void closed ();
};
@ -115,25 +117,25 @@ public:
*/
class KMPLAYER_NO_EXPORT TVDevice : public TVNode {
public:
TVDevice (KMPlayer::NodePtr & d, const QString & s);
TVDevice (KMPlayer::NodePtr & d, const TQString & s);
TVDevice (KMPlayer::NodePtr & d);
~TVDevice ();
KMPlayer::NodePtr childFromTag (const QString &);
KMPlayer::NodePtr childFromTag (const TQString &);
void closed ();
void childDone (KMPlayer::NodePtr child);
void setNodeName (const QString &);
void setNodeName (const TQString &);
bool expose () const { return false; }
void updateNodeName ();
void updateDevicePage ();
bool zombie;
QGuardedPtr <TVDevicePage> device_page;
TQGuardedPtr <TVDevicePage> device_page;
};
class KMPLAYER_NO_EXPORT TVDocument : public FileDocument {
KMPlayerTVSource * m_source;
public:
TVDocument (KMPlayerTVSource *);
KMPlayer::NodePtr childFromTag (const QString &);
KMPlayer::NodePtr childFromTag (const TQString &);
void defer ();
KDE_NO_EXPORT const char * nodeName () const { return "tvdevices"; }
void childDone (KMPlayer::NodePtr child);
@ -145,15 +147,16 @@ public:
*/
class KMPLAYER_NO_EXPORT TVDeviceScannerSource : public KMPlayer::Source {
Q_OBJECT
TQ_OBJECT
public:
TVDeviceScannerSource (KMPlayerTVSource * src);
KDE_NO_CDTOR_EXPORT ~TVDeviceScannerSource () {};
virtual void init ();
virtual bool processOutput (const QString & line);
virtual QString filterOptions ();
virtual bool processOutput (const TQString & line);
virtual TQString filterOptions ();
virtual bool hasLength ();
virtual bool isSeekable ();
virtual bool scan (const QString & device, const QString & driver);
virtual bool scan (const TQString & device, const TQString & driver);
public slots:
virtual void activate ();
virtual void deactivate ();
@ -165,10 +168,10 @@ private:
KMPlayerTVSource * m_tvsource;
TVDevice * m_tvdevice;
KMPlayer::Source * m_old_source;
QString m_driver;
QRegExp m_nameRegExp;
QRegExp m_sizesRegExp;
QRegExp m_inputRegExp;
TQString m_driver;
TQRegExp m_nameRegExp;
TQRegExp m_sizesRegExp;
TQRegExp m_inputRegExp;
};
/*
@ -176,20 +179,21 @@ private:
*/
class KMPLAYER_NO_EXPORT KMPlayerTVSource : public KMPlayerMenuSource, public KMPlayer::PreferencesPage {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerTVSource (KMPlayerApp * app, QPopupMenu * m);
KMPlayerTVSource (KMPlayerApp * app, TQPopupMenu * m);
virtual ~KMPlayerTVSource ();
virtual QString filterOptions ();
virtual TQString filterOptions ();
virtual bool hasLength ();
virtual bool isSeekable ();
virtual KMPlayer::NodePtr root ();
void buildMenu ();
virtual QString prettyName ();
virtual TQString prettyName ();
virtual void write (KConfig *);
virtual void read (KConfig *);
virtual void sync (bool);
virtual void prefLocation (QString & item, QString & icon, QString & tab);
virtual QFrame * prefPage (QWidget * parent);
virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual TQFrame * prefPage (TQWidget * tqparent);
void readXML ();
public slots:
virtual void activate ();
@ -207,8 +211,8 @@ private:
void buildArguments ();
KMPlayer::NodePtrW m_cur_tvdevice;
KMPlayer::NodePtrW m_cur_tvinput;
QPopupMenu * m_channelmenu;
QString tvdriver;
TQPopupMenu * m_channelmenu;
TQString tvdriver;
KMPlayerPrefSourcePageTV * m_configpage;
TVDeviceScannerSource * scanner;
int tree_id;

@ -20,25 +20,25 @@
#include <math.h>
#include <unistd.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qmap.h>
#include <qtimer.h>
#include <qpushbutton.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qtable.h>
#include <qstringlist.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qgroupbox.h>
#include <qwhatsthis.h>
#include <qtabwidget.h>
#include <qradiobutton.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qsocket.h>
#include <qeventloop.h>
#include <tqlayout.h>
#include <tqlabel.h>
#include <tqmap.h>
#include <tqtimer.h>
#include <tqpushbutton.h>
#include <tqbuttongroup.h>
#include <tqcheckbox.h>
#include <tqtable.h>
#include <tqstringlist.h>
#include <tqcombobox.h>
#include <tqlineedit.h>
#include <tqgroupbox.h>
#include <tqwhatsthis.h>
#include <tqtabwidget.h>
#include <tqradiobutton.h>
#include <tqmessagebox.h>
#include <tqpopupmenu.h>
#include <tqsocket.h>
#include <tqeventloop.h>
#include <klocale.h>
#include <kdebug.h>
@ -75,39 +75,39 @@ static const char * strXVPort = "XV Port";
static const char * strXVEncoding = "XV Encoding";
static const char * strXVScale = "XV Scale";
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::KMPlayerPrefSourcePageVDR (QWidget * parent, KMPlayer::PartBase * player)
: QFrame (parent), m_player (player) {
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::KMPlayerPrefSourcePageVDR (TQWidget * tqparent, KMPlayer::PartBase * player)
: TQFrame (tqparent), m_player (player) {
//KURLRequester * v4ldevice;
QVBoxLayout *layout = new QVBoxLayout (this, 5, 2);
QGridLayout *gridlayout = new QGridLayout (1, 2);
TQVBoxLayout *tqlayout = new TQVBoxLayout (this, 5, 2);
TQGridLayout *gridtqlayout = new TQGridLayout (1, 2);
xv_port = new KListView (this);
xv_port->addColumn (QString());
xv_port->addColumn (TQString());
xv_port->header()->hide ();
xv_port->setTreeStepSize (15);
//xv_port->setRootIsDecorated (true);
//xv_port->setSorting (-1);
QListViewItem * vitem = new QListViewItem (xv_port, i18n ("XVideo port"));
TQListViewItem * vitem = new TQListViewItem (xv_port, i18n ("XVideo port"));
vitem->setOpen (true);
QWhatsThis::add (xv_port, i18n ("Port base of the X Video extension.\nIf left to default (0), the first available port will be used. However if you have multiple XVideo instances, you might have to provide the port to use here.\nSee the output from 'xvinfo' for more information"));
QLabel * label = new QLabel (i18n ("Communication port:"), this);
gridlayout->addWidget (label, 0, 0);
tcp_port = new QLineEdit ("", this);
QWhatsThis::add (tcp_port, i18n ("Communication port with VDR. Default is port 2001.\nIf you use another port, with the '-p' option of 'vdr', you must set it here too."));
gridlayout->addWidget (tcp_port, 0, 1);
layout->addWidget (xv_port);
layout->addLayout (gridlayout);
scale = new QButtonGroup (2, Qt::Vertical, i18n ("Scale"), this);
new QRadioButton (i18n ("4:3"), scale);
new QRadioButton (i18n ("16:9"), scale);
QWhatsThis::add (scale, i18n ("Aspects to use when viewing VDR"));
TQWhatsThis::add (xv_port, i18n ("Port base of the X Video extension.\nIf left to default (0), the first available port will be used. However if you have multiple XVideo instances, you might have to provide the port to use here.\nSee the output from 'xvinfo' for more information"));
TQLabel * label = new TQLabel (i18n ("Communication port:"), this);
gridtqlayout->addWidget (label, 0, 0);
tcp_port = new TQLineEdit ("", this);
TQWhatsThis::add (tcp_port, i18n ("Communication port with VDR. Default is port 2001.\nIf you use another port, with the '-p' option of 'vdr', you must set it here too."));
gridtqlayout->addWidget (tcp_port, 0, 1);
tqlayout->addWidget (xv_port);
tqlayout->addLayout (gridtqlayout);
scale = new TQButtonGroup (2, Qt::Vertical, i18n ("Scale"), this);
new TQRadioButton (i18n ("4:3"), scale);
new TQRadioButton (i18n ("16:9"), scale);
TQWhatsThis::add (scale, i18n ("Aspects to use when viewing VDR"));
scale->setButton (0);
layout->addWidget (scale);
layout->addItem (new QSpacerItem (5, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
tqlayout->addWidget (scale);
tqlayout->addItem (new TQSpacerItem (5, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
}
KDE_NO_CDTOR_EXPORT KMPlayerPrefSourcePageVDR::~KMPlayerPrefSourcePageVDR () {}
KDE_NO_EXPORT void KMPlayerPrefSourcePageVDR::showEvent (QShowEvent *) {
KDE_NO_EXPORT void KMPlayerPrefSourcePageVDR::showEvent (TQShowEvent *) {
XVideo * xvideo = static_cast<XVideo *>(m_player->players()["xvideo"]);
if (!xvideo->configDocument ())
xvideo->getConfigData ();
@ -130,10 +130,10 @@ public:
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::KMPlayerVDRSource (KMPlayerApp * app)
: KMPlayer::Source (QString ("VDR"), app->player (), "vdrsource"),
: KMPlayer::Source (TQString ("VDR"), app->player (), "vdrsource"),
m_app (app),
m_configpage (0),
m_socket (new QSocket (this)),
m_socket (new TQSocket (this)),
commands (0L),
channel_timer (0),
timeout_timer (0),
@ -142,10 +142,10 @@ KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::KMPlayerVDRSource (KMPlayerApp * app)
m_stored_volume (0) {
memset (m_actions, 0, sizeof (KAction *) * int (act_last));
m_player->settings ()->addPage (this);
connect (m_socket, SIGNAL (connectionClosed()), this, SLOT(disconnected()));
connect (m_socket, SIGNAL (connected ()), this, SLOT (connected ()));
connect (m_socket, SIGNAL (readyRead ()), this, SLOT (readyRead ()));
connect (m_socket, SIGNAL (error (int)), this, SLOT (socketError (int)));
connect (m_socket, TQT_SIGNAL (connectionClosed()), this, TQT_SLOT(disconnected()));
connect (m_socket, TQT_SIGNAL (connected ()), this, TQT_SLOT (connected ()));
connect (m_socket, TQT_SIGNAL (readyRead ()), this, TQT_SLOT (readyRead ()));
connect (m_socket, TQT_SIGNAL (error (int)), this, TQT_SLOT (socketError (int)));
}
KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::~KMPlayerVDRSource () {}
@ -154,8 +154,8 @@ KDE_NO_CDTOR_EXPORT void KMPlayerVDRSource::waitForConnectionClose () {
if (timeout_timer) {
finish_timer = startTimer (500);
kdDebug () << "VDR connection not yet closed" << endl;
QApplication::eventLoop ()->enterLoop ();
kdDebug () << "VDR connection:" << (m_socket->state () == QSocket::Connected) << endl;
TQApplication::eventLoop ()->enterLoop ();
kdDebug () << "VDR connection:" << (m_socket->state () == TQSocket::Connected) << endl;
timeout_timer = 0;
}
}
@ -168,14 +168,14 @@ KDE_NO_EXPORT bool KMPlayerVDRSource::isSeekable () {
return true;
}
KDE_NO_EXPORT QString KMPlayerVDRSource::prettyName () {
KDE_NO_EXPORT TQString KMPlayerVDRSource::prettyName () {
return i18n ("VDR");
}
KDE_NO_EXPORT void KMPlayerVDRSource::activate () {
last_channel = 0;
connect (this, SIGNAL (startPlaying ()), this, SLOT (processStarted()));
connect (this, SIGNAL (stopPlaying ()), this, SLOT (processStopped ()));
connect (this, TQT_SIGNAL (startPlaying ()), this, TQT_SLOT (processStarted()));
connect (this, TQT_SIGNAL (stopPlaying ()), this, TQT_SLOT (processStopped ()));
KMPlayer::ControlPanel * panel = m_app->view()->controlPanel ();
panel->button (KMPlayer::ControlPanel::button_red)->show ();
panel->button (KMPlayer::ControlPanel::button_green)->show ();
@ -183,29 +183,29 @@ KDE_NO_EXPORT void KMPlayerVDRSource::activate () {
panel->button (KMPlayer::ControlPanel::button_blue)->show ();
panel->button (KMPlayer::ControlPanel::button_pause)->hide ();
panel->button (KMPlayer::ControlPanel::button_record)->hide ();
connect (panel->volumeBar (), SIGNAL (volumeChanged (int)), this, SLOT (volumeChanged (int)));
connect (panel->button (KMPlayer::ControlPanel::button_red), SIGNAL (clicked ()), this, SLOT (keyRed ()));
connect (panel->button (KMPlayer::ControlPanel::button_green), SIGNAL (clicked ()), this, SLOT (keyGreen ()));
connect (panel->button (KMPlayer::ControlPanel::button_yellow), SIGNAL (clicked ()), this, SLOT (keyYellow ()));
connect (panel->button (KMPlayer::ControlPanel::button_blue), SIGNAL (clicked ()), this, SLOT (keyBlue ()));
connect (panel->volumeBar (), TQT_SIGNAL (volumeChanged (int)), this, TQT_SLOT (volumeChanged (int)));
connect (panel->button (KMPlayer::ControlPanel::button_red), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyRed ()));
connect (panel->button (KMPlayer::ControlPanel::button_green), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyGreen ()));
connect (panel->button (KMPlayer::ControlPanel::button_yellow), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyYellow ()));
connect (panel->button (KMPlayer::ControlPanel::button_blue), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyBlue ()));
setAspect (m_document, scale ? 16.0/9 : 1.33);
if (!m_url.protocol ().compare ("kmplayer"))
m_request_jump = KURL::decode_string (m_url.path ()).mid (1);
setURL (KURL (QString ("vdr://localhost:%1").arg (tcp_port)));
QTimer::singleShot (0, m_player, SLOT (play ()));
setURL (KURL (TQString ("vdr://localhost:%1").arg (tcp_port)));
TQTimer::singleShot (0, m_player, TQT_SLOT (play ()));
}
KDE_NO_EXPORT void KMPlayerVDRSource::deactivate () {
disconnect (m_socket, SIGNAL (error (int)), this, SLOT (socketError (int)));
disconnect (m_socket, TQT_SIGNAL (error (int)), this, TQT_SLOT (socketError (int)));
if (m_player->view ()) {
disconnect (this, SIGNAL(startPlaying()), this, SLOT(processStarted()));
disconnect (this, SIGNAL (stopPlaying()), this, SLOT(processStopped()));
disconnect (this, TQT_SIGNAL(startPlaying()), this, TQT_SLOT(processStarted()));
disconnect (this, TQT_SIGNAL (stopPlaying()), this, TQT_SLOT(processStopped()));
KMPlayer::ControlPanel * panel = m_app->view()->controlPanel ();
disconnect (panel->volumeBar (), SIGNAL (volumeChanged (int)), this, SLOT (volumeChanged (int)));
disconnect (panel->button (KMPlayer::ControlPanel::button_red), SIGNAL (clicked ()), this, SLOT (keyRed ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_green), SIGNAL (clicked ()), this, SLOT (keyGreen ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_yellow), SIGNAL (clicked ()), this, SLOT (keyYellow ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_blue), SIGNAL (clicked ()), this, SLOT (keyBlue ()));
disconnect (panel->volumeBar (), TQT_SIGNAL (volumeChanged (int)), this, TQT_SLOT (volumeChanged (int)));
disconnect (panel->button (KMPlayer::ControlPanel::button_red), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyRed ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_green), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyGreen ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_yellow), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyYellow ()));
disconnect (panel->button (KMPlayer::ControlPanel::button_blue), TQT_SIGNAL (clicked ()), this, TQT_SLOT (keyBlue ()));
}
processStopped ();
m_request_jump.truncate (0);
@ -217,9 +217,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::playCurrent () {
}
KDE_NO_EXPORT void KMPlayerVDRSource::processStopped () {
if (m_socket->state () == QSocket::Connected) {
queueCommand (QString ("VOLU %1\n").arg (m_stored_volume).ascii ());
queueCommand ("QUIT\n");
if (m_socket->state () == TQSocket::Connected) {
queueCommand (TQString ("VOLU %1\n").tqarg (m_stored_volume).ascii ());
queueCommand ("TQUIT\n");
}
}
@ -229,7 +229,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::processStarted () {
}
#define DEF_ACT(i,text,pix,scut,slot,name) \
m_actions [i] = new KAction (text, QString (pix), KShortcut (scut), this, slot, m_app->actionCollection (), name); \
m_actions [i] = new KAction (text, TQString (pix), KShortcut (scut), this, slot, m_app->actionCollection (), name); \
m_fullscreen_actions [i] = new KAction (text, KShortcut (scut), this, slot, m_app->view ()->viewArea ()->actionCollection (), name)
KDE_NO_EXPORT void KMPlayerVDRSource::connected () {
@ -238,33 +238,33 @@ KDE_NO_EXPORT void KMPlayerVDRSource::connected () {
killTimer (channel_timer);
channel_timer = startTimer (3000);
KAction * action = m_app->actionCollection ()->action ("vdr_connect");
action->setIcon (QString ("connect_no"));
action->setIcon (TQString ("connect_no"));
action->setText (i18n ("Dis&connect"));
DEF_ACT (act_up, i18n ("VDR Key Up"), "up", , SLOT (keyUp ()), "vdr_key_up");
DEF_ACT (act_down, i18n ("VDR Key Down"), "down", , SLOT (keyDown ()), "vdr_key_down");
DEF_ACT (act_back, i18n ("VDR Key Back"), "back", , SLOT (keyBack ()), "vdr_key_back");
DEF_ACT (act_ok, i18n ("VDR Key Ok"), "ok", , SLOT (keyOk ()), "vdr_key_ok");
DEF_ACT (act_setup, i18n ("VDR Key Setup"), "configure", , SLOT (keySetup ()), "vdr_key_setup");
DEF_ACT (act_channels, i18n ("VDR Key Channels"), "player_playlist", , SLOT (keyChannels ()), "vdr_key_channels");
DEF_ACT (act_menu, i18n ("VDR Key Menu"), "showmenu", , SLOT (keyMenu ()), "vdr_key_menu");
DEF_ACT (act_red, i18n ("VDR Key Red"), "red", , SLOT (keyRed ()), "vdr_key_red");
DEF_ACT (act_green, i18n ("VDR Key Green"), "green", , SLOT (keyGreen ()), "vdr_key_green");
DEF_ACT (act_yellow, i18n ("VDR Key Yellow"), "yellow", , SLOT (keyYellow ()), "vdr_key_yellow");
DEF_ACT (act_blue, i18n ("VDR Key Blue"), "blue", , SLOT (keyBlue ()), "vdr_key_blue");
DEF_ACT (act_up, i18n ("VDR Key Up"), "up", , TQT_SLOT (keyUp ()), "vdr_key_up");
DEF_ACT (act_down, i18n ("VDR Key Down"), "down", , TQT_SLOT (keyDown ()), "vdr_key_down");
DEF_ACT (act_back, i18n ("VDR Key Back"), "back", , TQT_SLOT (keyBack ()), "vdr_key_back");
DEF_ACT (act_ok, i18n ("VDR Key Ok"), "ok", , TQT_SLOT (keyOk ()), "vdr_key_ok");
DEF_ACT (act_setup, i18n ("VDR Key Setup"), "configure", , TQT_SLOT (keySetup ()), "vdr_key_setup");
DEF_ACT (act_channels, i18n ("VDR Key Channels"), "player_playlist", , TQT_SLOT (keyChannels ()), "vdr_key_channels");
DEF_ACT (act_menu, i18n ("VDR Key Menu"), "showmenu", , TQT_SLOT (keyMenu ()), "vdr_key_menu");
DEF_ACT (act_red, i18n ("VDR Key Red"), "red", , TQT_SLOT (keyRed ()), "vdr_key_red");
DEF_ACT (act_green, i18n ("VDR Key Green"), "green", , TQT_SLOT (keyGreen ()), "vdr_key_green");
DEF_ACT (act_yellow, i18n ("VDR Key Yellow"), "yellow", , TQT_SLOT (keyYellow ()), "vdr_key_yellow");
DEF_ACT (act_blue, i18n ("VDR Key Blue"), "blue", , TQT_SLOT (keyBlue ()), "vdr_key_blue");
#if KDE_IS_VERSION(3, 1, 90)
DEF_ACT (act_custom, "VDR Custom Command", "exec", , SLOT (customCmd ()), "vdr_key_custom");
DEF_ACT (act_custom, "VDR Custom Command", "exec", , TQT_SLOT (customCmd ()), "vdr_key_custom");
#endif
m_app->initMenu (); // update menu and toolbar
DEF_ACT (act_0, i18n ("VDR Key 0"), "0", Qt::Key_0, SLOT (key0 ()), "vdr_key_0");
DEF_ACT (act_1, i18n ("VDR Key 1"), "1", Qt::Key_1, SLOT (key1 ()), "vdr_key_1");
DEF_ACT (act_2, i18n ("VDR Key 2"), "2", Qt::Key_2, SLOT (key2 ()), "vdr_key_2");
DEF_ACT (act_3, i18n ("VDR Key 3"), "3", Qt::Key_3, SLOT (key3 ()), "vdr_key_3");
DEF_ACT (act_4, i18n ("VDR Key 4"), "4", Qt::Key_4, SLOT (key4 ()), "vdr_key_4");
DEF_ACT (act_5, i18n ("VDR Key 5"), "5", Qt::Key_5, SLOT (key5 ()), "vdr_key_5");
DEF_ACT (act_6, i18n ("VDR Key 6"), "6", Qt::Key_6, SLOT (key6 ()), "vdr_key_6");
DEF_ACT (act_7, i18n ("VDR Key 7"), "7", Qt::Key_7, SLOT (key7 ()), "vdr_key_7");
DEF_ACT (act_8, i18n ("VDR Key 8"), "8", Qt::Key_8, SLOT (key8 ()), "vdr_key_8");
DEF_ACT (act_9, i18n ("VDR Key 9"), "9", Qt::Key_9, SLOT (key9 ()), "vdr_key_9");
DEF_ACT (act_0, i18n ("VDR Key 0"), "0", TQt::Key_0, TQT_SLOT (key0 ()), "vdr_key_0");
DEF_ACT (act_1, i18n ("VDR Key 1"), "1", TQt::Key_1, TQT_SLOT (key1 ()), "vdr_key_1");
DEF_ACT (act_2, i18n ("VDR Key 2"), "2", TQt::Key_2, TQT_SLOT (key2 ()), "vdr_key_2");
DEF_ACT (act_3, i18n ("VDR Key 3"), "3", TQt::Key_3, TQT_SLOT (key3 ()), "vdr_key_3");
DEF_ACT (act_4, i18n ("VDR Key 4"), "4", TQt::Key_4, TQT_SLOT (key4 ()), "vdr_key_4");
DEF_ACT (act_5, i18n ("VDR Key 5"), "5", TQt::Key_5, TQT_SLOT (key5 ()), "vdr_key_5");
DEF_ACT (act_6, i18n ("VDR Key 6"), "6", TQt::Key_6, TQT_SLOT (key6 ()), "vdr_key_6");
DEF_ACT (act_7, i18n ("VDR Key 7"), "7", TQt::Key_7, TQT_SLOT (key7 ()), "vdr_key_7");
DEF_ACT (act_8, i18n ("VDR Key 8"), "8", TQt::Key_8, TQT_SLOT (key8 ()), "vdr_key_8");
DEF_ACT (act_9, i18n ("VDR Key 9"), "9", TQt::Key_9, TQT_SLOT (key9 ()), "vdr_key_9");
//KMPlayer::ViewLayer * layer = m_app->view ()->viewArea ();
for (int i = 0; i < int (act_last); ++i)
// somehow, the configured shortcuts only show up after createGUI() call
@ -280,12 +280,12 @@ KDE_NO_EXPORT void KMPlayerVDRSource::disconnected () {
deleteCommands ();
return;
}
setURL (KURL (QString ("vdr://localhost:%1").arg (tcp_port)));
setURL (KURL (TQString ("vdr://localhost:%1").arg (tcp_port)));
if (channel_timer && m_player->source () == this)
m_player->process ()->quit ();
deleteCommands ();
KAction * action = m_app->actionCollection ()->action ("vdr_connect");
action->setIcon (QString ("connect_established"));
action->setIcon (TQString ("connect_established"));
action->setText (i18n ("&Connect"));
m_app->guiFactory ()->removeClient (m_app);// crash w/ m_actions[i]->unplugAll (); in for loop below
for (int i = 0; i < int (act_last); ++i)
@ -298,8 +298,8 @@ KDE_NO_EXPORT void KMPlayerVDRSource::disconnected () {
}
KDE_NO_EXPORT void KMPlayerVDRSource::toggleConnected () {
if (m_socket->state () == QSocket::Connected) {
queueCommand ("QUIT\n");
if (m_socket->state () == TQSocket::Connected) {
queueCommand ("TQUIT\n");
killTimer (channel_timer);
channel_timer = 0;
} else {
@ -309,7 +309,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::toggleConnected () {
}
KDE_NO_EXPORT void KMPlayerVDRSource::volumeChanged (int val) {
queueCommand (QString ("VOLU %1\n").arg (int (sqrt (255 * 255 * val / 100))).ascii ());
queueCommand (TQString ("VOLU %1\n").tqarg (int (sqrt (255 * 255 * val / 100))).ascii ());
}
static struct ReadBuf {
@ -329,13 +329,13 @@ static struct ReadBuf {
delete buf;
buf = b;
}
KDE_NO_EXPORT QCString mid (int p) {
return QCString (buf + p);
KDE_NO_EXPORT TQCString mid (int p) {
return TQCString (buf + p);
}
KDE_NO_EXPORT QCString left (int p) {
return QCString (buf, p);
KDE_NO_EXPORT TQCString left (int p) {
return TQCString (buf, p);
}
KDE_NO_EXPORT QCString getReadLine ();
KDE_NO_EXPORT TQCString getReadLine ();
KDE_NO_EXPORT void clear () {
delete [] buf;
buf = 0;
@ -343,8 +343,8 @@ static struct ReadBuf {
}
} readbuf;
KDE_NO_EXPORT QCString ReadBuf::getReadLine () {
QCString out;
KDE_NO_EXPORT TQCString ReadBuf::getReadLine () {
TQCString out;
if (!length)
return out;
int p = strcspn (buf, "\r\n");
@ -365,7 +365,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
m_socket->readBlock (data, nr);
data [nr] = 0;
readbuf += data;
QCString line = readbuf.getReadLine ();
TQCString line = readbuf.getReadLine ();
if (commands) {
bool cmd_done = false;
while (!line.isEmpty ()) {
@ -373,14 +373,14 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
cmd_done = (line.length () > 3 && line[3] == ' '); // from svdrpsend.pl
// kdDebug () << "readyRead " << cmd_done << " " << commands->command << endl;
if (!strcmp (commands->command, cmd_list_channels) && m_document) {
int p = line.find (';');
int q = line.find (':');
int p = line.tqfind (';');
int q = line.tqfind (':');
if (q > 0 && (p < 0 || q < p))
p = q;
if (p > 0)
line.truncate (p);
QString channel_name = line.mid (4);
m_document->appendChild (new KMPlayer::GenericMrl (m_document, QString ("kmplayer://vdrsource/%1").arg(channel_name), channel_name));
TQString channel_name = line.mid (4);
m_document->appendChild (new KMPlayer::GenericMrl (m_document, TQString ("kmplayer://vdrsource/%1").tqarg(channel_name), channel_name));
if (cmd_done) {
m_player->updateTree ();
if (!m_request_jump.isEmpty ()) {
@ -391,9 +391,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
toconsole = false;
} else if (!strcmp (commands->command, cmd_chan_query)) {
if (v && line.length () > 4) {
QString ch = line.mid (4);
TQString ch = line.mid (4);
setTitle (ch);
KMPlayer::PlayListItem * lvi = static_cast <KMPlayer::PlayListItem *> (v->playList ()->findItem (ch, 0));
KMPlayer::PlayListItem * lvi = static_cast <KMPlayer::PlayListItem *> (v->playList ()->tqfindItem (ch, 0));
if (lvi && lvi->node != m_last_channel) {
KMPlayer::PlayListItem * si = static_cast <KMPlayer::PlayListItem *> (v->playList ()->selectedItem ());
bool jump_selection = (si && (si->node == m_document || si->node == m_last_channel));
@ -412,14 +412,14 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
int c = strtol(ch.ascii(), 0L, 10);
if (c != last_channel) {
last_channel = c;
m_app->statusBar ()->changeItem (QString::number (c),
m_app->statusBar ()->changeItem (TQString::number (c),
id_status_timer);
}
}
} else if (cmd_done && !strcmp(commands->command,cmd_volume_query)){
int pos = line.findRev (QChar (' '));
int pos = line.tqfindRev (TQChar (' '));
if (pos > 0) {
QString vol = line.mid (pos + 1);
TQString vol = line.mid (pos + 1);
if (!vol.compare ("mute"))
m_stored_volume = 0;
else
@ -429,7 +429,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
}
}
if (v && toconsole)
v->addText (QString (line), true);
v->addText (TQString (line), true);
line = readbuf.getReadLine ();
}
if (cmd_done) {
@ -448,9 +448,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::readyRead () {
}
KDE_NO_EXPORT void KMPlayerVDRSource::socketError (int code) {
if (code == QSocket::ErrHostNotFound) {
if (code == TQSocket::ErrHostNotFound) {
KMessageBox::error (m_configpage, i18n ("Host not found"), i18n ("Error"));
} else if (code == QSocket::ErrConnectionRefused) {
} else if (code == TQSocket::ErrConnectionRefused) {
KMessageBox::error (m_configpage, i18n ("Connection refused"), i18n ("Error"));
}
}
@ -461,7 +461,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::queueCommand (const char * cmd) {
if (!commands) {
readbuf.clear ();
commands = new VDRCommand (cmd);
if (m_socket->state () == QSocket::Connected) {
if (m_socket->state () == TQSocket::Connected) {
sendCommand ();
} else {
m_socket->connectToHost ("127.0.0.1", tcp_port);
@ -493,13 +493,13 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sendCommand () {
KDE_NO_EXPORT void KMPlayerVDRSource::customCmd () {
#if KDE_IS_VERSION(3, 1, 90)
QString cmd = KInputDialog::getText (i18n ("Custom VDR command"), i18n ("You can pass commands to VDR.\nEnter 'HELP' to see a list of available commands.\nYou can see VDR response in the console window.\n\nVDR Command:"), QString(), 0, m_player->view ());
TQString cmd = KInputDialog::getText (i18n ("Custom VDR command"), i18n ("You can pass commands to VDR.\nEnter 'HELP' to see a list of available commands.\nYou can see VDR response in the console window.\n\nVDR Command:"), TQString(), 0, m_player->view ());
if (!cmd.isEmpty ())
queueCommand (QString (cmd + QChar ('\n')).local8Bit ());
queueCommand (TQString (cmd + TQChar ('\n')).local8Bit ());
#endif
}
KDE_NO_EXPORT void KMPlayerVDRSource::timerEvent (QTimerEvent * e) {
KDE_NO_EXPORT void KMPlayerVDRSource::timerEvent (TQTimerEvent * e) {
if (e->timerId () == timeout_timer || e->timerId () == finish_timer) {
deleteCommands ();
} else if (e->timerId () == channel_timer) {
@ -521,7 +521,7 @@ KDE_NO_EXPORT void KMPlayerVDRSource::deleteCommands () {
readbuf.clear ();
if (finish_timer) {
killTimer (finish_timer);
QApplication::eventLoop ()->exitLoop ();
TQApplication::eventLoop ()->exitLoop ();
}
}
@ -531,10 +531,10 @@ KDE_NO_EXPORT void KMPlayerVDRSource::jump (KMPlayer::NodePtr e) {
jump (e->mrl ()->pretty_name);
}
KDE_NO_EXPORT void KMPlayerVDRSource::jump (const QString & channel) {
QCString c ("CHAN ");
QCString ch = channel.local8Bit ();
int p = ch.find (' ');
KDE_NO_EXPORT void KMPlayerVDRSource::jump (const TQString & channel) {
TQCString c ("CHAN ");
TQCString ch = channel.local8Bit ();
int p = ch.tqfind (' ');
if (p > 0)
c += ch.left (p);
else
@ -651,9 +651,9 @@ KDE_NO_EXPORT void KMPlayerVDRSource::read (KConfig * m_config) {
scale = m_config->readNumEntry (strXVScale, 0);
}
struct XVTreeItem : public QListViewItem {
XVTreeItem (QListViewItem *parent, const QString & t, int p, int e)
: QListViewItem (parent, t), port (p), encoding (e) {}
struct XVTreeItem : public TQListViewItem {
XVTreeItem (TQListViewItem *tqparent, const TQString & t, int p, int e)
: TQListViewItem (tqparent, t), port (p), encoding (e) {}
int port;
int encoding;
};
@ -670,12 +670,12 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
m_xvencoding = vitem->encoding;
}
} else {
m_configpage->tcp_port->setText (QString::number (tcp_port));
m_configpage->tcp_port->setText (TQString::number (tcp_port));
m_configpage->scale->setButton (scale);
QListViewItem * vitem = m_configpage->xv_port->firstChild ();
TQListViewItem * vitem = m_configpage->xv_port->firstChild ();
NodePtr configdoc = xvideo->configDocument ();
if (configdoc && configdoc->firstChild ()) {
for (QListViewItem *i=vitem->firstChild(); i; i=vitem->firstChild())
for (TQListViewItem *i=vitem->firstChild(); i; i=vitem->firstChild())
delete i;
NodePtr node = configdoc->firstChild ();
for (node = node->firstChild (); node; node = node->nextSibling()) {
@ -683,27 +683,27 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
continue; // some text sneaked in ?
Element * elm = convertNode <Element> (node);
if (elm->getAttribute (KMPlayer::StringPool::attr_type) !=
QString ("tree"))
TQString ("tree"))
continue;
for (NodePtr n = elm->firstChild (); n; n = n->nextSibling ()) {
if (!n->isElementNode () || strcmp (n->nodeName (), "Port"))
continue;
Element * e = convertNode <Element> (n);
QString portatt = e->getAttribute (
TQString portatt = e->getAttribute (
KMPlayer::StringPool::attr_value);
int port;
QListViewItem *pi = new QListViewItem (vitem, i18n ("Port ") + portatt);
TQListViewItem *pi = new TQListViewItem (vitem, i18n ("Port ") + portatt);
port = portatt.toInt ();
for (NodePtr in=e->firstChild(); in; in=in->nextSibling()) {
if (!in->isElementNode () ||
strcmp (in->nodeName (), "Input"))
continue;
Element * i = convertNode <Element> (in);
QString inp = i->getAttribute (
TQString inp = i->getAttribute (
KMPlayer::StringPool::attr_name);
int enc = i->getAttribute (
KMPlayer::StringPool::attr_value).toInt ();
QListViewItem * ii = new XVTreeItem(pi, inp, port, enc);
TQListViewItem * ii = new XVTreeItem(pi, inp, port, enc);
if (m_xvport == port && enc == m_xvencoding) {
ii->setSelected (true);
m_configpage->xv_port->ensureItemVisible (ii);
@ -712,25 +712,25 @@ KDE_NO_EXPORT void KMPlayerVDRSource::sync (bool fromUI) {
}
}
} else // wait for showEvent
connect (xvideo, SIGNAL (configReceived()), this, SLOT (configReceived()));
connect (xvideo, TQT_SIGNAL (configReceived()), this, TQT_SLOT (configReceived()));
}
}
KDE_NO_EXPORT void KMPlayerVDRSource::configReceived () {
XVideo * xvideo = static_cast<XVideo *>(m_player->players()["xvideo"]);
disconnect (xvideo, SIGNAL (configReceived()), this, SLOT (configReceived()));
disconnect (xvideo, TQT_SIGNAL (configReceived()), this, TQT_SLOT (configReceived()));
sync (false);
}
KDE_NO_EXPORT void KMPlayerVDRSource::prefLocation (QString & item, QString & icon, QString & tab) {
KDE_NO_EXPORT void KMPlayerVDRSource::prefLocation (TQString & item, TQString & icon, TQString & tab) {
item = i18n ("Source");
icon = QString ("source");
icon = TQString ("source");
tab = i18n ("VDR");
}
KDE_NO_EXPORT QFrame * KMPlayerVDRSource::prefPage (QWidget * parent) {
KDE_NO_EXPORT TQFrame * KMPlayerVDRSource::prefPage (TQWidget * tqparent) {
if (!m_configpage)
m_configpage = new KMPlayerPrefSourcePageVDR (parent, m_player);
m_configpage = new KMPlayerPrefSourcePageVDR (tqparent, m_player);
return m_configpage;
}
@ -747,8 +747,8 @@ static const char * xv_supported [] = {
"tvsource", "vdrsource", 0L
};
KDE_NO_CDTOR_EXPORT XVideo::XVideo (QObject * parent, Settings * settings)
: KMPlayer::CallbackProcess (parent, settings, "xvideo", i18n ("X&Video")) {
KDE_NO_CDTOR_EXPORT XVideo::XVideo (TQObject * tqparent, Settings * settings)
: KMPlayer::CallbackProcess (tqparent, settings, "xvideo", i18n ("X&Video")) {
m_supported_sources = xv_supported;
//m_player->settings ()->addPage (m_configpage);
}
@ -760,16 +760,16 @@ KDE_NO_EXPORT bool XVideo::ready (KMPlayer::Viewer * v) {
return true;
}
initProcess (v);
QString cmd = QString ("kxvplayer -wid %3 -cb %4").arg (viewer ()->embeddedWinId ()).arg (dcopName ());
TQString cmd = TQString ("kxvplayer -wid %3 -cb %4").arg (viewer ()->embeddedWinId ()).arg (dcopName ());
if (m_have_config == config_unknown || m_have_config == config_probe)
cmd += QString (" -c");
cmd += TQString (" -c");
if (m_source) {
int xv_port = m_source->xvPort ();
int xv_encoding = m_source->xvEncoding ();
int freq = m_source->frequency ();
cmd += QString (" -port %1 -enc %2 -norm \"%3\"").arg (xv_port).arg (xv_encoding).arg (m_source->videoNorm ());
cmd += TQString (" -port %1 -enc %2 -norm \"%3\"").arg (xv_port).arg (xv_encoding).arg (m_source->videoNorm ());
if (freq > 0)
cmd += QString (" -freq %1").arg (freq);
cmd += TQString (" -freq %1").arg (freq);
}
fprintf (stderr, "%s\n", cmd.latin1 ());
*m_process << cmd;

@ -24,7 +24,7 @@
#include <config.h>
#endif
#include <qframe.h>
#include <tqframe.h>
#include <kurl.h>
@ -36,29 +36,30 @@
class KMPlayerApp;
class VDRCommand;
class KURLRequester;
class QButtonGroup;
class QMenuItem;
class QCheckBox;
class QLineEdit;
class TQButtonGroup;
class TQMenuItem;
class TQCheckBox;
class TQLineEdit;
class KAction;
class QSocket;
class QTimerEvent;
class TQSocket;
class TQTimerEvent;
class KListView;
/*
* Preference page for VDR
*/
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageVDR : public QFrame {
class KMPLAYER_NO_EXPORT KMPlayerPrefSourcePageVDR : public TQFrame {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerPrefSourcePageVDR (QWidget * parent, KMPlayer::PartBase * player);
KMPlayerPrefSourcePageVDR (TQWidget * tqparent, KMPlayer::PartBase * player);
~KMPlayerPrefSourcePageVDR ();
KURLRequester * vcddevice;
KListView * xv_port;
QLineEdit * tcp_port;
QButtonGroup * scale;
TQLineEdit * tcp_port;
TQButtonGroup * scale;
protected:
void showEvent (QShowEvent *);
void showEvent (TQShowEvent *);
private:
KMPlayer::PartBase * m_player;
};
@ -69,17 +70,18 @@ private:
*/
class KMPLAYER_NO_EXPORT KMPlayerVDRSource : public KMPlayer::Source, public KMPlayer::PreferencesPage {
Q_OBJECT
TQ_OBJECT
public:
KMPlayerVDRSource (KMPlayerApp * app);
virtual ~KMPlayerVDRSource ();
virtual bool hasLength ();
virtual bool isSeekable ();
virtual QString prettyName ();
virtual TQString prettyName ();
virtual void write (KConfig *);
virtual void read (KConfig *);
virtual void sync (bool);
virtual void prefLocation (QString & item, QString & icon, QString & tab);
virtual QFrame * prefPage (QWidget * parent);
virtual void prefLocation (TQString & item, TQString & icon, TQString & tab);
virtual TQFrame * prefPage (TQWidget * tqparent);
virtual bool requestPlayURL (KMPlayer::NodePtr mrl);
virtual void stateElementChanged (KMPlayer::Node * node, KMPlayer::Node::State os, KMPlayer::Node::State ns);
void waitForConnectionClose ();
@ -123,7 +125,7 @@ private slots:
void processStarted ();
void configReceived ();
protected:
void timerEvent (QTimerEvent *);
void timerEvent (TQTimerEvent *);
private:
enum {
act_up = 0, act_down, act_back, act_ok,
@ -139,14 +141,14 @@ private:
void queueCommand (const char * cmd, int repeat_ms);
void sendCommand ();
void deleteCommands ();
void jump (const QString & channel);
void jump (const TQString & channel);
KMPlayerApp * m_app;
KMPlayerPrefSourcePageVDR * m_configpage;
KAction * m_actions [act_last];
KAction * m_fullscreen_actions [act_last];
QSocket * m_socket;
TQSocket * m_socket;
VDRCommand * commands;
QString m_request_jump;
TQString m_request_jump;
KMPlayer::NodePtrW m_last_channel;
int channel_timer;
int timeout_timer;
@ -159,8 +161,9 @@ private:
class XVideo : public KMPlayer::CallbackProcess {
Q_OBJECT
TQ_OBJECT
public:
XVideo (QObject * parent, KMPlayer::Settings * settings);
XVideo (TQObject * tqparent, KMPlayer::Settings * settings);
~XVideo ();
public slots:
virtual bool ready (KMPlayer::Viewer *);

@ -20,25 +20,25 @@
#include <math.h>
#include <config.h>
// include files for Qt
#include <qstyle.h>
#include <qtimer.h>
#include <qpainter.h>
#include <qmetaobject.h>
#include <qlayout.h>
#include <qpixmap.h>
#include <qtextedit.h>
#include <qtooltip.h>
#include <qapplication.h>
#include <qiconset.h>
#include <qcursor.h>
#include <qkeysequence.h>
#include <qslider.h>
#include <qlabel.h>
#include <qdatastream.h>
#include <qwidgetstack.h>
#include <qcursor.h>
#include <qclipboard.h>
// include files for TQt
#include <tqstyle.h>
#include <tqtimer.h>
#include <tqpainter.h>
#include <tqmetaobject.h>
#include <tqlayout.h>
#include <tqpixmap.h>
#include <tqtextedit.h>
#include <tqtooltip.h>
#include <tqapplication.h>
#include <tqiconset.h>
#include <tqcursor.h>
#include <tqkeysequence.h>
#include <tqslider.h>
#include <tqlabel.h>
#include <tqdatastream.h>
#include <tqwidgetstack.h>
#include <tqcursor.h>
#include <tqclipboard.h>
#include <kiconloader.h>
#include <kstatusbar.h>
@ -68,7 +68,7 @@ static const int XKeyPress = KeyPress;
#undef KeyPress
#undef Always
#undef Never
#undef Status
#undef tqStatus
#undef Unsorted
#undef Bool
@ -85,49 +85,49 @@ using namespace KMPlayer;
namespace KMPlayer {
class KMPlayerPictureWidget : public QWidget {
class KMPlayerPictureWidget : public TQWidget {
View * m_view;
public:
KDE_NO_CDTOR_EXPORT KMPlayerPictureWidget (QWidget * parent, View * view)
: QWidget (parent), m_view (view) {}
KDE_NO_CDTOR_EXPORT KMPlayerPictureWidget (TQWidget * tqparent, View * view)
: TQWidget (tqparent), m_view (view) {}
KDE_NO_CDTOR_EXPORT ~KMPlayerPictureWidget () {}
protected:
void mousePressEvent (QMouseEvent *);
void mousePressEvent (TQMouseEvent *);
};
} // namespace
KDE_NO_EXPORT void KMPlayerPictureWidget::mousePressEvent (QMouseEvent *) {
KDE_NO_EXPORT void KMPlayerPictureWidget::mousePressEvent (TQMouseEvent *) {
m_view->emitPictureClicked ();
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT TextEdit::TextEdit (QWidget * parent, View * view) : QTextEdit (parent, "kde_kmplayer_console"), m_view (view) {
KDE_NO_CDTOR_EXPORT TextEdit::TextEdit (TQWidget * tqparent, View * view) : TQTextEdit (tqparent, "kde_kmplayer_console"), m_view (view) {
setReadOnly (true);
setPaper (QBrush (QColor (0, 0, 0)));
setColor (QColor (0xB2, 0xB2, 0xB2));
setPaper (TQBrush (TQColor (0, 0, 0)));
setColor (TQColor (0xB2, 0xB2, 0xB2));
}
KDE_NO_EXPORT void TextEdit::contextMenuEvent (QContextMenuEvent * e) {
KDE_NO_EXPORT void TextEdit::contextMenuEvent (TQContextMenuEvent * e) {
m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ());
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT InfoWindow::InfoWindow (QWidget * parent, View * view) : QTextEdit (parent, "kde_kmplayer_console"), m_view (view) {
KDE_NO_CDTOR_EXPORT InfoWindow::InfoWindow (TQWidget * tqparent, View * view) : TQTextEdit (tqparent, "kde_kmplayer_console"), m_view (view) {
setReadOnly (true);
setLinkUnderline (false);
}
KDE_NO_EXPORT void InfoWindow::contextMenuEvent (QContextMenuEvent * e) {
KDE_NO_EXPORT void InfoWindow::contextMenuEvent (TQContextMenuEvent * e) {
m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ());
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT View::View (QWidget *parent, const char *name)
: KMediaPlayer::View (parent, name),
KDE_NO_CDTOR_EXPORT View::View (TQWidget *tqparent, const char *name)
: KMediaPlayer::View (tqparent, name),
m_image (0L),
m_control_panel (0L),
m_status_bar (0L),
@ -148,13 +148,13 @@ KDE_NO_CDTOR_EXPORT View::View (QWidget *parent, const char *name)
m_edit_mode (false)
{}
KDE_NO_EXPORT void View::dropEvent (QDropEvent * de) {
KDE_NO_EXPORT void View::dropEvent (TQDropEvent * de) {
KURL::List sl;
if (KURLDrag::canDecode (de)) {
KURLDrag::decode (de, sl);
} else if (QTextDrag::canDecode (de)) {
QString text;
QTextDrag::decode (de, text);
} else if (TQTextDrag::canDecode (de)) {
TQString text;
TQTextDrag::decode (de, text);
sl.push_back (KURL (text));
}
if (sl.size () > 0) {
@ -166,34 +166,34 @@ KDE_NO_EXPORT void View::dropEvent (QDropEvent * de) {
}
}
KDE_NO_EXPORT void View::dragEnterEvent (QDragEnterEvent* dee) {
KDE_NO_EXPORT void View::dragEnterEvent (TQDragEnterEvent* dee) {
if (isDragValid (dee))
dee->accept ();
}
KDE_NO_EXPORT void View::init (KActionCollection * action_collection) {
setBackgroundMode(Qt::NoBackground); // prevents flashing
//m_dockarea->setEraseColor (QColor (0, 0, 0));
QPalette pal (QColor (64, 64,64), QColor (32, 32, 32));
QVBoxLayout * viewbox = new QVBoxLayout (this, 0, 0);
setBackgroundMode(TQt::NoBackground); // prevents flashing
//m_dockarea->setEraseColor (TQColor (0, 0, 0));
TQPalette pal (TQColor (64, 64,64), TQColor (32, 32, 32));
TQVBoxLayout * viewbox = new TQVBoxLayout (this, 0, 0);
m_dockarea = new KDockArea (this, "kde_kmplayer_dock_area");
m_dock_video = new KDockWidget (m_dockarea->manager (), 0, KGlobal::iconLoader ()->loadIcon (QString ("kmplayer"), KIcon::Small), m_dockarea);
m_dock_video->setEraseColor (QColor (0, 0, 255));
m_dock_video = new KDockWidget (m_dockarea->manager (), 0, KGlobal::iconLoader ()->loadIcon (TQString ("kmplayer"), KIcon::Small), m_dockarea);
m_dock_video->setEraseColor (TQColor (0, 0, 255));
m_dock_video->setDockSite (KDockWidget::DockLeft | KDockWidget::DockBottom | KDockWidget::DockRight | KDockWidget::DockTop);
m_dock_video->setEnableDocking(KDockWidget::DockNone);
m_view_area = new ViewArea (m_dock_video, this);
m_dock_video->setWidget (m_view_area);
m_dockarea->setMainDockWidget (m_dock_video);
m_dock_playlist = m_dockarea->createDockWidget (i18n ("Play List"), KGlobal::iconLoader ()->loadIcon (QString ("player_playlist"), KIcon::Small));
m_dock_playlist = m_dockarea->createDockWidget (i18n ("Play List"), KGlobal::iconLoader ()->loadIcon (TQString ("player_playlist"), KIcon::Small));
m_playlist = new PlayListView (m_dock_playlist, this, action_collection);
m_dock_playlist->setWidget (m_playlist);
viewbox->addWidget (m_dockarea);
m_widgetstack = new QWidgetStack (m_view_area);
m_widgetstack = new TQWidgetStack (m_view_area);
m_control_panel = new ControlPanel (m_view_area, this);
m_control_panel->setMaximumSize (2500, controlPanel ()->maximumSize ().height ());
m_control_panel->setMaximumSize (2500, controlPanel ()->tqmaximumSize ().height ());
m_status_bar = new StatusBar (m_view_area);
m_status_bar->insertItem (QString (""), 0);
QSize sbsize = m_status_bar->sizeHint ();
m_status_bar->insertItem (TQString (""), 0);
TQSize sbsize = m_status_bar->tqsizeHint ();
m_status_bar->hide ();
m_status_bar->setMaximumSize (2500, sbsize.height ());
m_viewer = new Viewer (m_widgetstack, this);
@ -203,14 +203,14 @@ KDE_NO_EXPORT void View::init (KActionCollection * action_collection) {
#endif
m_multiedit = new TextEdit (m_widgetstack, this);
m_multiedit->setTextFormat (Qt::PlainText);
QFont fnt = KGlobalSettings::fixedFont ();
m_multiedit->setTextFormat (TQt::PlainText);
TQFont fnt = KGlobalSettings::fixedFont ();
m_multiedit->setFont (fnt);
m_widgettypes[WT_Console] = m_multiedit;
m_widgettypes[WT_Picture] = new KMPlayerPictureWidget (m_widgetstack, this);
m_dock_infopanel = m_dockarea->createDockWidget ("infopanel", KGlobal::iconLoader ()->loadIcon (QString ("info"), KIcon::Small));
m_dock_infopanel = m_dockarea->createDockWidget ("infopanel", KGlobal::iconLoader ()->loadIcon (TQString ("info"), KIcon::Small));
m_infopanel = new InfoWindow (m_dock_infopanel, this);
m_dock_infopanel->setWidget (m_infopanel);
@ -218,7 +218,7 @@ KDE_NO_EXPORT void View::init (KActionCollection * action_collection) {
m_widgetstack->addWidget (m_multiedit);
m_widgetstack->addWidget (m_widgettypes[WT_Picture]);
setFocusPolicy (QWidget::ClickFocus);
setFocusPolicy (TQ_ClickFocus);
setAcceptDrops (true);
m_view_area->resizeEvent (0L);
@ -228,11 +228,11 @@ KDE_NO_EXPORT void View::init (KActionCollection * action_collection) {
KDE_NO_CDTOR_EXPORT View::~View () {
delete m_image;
if (m_view_area->parent () != this)
if (TQT_BASE_OBJECT(m_view_area->tqparent ()) != TQT_BASE_OBJECT(this))
delete m_view_area;
}
KDE_NO_EXPORT void View::setEraseColor (const QColor & color) {
KDE_NO_EXPORT void View::setEraseColor (const TQColor & color) {
KMediaPlayer::View::setEraseColor (color);
if (statusBar ()) {
statusBar ()->setEraseColor (color);
@ -240,7 +240,7 @@ KDE_NO_EXPORT void View::setEraseColor (const QColor & color) {
}
}
void View::setInfoMessage (const QString & msg) {
void View::setInfoMessage (const TQString & msg) {
bool ismain = m_dockarea->getMainDockWidget () == m_dock_infopanel;
if (msg.isEmpty ()) {
if (!ismain && !m_edit_mode && !infopanel_timer)
@ -253,7 +253,7 @@ void View::setInfoMessage (const QString & msg) {
}
}
void View::setStatusMessage (const QString & msg) {
void View::setStatusMessage (const TQString & msg) {
if (m_statusbar_mode != SB_Hide)
m_status_bar->changeItem (msg, 0);
}
@ -266,11 +266,11 @@ void View::toggleShowPlaylist () {
m_dock_playlist->dockBack ();
else {
bool horz = true;
QStyle & style = m_playlist->style ();
int h = style.pixelMetric (QStyle::PM_ScrollBarExtent, m_playlist);
h += style.pixelMetric(QStyle::PM_DockWindowFrameWidth, m_playlist);
h +=style.pixelMetric(QStyle::PM_DockWindowHandleExtent,m_playlist);
for (QListViewItem *i=m_playlist->firstChild();i;i=i->itemBelow()) {
TQStyle & style = m_playlist->tqstyle ();
int h = style.tqpixelMetric (TQStyle::PM_ScrollBarExtent, m_playlist);
h += style.tqpixelMetric(TQStyle::PM_DockWindowFrameWidth, m_playlist);
h +=style.tqpixelMetric(TQStyle::PM_DockWindowHandleExtent,m_playlist);
for (TQListViewItem *i=m_playlist->firstChild();i;i=i->itemBelow()) {
h += i->height ();
if (h > int (0.25 * height ())) {
horz = false;
@ -314,18 +314,18 @@ void View::setPlaylistOnly () {
void View::setEditMode (RootPlayListItem *ri, bool enable) {
m_edit_mode = enable;
m_infopanel->setReadOnly (!m_edit_mode);
m_infopanel->setTextFormat (enable ? Qt::PlainText : Qt::AutoText);
m_infopanel->setTextFormat (enable ? TQt::PlainText : TQt::AutoText);
if (m_edit_mode && m_dock_infopanel->mayBeShow ())
m_dock_infopanel->manualDock(m_dock_video,KDockWidget::DockBottom,50);
m_playlist->showAllNodes (ri, m_edit_mode);
}
bool View::setPicture (const QString & path) {
bool View::setPicture (const TQString & path) {
delete m_image;
if (path.isEmpty ())
m_image = 0L;
else {
m_image = new QPixmap (path);
m_image = new TQPixmap (path);
if (m_image->isNull ()) {
delete m_image;
m_image = 0L;
@ -345,8 +345,8 @@ bool View::setPicture (const QString & path) {
KDE_NO_EXPORT void View::updateVolume () {
if (m_mixer_init && !m_volume_slider)
return;
QByteArray data, replydata;
QCString replyType;
TQByteArray data, replydata;
TQCString replyType;
int volume;
bool has_mixer = kapp->dcopClient ()->call (m_mixer_object, "Mixer0",
"masterVolume()", data, replyType, replydata);
@ -356,13 +356,13 @@ KDE_NO_EXPORT void View::updateVolume () {
"masterVolume()", data, replyType, replydata);
}
if (has_mixer) {
QDataStream replystream (replydata, IO_ReadOnly);
TQDataStream replystream (replydata, IO_ReadOnly);
replystream >> volume;
if (!m_mixer_init) {
QLabel * mixer_label = new QLabel (i18n ("Volume:"), m_control_panel->popupMenu ());
TQLabel * mixer_label = new TQLabel (i18n ("Volume:"), m_control_panel->popupMenu ());
m_control_panel->popupMenu ()->insertItem (mixer_label, -1, 4);
m_volume_slider = new QSlider (0, 100, 10, volume, Qt::Horizontal, m_control_panel->popupMenu ());
connect(m_volume_slider, SIGNAL(valueChanged(int)), this,SLOT(setVolume(int)));
m_volume_slider = new TQSlider (0, 100, 10, volume, Qt::Horizontal, m_control_panel->popupMenu ());
connect(m_volume_slider, TQT_SIGNAL(valueChanged(int)), this,TQT_SLOT(setVolume(int)));
m_control_panel->popupMenu ()->insertItem (m_volume_slider, ControlPanel::menu_volume, 5);
m_control_panel->popupMenu ()->insertSeparator (6);
} else {
@ -382,7 +382,7 @@ KDE_NO_EXPORT void View::updateVolume () {
void View::showWidget (WidgetType wt) {
m_widgetstack->raiseWidget (m_widgettypes [wt]);
if (m_widgetstack->visibleWidget () == m_widgettypes[WT_Console]) {
addText (QString (""), false);
addText (TQString (""), false);
if (m_controlpanel_mode == CP_AutoHide && m_playing)
m_control_panel->show();
} else
@ -394,9 +394,9 @@ void View::toggleVideoConsoleWindow () {
WidgetType wt = WT_Console;
if (m_widgetstack->visibleWidget () == m_widgettypes[WT_Console]) {
wt = WT_Video;
m_control_panel->popupMenu ()->changeItem (ControlPanel::menu_video, KGlobal::iconLoader ()->loadIconSet (QString ("konsole"), KIcon::Small, 0, true), i18n ("Con&sole"));
m_control_panel->popupMenu ()->changeItem (ControlPanel::menu_video, KGlobal::iconLoader ()->loadIconSet (TQString ("konsole"), KIcon::Small, 0, true), i18n ("Con&sole"));
} else
m_control_panel->popupMenu ()->changeItem (ControlPanel::menu_video, KGlobal::iconLoader ()->loadIconSet (QString ("video"), KIcon::Small, 0, true), i18n ("V&ideo"));
m_control_panel->popupMenu ()->changeItem (ControlPanel::menu_video, KGlobal::iconLoader ()->loadIconSet (TQString ("video"), KIcon::Small, 0, true), i18n ("V&ideo"));
showWidget (wt);
emit windowVideoConsoleToggled (int (wt));
}
@ -454,8 +454,8 @@ KDE_NO_EXPORT void View::delayedShowButtons (bool show) {
KDE_NO_EXPORT void View::setVolume (int vol) {
if (m_inVolumeUpdate) return;
QByteArray data;
QDataStream arg( data, IO_WriteOnly );
TQByteArray data;
TQDataStream arg( data, IO_WriteOnly );
arg << vol;
if (!kapp->dcopClient()->send (m_mixer_object, "Mixer0", "setMasterVolume(int)", data))
kdWarning() << "Failed to update volume" << endl;
@ -475,14 +475,14 @@ void View::setKeepSizeRatio (bool b) {
}
}
KDE_NO_EXPORT void View::timerEvent (QTimerEvent * e) {
KDE_NO_EXPORT void View::timerEvent (TQTimerEvent * e) {
if (e->timerId () == controlbar_timer) {
controlbar_timer = 0;
if (m_playing ||
m_widgetstack->visibleWidget () == m_widgettypes[WT_Picture]) {
int vert_buttons_pos = m_view_area->height()-statusBarHeight ();
QPoint mouse_pos = m_view_area->mapFromGlobal (QCursor::pos ());
int cp_height = m_control_panel->maximumSize ().height ();
TQPoint mouse_pos = m_view_area->mapFromGlobal (TQCursor::pos ());
int cp_height = m_control_panel->tqmaximumSize ().height ();
bool mouse_on_buttons = (//m_view_area->hasMouse () &&
mouse_pos.y () >= vert_buttons_pos-cp_height &&
mouse_pos.y ()<= vert_buttons_pos &&
@ -504,9 +504,9 @@ KDE_NO_EXPORT void View::timerEvent (QTimerEvent * e) {
killTimer (e->timerId ());
}
void View::addText (const QString & str, bool eol) {
void View::addText (const TQString & str, bool eol) {
if (m_tmplog_needs_eol)
tmplog += QChar ('\n');
tmplog += TQChar ('\n');
tmplog += str;
m_tmplog_needs_eol = eol;
if (m_widgetstack->visibleWidget () != m_widgettypes[WT_Console] &&
@ -517,7 +517,7 @@ void View::addText (const QString & str, bool eol) {
tmplog.truncate (0);
m_tmplog_needs_eol = false;
} else {
int pos = tmplog.findRev (QChar ('\n'));
int pos = tmplog.tqfindRev (TQChar ('\n'));
if (pos >= 0) {
m_multiedit->append (tmplog.left (pos));
tmplog = tmplog.mid (pos+1);
@ -531,9 +531,9 @@ void View::addText (const QString & str, bool eol) {
m_multiedit->setCursorPosition (m_multiedit->paragraphs () - 1, 0);
}
/* void View::print (QPrinter *pPrinter)
/* void View::print (TQPrinter *pPrinter)
{
QPainter printpainter;
TQPainter printpainter;
printpainter.begin (pPrinter);
// TODO: add your printing code here
@ -581,7 +581,7 @@ KDE_NO_EXPORT void View::playingStop () {
m_view_area->resizeEvent (0L);
}
KDE_NO_EXPORT void View::leaveEvent (QEvent *) {
KDE_NO_EXPORT void View::leaveEvent (TQEvent *) {
delayedShowButtons (false);
}
@ -600,16 +600,16 @@ bool View::isFullScreen () const {
void View::fullScreen () {
if (!m_view_area->isFullScreen()) {
m_sreensaver_disabled = false;
QByteArray data, replydata;
QCString replyType;
TQByteArray data, replydata;
TQCString replyType;
if (kapp->dcopClient ()->call ("kdesktop", "KScreensaverIface",
"isEnabled()", data, replyType, replydata)) {
bool enabled;
QDataStream replystream (replydata, IO_ReadOnly);
TQDataStream replystream (replydata, IO_ReadOnly);
replystream >> enabled;
if (enabled)
m_sreensaver_disabled = kapp->dcopClient()->send
("kdesktop", "KScreensaverIface", "enable(bool)", "false");
("kdesktop", "KScreensaverIface", "enable(bool)", TQString("false"));
}
//if (m_keepsizeratio && m_viewer->aspect () < 0.01)
// m_viewer->setAspect (1.0 * m_viewer->width() / m_viewer->height());
@ -619,7 +619,7 @@ void View::fullScreen () {
} else {
if (m_sreensaver_disabled)
m_sreensaver_disabled = !kapp->dcopClient()->send
("kdesktop", "KScreensaverIface", "enable(bool)", "true");
("kdesktop", "KScreensaverIface", "enable(bool)", TQString("true"));
m_view_area->fullScreen();
m_control_panel->popupMenu ()->setItemVisible (ControlPanel::menu_zoom, true);
}
@ -632,7 +632,7 @@ KDE_NO_EXPORT int View::statusBarHeight () const {
if (statusBarMode () == SB_Only)
return height ();
else
return statusBar()->maximumSize ().height ();
return statusBar()->tqmaximumSize ().height ();
}
return 0;
}
@ -665,13 +665,13 @@ bool View::x11Event (XEvent * e) {
if (e->xmotion.window == m_viewer->embeddedWinId ())
delayedShowButtons (e->xmotion.y > m_view_area->height () -
statusBarHeight () -
m_control_panel->maximumSize ().height ());
m_control_panel->tqmaximumSize ().height ());
m_view_area->mouseMoved ();
break;
case MapNotify:
if (e->xmap.event == m_viewer->embeddedWinId ()) {
show ();
QTimer::singleShot (10, m_viewer, SLOT (sendConfigureEvent ()));
TQTimer::singleShot (10, m_viewer, TQT_SLOT (sendConfigureEvent ()));
}
break;
/*case ConfigureNotify:
@ -685,8 +685,8 @@ bool View::x11Event (XEvent * e) {
//----------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT Viewer::Viewer (QWidget *parent, View * view)
: QXEmbed (parent), m_plain_window (0), m_bgcolor (0), m_aspect (0.0),
KDE_NO_CDTOR_EXPORT Viewer::Viewer (TQWidget *tqparent, View * view)
: QXEmbed (tqparent), m_plain_window (0), m_bgcolor (0), m_aspect (0.0),
m_view (view) {
/*XWindowAttributes xwa;
XGetWindowAttributes (qt_xdisplay(), winId (), &xwa);
@ -694,7 +694,7 @@ KDE_NO_CDTOR_EXPORT Viewer::Viewer (QWidget *parent, View * view)
xswa.background_pixel = 0;
xswa.border_pixel = 0;
xswa.colormap = xwa.colormap;
create (XCreateWindow (qt_xdisplay (), parent->winId (), 0, 0, 10, 10, 0,
create (XCreateWindow (qt_xdisplay (), tqparent->winId (), 0, 0, 10, 10, 0,
x11Depth (), InputOutput, (Visual*)x11Visual (),
CWBackPixel | CWBorderPixel | CWColormap, &xswa));*/
setAcceptDrops (true);
@ -747,9 +747,9 @@ KDE_NO_EXPORT void Viewer::windowChanged (WId w) {
PointerMotionMask);
}
KDE_NO_EXPORT void Viewer::mouseMoveEvent (QMouseEvent * e) {
KDE_NO_EXPORT void Viewer::mouseMoveEvent (TQMouseEvent * e) {
if (e->state () == Qt::NoButton) {
int cp_height = m_view->controlPanel ()->maximumSize ().height ();
int cp_height = m_view->controlPanel ()->tqmaximumSize ().height ();
m_view->delayedShowButtons (e->y () > height () - cp_height);
}
m_view->viewArea ()->mouseMoved ();
@ -765,11 +765,11 @@ KDE_NO_EXPORT int Viewer::heightForWidth (int w) const {
return int (w/m_aspect);
}
KDE_NO_EXPORT void Viewer::dropEvent (QDropEvent * de) {
KDE_NO_EXPORT void Viewer::dropEvent (TQDropEvent * de) {
m_view->dropEvent (de);
}
KDE_NO_EXPORT void Viewer::dragEnterEvent (QDragEnterEvent* dee) {
KDE_NO_EXPORT void Viewer::dragEnterEvent (TQDragEnterEvent* dee) {
m_view->dragEnterEvent (dee);
}
/*
@ -804,11 +804,11 @@ KDE_NO_EXPORT void Viewer::sendConfigureEvent () {
}
}
KDE_NO_EXPORT void Viewer::contextMenuEvent (QContextMenuEvent * e) {
KDE_NO_EXPORT void Viewer::contextMenuEvent (TQContextMenuEvent * e) {
m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ());
}
KDE_NO_EXPORT void Viewer::setBackgroundColor (const QColor & c) {
KDE_NO_EXPORT void Viewer::setBackgroundColor (const TQColor & c) {
if (m_bgcolor != c.rgb ()) {
m_bgcolor = c.rgb ();
setCurrentBackgroundColor (c);
@ -819,7 +819,7 @@ KDE_NO_EXPORT void Viewer::resetBackgroundColor () {
setCurrentBackgroundColor (m_bgcolor);
}
KDE_NO_EXPORT void Viewer::setCurrentBackgroundColor (const QColor & c) {
KDE_NO_EXPORT void Viewer::setCurrentBackgroundColor (const TQColor & c) {
setPaletteBackgroundColor (c);
WId w = embeddedWinId ();
if (w) {

@ -22,8 +22,8 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <qwidget.h>
#include <qtextedit.h>
#include <tqwidget.h>
#include <tqtextedit.h>
#include <kdockwidget.h>
#include <kurl.h>
@ -34,12 +34,12 @@
#define MOUSE_INVISIBLE_DELAY 2000
class QWidgetStack;
class QPixmap;
class QPaintDevice;
class QPainter;
class QSlider;
class QLabel;
class TQWidgetStack;
class TQPixmap;
class TQPaintDevice;
class TQPainter;
class TQSlider;
class TQLabel;
class KActionCollection;
class KAction;
class KShortcut;
@ -63,11 +63,11 @@ typedef KStatusBar StatusBar;
/*
* The console GUI
*/
class TextEdit : public QTextEdit {
class TextEdit : public TQTextEdit {
public:
TextEdit (QWidget * parent, View * view);
TextEdit (TQWidget * tqparent, View * view);
protected:
void contextMenuEvent (QContextMenuEvent * e);
void contextMenuEvent (TQContextMenuEvent * e);
private:
View * m_view;
};
@ -75,12 +75,12 @@ private:
/*
* The infowindow GUI
*/
class InfoWindow : public QTextEdit {
class InfoWindow : public TQTextEdit {
public:
InfoWindow (QWidget * parent, View * view);
InfoWindow (TQWidget * tqparent, View * view);
KDE_NO_EXPORT View * view () const { return m_view; }
protected:
void contextMenuEvent (QContextMenuEvent * e);
void contextMenuEvent (TQContextMenuEvent * e);
private:
View * m_view;
};
@ -90,6 +90,7 @@ private:
*/
class KMPLAYER_EXPORT View : public KMediaPlayer::View {
Q_OBJECT
TQ_OBJECT
public:
enum ControlPanelMode {
CP_Hide, CP_AutoHide, CP_Show, CP_Only /* no video widget */
@ -101,13 +102,13 @@ public:
WT_Video, WT_Console, WT_Picture, WT_Last
};
View (QWidget *parent, const char *);
View (TQWidget *tqparent, const char *);
~View();
void addText (const QString &, bool eol=false);
void addText (const TQString &, bool eol=false);
void init (KActionCollection * ac);
void reset ();
//void print(QPrinter *pPrinter);
//void print(TQPrinter *pPrinter);
TextEdit * console () const { return m_multiedit; }
KDE_NO_EXPORT Viewer * viewer () const { return m_viewer; }
@ -115,7 +116,7 @@ public:
KDE_NO_EXPORT StatusBar * statusBar () const {return m_status_bar;}
KDE_NO_EXPORT PlayListView * playList () const { return m_playlist; }
KDE_NO_EXPORT InfoWindow * infoPanel () const { return m_infopanel; }
KDE_NO_EXPORT QWidgetStack * widgetStack () const { return m_widgetstack; }
KDE_NO_EXPORT TQWidgetStack * widgetStack () const { return m_widgetstack; }
KDE_NO_EXPORT KDockArea * docArea () const { return m_dockarea; }
KDE_NO_EXPORT ViewArea * viewArea () const { return m_view_area; }
KDE_NO_EXPORT bool keepSizeRatio () const { return m_keepsizeratio; }
@ -123,22 +124,22 @@ public:
void showWidget (WidgetType w);
void setControlPanelMode (ControlPanelMode m);
void setStatusBarMode (StatusBarMode m);
void setEraseColor (const QColor &);
void setEraseColor (const TQColor &);
KDE_NO_EXPORT ControlPanelMode controlPanelMode () const { return m_controlpanel_mode; }
KDE_NO_EXPORT StatusBarMode statusBarMode () const { return m_statusbar_mode; }
void delayedShowButtons (bool show);
bool isFullScreen () const;
int statusBarHeight () const;
KDE_NO_EXPORT bool editMode () const { return m_edit_mode; }
bool setPicture (const QString & path);
KDE_NO_EXPORT QPixmap * image () const { return m_image; }
bool setPicture (const TQString & path);
KDE_NO_EXPORT TQPixmap * image () const { return m_image; }
void setNoInfoMessages (bool b) { m_no_info = b; }
void setViewOnly ();
void setInfoPanelOnly ();
void setPlaylistOnly ();
void setEditMode (RootPlayListItem *, bool enable=true);
void dragEnterEvent (QDragEnterEvent *);
void dropEvent (QDropEvent *);
void dragEnterEvent (TQDragEnterEvent *);
void dropEvent (TQDropEvent *);
KDE_NO_EXPORT void emitPictureClicked () { emit pictureClicked (); }
/* raise video widget, might (auto) hides panel */
void videoStart ();
@ -152,16 +153,16 @@ public slots:
void updateLayout ();
void toggleShowPlaylist ();
void toggleVideoConsoleWindow ();
void setInfoMessage (const QString & msg);
void setStatusMessage (const QString & msg);
void setInfoMessage (const TQString & msg);
void setStatusMessage (const TQString & msg);
signals:
void urlDropped (const KURL::List & urls);
void pictureClicked ();
void fullScreenChanged ();
void windowVideoConsoleToggled (int wt);
protected:
void leaveEvent (QEvent *) KDE_NO_EXPORT;
void timerEvent (QTimerEvent *) KDE_NO_EXPORT;
void leaveEvent (TQEvent *) KDE_NO_EXPORT;
void timerEvent (TQTimerEvent *) KDE_NO_EXPORT;
bool x11Event (XEvent *) KDE_NO_EXPORT;
private:
// widget for player's output
@ -169,24 +170,24 @@ private:
// console output
TextEdit * m_multiedit;
// widget stack contains m_viewer, m_multiedit and m_picturewidget
QWidgetStack * m_widgetstack;
// widget that layouts m_widgetstack for ratio setting and m_control_panel
TQWidgetStack * m_widgetstack;
// widget that tqlayouts m_widgetstack for ratio setting and m_control_panel
ViewArea * m_view_area;
// playlist widget
PlayListView * m_playlist;
// infopanel widget
InfoWindow * m_infopanel;
// all widget types
QWidget * m_widgettypes [WT_Last];
TQWidget * m_widgettypes [WT_Last];
KDockArea * m_dockarea;
KDockWidget * m_dock_video;
KDockWidget * m_dock_playlist;
KDockWidget * m_dock_infopanel;
QString tmplog;
QPixmap * m_image;
TQString tmplog;
TQPixmap * m_image;
ControlPanel * m_control_panel;
StatusBar * m_status_bar;
QSlider * m_volume_slider;
TQSlider * m_volume_slider;
const char * m_mixer_object;
ControlPanelMode m_controlpanel_mode;
ControlPanelMode m_old_controlpanel_mode;
@ -209,8 +210,9 @@ private:
*/
class KMPLAYER_EXPORT Viewer : public QXEmbed {
Q_OBJECT
TQ_OBJECT
public:
Viewer(QWidget *parent, View * view);
Viewer(TQWidget *tqparent, View * view);
~Viewer();
int heightForWidth (int w) const;
@ -218,18 +220,18 @@ public:
void setAspect (float a);
float aspect () { return m_aspect; }
void sendKeyEvent (int key);
void setBackgroundColor (const QColor & c);
void setBackgroundColor (const TQColor & c);
void resetBackgroundColor ();
void setCurrentBackgroundColor (const QColor & c);
void setCurrentBackgroundColor (const TQColor & c);
KDE_NO_EXPORT View * view () const { return m_view; }
void changeProtocol (QXEmbed::Protocol p);
public slots:
void sendConfigureEvent ();
protected:
void dragEnterEvent (QDragEnterEvent *);
void dropEvent (QDropEvent *);
void mouseMoveEvent (QMouseEvent * e);
void contextMenuEvent (QContextMenuEvent * e);
void dragEnterEvent (TQDragEnterEvent *);
void dropEvent (TQDropEvent *);
void mouseMoveEvent (TQMouseEvent * e);
void contextMenuEvent (TQContextMenuEvent * e);
virtual void windowChanged( WId w );
private:
WId m_plain_window;

@ -23,8 +23,8 @@ email :
#include <kdemacros.h>
#include <dcopclient.h>
#include <qguardedptr.h>
#include <qfileinfo.h>
#include <tqguardedptr.h>
#include <tqfileinfo.h>
#include "kmplayer.h"
@ -54,7 +54,7 @@ extern "C" {
KMPlayer::StringPool::init();
KApplication app;
QGuardedPtr <KMPlayerApp> kmplayer;
TQGuardedPtr <KMPlayerApp> kmplayer;
if (app.isRestored ()) {
RESTORE (KMPlayerApp);
@ -70,8 +70,8 @@ extern "C" {
if (args->count () > 1)
for (int i = 0; i < args->count (); i++) {
KURL url = args->url (i);
if (url.url ().find ("://") < 0)
url = KURL (QFileInfo (url.url ()).absFilePath ());
if (url.url ().tqfind ("://") < 0)
url = KURL (TQFileInfo (url.url ()).absFilePath ());
if (url.isValid ())
kmplayer->addURL (url);
}

@ -58,7 +58,7 @@ static gchar *callback_path;
static GModule *library;
static GtkWidget *xembed;
static Window socket_id;
static Window parent_id;
static Window tqparent_id;
static int top_w, top_h;
static int update_dimension_timer;
static int stdin_read_watch;
@ -94,7 +94,7 @@ typedef struct _StreamInfo {
struct JsObject;
typedef struct _JsObject {
NPObject npobject;
struct _JsObject * parent;
struct _JsObject * tqparent;
char * name;
} JsObject;
@ -249,15 +249,15 @@ static StreamInfo *addStream (const char *url, const char *mime, const char *tar
static void createJsName (JsObject * obj, char **name, uint32_t * len) {
int slen = strlen (obj->name);
if (obj->parent) {
if (obj->tqparent) {
*len += slen + 1;
createJsName (obj->parent, name, len);
createJsName (obj->tqparent, name, len);
} else {
*name = (char *) malloc (*len + slen + 1);
*(*name + *len + slen) = 0;
*len = 0;
}
if (obj->parent) {
if (obj->tqparent) {
*(*name + *len) = '.';
*len += 1;
}
@ -379,9 +379,9 @@ static NPError nsDestroyStream (NPP instance, NPStream *stream, NPError reason)
return NPERR_NO_DATA;
}
static void nsStatus (NPP instance, const char* message) {
static void nstqStatus (NPP instance, const char* message) {
(void)instance;
print ("NPN_Status %s\n", message ? message : "-");
print ("NPN_tqStatus %s\n", message ? message : "-");
}
static const char* nsUserAgent (NPP instance) {
@ -687,8 +687,8 @@ static NPObject * windowClassAllocate (NPP instance, NPClass *aClass) {
static void windowClassDeallocate (NPObject *npobj) {
JsObject *jo = (JsObject *) npobj;
/*print ("windowClassDeallocate\n");*/
if (jo->parent) {
nsReleaseObject ((NPObject *) jo->parent);
if (jo->tqparent) {
nsReleaseObject ((NPObject *) jo->tqparent);
} else if (jo->name && !strncmp (jo->name, "this.__kmplayer__obj_", 21)) {
char *script = (char *) malloc (strlen (jo->name) + 7);
char *result;
@ -793,7 +793,7 @@ static bool windowClassGetProperty (NPObject *npobj, NPIdentifier property,
}
jo.name = id;
jo.parent = (JsObject *) npobj;
jo.tqparent = (JsObject *) npobj;
createJsName (&jo, (char **)&fullname.utf8characters, &fullname.utf8length);
res = nsEvaluate (npp, npobj, &fullname, result);
@ -814,7 +814,7 @@ static bool windowClassSetProperty (NPObject *npobj, NPIdentifier property,
return false;
jo.name = id;
jo.parent = (JsObject *) npobj;
jo.tqparent = (JsObject *) npobj;
createJsName (&jo, &var_name, &len);
var_val = nsVariant2Str (value);
@ -966,7 +966,7 @@ static int initPlugin (const char *plugin_lib) {
ns_funcs.newstream = nsNewStream;
ns_funcs.write = nsWrite;
ns_funcs.destroystream = nsDestroyStream;
ns_funcs.status = nsStatus;
ns_funcs.status = nstqStatus;
ns_funcs.uagent = nsUserAgent;
ns_funcs.memalloc = nsAlloc;
ns_funcs.memfree = nsMemFree;
@ -1354,19 +1354,19 @@ static void windowCreatedEvent (GtkWidget *w, gpointer d) {
(void)d;
print ("windowCreatedEvent\n");
socket_id = gtk_socket_get_id (GTK_SOCKET (xembed));
if (parent_id) {
if (tqparent_id) {
print ("windowCreatedEvent %p\n", GTK_PLUG (w)->socket_window);
if (!GTK_PLUG (w)->socket_window)
gtk_plug_construct (GTK_PLUG (w), parent_id);
gtk_plug_construct (GTK_PLUG (w), tqparent_id);
gdk_window_reparent( w->window,
GTK_PLUG (w)->socket_window
? GTK_PLUG (w)->socket_window
: gdk_window_foreign_new (parent_id),
: gdk_window_foreign_new (tqparent_id),
0, 0);
gtk_widget_show_all (w);
/*XReparentWindow (gdk_x11_drawable_get_xdisplay (w->window),
/*XRetqparentWindow (gdk_x11_drawable_get_xdisplay (w->window),
gdk_x11_drawable_get_xid (w->window),
parent_id,
tqparent_id,
0, 0);*/
}
if (!callback_service) {
@ -1425,7 +1425,7 @@ static gboolean initPlayer (void * p) {
(void)p;
window = callback_service
? gtk_plug_new (parent_id)
? gtk_plug_new (tqparent_id)
: gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), "delete_event",
G_CALLBACK (windowCloseEvent), NULL);
@ -1446,7 +1446,7 @@ static gboolean initPlayer (void * p) {
gtk_container_add (GTK_CONTAINER (window), xembed);
if (!parent_id) {
if (!tqparent_id) {
gtk_widget_set_size_request (window, 440, 330);
gtk_widget_show_all (window);
} else {
@ -1518,7 +1518,7 @@ int main (int argc, char **argv) {
} else if (!strcmp (argv[i], "-m") && ++i < argc) {
mimetype = g_strdup (argv[i]);
} else if (!strcmp (argv [i], "-wid") && ++i < argc) {
parent_id = strtol (argv[i], 0L, 10);
tqparent_id = strtol (argv[i], 0L, 10);
} else
object_url = g_strdup (argv[i]);
}

@ -19,17 +19,17 @@
#include <stdio.h>
#include <config.h>
// include files for Qt
#include <qapplication.h>
#include <qclipboard.h>
#include <qpopupmenu.h>
#include <qdrawutil.h>
#include <qpainter.h>
#include <qiconset.h>
#include <qpixmap.h>
#include <qheader.h>
#include <qstyle.h>
#include <qtimer.h>
// include files for TQt
#include <tqapplication.h>
#include <tqclipboard.h>
#include <tqpopupmenu.h>
#include <tqdrawutil.h>
#include <tqpainter.h>
#include <tqiconset.h>
#include <tqpixmap.h>
#include <tqheader.h>
#include <tqstyle.h>
#include <tqtimer.h>
#include <kiconloader.h>
#include <kfinddialog.h>
@ -48,12 +48,12 @@ using namespace KMPlayer;
namespace KMPlayer {
KDE_NO_EXPORT bool isDragValid (QDropEvent * de) {
KDE_NO_EXPORT bool isDragValid (TQDropEvent * de) {
if (KURLDrag::canDecode (de))
return true;
if (QTextDrag::canDecode (de)) {
QString text;
if (QTextDrag::decode (de, text) && KURL (text).isValid ())
if (TQTextDrag::canDecode (de)) {
TQString text;
if (TQTextDrag::decode (de, text) && KURL (text).isValid ())
return true;
}
return false;
@ -62,59 +62,59 @@ namespace KMPlayer {
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (QListViewItem *p, const NodePtr & e, PlayListView * lv) : QListViewItem (p), node (e), listview (lv) {}
KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (TQListViewItem *p, const NodePtr & e, PlayListView * lv) : TQListViewItem (p), node (e), listview (lv) {}
KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (QListViewItem *p, const AttributePtr & a, PlayListView * lv) : QListViewItem (p), m_attr (a), listview (lv) {}
KDE_NO_CDTOR_EXPORT PlayListItem::PlayListItem (TQListViewItem *p, const AttributePtr & a, PlayListView * lv) : TQListViewItem (p), m_attr (a), listview (lv) {}
KDE_NO_CDTOR_EXPORT
PlayListItem::PlayListItem (PlayListView *v, const NodePtr &e, QListViewItem *b)
: QListViewItem (v, b), node (e), listview (v) {}
PlayListItem::PlayListItem (PlayListView *v, const NodePtr &e, TQListViewItem *b)
: TQListViewItem (v, b), node (e), listview (v) {}
KDE_NO_CDTOR_EXPORT void PlayListItem::paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align) {
KDE_NO_CDTOR_EXPORT void PlayListItem::paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align) {
if (node && node->state == Node::state_began) {
QColorGroup mycg (cg);
mycg.setColor (QColorGroup::Foreground, listview->activeColor ());
mycg.setColor (QColorGroup::Text, listview->activeColor ());
QListViewItem::paintCell (p, mycg, column, width, align);
TQColorGroup mycg (cg);
mycg.setColor (TQColorGroup::Foreground, listview->activeColor ());
mycg.setColor (TQColorGroup::Text, listview->activeColor ());
TQListViewItem::paintCell (p, mycg, column, width, align);
} else
QListViewItem::paintCell (p, cg, column, width, align);
TQListViewItem::paintCell (p, cg, column, width, align);
}
KDE_NO_CDTOR_EXPORT void PlayListItem::paintBranches (QPainter * p, const QColorGroup &, int w, int, int h) {
KDE_NO_CDTOR_EXPORT void PlayListItem::paintBranches (TQPainter * p, const TQColorGroup &, int w, int, int h) {
p->fillRect (0, 0, w, h, listview->paletteBackgroundColor());
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT
RootPlayListItem::RootPlayListItem (int _id, PlayListView *v, const NodePtr & e, QListViewItem * before, int flgs)
RootPlayListItem::RootPlayListItem (int _id, PlayListView *v, const NodePtr & e, TQListViewItem * before, int flgs)
: PlayListItem (v, e, before),
id (_id),
flags (flgs),
show_all_nodes (false),
have_dark_nodes (false) {}
KDE_NO_CDTOR_EXPORT void RootPlayListItem::paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align) {
QColorGroup mycg (cg);
mycg.setColor (QColorGroup::Base, listview->topLevelWidget()->paletteBackgroundColor());
mycg.setColor (QColorGroup::Highlight, mycg.base ());
mycg.setColor (QColorGroup::Text, listview->topLevelWidget()->paletteForegroundColor());
mycg.setColor (QColorGroup::HighlightedText, mycg.text ());
QListViewItem::paintCell (p, mycg, column, width, align);
KDE_NO_CDTOR_EXPORT void RootPlayListItem::paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align) {
TQColorGroup mycg (cg);
mycg.setColor (TQColorGroup::Base, listview->tqtopLevelWidget()->paletteBackgroundColor());
mycg.setColor (TQColorGroup::Highlight, mycg.base ());
mycg.setColor (TQColorGroup::Text, listview->tqtopLevelWidget()->paletteForegroundColor());
mycg.setColor (TQColorGroup::HighlightedText, mycg.text ());
TQListViewItem::paintCell (p, mycg, column, width, align);
qDrawShadeRect (p, 0, 0, width -1, height () -1, mycg, !isOpen ());
}
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (QWidget * parent, View * view, KActionCollection * ac)
: KListView (parent, "kde_kmplayer_playlist"),
KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (TQWidget * tqparent, View * view, KActionCollection * ac)
: KListView (tqparent, "kde_kmplayer_playlist"),
m_view (view),
m_find_dialog (0L),
m_active_color (30, 0, 255),
last_id (0),
last_drag_tree_id (0),
m_ignore_expanded (false) {
addColumn (QString ());
addColumn (TQString ());
header()->hide ();
//setRootIsDecorated (true);
setSorting (-1);
@ -122,36 +122,36 @@ KDE_NO_CDTOR_EXPORT PlayListView::PlayListView (QWidget * parent, View * view, K
setDropVisualizer (true);
setItemsRenameable (true);
setItemMargin (2);
setPaletteBackgroundColor (QColor (0, 0, 0));
setPaletteForegroundColor (QColor (0xB2, 0xB2, 0xB2));
m_itemmenu = new QPopupMenu (this);
folder_pix = KGlobal::iconLoader ()->loadIcon (QString ("folder"), KIcon::Small);
auxiliary_pix = KGlobal::iconLoader ()->loadIcon (QString ("folder_grey"), KIcon::Small);
video_pix = KGlobal::iconLoader ()->loadIcon (QString ("video"), KIcon::Small);
info_pix = KGlobal::iconLoader ()->loadIcon (QString ("messagebox_info"), KIcon::Small);
img_pix = KGlobal::iconLoader ()->loadIcon (QString ("colorize"), KIcon::Small);
unknown_pix = KGlobal::iconLoader ()->loadIcon (QString ("unknown"), KIcon::Small);
menu_pix = KGlobal::iconLoader ()->loadIcon (QString ("player_playlist"), KIcon::Small);
config_pix = KGlobal::iconLoader ()->loadIcon (QString ("configure"), KIcon::Small);
url_pix = KGlobal::iconLoader ()->loadIcon (QString ("www"), KIcon::Small);
m_find = KStdAction::find (this, SLOT (slotFind ()), ac, "find");
m_find_next = KStdAction::findNext (this, SLOT(slotFindNext()), ac, "next");
setPaletteBackgroundColor (TQColor (0, 0, 0));
setPaletteForegroundColor (TQColor (0xB2, 0xB2, 0xB2));
m_itemmenu = new TQPopupMenu (this);
folder_pix = KGlobal::iconLoader ()->loadIcon (TQString ("folder"), KIcon::Small);
auxiliary_pix = KGlobal::iconLoader ()->loadIcon (TQString ("folder_grey"), KIcon::Small);
video_pix = KGlobal::iconLoader ()->loadIcon (TQString ("video"), KIcon::Small);
info_pix = KGlobal::iconLoader ()->loadIcon (TQString ("messagebox_info"), KIcon::Small);
img_pix = KGlobal::iconLoader ()->loadIcon (TQString ("colorize"), KIcon::Small);
unknown_pix = KGlobal::iconLoader ()->loadIcon (TQString ("unknown"), KIcon::Small);
menu_pix = KGlobal::iconLoader ()->loadIcon (TQString ("player_playlist"), KIcon::Small);
config_pix = KGlobal::iconLoader ()->loadIcon (TQString ("configure"), KIcon::Small);
url_pix = KGlobal::iconLoader ()->loadIcon (TQString ("www"), KIcon::Small);
m_tqfind = KStdAction::find (TQT_TQOBJECT(this), TQT_SLOT (slotFind ()), ac, "tqfind");
m_find_next = KStdAction::findNext (TQT_TQOBJECT(this), TQT_SLOT(slotFindNext()), ac, "next");
m_find_next->setEnabled (false);
connect (this, SIGNAL (contextMenuRequested (QListViewItem *, const QPoint &, int)), this, SLOT (contextMenuItem (QListViewItem *, const QPoint &, int)));
connect (this, SIGNAL (expanded (QListViewItem *)),
this, SLOT (itemExpanded (QListViewItem *)));
connect (this, SIGNAL (dropped (QDropEvent *, QListViewItem *)),
this, SLOT (itemDropped (QDropEvent *, QListViewItem *)));
connect (this, SIGNAL (itemRenamed (QListViewItem *)),
this, SLOT (itemIsRenamed (QListViewItem *)));
connect (this, SIGNAL (selectionChanged (QListViewItem *)),
this, SLOT (itemIsSelected (QListViewItem *)));
connect (this, TQT_SIGNAL (contextMenuRequested (TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT (contextMenuItem (TQListViewItem *, const TQPoint &, int)));
connect (this, TQT_SIGNAL (expanded (TQListViewItem *)),
this, TQT_SLOT (itemExpanded (TQListViewItem *)));
connect (this, TQT_SIGNAL (dropped (TQDropEvent *, TQListViewItem *)),
this, TQT_SLOT (itemDropped (TQDropEvent *, TQListViewItem *)));
connect (this, TQT_SIGNAL (itemRenamed (TQListViewItem *)),
this, TQT_SLOT (itemIsRenamed (TQListViewItem *)));
connect (this, TQT_SIGNAL (selectionChanged (TQListViewItem *)),
this, TQT_SLOT (itemIsSelected (TQListViewItem *)));
}
KDE_NO_CDTOR_EXPORT PlayListView::~PlayListView () {
}
int PlayListView::addTree (NodePtr root, const QString & source, const QString & icon, int flags) {
int PlayListView::addTree (NodePtr root, const TQString & source, const TQString & icon, int flags) {
//kdDebug () << "addTree " << source << " " << root->mrl()->src << endl;
RootPlayListItem * ritem = new RootPlayListItem (++last_id, this, root, lastChild(), flags);
ritem->source = source;
@ -173,7 +173,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
}
PlayListItem * item = pitem ? new PlayListItem (pitem, e, this) : root;
Mrl * mrl = e->mrl ();
QString text (e->nodeName());
TQString text (e->nodeName());
if (mrl && !root->show_all_nodes) {
if (mrl->pretty_name.isEmpty ()) {
if (!mrl->src.isEmpty())
@ -201,7 +201,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
as->setPixmap (0, menu_pix);
for (; a; a = a->nextSibling ()) {
PlayListItem * ai = new PlayListItem (as, a, this);
ai->setText (0, QString ("%1=%2").arg (
ai->setText (0, TQString ("%1=%2").arg (
a->name ().toString ()).arg (a->value ()));
ai->setPixmap (0, config_pix);
}
@ -210,7 +210,7 @@ KDE_NO_EXPORT PlayListItem * PlayListView::populate
}
if (item != root) {
Node::PlayType pt = e->playType ();
QPixmap * pix;
TQPixmap * pix;
switch (pt) {
case Node::play_type_image:
pix = &img_pix;
@ -238,7 +238,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
bool select, bool open) {
// TODO, if root is same as rootitems->node and treeversion is the same
// and show all nodes is unchanged then only update the cells
QWidget * w = focusWidget ();
TQWidget * w = tqfocusWidget ();
if (w && w != this)
w->clearFocus ();
//setSelected (firstChild (), true);
@ -251,7 +251,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
break; // found based on id
}
if (id == -1) { // wildcard id
for (NodePtr n = root; n; n = n->parentNode ())
for (NodePtr n = root; n; n = n->tqparentNode ())
if (n == ritem->node) {
root = n;
break;
@ -277,7 +277,7 @@ void PlayListView::updateTree (int id, NodePtr root, NodePtr active,
bool need_timer = !tree_update;
tree_update = new TreeUpdate (ritem, active, select, open, tree_update);
if (need_timer)
QTimer::singleShot (0, this, SLOT (updateTrees ()));
TQTimer::singleShot (0, this, TQT_SLOT (updateTrees ()));
}
KDE_NO_EXPORT void PlayListView::updateTrees () {
@ -308,23 +308,23 @@ void PlayListView::updateTree (RootPlayListItem * ritem, NodePtr active, bool se
m_ignore_expanded = false;
}
void PlayListView::selectItem (const QString & txt) {
QListViewItem * item = selectedItem ();
void PlayListView::selectItem (const TQString & txt) {
TQListViewItem * item = selectedItem ();
if (item && item->text (0) == txt)
return;
item = findItem (txt, 0);
item = tqfindItem (txt, 0);
if (item) {
setSelected (item, true);
ensureItemVisible (item);
}
}
KDE_NO_EXPORT QDragObject * PlayListView::dragObject () {
KDE_NO_EXPORT TQDragObject * PlayListView::dragObject () {
PlayListItem * item = static_cast <PlayListItem *> (selectedItem ());
if (item && item->node) {
QString txt = item->node->isPlayable ()
TQString txt = item->node->isPlayable ()
? item->node->mrl ()->src : item->node->outerXML ();
QTextDrag * drag = new QTextDrag (txt, this);
TQTextDrag * drag = new TQTextDrag (txt, this);
last_drag_tree_id = rootItem (item)->id;
m_last_drag = item->node;
drag->setPixmap (*item->pixmap (0));
@ -335,40 +335,40 @@ KDE_NO_EXPORT QDragObject * PlayListView::dragObject () {
return 0;
}
KDE_NO_EXPORT void PlayListView::setFont (const QFont & fnt) {
setTreeStepSize (QFontMetrics (fnt).boundingRect ('m').width ());
KDE_NO_EXPORT void PlayListView::setFont (const TQFont & fnt) {
setTreeStepSize (TQFontMetrics (fnt).boundingRect ('m').width ());
KListView::setFont (fnt);
}
KDE_NO_EXPORT void PlayListView::contextMenuItem (QListViewItem * vi, const QPoint & p, int) {
KDE_NO_EXPORT void PlayListView::contextMenuItem (TQListViewItem * vi, const TQPoint & p, int) {
if (vi) {
PlayListItem * item = static_cast <PlayListItem *> (vi);
if (item->node || item->m_attr) {
RootPlayListItem * ritem = rootItem (vi);
if (m_itemmenu->count () > 0) {
m_find->unplug (m_itemmenu);
m_tqfind->unplug (m_itemmenu);
m_find_next->unplug (m_itemmenu);
m_itemmenu->clear ();
}
m_itemmenu->insertItem (KGlobal::iconLoader ()->loadIconSet
(QString ("editcopy"), KIcon::Small, 0, true),
(TQString ("editcopy"), KIcon::Small, 0, true),
i18n ("&Copy to Clipboard"),
this, SLOT (copyToClipboard ()), 0, 0);
this, TQT_SLOT (copyToClipboard ()), 0, 0);
if (item->m_attr ||
(item->node && (item->node->isPlayable () ||
item->node->isDocument ()) &&
item->node->mrl ()->bookmarkable))
m_itemmenu->insertItem (KGlobal::iconLoader ()->loadIconSet
(QString ("bookmark_add"), KIcon::Small, 0, true),
(TQString ("bookmark_add"), KIcon::Small, 0, true),
i18n ("&Add Bookmark"),
this, SLOT (addBookMark ()), 0, 1);
this, TQT_SLOT (addBookMark ()), 0, 1);
if (ritem->have_dark_nodes) {
m_itemmenu->insertItem (i18n ("&Show all"),
this, SLOT (toggleShowAllNodes ()), 0, 2);
this, TQT_SLOT (toggleShowAllNodes ()), 0, 2);
m_itemmenu->setItemChecked (2, ritem->show_all_nodes);
}
m_itemmenu->insertSeparator ();
m_find->plug (m_itemmenu);
m_tqfind->plug (m_itemmenu);
m_find_next->plug (m_itemmenu);
emit prepareMenu (item, m_itemmenu);
m_itemmenu->exec (p);
@ -377,7 +377,7 @@ KDE_NO_EXPORT void PlayListView::contextMenuItem (QListViewItem * vi, const QPoi
m_view->controlPanel ()->popupMenu ()->exec (p);
}
void PlayListView::itemExpanded (QListViewItem * item) {
void PlayListView::itemExpanded (TQListViewItem * item) {
if (!m_ignore_expanded && item->childCount () == 1) {
PlayListItem * child_item = static_cast<PlayListItem*>(item->firstChild ());
child_item->setOpen (rootItem (item)->show_all_nodes ||
@ -385,11 +385,11 @@ void PlayListView::itemExpanded (QListViewItem * item) {
}
}
RootPlayListItem * PlayListView::rootItem (QListViewItem * item) const {
RootPlayListItem * PlayListView::rootItem (TQListViewItem * item) const {
if (!item)
return 0L;
while (item->parent ())
item = item->parent ();
while (item->tqparent ())
item = item->tqparent ();
return static_cast <RootPlayListItem *> (item);
}
@ -404,20 +404,20 @@ RootPlayListItem * PlayListView::rootItem (int id) const {
void PlayListView::copyToClipboard () {
PlayListItem * item = currentPlayListItem ();
QString text = item->text (0);
TQString text = item->text (0);
if (item->node) {
Mrl * mrl = item->node->mrl ();
if (mrl && !mrl->src.isEmpty ())
text = mrl->src;
}
QApplication::clipboard()->setText (text);
TQApplication::tqclipboard()->setText (text);
}
void PlayListView::addBookMark () {
PlayListItem * item = currentPlayListItem ();
if (item->node) {
Mrl * mrl = item->node->mrl ();
KURL url (mrl ? mrl->src : QString (item->node->nodeName ()));
KURL url (mrl ? mrl->src : TQString (item->node->nodeName ()));
emit addBookMark (mrl->pretty_name.isEmpty () ? url.prettyURL () : mrl->pretty_name, url.url ());
}
}
@ -445,8 +445,8 @@ KDE_NO_EXPORT void PlayListView::showAllNodes(RootPlayListItem *ri, bool show) {
}
}
KDE_NO_EXPORT bool PlayListView::acceptDrag (QDropEvent * de) const {
QListViewItem * item = itemAt (contentsToViewport (de->pos ()));
KDE_NO_EXPORT bool PlayListView::acceptDrag (TQDropEvent * de) const {
TQListViewItem * item = itemAt (contentsToViewport (de->pos ()));
if (item && (de->source () == this || isDragValid (de))) {
RootPlayListItem * ritem = rootItem (item);
return ritem->flags & AllowDrops;
@ -454,11 +454,11 @@ KDE_NO_EXPORT bool PlayListView::acceptDrag (QDropEvent * de) const {
return false;
}
KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *after) {
KDE_NO_EXPORT void PlayListView::itemDropped (TQDropEvent * de, TQListViewItem *after) {
if (!after) { // could still be a descendent
after = itemAt (contentsToViewport (de->pos ()));
if (after)
after = after->parent ();
after = after->tqparent ();
}
if (after) {
RootPlayListItem * ritem = rootItem (after);
@ -469,9 +469,9 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
KURL::List sl;
if (KURLDrag::canDecode (de)) {
KURLDrag::decode (de, sl);
} else if (QTextDrag::canDecode (de)) {
QString text;
QTextDrag::decode (de, text);
} else if (TQTextDrag::canDecode (de)) {
TQString text;
TQTextDrag::decode (de, text);
sl.push_back (KURL (text));
}
if (valid && sl.size () > 0) {
@ -482,7 +482,7 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
if (as_child)
n->insertBefore (ni, n->firstChild ());
else
n->parentNode ()->insertBefore (ni, n->nextSibling ());
n->tqparentNode ()->insertBefore (ni, n->nextSibling ());
}
PlayListItem * citem = currentPlayListItem ();
NodePtr cn;
@ -494,7 +494,7 @@ KDE_NO_EXPORT void PlayListView::itemDropped (QDropEvent * de, QListViewItem *af
m_view->dropEvent (de);
}
KDE_NO_EXPORT void PlayListView::itemIsRenamed (QListViewItem * qitem) {
KDE_NO_EXPORT void PlayListView::itemIsRenamed (TQListViewItem * qitem) {
PlayListItem * item = static_cast <PlayListItem *> (qitem);
if (item->node) {
RootPlayListItem * ri = rootItem (qitem);
@ -505,30 +505,30 @@ KDE_NO_EXPORT void PlayListView::itemIsRenamed (QListViewItem * qitem) {
} else // restore damage ..
updateTree (ri, item->node, true);
} else if (item->m_attr) {
QString txt = item->text (0);
int pos = txt.find (QChar ('='));
TQString txt = item->text (0);
int pos = txt.tqfind (TQChar ('='));
if (pos > -1) {
item->m_attr->setName (txt.left (pos));
item->m_attr->setValue (txt.mid (pos + 1));
} else {
item->m_attr->setName (txt);
item->m_attr->setValue (QString (""));
item->m_attr->setValue (TQString (""));
}
PlayListItem * pi = static_cast <PlayListItem *> (item->parent ());
PlayListItem * pi = static_cast <PlayListItem *> (item->tqparent ());
if (pi && pi->node)
pi->node->document ()->m_tree_version++;
}
}
KDE_NO_EXPORT void PlayListView::itemIsSelected (QListViewItem * qitem) {
KDE_NO_EXPORT void PlayListView::itemIsSelected (TQListViewItem * qitem) {
RootPlayListItem * ri = rootItem (qitem);
setItemsRenameable (ri && (ri->flags & TreeEdit) && ri != qitem);
}
KDE_NO_EXPORT void PlayListView::rename (QListViewItem * qitem, int c) {
KDE_NO_EXPORT void PlayListView::rename (TQListViewItem * qitem, int c) {
PlayListItem * item = static_cast <PlayListItem *> (qitem);
if (rootItem (qitem)->show_all_nodes && item && item->m_attr) {
PlayListItem * pi = static_cast <PlayListItem *> (qitem->parent ());
PlayListItem * pi = static_cast <PlayListItem *> (qitem->tqparent ());
if (pi && pi->node && pi->node->isEditable ())
KListView::rename (item, c);
} else if (item && item->node && item->node->isEditable ()) {
@ -542,7 +542,7 @@ KDE_NO_EXPORT void PlayListView::rename (QListViewItem * qitem, int c) {
}
KDE_NO_EXPORT void PlayListView::editCurrent () {
QListViewItem * qitem = selectedItem ();
TQListViewItem * qitem = selectedItem ();
if (qitem) {
RootPlayListItem * ri = rootItem (qitem);
if (ri && (ri->flags & TreeEdit) && ri != qitem)
@ -553,24 +553,24 @@ KDE_NO_EXPORT void PlayListView::editCurrent () {
KDE_NO_EXPORT void PlayListView::slotFind () {
m_current_find_elm = 0L;
if (!m_find_dialog) {
m_find_dialog = new KFindDialog (false, this, "kde_kmplayer_find", KFindDialog::CaseSensitive);
m_find_dialog = new KFindDialog (false, this, "kde_kmplayer_tqfind", KFindDialog::CaseSensitive);
m_find_dialog->setHasSelection (false);
connect(m_find_dialog, SIGNAL(okClicked ()), this, SLOT(slotFindOk ()));
connect(m_find_dialog, TQT_SIGNAL(okClicked ()), this, TQT_SLOT(slotFindOk ()));
} else
m_find_dialog->setPattern (QString ());
m_find_dialog->setPattern (TQString ());
m_find_dialog->show ();
}
static QListViewItem * findNodeInTree (NodePtr n, QListViewItem * item) {
static TQListViewItem * findNodeInTree (NodePtr n, TQListViewItem * item) {
//kdDebug () << "item:" << item->text (0) << " n:" << (n ? n->nodeName () : "null" ) <<endl;
PlayListItem * pi = static_cast <PlayListItem *> (item);
if (!n || !pi->node)
return 0L;
if (n == pi->node)
return item;
for (QListViewItem * ci = item->firstChild(); ci; ci = ci->nextSibling ()) {
for (TQListViewItem * ci = item->firstChild(); ci; ci = ci->nextSibling ()) {
//kdDebug () << "ci:" << ci->text (0) << " n:" << n->nodeName () <<endl;
QListViewItem * vi = findNodeInTree (n, ci);
TQListViewItem * vi = findNodeInTree (n, ci);
if (vi)
return vi;
}
@ -590,7 +590,7 @@ KDE_NO_EXPORT void PlayListView::slotFindOk () {
m_current_find_elm = lvi->node;
current_find_tree_id = rootItem (lvi)->id;
} else if (lvi && lvi->m_attr) {
PlayListItem*pi=static_cast<PlayListItem*>(currentItem()->parent());
PlayListItem*pi=static_cast<PlayListItem*>(currentItem()->tqparent());
if (pi) {
m_current_find_attr = lvi->m_attr;
m_current_find_elm = pi->node;
@ -607,17 +607,17 @@ KDE_NO_EXPORT void PlayListView::slotFindOk () {
slotFindNext ();
}
/* A bit tricky, but between the find's PlayListItems might be gone, so
/* A bit tricky, but between the tqfind's PlayListItems might be gone, so
* try to match on the generated tree following the source's document tree
*/
KDE_NO_EXPORT void PlayListView::slotFindNext () {
if (!m_find_dialog)
return;
QString str = m_find_dialog->pattern();
TQString str = m_find_dialog->pattern();
if (!m_current_find_elm || str.isEmpty ())
return;
long opt = m_find_dialog->options ();
QRegExp regexp;
TQRegExp regexp;
if (opt & KFindDialog::RegularExpression)
regexp = str;
bool cs = (opt & KFindDialog::CaseSensitive);
@ -627,7 +627,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
while (!found && n) {
if (ri->show_all_nodes || n->expose ()) {
bool elm = n->isElementNode ();
QString val = n->nodeName ();
TQString val = n->nodeName ();
if (elm && !ri->show_all_nodes) {
Mrl * mrl = n->mrl ();
if (mrl) {
@ -640,19 +640,19 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (!elm)
val = n->nodeValue ();
if (((opt & KFindDialog::RegularExpression) &&
val.find (regexp, 0) > -1) ||
val.tqfind (regexp, 0) > -1) ||
(!(opt & KFindDialog::RegularExpression) &&
val.find (str, 0, cs) > -1)) {
val.tqfind (str, 0, cs) > -1)) {
node = n;
m_current_find_attr = 0L;
found = true;
} else if (elm && ri->show_all_nodes) {
for (AttributePtr a = convertNode <Element> (n)->attributes ()->first (); a; a = a->nextSibling ()) {
QString attr = a->name ().toString ();
TQString attr = a->name ().toString ();
if (((opt & KFindDialog::RegularExpression) &&
(attr.find (regexp, 0) || a->value ().find (regexp, 0) > -1)) ||
(attr.tqfind (regexp, 0) || a->value ().tqfind (regexp, 0) > -1)) ||
(!(opt & KFindDialog::RegularExpression) &&
(attr.find (str, 0, cs) > -1 || a->value ().find (str, 0, cs) > -1))) {
(attr.tqfind (str, 0, cs) > -1 || a->value ().tqfind (str, 0, cs) > -1))) {
node = n;
m_current_find_attr = a;
found = true;
@ -668,7 +668,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (n->previousSibling ()) {
n = n->previousSibling ();
} else {
for (n = n->parentNode (); n; n = n->parentNode ())
for (n = n->tqparentNode (); n; n = n->tqparentNode ())
if (n->previousSibling ()) {
n = n->previousSibling ();
break;
@ -685,7 +685,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
} else if (n->nextSibling ()) {
n = n->nextSibling ();
} else {
for (n = n->parentNode (); n; n = n->parentNode ())
for (n = n->tqparentNode (); n; n = n->tqparentNode ())
if (n->nextSibling ()) {
n = n->nextSibling ();
break;
@ -703,7 +703,7 @@ KDE_NO_EXPORT void PlayListView::slotFindNext () {
m_current_find_elm = n;
kdDebug () << " search for " << str << "=" << (node ? node->nodeName () : "not found") << " next:" << (n ? n->nodeName () : " not found") << endl;
if (found) {
QListViewItem * fc = findNodeInTree (node, ri);
TQListViewItem * fc = findNodeInTree (node, ri);
if (!fc) {
m_current_find_elm = 0L;
kdDebug () << "node not found in tree tree:" << ri->id << endl;

@ -27,30 +27,30 @@
#include "kmplayerplaylist.h"
class QFont;
class QPixmap;
class QPainter;
class QPopupMenu;
class QDropEvent;
class TQFont;
class TQPixmap;
class TQPainter;
class TQPopupMenu;
class TQDropEvent;
namespace KMPlayer {
class View;
class PlayListView;
bool isDragValid (QDropEvent * de) KMPLAYER_NO_MBR_EXPORT;
bool isDragValid (TQDropEvent * de) KMPLAYER_NO_MBR_EXPORT;
/*
* An item in the playlist
*/
class KMPLAYER_NO_EXPORT PlayListItem : public QListViewItem {
class KMPLAYER_NO_EXPORT PlayListItem : public TQListViewItem {
public:
PlayListItem (QListViewItem *p, const NodePtr & e, PlayListView * lv);
PlayListItem (QListViewItem *p, const AttributePtr & e, PlayListView * lv);
PlayListItem (PlayListView *v, const NodePtr & d, QListViewItem * b);
PlayListItem (TQListViewItem *p, const NodePtr & e, PlayListView * lv);
PlayListItem (TQListViewItem *p, const AttributePtr & e, PlayListView * lv);
PlayListItem (PlayListView *v, const NodePtr & d, TQListViewItem * b);
KDE_NO_CDTOR_EXPORT ~PlayListItem () {}
void paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align);
void paintBranches(QPainter *p, const QColorGroup &cg, int w, int y, int h);
void paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align);
void paintBranches(TQPainter *p, const TQColorGroup &cg, int w, int y, int h);
PlayListView * playListView () const;
NodePtrW node;
AttributePtrW m_attr;
@ -61,11 +61,11 @@ protected:
class KMPLAYER_NO_EXPORT RootPlayListItem : public PlayListItem {
public:
RootPlayListItem (int id, PlayListView *v, const NodePtr & d, QListViewItem * b, int flags);
RootPlayListItem (int id, PlayListView *v, const NodePtr & d, TQListViewItem * b, int flags);
KDE_NO_CDTOR_EXPORT ~RootPlayListItem () {}
void paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int align);
QString source;
QString icon;
void paintCell (TQPainter * p, const TQColorGroup & cg, int column, int width, int align);
TQString source;
TQString icon;
int id;
int flags;
bool show_all_nodes;
@ -77,45 +77,46 @@ public:
*/
class KMPLAYER_EXPORT PlayListView : public KListView {
Q_OBJECT
TQ_OBJECT
public:
enum Flags {
AllowDrops = 0x01, AllowDrag = 0x02,
InPlaceEdit = 0x04, TreeEdit = 0x08,
Moveable = 0x10, Deleteable = 0x20
};
PlayListView (QWidget * parent, View * view, KActionCollection * ac);
PlayListView (TQWidget * tqparent, View * view, KActionCollection * ac);
~PlayListView ();
void selectItem (const QString & txt);
void selectItem (const TQString & txt);
void showAllNodes (RootPlayListItem *, bool show=true);
void setActiveForegroundColor (const QColor & c) { m_active_color = c; }
const QColor & activeColor () const { return m_active_color; }
int addTree (NodePtr r, const QString & src, const QString & ico, int flgs);
RootPlayListItem * rootItem (QListViewItem * item) const;
void setActiveForegroundColor (const TQColor & c) { m_active_color = c; }
const TQColor & activeColor () const { return m_active_color; }
int addTree (NodePtr r, const TQString & src, const TQString & ico, int flgs);
RootPlayListItem * rootItem (TQListViewItem * item) const;
RootPlayListItem * rootItem (int id) const;
void setFont (const QFont &);
void setFont (const TQFont &);
PlayListItem * currentPlayListItem () const;
PlayListItem * selectedPlayListItem () const;
NodePtr lastDragNode () const { return m_last_drag; }
int lastDragTreeId () const { return last_drag_tree_id; }
signals:
void addBookMark (const QString & title, const QString & url);
void prepareMenu (KMPlayer::PlayListItem * item, QPopupMenu * menu);
void addBookMark (const TQString & title, const TQString & url);
void prepareMenu (KMPlayer::PlayListItem * item, TQPopupMenu * menu);
protected:
bool acceptDrag (QDropEvent* event) const;
QDragObject * dragObject ();
bool acceptDrag (TQDropEvent* event) const;
TQDragObject * dragObject ();
public slots:
void editCurrent ();
void rename (QListViewItem * item, int c);
void rename (TQListViewItem * item, int c);
void updateTree (int id, NodePtr root, NodePtr active, bool sel, bool open);
private slots:
void contextMenuItem (QListViewItem *, const QPoint &, int);
void itemExpanded (QListViewItem *);
void contextMenuItem (TQListViewItem *, const TQPoint &, int);
void itemExpanded (TQListViewItem *);
void copyToClipboard ();
void addBookMark ();
void toggleShowAllNodes ();
void itemDropped (QDropEvent * e, QListViewItem * after);
void itemIsRenamed (QListViewItem * item);
void itemIsSelected (QListViewItem * item);
void itemDropped (TQDropEvent * e, TQListViewItem * after);
void itemIsRenamed (TQListViewItem * item);
void itemIsSelected (TQListViewItem * item);
void updateTrees ();
void slotFind ();
void slotFindOk ();
@ -134,20 +135,20 @@ private:
};
SharedPtr <TreeUpdate> tree_update;
View * m_view;
QPopupMenu * m_itemmenu;
KAction * m_find;
TQPopupMenu * m_itemmenu;
KAction * m_tqfind;
KAction * m_find_next;
KFindDialog * m_find_dialog;
QPixmap folder_pix;
QPixmap auxiliary_pix;
QPixmap video_pix;
QPixmap unknown_pix;
QPixmap menu_pix;
QPixmap config_pix;
QPixmap url_pix;
QPixmap info_pix;
QPixmap img_pix;
QColor m_active_color;
TQPixmap folder_pix;
TQPixmap auxiliary_pix;
TQPixmap video_pix;
TQPixmap unknown_pix;
TQPixmap menu_pix;
TQPixmap config_pix;
TQPixmap url_pix;
TQPixmap info_pix;
TQPixmap img_pix;
TQColor m_active_color;
NodePtrW m_current_find_elm;
NodePtrW m_last_drag;
AttributePtrW m_current_find_attr;

File diff suppressed because it is too large Load Diff

@ -24,20 +24,20 @@
#include "kmplayer_def.h"
#include <kdialogbase.h>
#include <qframe.h>
#include <qmap.h>
class QTabWidget;
class QTable;
class QGroupBox;
class QCheckBox;
class QComboBox;
class QLineEdit;
class QRadioButton;
class QSlider;
class QSpinBox;
class QColor;
class QButtonGroup;
#include <tqframe.h>
#include <tqmap.h>
class TQTabWidget;
class TQTable;
class TQGroupBox;
class TQCheckBox;
class TQComboBox;
class TQLineEdit;
class TQRadioButton;
class TQSlider;
class TQSpinBox;
class TQColor;
class TQButtonGroup;
class KHistoryCombo;
class KComboBox;
class KURLRequester;
@ -68,6 +68,7 @@ class FontSetting;
class KMPLAYER_NO_EXPORT Preferences : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
Preferences(PartBase *, Settings *);
@ -92,46 +93,48 @@ public:
void removePrefPage (PreferencesPage *);
RecorderPage * recorders;
QMap<QString, QTabWidget *> entries;
TQMap<TQString, TQTabWidget *> entries;
public slots:
void confirmDefaults();
};
class KMPLAYER_NO_EXPORT PrefGeneralPageGeneral : public QFrame
class KMPLAYER_NO_EXPORT PrefGeneralPageGeneral : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
PrefGeneralPageGeneral(QWidget *parent, Settings *);
PrefGeneralPageGeneral(TQWidget *tqparent, Settings *);
~PrefGeneralPageGeneral() {}
QCheckBox *keepSizeRatio;
QCheckBox * autoResize;
QButtonGroup *sizesChoice;
QCheckBox *dockSysTray;
QCheckBox *loop;
QCheckBox *showConfigButton;
QCheckBox *showPlaylistButton;
QCheckBox *showRecordButton;
QCheckBox *showBroadcastButton;
QCheckBox *framedrop;
QCheckBox *adjustvolume;
QCheckBox *adjustcolors;
QSpinBox *seekTime;
TQCheckBox *keepSizeRatio;
TQCheckBox * autoResize;
TQButtonGroup *sizesChoice;
TQCheckBox *dockSysTray;
TQCheckBox *loop;
TQCheckBox *showConfigButton;
TQCheckBox *showPlaylistButton;
TQCheckBox *showRecordButton;
TQCheckBox *showBroadcastButton;
TQCheckBox *framedrop;
TQCheckBox *adjustvolume;
TQCheckBox *adjustcolors;
TQSpinBox *seekTime;
};
class KMPLAYER_NO_EXPORT PrefGeneralPageLooks : public QFrame {
class KMPLAYER_NO_EXPORT PrefGeneralPageLooks : public TQFrame {
Q_OBJECT
TQ_OBJECT
public:
PrefGeneralPageLooks (QWidget *parent, Settings *);
PrefGeneralPageLooks (TQWidget *tqparent, Settings *);
~PrefGeneralPageLooks () {}
QComboBox *colorscombo;
TQComboBox *colorscombo;
KColorButton *colorbutton;
QComboBox *fontscombo;
QPushButton *fontbutton;
TQComboBox *fontscombo;
TQPushButton *fontbutton;
public slots:
void colorItemChanged (int);
void colorCanged (const QColor &);
void colorCanged (const TQColor &);
void fontItemChanged (int);
void fontClicked ();
private:
@ -139,11 +142,12 @@ private:
FontSetting * fonts;
};
class KMPLAYER_NO_EXPORT PrefSourcePageURL : public QFrame
class KMPLAYER_NO_EXPORT PrefSourcePageURL : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
PrefSourcePageURL (QWidget *parent);
PrefSourcePageURL (TQWidget *tqparent);
~PrefSourcePageURL () {}
KURLRequester * url;
@ -151,29 +155,30 @@ public:
KComboBox * urllist;
KURLRequester * sub_url;
KComboBox * sub_urllist;
QListBox * backend;
QCheckBox * allowhref;
QLineEdit * prefBitRate;
QLineEdit * maxBitRate;
TQListBox * backend;
TQCheckBox * allowhref;
TQLineEdit * prefBitRate;
TQLineEdit * maxBitRate;
bool changed;
private slots:
void slotBrowse ();
void slotTextChanged (const QString &);
void slotTextChanged (const TQString &);
};
class KMPLAYER_NO_EXPORT PrefRecordPage : public QFrame
class KMPLAYER_NO_EXPORT PrefRecordPage : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
PrefRecordPage (QWidget *parent, PartBase *, RecorderPage *, int len);
PrefRecordPage (TQWidget *tqparent, PartBase *, RecorderPage *, int len);
~PrefRecordPage () {}
KURLRequester * url;
QButtonGroup * recorder;
QButtonGroup * replay;
QLineEdit * replaytime;
QLabel * source;
TQButtonGroup * recorder;
TQButtonGroup * replay;
TQLineEdit * replaytime;
TQLabel * source;
public slots:
void replayClicked (int id);
void recorderClicked (int id);
@ -186,18 +191,19 @@ private slots:
private:
PartBase * m_player;
RecorderPage * m_recorders;
QPushButton * recordButton;
TQPushButton * recordButton;
int m_recorders_length;
};
class KMPLAYER_NO_EXPORT RecorderPage : public QFrame
class KMPLAYER_NO_EXPORT RecorderPage : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
RecorderPage (QWidget *parent, PartBase *);
RecorderPage (TQWidget *tqparent, PartBase *);
virtual ~RecorderPage () {};
virtual void record ();
virtual QString name () = 0;
virtual TQString name () = 0;
virtual const char * recorderName () = 0;
RecorderPage * next;
protected:
@ -207,16 +213,17 @@ protected:
class KMPLAYER_NO_EXPORT PrefMEncoderPage : public RecorderPage
{
Q_OBJECT
TQ_OBJECT
public:
PrefMEncoderPage (QWidget *parent, PartBase *);
PrefMEncoderPage (TQWidget *tqparent, PartBase *);
~PrefMEncoderPage () {}
void record ();
QString name ();
TQString name ();
const char * recorderName () { return "mencoder"; }
QLineEdit * arguments;
QButtonGroup * format;
TQLineEdit * arguments;
TQButtonGroup * format;
public slots:
void formatClicked (int id);
private:
@ -224,20 +231,20 @@ private:
class KMPLAYER_NO_EXPORT PrefMPlayerDumpstreamPage : public RecorderPage {
public:
PrefMPlayerDumpstreamPage (QWidget *parent, PartBase *);
PrefMPlayerDumpstreamPage (TQWidget *tqparent, PartBase *);
~PrefMPlayerDumpstreamPage () {}
QString name ();
TQString name ();
const char * recorderName () { return "mplayerdumpstream"; }
};
#ifdef HAVE_XINE
class KMPLAYER_NO_EXPORT PrefXinePage : public RecorderPage {
public:
PrefXinePage (QWidget *parent, PartBase *);
PrefXinePage (TQWidget *tqparent, PartBase *);
~PrefXinePage () {}
QString name ();
TQString name ();
const char * recorderName () { return "xine"; }
};
#endif
@ -245,74 +252,78 @@ public:
class KMPLAYER_NO_EXPORT PrefFFMpegPage : public RecorderPage
{
Q_OBJECT
TQ_OBJECT
public:
PrefFFMpegPage (QWidget *parent, PartBase *);
PrefFFMpegPage (TQWidget *tqparent, PartBase *);
~PrefFFMpegPage () {}
void record ();
QString name ();
TQString name ();
const char * recorderName () { return "ffmpeg"; }
QLineEdit * arguments;
QButtonGroup * format;
TQLineEdit * arguments;
TQButtonGroup * format;
private:
};
class KMPLAYER_NO_EXPORT PrefGeneralPageOutput : public QFrame
class KMPLAYER_NO_EXPORT PrefGeneralPageOutput : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
PrefGeneralPageOutput (QWidget *parent, OutputDriver * ad, OutputDriver * vd);
PrefGeneralPageOutput (TQWidget *tqparent, OutputDriver * ad, OutputDriver * vd);
~PrefGeneralPageOutput() {}
QListBox *videoDriver;
QListBox *audioDriver;
TQListBox *videoDriver;
TQListBox *audioDriver;
};
class KMPLAYER_NO_EXPORT PrefOPPageGeneral : public QFrame
class KMPLAYER_NO_EXPORT PrefOPPageGeneral : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
PrefOPPageGeneral(QWidget *parent = 0);
PrefOPPageGeneral(TQWidget *tqparent = 0);
~PrefOPPageGeneral() {}
};
class KMPLAYER_NO_EXPORT PrefOPPagePostProc : public QFrame
class KMPLAYER_NO_EXPORT PrefOPPagePostProc : public TQFrame
{
Q_OBJECT
TQ_OBJECT
public:
PrefOPPagePostProc(QWidget *parent = 0);
PrefOPPagePostProc(TQWidget *tqparent = 0);
~PrefOPPagePostProc() {}
QCheckBox* postProcessing;
QCheckBox* disablePPauto;
QTabWidget* PostprocessingOptions;
QRadioButton* defaultPreset;
QRadioButton* customPreset;
QRadioButton* fastPreset;
QCheckBox* HzDeblockFilter;
QCheckBox* VtDeblockFilter;
QCheckBox* DeringFilter;
QCheckBox* HzDeblockAQuality;
QCheckBox* VtDeblockAQuality;
QCheckBox* DeringAQuality;
QCheckBox* AutolevelsFilter;
QCheckBox* AutolevelsFullrange;
QCheckBox* HzDeblockCFiltering;
QCheckBox* VtDeblockCFiltering;
QCheckBox* DeringCFiltering;
QCheckBox* TmpNoiseFilter;
QSlider* TmpNoiseSlider;
QCheckBox* LinBlendDeinterlacer;
QCheckBox* CubicIntDeinterlacer;
QCheckBox* LinIntDeinterlacer;
QCheckBox* MedianDeinterlacer;
QCheckBox* FfmpegDeinterlacer;
TQCheckBox* postProcessing;
TQCheckBox* disablePPauto;
TQTabWidget* PostprocessingOptions;
TQRadioButton* defaultPreset;
TQRadioButton* customPreset;
TQRadioButton* fastPreset;
TQCheckBox* HzDeblockFilter;
TQCheckBox* VtDeblockFilter;
TQCheckBox* DeringFilter;
TQCheckBox* HzDeblockAQuality;
TQCheckBox* VtDeblockAQuality;
TQCheckBox* DeringAQuality;
TQCheckBox* AutolevelsFilter;
TQCheckBox* AutolevelsFullrange;
TQCheckBox* HzDeblockCFiltering;
TQCheckBox* VtDeblockCFiltering;
TQCheckBox* DeringCFiltering;
TQCheckBox* TmpNoiseFilter;
TQSlider* TmpNoiseSlider;
TQCheckBox* LinBlendDeinterlacer;
TQCheckBox* CubicIntDeinterlacer;
TQCheckBox* LinIntDeinterlacer;
TQCheckBox* MedianDeinterlacer;
TQCheckBox* FfmpegDeinterlacer;
};
} // namespace

@ -40,13 +40,13 @@ struct KMPLAYER_NO_EXPORT TrieNode {
void unref ();
void removeChild (TrieNode *);
void dump (int lvl) {
QString indent (QString ().fill (QChar ('.'), lvl));
TQString indent (TQString ().fill (TQChar ('.'), lvl));
printf("%s%s len:%4d rc:%4d\n", indent.ascii(), str, length, ref_count);
}
char * str;
unsigned short length;
unsigned short ref_count;
TrieNode * parent;
TrieNode * tqparent;
TrieNode * first_child;
TrieNode * next_sibling;
};
@ -70,7 +70,7 @@ KDE_NO_CDTOR_EXPORT TrieNode::TrieNode (const char * s)
: str (s ? strdup (s) : 0L),
length (s ? strlen (s) : 0),
ref_count (1),
parent (0L),
tqparent (0L),
first_child (0L),
next_sibling (0L) {}
@ -81,7 +81,7 @@ KDE_NO_CDTOR_EXPORT TrieNode::~TrieNode () {
KDE_NO_EXPORT void TrieNode::unref () {
if (--ref_count <= 0 && !first_child)
parent->removeChild (this);
tqparent->removeChild (this);
}
KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) {
@ -95,10 +95,10 @@ KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) {
}
}
delete node;
if (!parent)
if (!tqparent)
return;
if (!ref_count && !first_child)
parent->removeChild (this); // can this happen ?
tqparent->removeChild (this); // can this happen ?
else if (!ref_count && !first_child->next_sibling) { // merge with child
char * tmp = first_child->str;
first_child->length = first_child->length + length;
@ -106,12 +106,12 @@ KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) {
strcpy (first_child->str, str);
strcat (first_child->str, tmp);
free (tmp);
first_child->parent = parent;
first_child->tqparent = tqparent;
first_child->next_sibling = next_sibling;
if (parent->first_child == this) {
parent->first_child = first_child;
if (tqparent->first_child == this) {
tqparent->first_child = first_child;
} else {
for (TrieNode *n = parent->first_child; n; n = n->next_sibling)
for (TrieNode *n = tqparent->first_child; n; n = n->next_sibling)
if (n->next_sibling == this) {
n->next_sibling = first_child;
break;
@ -123,9 +123,9 @@ KDE_NO_EXPORT void TrieNode::removeChild (TrieNode * node) {
static char * trieRetrieveString (TrieNode * node, int &len) {
char *buf;
if (node->parent) {
if (node->tqparent) {
len += node->length;
buf = trieRetrieveString (node->parent, len);
buf = trieRetrieveString (node->tqparent, len);
strcat (buf, node->str);
} else {
buf = (char *) malloc (len + 1);
@ -138,8 +138,8 @@ static int trieStringCompare (TrieNode * node, const char * s, int &len) {
int cmp = 0;
if (!node)
return !!s;
if (node->parent && node->parent != root_trie)
cmp = trieStringCompare (node->parent, s, len);
if (node->tqparent && node->tqparent != root_trie)
cmp = trieStringCompare (node->tqparent, s, len);
if (!cmp) {
#ifdef TEST_TRIE
printf( "compare %s %s %d\n", node->str, s + len, node->length);
@ -153,8 +153,8 @@ static int trieStringCompare (TrieNode * node, const char * s, int &len) {
static int trieStringCompare (TrieNode * n1, TrieNode * n2) {
// pre n1 && n2 on same depth and not NIL
int cmp = 0;
if (n1->parent && n1->parent != root_trie)
cmp = trieStringCompare (n1->parent, n2->parent);
if (n1->tqparent && n1->tqparent != root_trie)
cmp = trieStringCompare (n1->tqparent, n2->tqparent);
if (!cmp && n1 != n2) {
#ifdef TEST_TRIE
printf( "compare %s %s", n1->str, n2->str);
@ -174,8 +174,8 @@ static int trieStringCompare (TrieNode * n1, TrieNode * n2) {
static int trieStringStarts (TrieNode * node, const char * s, int & pos) {
int cmp = -1; // -1 still matches, 0 no, 1 yes
if (node->parent && node->parent != root_trie)
cmp = trieStringStarts (node->parent, s, pos);
if (node->tqparent && node->tqparent != root_trie)
cmp = trieStringStarts (node->tqparent, s, pos);
if (cmp == -1) {
for (int i = 0; i < node->length; i++)
if (node->str[i] != s[pos + i])
@ -190,8 +190,8 @@ static TrieNode * trieInsert (const char * s) {
root_trie = new TrieNode (0L);
//printf("trieInsert %s\n", s);
//dumpTrie();
TrieNode * parent = root_trie;
for (TrieNode * c = parent->first_child; c; c = c->first_child) {
TrieNode * tqparent = root_trie;
for (TrieNode * c = tqparent->first_child; c; c = c->first_child) {
TrieNode * prev = c;
for (TrieNode * n = prev; n; n = n->next_sibling) {
if (n->str[0] == s[0]) { // insert here
@ -206,13 +206,13 @@ static TrieNode * trieInsert (const char * s) {
tmp[i] = 0;
TrieNode * node = new TrieNode (tmp);
free (tmp);
node->parent = parent;
node->tqparent = tqparent;
node->next_sibling = n->next_sibling;
if (prev != n)
prev->next_sibling = node;
else
parent->first_child = node;
n->parent = node;
tqparent->first_child = node;
n->tqparent = node;
TrieNode * snode;
if (!s[i]) {
node->first_child = n;
@ -220,7 +220,7 @@ static TrieNode * trieInsert (const char * s) {
snode = node; // s is complete in node
} else {
snode = new TrieNode (s+i);
snode->parent = node;
snode->tqparent = node;
if (bigger) { // set n before snode
node->first_child = n;
n->next_sibling = snode;
@ -244,32 +244,32 @@ static TrieNode * trieInsert (const char * s) {
return n;
} else if (n->str[0] > s[0]) { // insert before
TrieNode * node = new TrieNode (s);
node->parent = parent;
node->tqparent = tqparent;
node->next_sibling = n;
if (prev != n)
prev->next_sibling = node;
else
parent->first_child = node;
tqparent->first_child = node;
return node;
}
prev = n;
}
if (prev) { // insert after
TrieNode * node = new TrieNode (s);
node->parent = parent;
node->tqparent = tqparent;
prev->next_sibling = node;
return node;
}
parent = c;
tqparent = c;
}
// hit an empty first_child, add s as first_child
TrieNode * node = new TrieNode (s);
parent->first_child = node;
node->parent = parent;
tqparent->first_child = node;
node->tqparent = tqparent;
return node;
}
TrieString::TrieString (const QString & s)
TrieString::TrieString (const TQString & s)
: node (s.isEmpty () ? 0L : trieInsert (s.utf8 ().data ()))
{}
@ -288,7 +288,7 @@ TrieString::~TrieString () {
}
bool TrieString::startsWith (const TrieString & s) const {
for (TrieNode * n = node; n; n = n->parent)
for (TrieNode * n = node; n; n = n->tqparent)
if (n == s.node)
return true;
return s.node ? false : true;
@ -327,12 +327,12 @@ TrieString & TrieString::operator = (const char * utf8) {
return *this;
}
QString TrieString::toString () const {
QString s;
TQString TrieString::toString () const {
TQString s;
if (node) {
int len = 0;
char *utf8 = trieRetrieveString (node, len);
s = QString::fromUtf8 (utf8);
s = TQString::fromUtf8 (utf8);
free (utf8);
}
return s;
@ -342,11 +342,11 @@ bool TrieString::operator < (const TrieString & s) const {
if (node == s.node)
return false;
int depth1 = 0, depth2 = 0;
for (TrieNode * n = node; n; n = n->parent)
for (TrieNode * n = node; n; n = n->tqparent)
depth1++;
if (!depth1)
return s.node ? true : false;
for (TrieNode * n = s.node; n; n = n->parent)
for (TrieNode * n = s.node; n; n = n->tqparent)
depth2++;
if (!depth2)
return false;
@ -355,13 +355,13 @@ bool TrieString::operator < (const TrieString & s) const {
while (depth1 > depth2) {
if (n1 == n2)
return false;
n1 = n1->parent;
n1 = n1->tqparent;
depth1--;
}
while (depth2 > depth1) {
if (n1 == n2)
return true;
n2 = n2->parent;
n2 = n2->tqparent;
depth2--;
}
int cmp = trieStringCompare (n1, n2);
@ -455,37 +455,37 @@ void KMPlayer::dumpTrie () {
}
#ifdef TEST_TRIE
// g++ triestring.cpp -o triestring -I$QTDIR/include -L$QTDIR/lib -lqt-mt -g -DTEST_TRIE
// g++ triestring.cpp -o triestring -I$TQTDIR/include -L$TQTDIR/lib -lqt-mt -g -DTEST_TRIE
int main (int, char **) {
StringPool::init();
{
TrieString s1;
TrieString s1_1(QString ("region"));
TrieString s1_1(TQString ("region"));
s1 = s1_1;
TrieString s2 (QString ("regionName"));
TrieString s3 (QString ("regPoint"));
TrieString s4 (QString ("regAlign"));
TrieString s6 (QString ("freeze"));
TrieString s7 (QString ("fit"));
TrieString s2 (TQString ("regionName"));
TrieString s3 (TQString ("regPoint"));
TrieString s4 (TQString ("regAlign"));
TrieString s6 (TQString ("freeze"));
TrieString s7 (TQString ("fit"));
{
TrieString s7_1 (QString ("fit"));
TrieString s5 (QString ("fill"));
TrieString s7_1 (TQString ("fit"));
TrieString s5 (TQString ("fill"));
dump (root_trie, 0);
}
dump (root_trie, 0);
TrieString s5 (QString ("fill"));
TrieString s8 (QString ("fontPtSize"));
TrieString s9 (QString ("fontSize"));
TrieString s10 (QString ("fontFace"));
TrieString s11 (QString ("fontColor"));
TrieString s12 (QString ("hAlign"));
TrieString s13 (QString ("region"));
TrieString s14 (QString ("ref"));
TrieString s15 (QString ("head"));
TrieString s5 (TQString ("fill"));
TrieString s8 (TQString ("fontPtSize"));
TrieString s9 (TQString ("fontSize"));
TrieString s10 (TQString ("fontFace"));
TrieString s11 (TQString ("fontColor"));
TrieString s12 (TQString ("hAlign"));
TrieString s13 (TQString ("region"));
TrieString s14 (TQString ("ref"));
TrieString s15 (TQString ("head"));
dump (root_trie, 0);
QString qs1 = s1.toString ();
QString qs2 = s2.toString ();
TQString qs1 = s1.toString ();
TQString qs2 = s2.toString ();
printf ("%s\n%s\n", qs1.ascii(), qs2.ascii());
printf("equal %s %s %d\n", qs2.ascii(), "regionName", s2 == "regionName");
printf("equal %s %s %d\n", qs2.ascii(), "zegionName", s2 == "zegionName");

@ -20,7 +20,7 @@
#ifndef _TRIE_STRING_H_
#define _TRIE_STRING_H_
#include <qstring.h>
#include <tqstring.h>
namespace KMPlayer {
@ -34,12 +34,12 @@ class KMPLAYER_EXPORT TrieString {
friend bool operator != (const TrieString & s1, const TrieString & s2);
public:
TrieString ();
TrieString (const QString & s);
TrieString (const TQString & s);
TrieString (const char * utf8);
TrieString (const TrieString & s);
~TrieString ();
QString toString () const;
TQString toString () const;
bool isNull () const;
void clear ();
bool startsWith (const TrieString & s) const;

@ -22,12 +22,12 @@
#include <stdlib.h>
#include <math.h>
#include <qapplication.h>
#include <qwidgetstack.h>
#include <qslider.h>
#include <qcursor.h>
#include <qimage.h>
#include <qmap.h>
#include <tqapplication.h>
#include <tqwidgetstack.h>
#include <tqslider.h>
#include <tqcursor.h>
#include <tqimage.h>
#include <tqmap.h>
#include <kactioncollection.h>
#include <kstaticdeleter.h>
@ -56,12 +56,12 @@ extern const char * playlist_xpm[];
//-------------------------------------------------------------------------
namespace KMPlayer {
typedef QMap <QString, ImageDataPtrW> ImageDataMap;
typedef TQMap <TQString, ImageDataPtrW> ImageDataMap;
static KStaticDeleter <ImageDataMap> imageCacheDeleter;
static ImageDataMap * image_data_map;
}
ImageData::ImageData( const QString & img) :
ImageData::ImageData( const TQString & img) :
image (0L),
url (img) {
//if (img.isEmpty ())
@ -77,12 +77,12 @@ ImageData::~ImageData() {
}
#ifdef HAVE_CAIRO
static void copyImage (Surface *s, int w, int h, QImage *img, cairo_surface_t *similar) {
static void copyImage (Surface *s, int w, int h, TQImage *img, cairo_surface_t *similar) {
int iw = img->width ();
int ih = img->height ();
if (img->depth () < 24) {
QImage qi = img->convertDepth (32, 0);
TQImage qi = img->convertDepth (32, 0);
*img = qi;
}
cairo_surface_t *sf = cairo_image_surface_create_for_data (
@ -114,11 +114,11 @@ bool CachedImage::isEmpty () {
return !data || !data->image;
}
void CachedImage::setUrl (const QString & url) {
void CachedImage::setUrl (const TQString & url) {
if (url.isEmpty ()) {
data = ImageDataPtr (new ImageData (url));
} else {
ImageDataMap::iterator i = image_data_map->find (url);
ImageDataMap::iterator i = image_data_map->tqfind (url);
if (i == image_data_map->end ()) {
data = ImageDataPtr (new ImageData (url));
image_data_map->insert (url, ImageDataPtrW (data));
@ -144,8 +144,8 @@ public:
SurfacePtr createSurface (NodePtr owner, const SRect & rect);
IRect toScreen (Single x, Single y, Single w, Single h);
void resize (const SRect & rect);
void repaint ();
void repaint (const SRect &rect);
void tqrepaint ();
void tqrepaint (const SRect &rect);
void video ();
NodePtrW current_video;
@ -181,14 +181,14 @@ KDE_NO_EXPORT void ViewSurface::resize (const SRect &r) {
#endif
/*if (rect == nrect)
;//return;
SRect pr = rect.unite (nrect); // for repaint
SRect pr = rect.unite (nrect); // for tqrepaint
rect = nrect;*/
}
KDE_NO_EXPORT IRect ViewSurface::toScreen (Single x, Single y, Single w, Single h) {
Matrix matrix (0, 0, xscale, yscale);
matrix.translate (bounds.x (), bounds.y ());
for (SurfacePtr s = parentNode(); s; s = s->parentNode()) {
for (SurfacePtr s = tqparentNode(); s; s = s->tqparentNode()) {
matrix.transform(Matrix (0, 0, s->xscale, s->yscale));
matrix.translate (s->bounds.x (), s->bounds.y ());
}
@ -197,14 +197,14 @@ KDE_NO_EXPORT IRect ViewSurface::toScreen (Single x, Single y, Single w, Single
}
KDE_NO_EXPORT
void ViewSurface::repaint (const SRect &r) {
void ViewSurface::tqrepaint (const SRect &r) {
markDirty ();
view_widget->scheduleRepaint (toScreen (r.x (), r.y (), r.width (), r.height ()));
//kdDebug() << "Surface::repaint x:" << (int)x << " y:" << (int)y << " w:" << (int)w << " h:" << (int)h << endl;
//kdDebug() << "Surface::tqrepaint x:" << (int)x << " y:" << (int)y << " w:" << (int)w << " h:" << (int)h << endl;
}
KDE_NO_EXPORT
void ViewSurface::repaint () {
void ViewSurface::tqrepaint () {
markDirty ();
view_widget->scheduleRepaint (toScreen (0, 0, bounds.width (), bounds.height ()));
}
@ -258,7 +258,7 @@ class KMPLAYER_NO_EXPORT CairoPaintVisitor : public Visitor {
public:
cairo_t * cr;
CairoPaintVisitor (cairo_surface_t * cs, Matrix m,
const IRect & rect, QColor c=QColor(), bool toplevel=false);
const IRect & rect, TQColor c=TQColor(), bool toplevel=false);
~CairoPaintVisitor ();
using Visitor::visit;
void visit (Node * n);
@ -281,7 +281,7 @@ public:
KDE_NO_CDTOR_EXPORT
CairoPaintVisitor::CairoPaintVisitor (cairo_surface_t * cs, Matrix m,
const IRect & rect, QColor c, bool top)
const IRect & rect, TQColor c, bool top)
: clip (rect), cairo_surface (cs), matrix (m), toplevel (top) {
cr = cairo_create (cs);
if (toplevel) {
@ -327,7 +327,7 @@ KDE_NO_EXPORT void CairoPaintVisitor::traverseRegion (SMIL::RegionBase * reg) {
if (c->data)
c->data->accept (this);
}
// finally visit children, accounting for z-order FIXME optimize
// finally visit tqchildren, accounting for z-order FIXME optimize
NodeRefList sorted;
for (NodePtr n = reg->firstChild (); n; n = n->nextSibling ()) {
if (n->id != SMIL::id_node_region)
@ -550,7 +550,7 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::Transition *trans) {
case SMIL::Transition::SubHorizontal:
phi = 0;
break;
default: // Vertical
default: //Qt::Vertical
phi = -M_PI / 2;
break;
}
@ -707,31 +707,31 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::TextMediaType * txt) {
matrix.getXYWH (x, y, w, h);
if (!s->surface) {
//kdDebug() << "new txt surface " << td->text << endl;
/* QTextEdit * edit = new QTextEdit;
/* TQTextEdit * edit = new TQTextEdit;
edit->setReadOnly (true);
edit->setHScrollBarMode (QScrollView::AlwaysOff);
edit->setVScrollBarMode (QScrollView::AlwaysOff);
edit->setFrameShape (QFrame::NoFrame);
edit->setFrameShadow (QFrame::Plain);
edit->setHScrollBarMode (TQScrollView::AlwaysOff);
edit->setVScrollBarMode (TQScrollView::AlwaysOff);
edit->setFrameShape (TQFrame::NoFrame);
edit->setFrameShadow (TQFrame::Plain);
edit->setGeometry (0, 0, w, h);
if (edit->length () == 0)
edit->setText (text);
if (w0 > 0)
font.setPointSize (int (1.0 * w * font_size / w0));
edit->setFont (font);
QRect rect = p.clipRegion (QPainter::CoordPainter).boundingRect ();
rect = rect.intersect (QRect (xoff, yoff, w, h));
QPixmap pix = QPixmap::grabWidget (edit, rect.x () - (int) xoff,
TQRect rect = p.clipRegion (TQPainter::CoordPainter).boundingRect ();
rect = rect.intersect (TQRect (xoff, yoff, w, h));
TQPixmap pix = TQPixmap::grabWidget (edit, rect.x () - (int) xoff,
rect.y () - (int) yoff, rect.width (), rect.height ());*/
float scale = 1.0 * w / rect.width (); // TODO: make an image
cairo_set_font_size (cr, scale * td->font_size);
cairo_font_extents_t txt_fnt;
cairo_font_extents (cr, &txt_fnt);
QString str = td->text;
TQString str = td->text;
struct Line {
Line (const QString & ln) : txt (ln), next(0) {}
QString txt;
Line (const TQString & ln) : txt (ln), next(0) {}
TQString txt;
cairo_text_extents_t txt_ext;
Single xoff;
Line * next;
@ -741,13 +741,13 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::TextMediaType * txt) {
int line_count = 0;
Single min_xoff = w;
while (!str.isEmpty ()) {
int len = str.find (QChar ('\n'));
int len = str.tqfind (TQChar ('\n'));
bool skip_cr = false;
if (len > 1 && str[len-1] == QChar ('\r')) {
if (len > 1 && str[len-1] == TQChar ('\r')) {
--len;
skip_cr = true;
}
QString para = len > -1 ? str.left (len) : str;
TQString para = len > -1 ? str.left (len) : str;
Line * line = new Line (para);
++line_count;
if (!lines)
@ -764,7 +764,7 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::TextMediaType * txt) {
int br_pos = int (line->txt.length () * frag); //educated guess
while (br_pos > 0) {
line->txt.truncate (br_pos);
br_pos = line->txt.findRev (QChar (' '));
br_pos = line->txt.tqfindRev (TQChar (' '));
if (br_pos < 1)
break;
line->txt.truncate (br_pos);
@ -853,7 +853,7 @@ KDE_NO_EXPORT void CairoPaintVisitor::visit (SMIL::Brush * brush) {
SRect rect = s->bounds;
Single x, y, w = rect.width(), h = rect.height();
matrix.getXYWH (x, y, w, h);
unsigned int color = QColor (brush->param ("color")).rgb ();
unsigned int color = TQColor (brush->param ("color")).rgb ();
if (brush->active_trans) {
cur_media = brush;
cur_pat = NULL;
@ -1129,7 +1129,7 @@ public:
void visit (SMIL::MediaType * n);
void visit (SMIL::Anchor *);
void visit (SMIL::Area *);
QCursor cursor;
TQCursor cursor;
};
} // namespace
@ -1143,17 +1143,17 @@ KDE_NO_EXPORT void MouseVisitor::visit (Node * n) {
kdDebug () << "Mouse event ignored for " << n->nodeName () << endl;
}
KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Layout * layout) {
if (layout->surface ()) {
KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Layout * tqlayout) {
if (tqlayout->surface ()) {
Matrix m = matrix;
SRect rect = layout->region_surface->bounds;
SRect rect = tqlayout->region_surface->bounds;
matrix = Matrix (rect.x(), rect.y(),
layout->region_surface->xscale, layout->region_surface->yscale);
tqlayout->region_surface->xscale, tqlayout->region_surface->yscale);
matrix.transform (m);
NodePtr node_save = node;
node = layout;
for (NodePtr r = layout->firstChild (); r; r = r->nextSibling ()) {
node = tqlayout;
for (NodePtr r = tqlayout->firstChild (); r; r = r->nextSibling ()) {
if (r->id == SMIL::id_node_region)
r->accept (this);
if (!node->active ())
@ -1232,7 +1232,7 @@ static void followLink (SMIL::LinkingBase * link) {
else
kdError() << "In document jumps smil not found" << endl;
} else
for (NodePtr p = link->parentNode (); p; p = p->parentNode ()) {
for (NodePtr p = link->tqparentNode (); p; p = p->tqparentNode ()) {
if (n->mrl () && n->mrl ()->opener == p) {
p->setState (Node::state_deferred);
p->mrl ()->setParam (StringPool::attr_src, link->href, 0L);
@ -1251,7 +1251,7 @@ KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Anchor * anchor) {
}
KDE_NO_EXPORT void MouseVisitor::visit (SMIL::Area * area) {
NodePtr n = area->parentNode ();
NodePtr n = area->tqparentNode ();
if (n->id >= SMIL::id_node_first_mediatype &&
n->id < SMIL::id_node_last_mediatype) {
SMIL::MediaType * mt = convertNode <SMIL::MediaType> (n);
@ -1338,22 +1338,22 @@ KDE_NO_EXPORT void MouseVisitor::visit (SMIL::MediaType * mediatype) {
//-----------------------------------------------------------------------------
KDE_NO_CDTOR_EXPORT ViewArea::ViewArea (QWidget * parent, View * view)
: QWidget (parent, "kde_kmplayer_viewarea", WResizeNoErase | WRepaintNoErase),
m_parent (parent),
KDE_NO_CDTOR_EXPORT ViewArea::ViewArea (TQWidget * tqparent, View * view)
: TQWidget (tqparent, "kde_kmplayer_viewarea", WResizeNoErase | WRepaintNoErase),
m_parent (tqparent),
m_view (view),
m_collection (new KActionCollection (this)),
surface (new ViewSurface (this)),
m_mouse_invisible_timer (0),
m_repaint_timer (0),
m_tqrepaint_timer (0),
m_fullscreen_scale (100),
scale_lbl_id (-1),
scale_slider_id (-1),
m_fullscreen (false),
m_minimal (false) {
setEraseColor (QColor (0, 0, 0));
setEraseColor (TQColor (0, 0, 0));
setAcceptDrops (true);
new KAction (i18n ("Fullscreen"), KShortcut (Qt::Key_F), this, SLOT (accelActivated ()), m_collection, "view_fullscreen_toggle");
new KAction (i18n ("Fullscreen"), KShortcut (TQt::Key_F), TQT_TQOBJECT(this), TQT_SLOT (accelActivated ()), m_collection, "view_fullscreen_toggle");
setMouseTracking (true);
if (!image_data_map)
imageCacheDeleter.setObject (image_data_map, new ImageDataMap);
@ -1363,11 +1363,11 @@ KDE_NO_CDTOR_EXPORT ViewArea::~ViewArea () {
}
KDE_NO_EXPORT void ViewArea::fullScreen () {
killTimers ();
m_mouse_invisible_timer = m_repaint_timer = 0;
TQT_TQOBJECT(this)->killTimers ();
m_mouse_invisible_timer = m_tqrepaint_timer = 0;
if (m_fullscreen) {
showNormal ();
reparent (m_parent, 0, QPoint (0, 0), true);
reparent (m_parent, 0, TQPoint (0, 0), true);
static_cast <KDockWidget *> (m_parent)->setWidget (this);
for (unsigned i = 0; i < m_collection->count (); ++i)
m_collection->action (i)->setEnabled (false);
@ -1376,20 +1376,20 @@ KDE_NO_EXPORT void ViewArea::fullScreen () {
m_view->controlPanel ()->popupMenu ()->removeItem (scale_slider_id);
scale_lbl_id = scale_slider_id = -1;
}
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (QIconSet (QPixmap (playlist_xpm)));
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (TQIconSet (TQPixmap (playlist_xpm)));
} else {
m_topwindow_rect = topLevelWidget ()->geometry ();
reparent (0L, 0, qApp->desktop()->screenGeometry(this).topLeft(), true);
m_topwindow_rect = tqtopLevelWidget ()->tqgeometry ();
reparent (0L, 0, tqApp->desktop()->screenGeometry(this).topLeft(), true);
showFullScreen ();
for (unsigned i = 0; i < m_collection->count (); ++i)
m_collection->action (i)->setEnabled (true);
QPopupMenu * menu = m_view->controlPanel ()->popupMenu ();
QLabel * lbl = new QLabel (i18n ("Scale:"), menu);
TQPopupMenu * menu = m_view->controlPanel ()->popupMenu ();
TQLabel * lbl = new TQLabel (i18n ("Scale:"), menu);
scale_lbl_id = menu->insertItem (lbl, -1, 4);
QSlider * slider = new QSlider (50, 150, 10, m_fullscreen_scale, Qt::Horizontal, menu);
connect (slider, SIGNAL (valueChanged (int)), this, SLOT (scale (int)));
TQSlider * slider = new TQSlider (50, 150, 10, m_fullscreen_scale, Qt::Horizontal, menu);
connect (slider, TQT_SIGNAL (valueChanged (int)), this, TQT_SLOT (scale (int)));
scale_slider_id = menu->insertItem (slider, -1, 5);
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (QIconSet (QPixmap (normal_window_xpm)));
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (TQIconSet (TQPixmap (normal_window_xpm)));
}
m_fullscreen = !m_fullscreen;
m_view->controlPanel()->popupMenu ()->setItemChecked (ControlPanel::menu_fullscreen, m_fullscreen);
@ -1413,26 +1413,26 @@ KDE_NO_EXPORT void ViewArea::fullScreen () {
void ViewArea::minimalMode () {
m_minimal = !m_minimal;
killTimers ();
m_mouse_invisible_timer = m_repaint_timer = 0;
TQT_TQOBJECT(this)->killTimers ();
m_mouse_invisible_timer = m_tqrepaint_timer = 0;
if (m_minimal) {
m_view->setViewOnly ();
m_view->setControlPanelMode (KMPlayer::View::CP_AutoHide);
m_view->setNoInfoMessages (true);
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (QIconSet (QPixmap (normal_window_xpm)));
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (TQIconSet (TQPixmap (normal_window_xpm)));
} else {
m_view->setControlPanelMode (KMPlayer::View::CP_Show);
m_view->setNoInfoMessages (false);
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (QIconSet (QPixmap (playlist_xpm)));
m_view->controlPanel ()->button (ControlPanel::button_playlist)->setIconSet (TQIconSet (TQPixmap (playlist_xpm)));
}
m_topwindow_rect = topLevelWidget ()->geometry ();
m_topwindow_rect = tqtopLevelWidget ()->tqgeometry ();
}
KDE_NO_EXPORT void ViewArea::accelActivated () {
m_view->controlPanel()->popupMenu ()->activateItemAt (m_view->controlPanel()->popupMenu ()->indexOf (ControlPanel::menu_fullscreen));
}
KDE_NO_EXPORT void ViewArea::mousePressEvent (QMouseEvent * e) {
KDE_NO_EXPORT void ViewArea::mousePressEvent (TQMouseEvent * e) {
if (surface->node) {
MouseVisitor visitor (event_pointer_clicked, e->x(), e->y());
surface->node->accept (&visitor);
@ -1440,14 +1440,14 @@ KDE_NO_EXPORT void ViewArea::mousePressEvent (QMouseEvent * e) {
e->accept ();
}
KDE_NO_EXPORT void ViewArea::mouseDoubleClickEvent (QMouseEvent *) {
KDE_NO_EXPORT void ViewArea::mouseDoubleClickEvent (TQMouseEvent *) {
m_view->fullScreen (); // screensaver stuff
}
KDE_NO_EXPORT void ViewArea::mouseMoveEvent (QMouseEvent * e) {
KDE_NO_EXPORT void ViewArea::mouseMoveEvent (TQMouseEvent * e) {
if (e->state () == Qt::NoButton) {
int vert_buttons_pos = height () - m_view->statusBarHeight ();
int cp_height = m_view->controlPanel ()->maximumSize ().height ();
int cp_height = m_view->controlPanel ()->tqmaximumSize ().height ();
m_view->delayedShowButtons (e->y() > vert_buttons_pos-cp_height &&
e->y() < vert_buttons_pos);
}
@ -1481,22 +1481,22 @@ KDE_NO_EXPORT void ViewArea::syncVisual (const IRect & rect) {
if (surface->node)
surface->node->accept (&visitor);
#else
repaint (QRect(rect.x, rect.y, rect.w, rect.h), false);
tqrepaint (TQRect(rect.x, rect.y, rect.w, rect.h), false);
#endif
if (m_repaint_timer) {
killTimer (m_repaint_timer);
m_repaint_timer = 0;
if (m_tqrepaint_timer) {
killTimer (m_tqrepaint_timer);
m_tqrepaint_timer = 0;
}
//XFlush (qt_xdisplay ());
}
KDE_NO_EXPORT void ViewArea::paintEvent (QPaintEvent * pe) {
KDE_NO_EXPORT void ViewArea::paintEvent (TQPaintEvent * pe) {
#ifdef HAVE_CAIRO
if (surface->node)
scheduleRepaint (IRect (pe->rect ().x (), pe->rect ().y (), pe->rect ().width (), pe->rect ().height ()));
else
#endif
QWidget::paintEvent (pe);
TQWidget::paintEvent (pe);
}
KDE_NO_EXPORT void ViewArea::scale (int val) {
@ -1510,7 +1510,7 @@ KDE_NO_EXPORT void ViewArea::updateSurfaceBounds () {
h -= m_view->controlPanel ()->isVisible ()
? (m_view->controlPanelMode () == View::CP_Only
? h
: (Single) m_view->controlPanel()->maximumSize ().height ())
: (Single) m_view->controlPanel()->tqmaximumSize ().height ())
: Single (0);
surface->resize (SRect (x, y, w, h));
Mrl *mrl = surface->node ? surface->node->mrl () : NULL;
@ -1538,14 +1538,14 @@ KDE_NO_EXPORT void ViewArea::updateSurfaceBounds () {
scheduleRepaint (IRect (0, 0, width (), height ()));
}
KDE_NO_EXPORT void ViewArea::resizeEvent (QResizeEvent *) {
KDE_NO_EXPORT void ViewArea::resizeEvent (TQResizeEvent *) {
if (!m_view->controlPanel ()) return;
Single x, y, w = width (), h = height ();
Single hsb = m_view->statusBarHeight ();
Single hcp = m_view->controlPanel ()->isVisible ()
? (m_view->controlPanelMode () == View::CP_Only
? h-hsb
: (Single) m_view->controlPanel()->maximumSize ().height ())
: (Single) m_view->controlPanel()->tqmaximumSize ().height ())
: Single (0);
Single wws = w;
// move controlpanel over video when autohiding and playing
@ -1593,18 +1593,18 @@ void ViewArea::setAudioVideoGeometry (const IRect &rect, unsigned int * bg_color
h = hfw;
}
}
m_av_geometry = QRect (x, y, w, h);
QRect wrect = m_view->widgetStack ()->geometry ();
if (m_av_geometry != wrect &&
!(m_av_geometry.width() <= 0 &&
m_av_tqgeometry = TQRect (x, y, w, h);
TQRect wrect = m_view->widgetStack ()->tqgeometry ();
if (m_av_tqgeometry != wrect &&
!(m_av_tqgeometry.width() <= 0 &&
wrect.width() <= 1 && wrect.height() <= 1)) {
m_view->widgetStack ()->setGeometry (x, y, w, h);
wrect.unite (m_av_geometry);
wrect.unite (m_av_tqgeometry);
scheduleRepaint (IRect (wrect.x (), wrect.y (), wrect.width (), wrect.height ()));
}
if (bg_color)
if (QColor (QRgb (*bg_color)) != (m_view->viewer ()->paletteBackgroundColor ())) {
m_view->viewer()->setCurrentBackgroundColor (QColor (QRgb (*bg_color)));
if (TQColor (TQRgb (*bg_color)) != (m_view->viewer ()->paletteBackgroundColor ())) {
m_view->viewer()->setCurrentBackgroundColor (TQColor (TQRgb (*bg_color)));
scheduleRepaint (IRect (x, y, w, h));
}
}
@ -1625,19 +1625,19 @@ KDE_NO_EXPORT SurfacePtr ViewArea::getSurface (NodePtr node) {
return 0L;
}
KDE_NO_EXPORT void ViewArea::showEvent (QShowEvent *) {
KDE_NO_EXPORT void ViewArea::showEvent (TQShowEvent *) {
resizeEvent (0L);
}
KDE_NO_EXPORT void ViewArea::dropEvent (QDropEvent * de) {
KDE_NO_EXPORT void ViewArea::dropEvent (TQDropEvent * de) {
m_view->dropEvent (de);
}
KDE_NO_EXPORT void ViewArea::dragEnterEvent (QDragEnterEvent* dee) {
KDE_NO_EXPORT void ViewArea::dragEnterEvent (TQDragEnterEvent* dee) {
m_view->dragEnterEvent (dee);
}
KDE_NO_EXPORT void ViewArea::contextMenuEvent (QContextMenuEvent * e) {
KDE_NO_EXPORT void ViewArea::contextMenuEvent (TQContextMenuEvent * e) {
m_view->controlPanel ()->popupMenu ()->exec (e->globalPos ());
}
@ -1651,40 +1651,40 @@ KDE_NO_EXPORT void ViewArea::mouseMoved () {
}
KDE_NO_EXPORT void ViewArea::scheduleRepaint (const IRect &rect) {
if (m_repaint_timer) {
m_repaint_rect = m_repaint_rect.unite (rect);
if (m_tqrepaint_timer) {
m_tqrepaint_rect = m_tqrepaint_rect.unite (rect);
} else {
m_repaint_rect = rect;
m_repaint_timer = startTimer (10); // 100 per sec should do
m_tqrepaint_rect = rect;
m_tqrepaint_timer = startTimer (10); // 100 per sec should do
}
}
KDE_NO_EXPORT void ViewArea::timerEvent (QTimerEvent * e) {
KDE_NO_EXPORT void ViewArea::timerEvent (TQTimerEvent * e) {
if (e->timerId () == m_mouse_invisible_timer) {
killTimer (m_mouse_invisible_timer);
m_mouse_invisible_timer = 0;
if (m_fullscreen)
setCursor (BlankCursor);
} else if (e->timerId () == m_repaint_timer) {
killTimer (m_repaint_timer);
m_repaint_timer = 0;
//repaint (m_repaint_rect, false);
syncVisual (m_repaint_rect.intersect (IRect (0, 0, width (), height ())));
} else if (e->timerId () == m_tqrepaint_timer) {
killTimer (m_tqrepaint_timer);
m_tqrepaint_timer = 0;
//tqrepaint (m_tqrepaint_rect, false);
syncVisual (m_tqrepaint_rect.intersect (IRect (0, 0, width (), height ())));
} else {
kdError () << "unknown timer " << e->timerId () << " " << m_repaint_timer << endl;
kdError () << "unknown timer " << e->timerId () << " " << m_tqrepaint_timer << endl;
killTimer (e->timerId ());
}
}
KDE_NO_EXPORT void ViewArea::closeEvent (QCloseEvent * e) {
KDE_NO_EXPORT void ViewArea::closeEvent (TQCloseEvent * e) {
//kdDebug () << "closeEvent" << endl;
if (m_fullscreen) {
fullScreen ();
if (!m_parent->topLevelWidget ()->isVisible ())
m_parent->topLevelWidget ()->show ();
if (!m_parent->tqtopLevelWidget ()->isVisible ())
m_parent->tqtopLevelWidget ()->show ();
e->ignore ();
} else
QWidget::closeEvent (e);
TQWidget::closeEvent (e);
}

@ -20,7 +20,7 @@
#ifndef KMPLAYER_VIEW_AREA_H
#define KMPLAYER_VIEW_AREA_H
#include <qwidget.h>
#include <tqwidget.h>
class KActionCollection;
@ -32,51 +32,52 @@ class ViewAreaPrivate;
/*
* The area in which the video widget and controlpanel are laid out
*/
class KMPLAYER_EXPORT ViewArea : public QWidget {
class KMPLAYER_EXPORT ViewArea : public TQWidget {
Q_OBJECT
TQ_OBJECT
public:
ViewArea (QWidget * parent, View * view);
ViewArea (TQWidget * tqparent, View * view);
~ViewArea ();
KDE_NO_EXPORT bool isFullScreen () const { return m_fullscreen; }
KDE_NO_EXPORT bool isMinimalMode () const { return m_minimal; }
KDE_NO_EXPORT KActionCollection * actionCollection () const { return m_collection; }
KDE_NO_EXPORT QRect topWindowRect () const { return m_topwindow_rect; }
KDE_NO_EXPORT TQRect topWindowRect () const { return m_topwindow_rect; }
SurfacePtr getSurface (NodePtr node);
void setAudioVideoGeometry (const IRect &rect, unsigned int * bg);
void setAudioVideoNode (NodePtr n);
void mouseMoved ();
void scheduleRepaint (const IRect &rect);
void resizeEvent (QResizeEvent *);
void resizeEvent (TQResizeEvent *);
void minimalMode ();
public slots:
void fullScreen ();
void accelActivated ();
void scale (int);
protected:
void showEvent (QShowEvent *);
void mouseMoveEvent (QMouseEvent *);
void mousePressEvent (QMouseEvent *);
void mouseDoubleClickEvent (QMouseEvent *);
void dragEnterEvent (QDragEnterEvent *);
void dropEvent (QDropEvent *);
void contextMenuEvent (QContextMenuEvent * e);
void paintEvent (QPaintEvent *);
void timerEvent (QTimerEvent * e);
void closeEvent (QCloseEvent * e);
void showEvent (TQShowEvent *);
void mouseMoveEvent (TQMouseEvent *);
void mousePressEvent (TQMouseEvent *);
void mouseDoubleClickEvent (TQMouseEvent *);
void dragEnterEvent (TQDragEnterEvent *);
void dropEvent (TQDropEvent *);
void contextMenuEvent (TQContextMenuEvent * e);
void paintEvent (TQPaintEvent *);
void timerEvent (TQTimerEvent * e);
void closeEvent (TQCloseEvent * e);
private:
void syncVisual (const IRect & rect);
void updateSurfaceBounds ();
ViewAreaPrivate * d;
QWidget * m_parent;
TQWidget * m_parent;
View * m_view;
KActionCollection * m_collection;
SurfacePtr surface;
NodePtrW video_node;
QRect m_av_geometry;
IRect m_repaint_rect;
QRect m_topwindow_rect;
TQRect m_av_tqgeometry;
IRect m_tqrepaint_rect;
TQRect m_topwindow_rect;
int m_mouse_invisible_timer;
int m_repaint_timer;
int m_tqrepaint_timer;
int m_fullscreen_scale;
int scale_lbl_id;
int scale_slider_id;

@ -23,13 +23,13 @@
#include <math.h>
#include <libgen.h>
#include <dcopclient.h>
#include <qcstring.h>
#include <qtimer.h>
#include <qfile.h>
#include <qurl.h>
#include <qthread.h>
#include <qmutex.h>
#include <qdom.h>
#include <tqcstring.h>
#include <tqtimer.h>
#include <tqfile.h>
#include <tqurl.h>
#include <tqthread.h>
#include <tqmutex.h>
#include <tqdom.h>
#include "kmplayer_backend.h"
#include "kmplayer_callback_stub.h"
#include "kmplayer_callback.h"
@ -62,7 +62,7 @@ typedef struct {
static KXinePlayer * xineapp;
static KMPlayer::Callback_stub * callback;
static QMutex mutex (true);
static TQMutex mutex (true);
static xine_t *xine;
static xine_stream_t *stream;
@ -97,31 +97,31 @@ static double pixel_aspect;
static int running = 0;
static volatile int firstframe = 0;
static const int event_finished = QEvent::User;
static const int event_progress = QEvent::User + 2;
static const int event_url = QEvent::User + 3;
static const int event_size = QEvent::User + 4;
static const int event_title = QEvent::User + 5;
static const int event_video = QEvent::User + 6;
static QString mrl;
static QString sub_mrl;
static QString rec_mrl;
static QString alang, slang;
static QStringList alanglist, slanglist;
static QString elmentry ("entry");
static QString elmitem ("item");
static QString attname ("name");
static QString atttype ("type");
static QString attdefault ("DEFAULT");
static QString attvalue ("value");
static QString attstart ("START");
static QString attend ("end");
static QString valrange ("range");
static QString valnum ("num");
static QString valbool ("bool");
static QString valenum ("enum");
static QString valstring ("string");
static const int event_finished = TQEvent::User;
static const int event_progress = TQEvent::User + 2;
static const int event_url = TQEvent::User + 3;
static const int event_size = TQEvent::User + 4;
static const int event_title = TQEvent::User + 5;
static const int event_video = TQEvent::User + 6;
static TQString mrl;
static TQString sub_mrl;
static TQString rec_mrl;
static TQString alang, slang;
static TQStringList alanglist, slanglist;
static TQString elmentry ("entry");
static TQString elmitem ("item");
static TQString attname ("name");
static TQString atttype ("type");
static TQString attdefault ("DEFAULT");
static TQString attvalue ("value");
static TQString attstart ("START");
static TQString attend ("end");
static TQString valrange ("range");
static TQString valnum ("num");
static TQString valbool ("bool");
static TQString valenum ("enum");
static TQString valstring ("string");
extern "C" {
@ -146,7 +146,7 @@ static void frame_output_cb(void * /*data*/, int /*video_width*/, int /*video_he
movie_width = xine_get_stream_info(stream, XINE_STREAM_INFO_VIDEO_WIDTH);
movie_height = xine_get_stream_info(stream, XINE_STREAM_INFO_VIDEO_HEIGHT);
mutex.unlock ();
QApplication::postEvent (xineapp, new XineMovieParamEvent (movie_length, movie_width, movie_height, alanglist, slanglist, true));
TQApplication::postEvent (xineapp, new XineMovieParamEvent (movie_length, movie_width, movie_height, alanglist, slanglist, true));
}
@ -185,15 +185,15 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
if (repeat_count-- > 0)
xine_play (stream, 0, 0);
else
QApplication::postEvent (xineapp, new QEvent ((QEvent::Type) event_finished));
TQApplication::postEvent (xineapp, new TQEvent ((TQEvent::Type) event_finished));
break;
case XINE_EVENT_PROGRESS:
QApplication::postEvent (xineapp, new XineProgressEvent (((xine_progress_data_t *) event->data)->percent));
TQApplication::postEvent (xineapp, new XineProgressEvent (((xine_progress_data_t *) event->data)->percent));
break;
case XINE_EVENT_MRL_REFERENCE:
fprintf(stderr, "XINE_EVENT_MRL_REFERENCE %s\n",
((xine_mrl_reference_data_t*)event->data)->mrl);
QApplication::postEvent (xineapp, new XineURLEvent (QString::fromLocal8Bit (((xine_mrl_reference_data_t*)event->data)->mrl)));
TQApplication::postEvent (xineapp, new XineURLEvent (TQString::fromLocal8Bit (((xine_mrl_reference_data_t*)event->data)->mrl)));
break;
case XINE_EVENT_FRAME_FORMAT_CHANGE:
fprintf (stderr, "XINE_EVENT_FRAME_FORMAT_CHANGE\n");
@ -201,7 +201,7 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
case XINE_EVENT_UI_SET_TITLE:
{
xine_ui_data_t * data = (xine_ui_data_t *) event->data;
QApplication::postEvent(xineapp, new XineTitleEvent(data->str));
TQApplication::postEvent(xineapp, new XineTitleEvent(data->str));
fprintf (stderr, "Set title event %s\n", data->str);
}
break;
@ -221,7 +221,7 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
for (int i = 0; i < nr; ++i) {
if (!xine_get_audio_lang (stream, i, langstr))
continue;
QString ls = QString::fromLocal8Bit (langstr).stripWhiteSpace();
TQString ls = TQString(TQString::fromLocal8Bit (langstr)).stripWhiteSpace();
if (ls.isEmpty ())
continue;
if (!slang.isEmpty () && alang == ls)
@ -234,7 +234,7 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
for (int i = 0; i < nr; ++i) {
if (!xine_get_spu_lang (stream, i, langstr))
continue;
QString ls = QString::fromLocal8Bit (langstr).stripWhiteSpace();
TQString ls = TQString(TQString::fromLocal8Bit (langstr)).stripWhiteSpace();
if (ls.isEmpty ())
continue;
if (!slang.isEmpty () && slang == ls)
@ -247,7 +247,7 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
movie_width = w;
movie_height = h;
movie_length = l;
QApplication::postEvent (xineapp, new XineMovieParamEvent (l, w, h, alanglist, slanglist, firstframe));
TQApplication::postEvent (xineapp, new XineMovieParamEvent (l, w, h, alanglist, slanglist, firstframe));
if (running && firstframe)
firstframe = 0;
if (window_created && w > 0 && h > 0) {
@ -271,16 +271,16 @@ static void event_listener(void * /*user_data*/, const xine_event_t *event) {
using namespace KMPlayer;
Backend::Backend ()
: DCOPObject (QCString ("Backend")) {
: DCOPObject (TQCString ("Backend")) {
}
Backend::~Backend () {}
void Backend::setURL (QString url) {
void Backend::setURL (TQString url) {
mrl = url;
}
void Backend::setSubTitleURL (QString url) {
void Backend::setSubTitleURL (TQString url) {
sub_mrl = url;
}
@ -289,7 +289,7 @@ void Backend::play (int repeat_count) {
}
void Backend::stop () {
QTimer::singleShot (0, xineapp, SLOT (stop ()));
TQTimer::singleShot (0, xineapp, TQT_SLOT (stop ()));
}
void Backend::pause () {
@ -323,11 +323,11 @@ void Backend::volume (int v, bool) {
void Backend::frequency (int) {
}
void Backend::setAudioLang (int id, QString al) {
void Backend::setAudioLang (int id, TQString al) {
xineapp->setAudioLang (id, al);
}
void Backend::setSubtitle (int id, QString sl) {
void Backend::setSubtitle (int id, TQString sl) {
xineapp->setSubtitle (id, sl);
}
@ -337,10 +337,10 @@ void Backend::quit () {
if (running)
stop ();
else
QTimer::singleShot (0, qApp, SLOT (quit ()));
TQTimer::singleShot (0, tqApp, TQT_SLOT (quit ()));
}
bool updateConfigEntry (const QString & name, const QString & value) {
bool updateConfigEntry (const TQString & name, const TQString & value) {
fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ());
bool changed = false;
xine_cfg_entry_t cfg_entry;
@ -358,22 +358,22 @@ bool updateConfigEntry (const QString & name, const QString & value) {
return changed;
}
void Backend::setConfig (QByteArray data) {
QString err;
void Backend::setConfig (TQByteArray data) {
TQString err;
int line, column;
QDomDocument dom;
TQDomDocument dom;
if (dom.setContent (data, false, &err, &line, &column)) {
if (dom.childNodes().length() == 1) {
for (QDomNode node = dom.firstChild().firstChild();
for (TQDomNode node = dom.firstChild().firstChild();
!node.isNull ();
node = node.nextSibling ()) {
QDomNamedNodeMap attr = node.attributes ();
TQDomNamedNodeMap attr = node.attributes ();
updateConfigEntry (attr.namedItem (attname).nodeValue (),
attr.namedItem (attvalue).nodeValue ());
}
xine_config_save (xine, configfile);
} else
err = QString ("invalid data");
err = TQString ("invalid data");
}
if (callback)
callback->errorMessage (0, err);
@ -389,7 +389,7 @@ bool Backend::isPlaying () {
}
KXinePlayer::KXinePlayer (int _argc, char ** _argv)
: QApplication (_argc, _argv, false) {
: TQApplication (_argc, _argv, false) {
}
void KXinePlayer::init () {
@ -441,7 +441,7 @@ void KXinePlayer::init () {
options[i+1] = 0L;
xine_config_register_enum (xine, "audio.visualization", 0, (char ** ) options, 0L, 0L, 0, xine_config_cb, 0L);
if (!callback)
QTimer::singleShot (10, this, SLOT (play ()));
TQTimer::singleShot (10, this, TQT_SLOT (play ()));
}
KXinePlayer::~KXinePlayer () {
@ -456,32 +456,32 @@ KXinePlayer::~KXinePlayer () {
xineapp = 0L;
}
void getConfigEntries (QByteArray & buf) {
void getConfigEntries (TQByteArray & buf) {
xine_cfg_entry_t entry;
QDomDocument doc;
QDomElement root = doc.createElement (QString ("document"));
TQDomDocument doc;
TQDomElement root = doc.createElement (TQString ("document"));
for (int i = xine_config_get_first_entry (xine, &entry);
i;
i = xine_config_get_next_entry (xine, &entry)) {
QDomElement elm = doc.createElement (elmentry);
elm.setAttribute (attname, QString (entry.key));
TQDomElement elm = doc.createElement (elmentry);
elm.setAttribute (attname, TQString (entry.key));
if (entry.type == XINE_CONFIG_TYPE_STRING || entry.type == XINE_CONFIG_TYPE_UNKNOWN) {
elm.setAttribute (atttype, valstring);
elm.setAttribute (attvalue, QString (entry.str_value));
elm.setAttribute (attvalue, TQString (entry.str_value));
} else {
elm.setAttribute (attdefault, QString::number (entry.num_default));
elm.setAttribute (attvalue, QString::number (entry.num_value));
elm.setAttribute (attdefault, TQString::number (entry.num_default));
elm.setAttribute (attvalue, TQString::number (entry.num_value));
switch (entry.type) {
case XINE_CONFIG_TYPE_RANGE:
elm.setAttribute (atttype, valrange);
elm.setAttribute (attstart, QString::number (entry.range_min));
elm.setAttribute (attend, QString::number (entry.range_max));
elm.setAttribute (attstart, TQString::number (entry.range_min));
elm.setAttribute (attend, TQString::number (entry.range_max));
break;
case XINE_CONFIG_TYPE_ENUM:
elm.setAttribute (atttype, valenum);
for (int i = 0; entry.enum_values[i]; i++) {
QDomElement item = doc.createElement (elmitem);
item.setAttribute (attvalue, QString (entry.enum_values[i]));
TQDomElement item = doc.createElement (elmitem);
item.setAttribute (attvalue, TQString (entry.enum_values[i]));
elm.appendChild (item);
}
break;
@ -496,12 +496,12 @@ void getConfigEntries (QByteArray & buf) {
}
}
if (entry.help)
elm.appendChild (doc.createTextNode (QString::fromUtf8 (entry.help)));
elm.appendChild (doc.createTextNode (TQString::fromUtf8 (entry.help)));
root.appendChild (elm);
}
doc.appendChild (root);
QString exp = doc.toString ();
QCString cexp = exp.utf8 ();
TQString exp = doc.toString ();
TQCString cexp = exp.utf8 ();
buf.duplicate (cexp);
buf.resize (cexp.length ()); // strip terminating \0
}
@ -522,7 +522,7 @@ void KXinePlayer::play (int repeat) {
movie_height = 0;
if (mrl.startsWith ("cdda://"))
mrl = QString ("cdda:/") + mrl.mid (7);
mrl = TQString ("cdda:/") + mrl.mid (7);
stream = xine_stream_new (xine, ao_port, vo_port);
event_queue = xine_event_new_queue (stream);
xine_event_create_listener_thread (event_queue, event_listener, NULL);
@ -531,12 +531,12 @@ void KXinePlayer::play (int repeat) {
char ** mrls = xine_get_autoplay_mrls (xine, "CD", &nr);
running = 1;
for (int i = 0; i < nr; i++) {
QString m (mrls[i]);
QString title;
TQString m (mrls[i]);
TQString title;
if (xine_open (stream, mrls[i])) {
const char * t = xine_get_meta_info (stream, XINE_META_INFO_TITLE);
if (t && t[0])
title = QString::fromUtf8 (t);
title = TQString::fromUtf8 (t);
xine_close (stream);
}
if (callback)
@ -552,14 +552,14 @@ void KXinePlayer::play (int repeat) {
xine_gui_send_vo_data(stream, XINE_GUI_SEND_VIDEOWIN_VISIBLE, (void *) 1);
running = 1;
QString mrlsetup = mrl;
TQString mrlsetup = mrl;
if (!rec_mrl.isEmpty ()) {
char * rm = strdup (rec_mrl.local8Bit ());
char *bn = basename (rm);
char *dn = dirname (rm);
if (bn)
updateConfigEntry (QString ("media.capture.save_dir"), QString::fromLocal8Bit (dn));
mrlsetup += QString ("#save:") + QString::fromLocal8Bit (bn);
updateConfigEntry (TQString ("media.capture.save_dir"), TQString::fromLocal8Bit (dn));
mrlsetup += TQString ("#save:") + TQString::fromLocal8Bit (bn);
free (rm);
}
if (!xine_open (stream, (const char *) mrlsetup.local8Bit ())) {
@ -593,7 +593,7 @@ void KXinePlayer::play (int repeat) {
}
audio_vis = false;
if (xine_get_stream_info (stream, XINE_STREAM_INFO_HAS_VIDEO))
QApplication::postEvent(xineapp, new QEvent((QEvent::Type)event_video));
TQApplication::postEvent(xineapp, new TQEvent((TQEvent::Type)event_video));
else
audio_vis = xine_config_lookup_entry
(xine, "audio.visualization", &audio_vis_cfg_entry);
@ -613,11 +613,11 @@ void KXinePlayer::stop () {
xine_stop (sub_stream);
xine_stop (stream);
mutex.unlock ();
QTimer::singleShot (10, this, SLOT (postFinished ()));
TQTimer::singleShot (10, this, TQT_SLOT (postFinished ()));
}
void KXinePlayer::postFinished () {
QApplication::postEvent (xineapp, new QEvent ((QEvent::Type) event_finished));
TQApplication::postEvent (xineapp, new TQEvent ((TQEvent::Type) event_finished));
}
void KXinePlayer::pause () {
@ -633,10 +633,10 @@ void KXinePlayer::pause () {
}
void KXinePlayer::finished () {
QTimer::singleShot (10, this, SLOT (stop ()));
TQTimer::singleShot (10, this, TQT_SLOT (stop ()));
}
void KXinePlayer::setAudioLang (int id, const QString & al) {
void KXinePlayer::setAudioLang (int id, const TQString & al) {
alang = al;
mutex.lock ();
if (xine_get_status (stream) == XINE_STATUS_PLAY)
@ -644,7 +644,7 @@ void KXinePlayer::setAudioLang (int id, const QString & al) {
mutex.unlock ();
}
void KXinePlayer::setSubtitle (int id, const QString & sl) {
void KXinePlayer::setSubtitle (int id, const TQString & sl) {
slang = sl;
mutex.lock ();
if (xine_get_status (stream) == XINE_STATUS_PLAY)
@ -662,7 +662,7 @@ void KXinePlayer::updatePosition () {
movie_pos = pos;
callback->moviePosition (pos/100);
}
QTimer::singleShot (500, this, SLOT (updatePosition ()));
TQTimer::singleShot (500, this, TQT_SLOT (updatePosition ()));
}
void KXinePlayer::saturation (int val) {
@ -721,7 +721,7 @@ void KXinePlayer::seek (int val) {
}
}
bool KXinePlayer::event (QEvent * e) {
bool KXinePlayer::event (TQEvent * e) {
switch (e->type()) {
case event_finished: {
fprintf (stderr, "event_finished\n");
@ -748,7 +748,7 @@ bool KXinePlayer::event (QEvent * e) {
if (callback)
callback->finished ();
else
QTimer::singleShot (0, this, SLOT (quit ()));
TQTimer::singleShot (0, this, TQT_SLOT (quit ()));
break;
}
case event_size: {
@ -758,7 +758,7 @@ bool KXinePlayer::event (QEvent * e) {
callback->movieParams (se->length/100, se->width, se->height, se->height ? 1.0*se->width/se->height : 1.0, se->alang, se->slang);
if (se->first_frame) {
callback->playing ();
QTimer::singleShot (500, this, SLOT (updatePosition ()));
TQTimer::singleShot (500, this, TQT_SLOT (updatePosition ()));
}
}
break;
@ -772,7 +772,7 @@ bool KXinePlayer::event (QEvent * e) {
case event_url: {
XineURLEvent * ue = static_cast <XineURLEvent *> (e);
if (callback)
callback->subMrl (ue->url, QString ());
callback->subMrl (ue->url, TQString ());
break;
}
case event_title: {
@ -783,7 +783,7 @@ bool KXinePlayer::event (QEvent * e) {
}
case event_video:
if (callback)
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, QString ());
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, TQString ());
break;
default:
return false;
@ -791,33 +791,33 @@ bool KXinePlayer::event (QEvent * e) {
return true;
}
void KXinePlayer::saveState (QSessionManager & sm) {
void KXinePlayer::saveState (TQSessionManager & sm) {
if (callback)
sm.setRestartHint (QSessionManager::RestartNever);
sm.setRestartHint (TQSessionManager::RestartNever);
}
XineMovieParamEvent::XineMovieParamEvent(int l, int w, int h, const QStringList & a, const QStringList & s, bool ff)
: QEvent ((QEvent::Type) event_size),
XineMovieParamEvent::XineMovieParamEvent(int l, int w, int h, const TQStringList & a, const TQStringList & s, bool ff)
: TQEvent ((TQEvent::Type) event_size),
length (l), width (w), height (h), alang (a), slang (s) , first_frame (ff)
{}
XineURLEvent::XineURLEvent (const QString & u)
: QEvent ((QEvent::Type) event_url), url (u)
XineURLEvent::XineURLEvent (const TQString & u)
: TQEvent ((TQEvent::Type) event_url), url (u)
{}
XineTitleEvent::XineTitleEvent (const char * t)
: QEvent ((QEvent::Type) event_title), title (QString::fromUtf8 (t))
: TQEvent ((TQEvent::Type) event_title), title (TQString::fromUtf8 (t))
{
QUrl::decode (title);
TQUrl::decode (title);
}
XineProgressEvent::XineProgressEvent (const int p)
: QEvent ((QEvent::Type) event_progress), progress (p)
: TQEvent ((TQEvent::Type) event_progress), progress (p)
{}
//static bool translateCoordinates (int wx, int wy, int mx, int my) {
// movie_width
class XEventThread : public QThread {
class XEventThread : public TQThread {
protected:
void run () {
Time prev_click_time = 0;
@ -1056,8 +1056,8 @@ int main(int argc, char **argv) {
snprintf(configfile, sizeof (configfile), "%s%s", xine_get_homedir(), "/.xine/config2");
xineapp = new KXinePlayer (argc, argv);
window_created = true;
QString vo_driver ("auto");
QString ao_driver ("auto");
TQString vo_driver ("auto");
TQString ao_driver ("auto");
for (int i = 1; i < argc; i++) {
if (!strcmp (argv [i], "-vo") && ++i < argc) {
vo_driver = argv [i];
@ -1079,9 +1079,9 @@ int main(int argc, char **argv) {
} else if (!strcmp (argv [i], "-window")) {
;
} else if (!strcmp (argv [i], "-sub") && ++i < argc) {
sub_mrl = QString (argv [i]);
sub_mrl = TQString (argv [i]);
} else if (!strcmp (argv [i], "-lang") && ++i < argc) {
slang = alang = QString (argv [i]);
slang = alang = TQString (argv [i]);
} else if (!strcmp (argv [i], "-v")) {
xine_verbose = true;
} else if (!strcmp (argv [i], "-vv")) {
@ -1092,15 +1092,15 @@ int main(int argc, char **argv) {
strncpy (configfile, argv [i], sizeof (configfile));
configfile[sizeof (configfile) - 1] = 0;
} else if (!strcmp (argv [i], "-cb") && ++i < argc) {
QString str = argv [i];
int pos = str.find ('/');
TQString str = argv [i];
int pos = str.tqfind ('/');
if (pos > -1) {
fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ());
callback = new KMPlayer::Callback_stub
(str.left (pos).ascii (), str.mid (pos + 1).ascii ());
}
} else if (!strcmp (argv [i], "-rec") && i < argc - 1) {
rec_mrl = QString::fromLocal8Bit (argv [++i]);
rec_mrl = TQString::fromLocal8Bit (argv [++i]);
} else if (!strcmp (argv [i], "-loop") && i < argc - 1) {
repeat_count = atol (argv [++i]);
} else {
@ -1108,10 +1108,10 @@ int main(int argc, char **argv) {
delete xineapp;
return 1;
}
mrl = QString::fromLocal8Bit (argv [i]);
mrl = TQString::fromLocal8Bit (argv [i]);
}
}
bool config_changed = !QFile (configfile).exists ();
bool config_changed = !TQFile (configfile).exists ();
if (!callback && mrl.isEmpty ()) {
fprintf (stderr, "usage: %s [-vo (xv|xshm)] [-ao (arts|esd|..)] "
@ -1141,16 +1141,16 @@ int main(int argc, char **argv) {
xineapp->init ();
if (dvd_device)
config_changed |= updateConfigEntry (QString ("input.dvd_device"), QString (dvd_device));
config_changed |= updateConfigEntry (TQString ("input.dvd_device"), TQString (dvd_device));
if (vcd_device)
config_changed |= updateConfigEntry (QString ("input.vcd_device"), QString (vcd_device));
config_changed |= updateConfigEntry (TQString ("input.vcd_device"), TQString (vcd_device));
if (grab_device)
config_changed |= updateConfigEntry (QString ("media.video4linux.video_device"), QString (grab_device));
config_changed |= updateConfigEntry (TQString ("media.video4linux.video_device"), TQString (grab_device));
if (config_changed)
xine_config_save (xine, configfile);
QStringList vos = QStringList::split (',', vo_driver);
TQStringList vos = TQStringList::split (',', vo_driver);
for (int i = 0; i < vos.size (); i++) {
if (vos[i] == "x11")
vos[i] = "xshm";
@ -1164,7 +1164,7 @@ int main(int argc, char **argv) {
}
if (!vo_port)
fprintf (stderr, "no video driver found\n");
QStringList aos = QStringList::split (',', ao_driver);
TQStringList aos = TQStringList::split (',', ao_driver);
for (int i = 0; i < aos.size (); i++) {
fprintf (stderr, "trying audio driver %s ..\n", aos[i].ascii ());
ao_port = xine_open_audio_driver (xine, aos[i].ascii (), NULL);
@ -1175,7 +1175,7 @@ int main(int argc, char **argv) {
fprintf (stderr, "audio driver initialisation failed\n");
stream = xine_stream_new (xine, ao_port, vo_port);
QByteArray buf;
TQByteArray buf;
if (wants_config) {
/* TODO? Opening the output drivers in front, will add more config
settings. Unfortunately, that also adds a second in startup..
@ -1196,7 +1196,7 @@ int main(int argc, char **argv) {
if (callback)
callback->started (dcopclient.appId (), buf);
else
;//printf ("%s\n", QString (buf).ascii ());
;//printf ("%s\n", TQString (buf).ascii ());
xineapp->exec ();
if (sub_stream)

@ -19,38 +19,39 @@
#ifndef _KXINEPLAYER_H_
#define _KXINEPLAYER_H_
#include <qapplication.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qsessionmanager.h>
#include <tqapplication.h>
#include <tqstring.h>
#include <tqstringlist.h>
#include <tqsessionmanager.h>
struct XineMovieParamEvent : public QEvent {
XineMovieParamEvent (int l, int w, int h, const QStringList & al, const QStringList & sl, bool ff=false);
struct XineMovieParamEvent : public TQEvent {
XineMovieParamEvent (int l, int w, int h, const TQStringList & al, const TQStringList & sl, bool ff=false);
int length;
int width;
int height;
QStringList alang;
QStringList slang;
TQStringList alang;
TQStringList slang;
bool first_frame;
};
struct XineURLEvent : public QEvent {
XineURLEvent (const QString & u);
QString url;
struct XineURLEvent : public TQEvent {
XineURLEvent (const TQString & u);
TQString url;
};
struct XineTitleEvent : public QEvent {
struct XineTitleEvent : public TQEvent {
XineTitleEvent (const char *);
QString title;
TQString title;
};
struct XineProgressEvent : public QEvent {
struct XineProgressEvent : public TQEvent {
XineProgressEvent (int p);
int progress;
};
class KXinePlayer : public QApplication {
class KXinePlayer : public TQApplication {
Q_OBJECT
TQ_OBJECT
public:
KXinePlayer (int argc, char ** argv);
~KXinePlayer ();
@ -63,9 +64,9 @@ public:
void brightness (int val);
void volume (int val);
void seek (int val);
bool event (QEvent * e);
void setAudioLang (int, const QString &);
void setSubtitle (int, const QString &);
bool event (TQEvent * e);
void setAudioLang (int, const TQString &);
void setSubtitle (int, const TQString &);
public slots:
void play (int repeat_count);
void stop ();
@ -73,7 +74,7 @@ public slots:
void updatePosition ();
void postFinished ();
protected:
void saveState (QSessionManager & sm);
void saveState (TQSessionManager & sm);
};
#endif //_KXINEPLAYER_H_

@ -22,13 +22,13 @@
#include <math.h>
#include <config.h>
#include <dcopclient.h>
#include <qcstring.h>
#include <qtimer.h>
#include <qfile.h>
#include <qurl.h>
#include <qthread.h>
#include <qmutex.h>
#include <qdom.h>
#include <tqcstring.h>
#include <tqtimer.h>
#include <tqfile.h>
#include <tqurl.h>
#include <tqthread.h>
#include <tqmutex.h>
#include <tqdom.h>
#include "kmplayer_backend.h"
#include "kmplayer_callback_stub.h"
#include "kmplayer_callback.h"
@ -60,7 +60,7 @@ static bool reset_xv_autopaint_colorkey;
static bool reset_xv_mute;
static int xvport;
static int xv_encoding = -1;
static QString xv_norm;
static TQString xv_norm;
static int xv_frequency;
static int screen;
static int movie_width;
@ -84,21 +84,21 @@ enum {
limit_last
};
static struct Limit { int min; int max; } xv_limits [limit_last];
static QString elmentry ("entry");
static QString elmitem ("item");
static QString attname ("name");
static QString atttype ("type");
static QString attdefault ("DEFAULT");
static QString attvalue ("value");
//static QString attstart ("START");
//static QString attend ("END");
//static QString valrange ("range");
//static QString valnum ("num");
//static QString valbool ("bool");
//static QString valenum ("enum");
//static QString valstring ("string");
static QString valtree ("tree");
static QByteArray config_buf;
static TQString elmentry ("entry");
static TQString elmitem ("item");
static TQString attname ("name");
static TQString atttype ("type");
static TQString attdefault ("DEFAULT");
static TQString attvalue ("value");
//static TQString attstart ("START");
//static TQString attend ("END");
//static TQString valrange ("range");
//static TQString valnum ("num");
//static TQString valbool ("bool");
//static TQString valenum ("enum");
//static TQString valstring ("string");
static TQString valtree ("tree");
static TQByteArray config_buf;
extern "C" {
@ -113,15 +113,15 @@ static void putVideo () {
using namespace KMPlayer;
Backend::Backend ()
: DCOPObject (QCString ("Backend")) {
: DCOPObject (TQCString ("Backend")) {
}
Backend::~Backend () {}
void Backend::setURL (QString) {
void Backend::setURL (TQString) {
}
void Backend::setSubTitleURL (QString) {
void Backend::setSubTitleURL (TQString) {
}
void Backend::play (int) {
@ -129,7 +129,7 @@ void Backend::play (int) {
}
void Backend::stop () {
QTimer::singleShot (0, xvapp, SLOT (stop ()));
TQTimer::singleShot (0, xvapp, TQT_SLOT (stop ()));
}
void Backend::pause () {
@ -167,10 +167,10 @@ void Backend::frequency (int f) {
xvapp->frequency (f);
}
void Backend::setAudioLang (int, QString) {
void Backend::setAudioLang (int, TQString) {
}
void Backend::setSubtitle (int, QString) {
void Backend::setSubtitle (int, TQString) {
}
void Backend::quit () {
@ -179,29 +179,29 @@ void Backend::quit () {
if (running)
stop ();
else
QTimer::singleShot (0, qApp, SLOT (quit ()));
TQTimer::singleShot (0, tqApp, TQT_SLOT (quit ()));
}
bool updateConfigEntry (const QString & name, const QString & value) {
bool updateConfigEntry (const TQString & name, const TQString & value) {
fprintf (stderr, "%s=%s\n", name.ascii (), (const char *) value.local8Bit ());
return true;
}
void Backend::setConfig (QByteArray data) {
QString err;
void Backend::setConfig (TQByteArray data) {
TQString err;
int line, column;
QDomDocument dom;
TQDomDocument dom;
if (dom.setContent (data, false, &err, &line, &column)) {
if (dom.childNodes().length() == 1) {
for (QDomNode node = dom.firstChild().firstChild();
for (TQDomNode node = dom.firstChild().firstChild();
!node.isNull ();
node = node.nextSibling ()) {
QDomNamedNodeMap attr = node.attributes ();
TQDomNamedNodeMap attr = node.attributes ();
updateConfigEntry (attr.namedItem (attname).nodeValue (),
attr.namedItem (attvalue).nodeValue ());
}
} else
err = QString ("invalid data");
err = TQString ("invalid data");
}
if (callback)
callback->errorMessage (0, err);
@ -212,7 +212,7 @@ bool Backend::isPlaying () {
}
KXVideoPlayer::KXVideoPlayer (int _argc, char ** _argv)
: QApplication (_argc, _argv, false), mute_timer (0) {
: TQApplication (_argc, _argv, false), mute_timer (0) {
}
void KXVideoPlayer::init () {
@ -226,17 +226,17 @@ void KXVideoPlayer::init () {
wid = XCreateSimpleWindow(display, XDefaultRootWindow(display),
xpos, ypos, width, height, 1, 0, 0);
if (!callback)
QTimer::singleShot (10, this, SLOT (play ()));
TQTimer::singleShot (10, this, TQT_SLOT (play ()));
XSelectInput (display, wid,
(PointerMotionMask | ExposureMask | KeyPressMask | ButtonPressMask | StructureNotifyMask)); // | SubstructureNotifyMask));
XvAdaptorInfo * ai;
unsigned int adaptors;
xv_success = true;
QDomDocument doc;
QDomElement root = doc.createElement (QString ("document"));
TQDomDocument doc;
TQDomElement root = doc.createElement (TQString ("document"));
if (XvQueryAdaptors (display, XDefaultRootWindow (display), &adaptors, &ai) == Success) {
QDomElement elm = doc.createElement (elmentry);
elm.setAttribute (attname, QString ("XVideo"));
TQDomElement elm = doc.createElement (elmentry);
elm.setAttribute (attname, TQString ("XVideo"));
elm.setAttribute (atttype, valtree);
for (unsigned i = 0; i < adaptors; i++) {
if ((ai[i].type & XvInputMask) &&
@ -270,21 +270,21 @@ void KXVideoPlayer::init () {
unsigned nr_encode;
XvQueryEncodings (display, port, &nr_encode, &encodings);
if (encodings) {
QDomElement port_item = doc.createElement (QString("Port"));
port_item.setAttribute (attvalue, QString::number (port));
TQDomElement port_item = doc.createElement (TQString("Port"));
port_item.setAttribute (attvalue, TQString::number (port));
if (freq_found)
port_item.setAttribute (QString("FREQ"), QString("1"));
port_item.setAttribute (TQString("FREQ"), TQString("1"));
for (unsigned i = 0; i < nr_encode; i++) {
if (strcmp (encodings[i].name, "XV_IMAGE")) {
if (xvport == port && xv_encoding < 0 && !xv_norm.isEmpty () && QString (encodings[i].name).lower ().startsWith(xv_norm.lower ()))
if (xvport == port && xv_encoding < 0 && !xv_norm.isEmpty () && TQString (encodings[i].name).lower ().startsWith(xv_norm.lower ()))
xv_encoding = encodings[i].encoding_id;
if (port == xvport && encodings[i].encoding_id == xv_encoding) {
movie_width = encodings[i].width;
movie_height = encodings[i].height;
}
QDomElement item = doc.createElement (QString ("Input"));
item.setAttribute (attvalue, QString::number (encodings[i].encoding_id));
item.setAttribute (attname, QString (encodings[i].name));
TQDomElement item = doc.createElement (TQString ("Input"));
item.setAttribute (attvalue, TQString::number (encodings[i].encoding_id));
item.setAttribute (attname, TQString (encodings[i].name));
port_item.appendChild (item);
fprintf (stderr, " encoding: %d %s\n", ( int ) encodings[i].encoding_id, encodings[i].name);
}
@ -298,7 +298,7 @@ void KXVideoPlayer::init () {
XvFreeAdaptorInfo(ai);
}
doc.appendChild (root);
QCString exp = doc.toCString ();
TQCString exp = doc.toCString ();
config_buf = exp;
//fprintf (stderr, "%s\n", (const char *)exp);
config_buf.resize (exp.length ()); // strip terminating \0
@ -332,11 +332,11 @@ KXVideoPlayer::~KXVideoPlayer () {
xvapp = 0L;
}
void getConfigEntries (QByteArray & buf) {
QDomDocument doc;
QDomElement root = doc.createElement (QString ("document"));
void getConfigEntries (TQByteArray & buf) {
TQDomDocument doc;
TQDomElement root = doc.createElement (TQString ("document"));
doc.appendChild (root);
QCString exp = doc.toCString ();
TQCString exp = doc.toCString ();
buf = exp;
buf.resize (exp.length ()); // strip terminating \0
}
@ -346,7 +346,7 @@ void KXVideoPlayer::play () {
if (!xv_success)
return;
if (callback && movie_width > 0 && movie_height > 0)
callback->movieParams (0, movie_width, movie_height, 1.0*movie_width/movie_height, QStringList (), QStringList ());
callback->movieParams (0, movie_width, movie_height, 1.0*movie_width/movie_height, TQStringList (), TQStringList ());
XLockDisplay (display);
if (!running && XvGrabPort (display, xvport, CurrentTime) == Success) {
gc = XCreateGC (display, wid, 0, NULL);
@ -404,7 +404,7 @@ void KXVideoPlayer::play () {
putVideo ();
if (callback) {
callback->playing ();
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, QString ());
callback->statusMessage ((int) KMPlayer::Callback::stat_hasvideo, TQString ());
}
}
XUnlockDisplay (display);
@ -435,11 +435,11 @@ void KXVideoPlayer::stop () {
if (callback)
callback->finished ();
else
QTimer::singleShot (0, qApp, SLOT (quit ()));
TQTimer::singleShot (0, tqApp, TQT_SLOT (quit ()));
}
void KXVideoPlayer::finished () {
QTimer::singleShot (10, this, SLOT (stop ()));
TQTimer::singleShot (10, this, TQT_SLOT (stop ()));
}
void KXVideoPlayer::saturation (int val) {
@ -502,12 +502,12 @@ void KXVideoPlayer::frequency (int val) {
}
}
void KXVideoPlayer::saveState (QSessionManager & sm) {
void KXVideoPlayer::saveState (TQSessionManager & sm) {
if (callback)
sm.setRestartHint (QSessionManager::RestartNever);
sm.setRestartHint (TQSessionManager::RestartNever);
}
void KXVideoPlayer::timerEvent (QTimerEvent * e) {
void KXVideoPlayer::timerEvent (TQTimerEvent * e) {
if (e->timerId () == mute_timer) {
int step = (current_volume - xv_limits[limit_volume].min) / 20;
if (step > 0 && tmp_volume == xv_limits[limit_volume].min) {
@ -528,7 +528,7 @@ void KXVideoPlayer::timerEvent (QTimerEvent * e) {
killTimer (e->timerId ());
}
class XEventThread : public QThread {
class XEventThread : public TQThread {
protected:
void run () {
Time prev_click_time = 0;
@ -647,8 +647,8 @@ int main(int argc, char **argv) {
strncpy (configfile, argv [++i], sizeof (configfile));
configfile[sizeof (configfile) - 1] = 0;
} else if (!strcmp (argv [i], "-cb")) {
QString str = argv [++i];
int pos = str.find ('/');
TQString str = argv [++i];
int pos = str.tqfind ('/');
if (pos > -1) {
fprintf (stderr, "callback is %s %s\n", str.left (pos).ascii (), str.mid (pos + 1).ascii ());
callback = new KMPlayer::Callback_stub

@ -20,12 +20,13 @@
#ifndef _K_XV_PLAYER_H_
#define _K_XV_PLAYER_H_
#include <qapplication.h>
#include <qstring.h>
#include <qsessionmanager.h>
#include <tqapplication.h>
#include <tqstring.h>
#include <tqsessionmanager.h>
class KXVideoPlayer : public QApplication {
class KXVideoPlayer : public TQApplication {
Q_OBJECT
TQ_OBJECT
public:
KXVideoPlayer (int argc, char ** argv);
~KXVideoPlayer ();
@ -39,7 +40,7 @@ public:
void volume (int val);
void frequency (int val);
//void seek (int val);
//bool event (QEvent * e);
//bool event (TQEvent * e);
public slots:
void play ();
void stop ();
@ -47,8 +48,8 @@ public slots:
//void updatePosition ();
//void postFinished ();
protected:
void saveState (QSessionManager & sm);
void timerEvent (QTimerEvent *);
void saveState (TQSessionManager & sm);
void timerEvent (TQTimerEvent *);
private:
int mute_timer;
};

Loading…
Cancel
Save