summaryrefslogtreecommitdiffstats
path: root/src/app/xineEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/xineEngine.cpp')
-rw-r--r--src/app/xineEngine.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/app/xineEngine.cpp b/src/app/xineEngine.cpp
index efc9612..ba3c76b 100644
--- a/src/app/xineEngine.cpp
+++ b/src/app/xineEngine.cpp
@@ -10,9 +10,9 @@
#include <limits>
#include <klocale.h>
#include "mxcl.library.h"
-#include <qapplication.h> //::sendEvent()
-#include <qdatetime.h> //record()
-#include <qdir.h> //::exists()
+#include <ntqapplication.h> //::sendEvent()
+#include <ntqdatetime.h> //record()
+#include <ntqdir.h> //::exists()
#include "slider.h"
#include "theStream.h"
#include <xine.h>
@@ -33,8 +33,8 @@ namespace Codeine {
VideoWindow *VideoWindow::s_instance = 0;
-VideoWindow::VideoWindow( QWidget *parent )
- : QWidget( parent, "VideoWindow" )
+VideoWindow::VideoWindow( TQWidget *parent )
+ : TQWidget( parent, "VideoWindow" )
, m_osd( 0 )
, m_stream( 0 )
, m_eventQueue( 0 )
@@ -48,11 +48,11 @@ VideoWindow::VideoWindow( QWidget *parent )
s_instance = this;
- setWFlags( Qt::WNoAutoErase );
+ setWFlags( TQt::WNoAutoErase );
setMouseTracking( true );
setAcceptDrops( true );
- setUpdatesEnabled( false ); //to stop Qt drawing over us
- setPaletteBackgroundColor( Qt::black );
+ setUpdatesEnabled( false ); //to stop TQt drawing over us
+ setPaletteBackgroundColor( TQt::black );
setFocusPolicy( ClickFocus );
//TODO sucks
@@ -116,7 +116,7 @@ VideoWindow::init()
#endif
debug() << "xine_config_load()\n";
- xine_config_load( m_xine, QFile::encodeName( QDir::homeDirPath() + "/.xine/config" ) );
+ xine_config_load( m_xine, TQFile::encodeName( TQDir::homeDirPath() + "/.xine/config" ) );
debug() << "xine_init()\n";
xine_init( m_xine );
@@ -160,7 +160,7 @@ VideoWindow::init()
{
- typedef QValueList<int> List;
+ typedef TQValueList<int> List;
List params( List()
<< XINE_PARAM_VO_HUE << XINE_PARAM_VO_SATURATION << XINE_PARAM_VO_CONTRAST << XINE_PARAM_VO_BRIGHTNESS
<< XINE_PARAM_SPU_CHANNEL << XINE_PARAM_AUDIO_CHANNEL_LOGICAL << XINE_PARAM_VO_ASPECT_RATIO );
@@ -193,7 +193,7 @@ VideoWindow::eject()
#define writeParameter( param, default ) { \
const int value = xine_get_param( m_stream, param ); \
- const QString key = QString::number( param ); \
+ const TQString key = TQString::number( param ); \
if( value != default ) \
profile->writeEntry( key, value ); \
else \
@@ -216,8 +216,8 @@ VideoWindow::eject()
else
profile->deleteEntry( "Position" );
- const QSize s = videoWindow()->size();
- const QSize defaultSize = TheStream::defaultVideoSize();
+ const TQSize s = videoWindow()->size();
+ const TQSize defaultSize = TheStream::defaultVideoSize();
if( s.width() == defaultSize.width() || s.height() == defaultSize.height() )
profile->deleteEntry( "Preferred Size" );
else
@@ -246,7 +246,7 @@ VideoWindow::load( const KURL &url )
if( xine_open( m_stream, url.url().local8Bit() ) )
{
KConfig *profile = TheStream::profile();
- #define setParameter( param, default ) xine_set_param( m_stream, param, profile->readNumEntry( QString::number( param ), default ) );
+ #define setParameter( param, default ) xine_set_param( m_stream, param, profile->readNumEntry( TQString::number( param ), default ) );
setParameter( XINE_PARAM_VO_HUE, 32768 );
setParameter( XINE_PARAM_VO_SATURATION, 32772 );
setParameter( XINE_PARAM_VO_CONTRAST, 32772 );
@@ -327,20 +327,20 @@ VideoWindow::record()
if( xine_config_lookup_entry( m_xine, "misc.save_dir", &config ) )
{
//TODO which fricking KDE function tells me this? Who can tell, stupid KDE API
- QDir d( QDir::home().filePath( "Desktop" ) );
- config.str_value = qstrdup( d.exists() //FIXME tiny-mem-leak, *shrug*
+ TQDir d( TQDir::home().filePath( "Desktop" ) );
+ config.str_value = tqstrdup( d.exists() //FIXME tiny-mem-leak, *shrug*
? d.path().utf8()
- : QDir::homeDirPath().utf8() );
+ : TQDir::homeDirPath().utf8() );
xine_config_update_entry( m_xine, &config );
- const QString fileName = m_url.filename();
+ const TQString fileName = m_url.filename();
- QString
+ TQString
url = m_url.url();
url += "#save:";
url += m_url.host();
url += " [";
- url += QDate::currentDate().toString();
+ url += TQDate::currentDate().toString();
url += ']';
url += fileName.mid( fileName.findRev( '.' ) + 1 ).lower();
@@ -390,7 +390,7 @@ VideoWindow::pause()
void
VideoWindow::showErrorMessage()
{
- const QString name = m_url.fileName();
+ const TQString name = m_url.fileName();
debug() << "xine_get_error()\n";
switch( xine_get_error( m_stream ) )
@@ -501,14 +501,14 @@ VideoWindow::seek( uint pos )
//better feedback
//NOTE doesn't work! I can't tell why..
- Slider::instance()->QSlider::setValue( pos );
+ Slider::instance()->TQSlider::setValue( pos );
Slider::instance()->repaint( false );
const bool fullscreen = toggleAction("fullscreen")->isChecked();
if( fullscreen ) {
//TODO don't use OSD (sucks) show slider widget instead
- QString osd = "[";
- QChar separator = '|';
+ TQString osd = "[";
+ TQChar separator = '|';
for( uint x = 0, y = int(pos / (65535.0/20.0)); x < 20; x++ ) {
if( x > y )
@@ -536,7 +536,7 @@ VideoWindow::seek( uint pos )
void
VideoWindow::setStreamParameter( int value )
{
- QCString sender = this->sender()->name();
+ TQCString sender = this->sender()->name();
int parameter;
if( sender == "hue" )
@@ -624,7 +624,7 @@ VideoWindow::scope()
}
void
-VideoWindow::timerEvent( QTimerEvent* )
+VideoWindow::timerEvent( TQTimerEvent* )
{
/// here we prune the buffer list regularly
#ifndef XINE_SAFE_MODE
@@ -654,7 +654,7 @@ VideoWindow::timerEvent( QTimerEvent* )
}
void
-VideoWindow::customEvent( QCustomEvent *e )
+VideoWindow::customEvent( TQCustomEvent *e )
{
switch( e->type() - 2000 ) {
case XINE_EVENT_UI_PLAYBACK_FINISHED:
@@ -671,7 +671,7 @@ VideoWindow::customEvent( QCustomEvent *e )
char s[128]; //apparently sufficient
{
- QStringList languages( "subtitle_channels_menu" );
+ TQStringList languages( "subtitle_channels_menu" );
int channels = xine_get_stream_info( m_stream, XINE_STREAM_INFO_MAX_SPU_CHANNEL );
for( int j = 0; j < channels; j++ )
languages += xine_get_spu_lang( m_stream, j, s ) ? s : i18n("Channel %1").arg( j+1 );
@@ -679,7 +679,7 @@ VideoWindow::customEvent( QCustomEvent *e )
}
{
- QStringList languages( "audio_channels_menu" );
+ TQStringList languages( "audio_channels_menu" );
int channels = xine_get_stream_info( m_stream, XINE_STREAM_INFO_MAX_AUDIO_CHANNEL );
for( int j = 0; j < channels; j++ )
languages += xine_get_audio_lang( m_stream, j, s ) ? s : i18n("Channel %1").arg( j+1 );
@@ -689,7 +689,7 @@ VideoWindow::customEvent( QCustomEvent *e )
}
case 1000:
- #define message static_cast<QString*>(e->data())
+ #define message static_cast<TQString*>(e->data())
emit statusMessage( *message );
delete message;
break;
@@ -723,8 +723,8 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
case XINE_EVENT_MRL_REFERENCE: {
//FIXME this is not the right way, it will have bugs
debug() << "XINE_EVENT_MRL_REFERENCE\n";
- engine->m_url = QString::fromUtf8( ((xine_mrl_reference_data_t*)xineEvent->data)->mrl );
- QTimer::singleShot( 0, engine, SLOT(play()) );
+ engine->m_url = TQString::fromUtf8( ((xine_mrl_reference_data_t*)xineEvent->data)->mrl );
+ TQTimer::singleShot( 0, engine, SLOT(play()) );
break;
}
case XINE_EVENT_DROPPED_FRAMES: debug() << "XINE_EVENT_DROPPED_FRAMES\n"; break;
@@ -733,29 +733,29 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
case XINE_EVENT_FRAME_FORMAT_CHANGE:
case XINE_EVENT_UI_CHANNELS_CHANGED:
{
- QCustomEvent *ce;
- ce = new QCustomEvent( 2000 + xineEvent->type );
+ TQCustomEvent *ce;
+ ce = new TQCustomEvent( 2000 + xineEvent->type );
ce->setData( const_cast<xine_event_t*>(xineEvent) );
- QApplication::postEvent( engine, ce );
+ TQApplication::postEvent( engine, ce );
break;
}
case XINE_EVENT_UI_SET_TITLE:
- QApplication::postEvent( engine, new QCustomEvent(
- QEvent::Type(3002),
- new QString( QString::fromUtf8( static_cast<xine_ui_data_t*>(xineEvent->data)->str ) ) ) );
+ TQApplication::postEvent( engine, new TQCustomEvent(
+ TQEvent::Type(3002),
+ new TQString( TQString::fromUtf8( static_cast<xine_ui_data_t*>(xineEvent->data)->str ) ) ) );
break;
case XINE_EVENT_PROGRESS:
{
xine_progress_data_t* pd = (xine_progress_data_t*)xineEvent->data;
- QString
+ TQString
msg = "%1 %2%";
- msg = msg.arg( QString::fromUtf8( pd->description ) )
+ msg = msg.arg( TQString::fromUtf8( pd->description ) )
.arg( KGlobal::locale()->formatNumber( pd->percent, 0 ) );
- QApplication::postEvent( engine, new QCustomEvent( QEvent::Type(3000), new QString( msg ) ) );
+ TQApplication::postEvent( engine, new TQCustomEvent( TQEvent::Type(3000), new TQString( msg ) ) );
break;
}
case XINE_EVENT_UI_MESSAGE:
@@ -763,7 +763,7 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
debug() << "message received from xine\n";
xine_ui_message_data_t *data = (xine_ui_message_data_t *)xineEvent->data;
- QString message;
+ TQString message;
switch( data->type ) {
case XINE_MSG_NO_ERROR:
@@ -808,7 +808,7 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
if(data->explanation)
{
message += "<b>";
- message += QString::fromUtf8( (char*) data + data->explanation );
+ message += TQString::fromUtf8( (char*) data + data->explanation );
message += "</b>";
}
else break; //if no explanation then why bother!
@@ -823,12 +823,12 @@ VideoWindow::xineEventListener( void *p, const xine_event_t* xineEvent )
if(data->parameters)
{
message += "xine says: <i>";
- message += QString::fromUtf8( (char*) data + data->parameters);
+ message += TQString::fromUtf8( (char*) data + data->parameters);
message += "</i>";
}
else message += i18n("Sorry, no additional information is available.");
- QApplication::postEvent( engine, new QCustomEvent(QEvent::Type(3001), new QString(message)) );
+ TQApplication::postEvent( engine, new TQCustomEvent(TQEvent::Type(3001), new TQString(message)) );
}
} //case
@@ -849,7 +849,7 @@ VideoWindow::toggleDVDMenu()
}
void
-VideoWindow::showOSD( const QString &message )
+VideoWindow::showOSD( const TQString &message )
{
if( m_osd ) {
xine_osd_clear( m_osd );
@@ -859,12 +859,12 @@ VideoWindow::showOSD( const QString &message )
}
}
-QString
+TQString
VideoWindow::fileFilter() const
{
char *supportedExtensions = xine_get_file_extensions( m_xine );
- QString filter( "*." );
+ TQString filter( "*." );
filter.append( supportedExtensions );
filter.remove( "txt" );
filter.remove( "png" );