summaryrefslogtreecommitdiff
path: root/noncore/multimedia
Side-by-side diff
Diffstat (limited to 'noncore/multimedia') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/camera/cmd/capture.cpp2
-rw-r--r--noncore/multimedia/camera/gui/main.cpp2
-rw-r--r--noncore/multimedia/camera/gui/mainwindow.cpp5
-rw-r--r--noncore/multimedia/camera/lib/imageio.cpp1
-rw-r--r--noncore/multimedia/camera/lib/zcameraio.cpp2
-rw-r--r--noncore/multimedia/opierec/helpwindow.cpp2
-rw-r--r--noncore/multimedia/opierec/main.cpp2
7 files changed, 14 insertions, 2 deletions
diff --git a/noncore/multimedia/camera/cmd/capture.cpp b/noncore/multimedia/camera/cmd/capture.cpp
index 64c223c..688622b 100644
--- a/noncore/multimedia/camera/cmd/capture.cpp
+++ b/noncore/multimedia/camera/cmd/capture.cpp
@@ -1,74 +1,76 @@
/**********************************************************************
** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "capture.h"
#include "zcameraio.h"
#include "imageio.h"
#include "avi.h"
#include <opie2/oapplication.h>
#include <opie2/odebug.h>
#include <qimage.h>
+using namespace Opie::Core;
+using namespace Opie::Core;
Capturer::Capturer()
:QFrame( 0 ), height( 320 ), width( 240 ), zoom( 1 ), quality( 90 ),
flip( "A" ), format( "JPEG" ), name( "Untitled" )
{
}
Capturer::~Capturer()
{
}
void Capturer::checkSettings()
{
if ( width > height )
{
if ( 0 != width % 16 || width < 16 || width > 640 )
{
printf( "Warning: Corrected X resolution to 320 px\n" );
width = 320;
}
if ( 0 != height % 16 || height < 16 || height > 480 )
{
printf( "Warning: Corrected Y resolution to 240 px\n" );
height = 240;
}
}
else
{
if ( 0 != width % 16 || width < 16 || width > 480 )
{
printf( "Warning: Corrected X resolution to 240 px\n" );
width = 240;
}
if ( 0 != height % 16 || height < 16 || height > 640 )
{
printf( "Warning: Corrected Y resolution to 320 px\n" );
height = 320;
}
}
if ( quality > 100 || quality < 10 )
{
printf( "Warning: Corrected quality to 75%%\n" );
quality = 75;
}
if ( zoom > 2 || zoom < 1 )
diff --git a/noncore/multimedia/camera/gui/main.cpp b/noncore/multimedia/camera/gui/main.cpp
index f25475c..7d6b3bb 100644
--- a/noncore/multimedia/camera/gui/main.cpp
+++ b/noncore/multimedia/camera/gui/main.cpp
@@ -1,28 +1,30 @@
/**********************************************************************
** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
+
#include "mainwindow.h"
#include <opie2/oapplication.h>
+using namespace Opie::Core;
int main( int argc, char **argv )
{
OApplication a( argc, argv, "Opie-Camera" );
CameraMainWindow* w = new CameraMainWindow();
a.showMainWidget( w );
a.exec();
delete w;
return 0;
}
diff --git a/noncore/multimedia/camera/gui/mainwindow.cpp b/noncore/multimedia/camera/gui/mainwindow.cpp
index e4e1b6c..7f2a9bd 100644
--- a/noncore/multimedia/camera/gui/mainwindow.cpp
+++ b/noncore/multimedia/camera/gui/mainwindow.cpp
@@ -1,114 +1,117 @@
/**********************************************************************
** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "mainwindow.h"
#include "previewwidget.h"
#include "zcameraio.h"
#include "imageio.h"
#include "avi.h"
/* OPIE */
#include <opie2/ofiledialog.h>
#include <opie2/odevice.h>
#include <opie2/oapplication.h>
#include <opie2/oconfig.h>
#include <opie2/odebug.h>
#include <qpe/global.h>
#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
-using namespace Opie;
/* QT */
#include <qapplication.h>
#include <qaction.h>
#include <qvbox.h>
#include <qcombobox.h>
#include <qcursor.h>
#include <qdatastream.h>
#include <qdir.h>
#include <qfile.h>
#include <qimage.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpopupmenu.h>
#include <qprogressbar.h>
#include <qpushbutton.h>
#include <qmessagebox.h>
#include <qlayout.h>
#include <qdirectpainter_qws.h>
/* STD */
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#define CAPTUREFILE "/tmp/capture.dat"
#define OUTPUTFILE "/tmp/output.avi"
#define OUTPUT_TO_CUSTOM 250
#define OUTPUT_TO_DOCFOLDER 251
+
+using namespace Opie::Ui;
+using namespace Opie::Core;
+
CameraMainWindow::CameraMainWindow( QWidget * parent, const char * name, WFlags f )
:QMainWindow( parent, name, f ),
_rotation( 270 ), // FIXME: get this from current settings (ODevice?)
_capturing( false ),
_pics( 1 ), _videos( 1 )
{
#ifdef QT_NO_DEBUG
if ( !ZCameraIO::instance()->isOpen() )
{
QVBox* v = new QVBox( this );
v->setMargin( 10 );
QLabel* l1 = new QLabel( v );
l1->setPixmap( Resource::loadPixmap( "camera/error" ) );
QLabel* l2 = new QLabel( v );
l2->setText( "<b>Sorry. could not detect your camera :-(</b><p>"
"* Is the sharpzdc_cs module loaded ?<br>"
"* Is /dev/sharpzdc read/writable ?<p>" );
connect( new QPushButton( "Exit", v ), SIGNAL( clicked() ), this, SLOT( close() ) );
setCentralWidget( v );
return;
}
#endif
init();
_rotation = 270; //TODO: grab these from the actual settings
preview = new PreviewWidget( this, "camera preview widget" );
//setCentralWidget( preview ); <--- don't do this!
preview->resize( QSize( 240, 288 ) );
preview->show();
// construct a System Channel to receive setRotation messages
_sysChannel = new QCopChannel( "QPE/System", this );
connect( _sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
this, SLOT( systemMessage(const QCString&,const QByteArray&) ) );
connect( preview, SIGNAL( contextMenuRequested() ), this, SLOT( showContextMenu() ) );
connect( ZCameraIO::instance(), SIGNAL( shutterClicked() ), this, SLOT( shutterClicked() ) );
updateCaption();
};
CameraMainWindow::~CameraMainWindow()
{
diff --git a/noncore/multimedia/camera/lib/imageio.cpp b/noncore/multimedia/camera/lib/imageio.cpp
index ed0d39f..7d20848 100644
--- a/noncore/multimedia/camera/lib/imageio.cpp
+++ b/noncore/multimedia/camera/lib/imageio.cpp
@@ -1,55 +1,56 @@
/**********************************************************************
** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "imageio.h"
#include <opie2/odebug.h>
#include <qimage.h>
+using namespace Opie::Core;
void bufferToImage( int _width, int _height, unsigned char* bp, QImage* image )
{
unsigned char* p;
image->create( _width, _height, 16 );
for ( int i = 0; i < _height; ++i )
{
p = image->scanLine( i );
for ( int j = 0; j < _width; j++ )
{
*p = *bp;
p++;
bp++;
*p = *bp;
p++;
bp++;
}
}
}
void imageToFile( QImage* i, const QString& name, const QString& format, int quality )
{
QImage im = i->convertDepth( 32 );
bool result = im.save( name, format, quality );
if ( !result )
{
oerr << "imageio-Problem while writing to " << name << oendl;
}
else
{
odebug << format << "-image has been successfully captured" << oendl;
}
}
diff --git a/noncore/multimedia/camera/lib/zcameraio.cpp b/noncore/multimedia/camera/lib/zcameraio.cpp
index d59cbbb..c4be42f 100644
--- a/noncore/multimedia/camera/lib/zcameraio.cpp
+++ b/noncore/multimedia/camera/lib/zcameraio.cpp
@@ -1,80 +1,82 @@
/**********************************************************************
** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "zcameraio.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <qimage.h>
#include <qdatetime.h>
#include <opie2/odebug.h>
#define SHARPZDC "/dev/sharp_zdc"
+using namespace Opie::Core;
+
ZCameraIO* ZCameraIO::_instance = 0;
ZCameraIO* ZCameraIO::instance()
{
if ( !ZCameraIO::_instance )
{
odebug << "Creating ZCameraIO::_instance" << oendl;
ZCameraIO::_instance = new ZCameraIO();
}
return ZCameraIO::_instance;
}
ZCameraIO::ZCameraIO()
: _pressed( false ), _height( 0 ), _width( 0 ), _zoom( 0 ),
_flip( -1 ), _rot( 0 ), _readlen( 0 )
{
_driver = ::open( SHARPZDC, O_RDWR );
if ( _driver == -1 )
oerr << "Can't open camera driver: " << strerror(errno) << oendl;
else
init();
}
void ZCameraIO::init()
{
if ( ZCameraIO::_instance )
ofatal << "Don't create more than one ZCameraIO instances." << oendl;
else
{
_timer = new QTime();
setReadMode( STATUS );
}
}
ZCameraIO::~ZCameraIO()
{
if ( _driver != -1 )
{
setReadMode( 0 );
::close( _driver );
}
}
diff --git a/noncore/multimedia/opierec/helpwindow.cpp b/noncore/multimedia/opierec/helpwindow.cpp
index a3b29fa..6aebaa1 100644
--- a/noncore/multimedia/opierec/helpwindow.cpp
+++ b/noncore/multimedia/opierec/helpwindow.cpp
@@ -1,62 +1,62 @@
/****************************************************************************
** $Id$
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of an example program for Qt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
#include "helpwindow.h"
#include <qlayout.h>
-#include <qpe/qpetoolbar.h>
+#include <qtoolbar.h>
#include <qpe/resource.h>
#include <qaction.h>
#include <qmenubar.h>
#include <ctype.h>
HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name )
: QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL()
{
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 2);
layout->setMargin( 2);
qDebug(_path);
browser = new QTextBrowser( this );
QStringList Strlist;
Strlist.append( home_);
browser->mimeSourceFactory()->setFilePath( Strlist );
browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
connect( browser, SIGNAL( textChanged() ), this, SLOT( textChanged() ) );
if ( !home_.isEmpty() )
browser->setSource( home_ );
QToolBar *toolbar = new QToolBar( this );
QAction *a = new QAction( tr( "Backward" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), browser, SLOT( backward() ) );
a->addTo( toolbar );
a = new QAction( tr( "Forward" ), Resource::loadPixmap( "forward" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), browser, SLOT( forward() ) );
a->addTo( toolbar );
layout->addMultiCellWidget( toolbar, 0, 0, 0, 0);
layout->addMultiCellWidget( browser, 1, 2, 0, 2);
browser->setFocus();
}
void HelpWindow::setBackwardAvailable( bool b)
{
menuBar()->setItemEnabled( backwardId, b);
}
diff --git a/noncore/multimedia/opierec/main.cpp b/noncore/multimedia/opierec/main.cpp
index bb51446..a435d8e 100644
--- a/noncore/multimedia/opierec/main.cpp
+++ b/noncore/multimedia/opierec/main.cpp
@@ -1,31 +1,33 @@
/***************************************************************************
+
main.cpp - main routine
***************************************************************************/
//// main.cpp
//// copyright 2001, 2002, by L. J. Potter <ljp@llornkcor.com>
/***************************************************************************
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "qtrec.h"
#ifdef PDAUDIO
int main(int argc, char* argv[]) {
QPEApplication a(argc, argv);
QtRec qtrec;
a.showMainWidget( &qtrec);
return a.exec();
}
#else
#include <opie2/oapplicationfactory.h>
+using namespace Opie::Core;
OPIE_EXPORT_APP( OApplicationFactory<QtRec> )
#endif