summaryrefslogtreecommitdiffstats
path: root/src/app/captureFrame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/captureFrame.cpp')
-rw-r--r--src/app/captureFrame.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/app/captureFrame.cpp b/src/app/captureFrame.cpp
index 4cba5fd..1456817 100644
--- a/src/app/captureFrame.cpp
+++ b/src/app/captureFrame.cpp
@@ -9,13 +9,13 @@
#include <kstdguiitem.h>
#include "mainWindow.h"
#include "mxcl.library.h"
-#include <qdialog.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qimage.h>
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qstringlist.h>
+#include <ntqdialog.h>
+#include <ntqhbox.h>
+#include <ntqlabel.h>
+#include <ntqimage.h>
+#include <ntqlayout.h>
+#include <ntqpainter.h>
+#include <ntqstringlist.h>
#include "theStream.h"
#include "xineEngine.h"
#include <xine.h>
@@ -25,26 +25,26 @@ namespace Codeine {
class FrameCapturePreview : public KPreviewWidgetBase
{
- QImage m_frame;
+ TQImage m_frame;
virtual void showPreview( const KURL& ) {}
virtual void clearPreview() {}
- virtual void paintEvent( QPaintEvent* )
+ virtual void paintEvent( TQPaintEvent* )
{
- QPainter painter( this );
+ TQPainter painter( this );
const uint h = int( double(m_frame.height()) / m_frame.width() * (width()-5) );
const uint y = (height() - h) / 2;
- painter.drawImage( QRect( 5, y, width(), h ), m_frame );
+ painter.drawImage( TQRect( 5, y, width(), h ), m_frame );
- const QString text = QString("%1x%2").arg( m_frame.width() ).arg( m_frame.height() );
+ const TQString text = TQString("%1x%2").arg( m_frame.width() ).arg( m_frame.height() );
const uint x = (width() - fontMetrics().width( text ))/2;
painter.drawText( x, y + h + fontMetrics().height() + 5, text );
}
public:
- FrameCapturePreview( const QImage& frame, QWidget *parent )
+ FrameCapturePreview( const TQImage& frame, TQWidget *parent )
: KPreviewWidgetBase( parent )
, m_frame( frame )
{
@@ -53,25 +53,25 @@ public:
};
-class FrameCaptureDialog : public QDialog
+class FrameCaptureDialog : public TQDialog
{
- const QImage m_frame;
- const QString m_time;
- const QString m_title;
+ const TQImage m_frame;
+ const TQString m_time;
+ const TQString m_title;
- void message( const QString &text ) { ((MainWindow*)parentWidget())->statusBar()->message( text, 4000 ); }
+ void message( const TQString &text ) { ((MainWindow*)parentWidget())->statusBar()->message( text, 4000 ); }
public:
- FrameCaptureDialog( const QImage &frame, const QString &time, MainWindow *parent )
- : QDialog( parent, 0, false /*modal*/, Qt::WDestructiveClose )
+ FrameCaptureDialog( const TQImage &frame, const TQString &time, MainWindow *parent )
+ : TQDialog( parent, 0, false /*modal*/, TQt::WDestructiveClose )
, m_frame( frame )
, m_time( time )
, m_title( TheStream::prettyTitle() )
{
- (new QVBoxLayout( this ))->setAutoAdd( true );
- (new QLabel( this ))->setPixmap( frame );
+ (new TQVBoxLayout( this ))->setAutoAdd( true );
+ (new TQLabel( this ))->setPixmap( frame );
- QHBox *box = new QHBox( this );
+ TQHBox *box = new TQHBox( this );
KPushButton *o = new KPushButton( KStdGuiItem::save(), box );
connect( o, SIGNAL(clicked()), SLOT(accept()) );
@@ -102,11 +102,11 @@ public:
dialog.setPreviewWidget( new FrameCapturePreview( m_frame, &dialog ) );
if( dialog.exec() == Accepted ) {
- const QString fileName = dialog.selectedFile();
+ const TQString fileName = dialog.selectedFile();
if( fileName.isEmpty() )
return;
- const QString type = dialog.currentFilter().remove( 0, 2 ).upper();
+ const TQString type = dialog.currentFilter().remove( 0, 2 ).upper();
if( m_frame.save( fileName, type ) )
message( i18n("%1 saved successfully").arg( fileName ) );
else
@@ -235,19 +235,19 @@ yv12ToRgb( uint8_t *src_y, uint8_t *src_u, uint8_t *src_v, const int w, const in
/************************************************************/
-QImage
+TQImage
VideoWindow::captureFrame() const
{
DEBUG_BLOCK
int ratio, format, w, h;
if( !xine_get_current_frame( *engine(), &w, &h, &ratio, &format, NULL ) )
- return QImage();
+ return TQImage();
uint8_t *yuv = new uint8_t[((w+8) * (h+1) * 2)];
if( yuv == 0 ) {
Debug::error() << "Not enough memory to make screenframe!\n";
- return QImage(); }
+ return TQImage(); }
xine_get_current_frame( *engine(), &w, &h, &ratio, &format, yuv );
@@ -262,7 +262,7 @@ VideoWindow::captureFrame() const
if( yuv == 0 ) {
Debug::error() << "Not enough memory to make screenframe!\n";
delete [] yuy2;
- return QImage(); }
+ return TQImage(); }
y = yuv;
u = yuv + w * h;
@@ -282,12 +282,12 @@ VideoWindow::captureFrame() const
default:
Debug::warning() << "Format " << format << " not supported!\n";
delete [] yuv;
- return QImage();
+ return TQImage();
}
// convert to rgb
uchar *rgb = yv12ToRgb( y, u, v, w, h );
- QImage frame( rgb, w, h, 32, 0, 0, QImage::IgnoreEndian );
+ TQImage frame( rgb, w, h, 32, 0, 0, TQImage::IgnoreEndian );
delete [] yuv;
return frame;