author | chicken <chicken> | 2004-03-02 15:11:14 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-02 15:11:14 (UTC) |
commit | b48c5437e9631094d15ec7280a9d1cf212b3eb28 (patch) (side-by-side diff) | |
tree | 4c0095e58acc98ba6e8ba40240c491d03b99be92 | |
parent | 12dd57c04b42d4517061ed847b1aa041dd8af841 (diff) | |
download | opie-b48c5437e9631094d15ec7280a9d1cf212b3eb28.zip opie-b48c5437e9631094d15ec7280a9d1cf212b3eb28.tar.gz opie-b48c5437e9631094d15ec7280a9d1cf212b3eb28.tar.bz2 |
fix includes
34 files changed, 1 insertions, 110 deletions
diff --git a/noncore/multimedia/camera/gui/mainwindow.h b/noncore/multimedia/camera/gui/mainwindow.h index 451ad5f..d93cca1 100644 --- a/noncore/multimedia/camera/gui/mainwindow.h +++ b/noncore/multimedia/camera/gui/mainwindow.h @@ -1,71 +1,69 @@ /********************************************************************** ** 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. ** **********************************************************************/ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <qmainwindow.h> -#include <qdatetime.h> #include <qimage.h> #include <qpixmap.h> -#include <qdatetime.h> class QAction; class QActionGroup; class QIconSet; class QTimerEvent; class QToolButton; class QLabel; class MainWindowBase; class QCopChannel; class PreviewWidget; class CameraMainWindow: public QMainWindow { Q_OBJECT public: CameraMainWindow( QWidget * parent = 0, const char * name = "mainwindow", WFlags f = 0 ); virtual ~CameraMainWindow(); public slots: void changeZoom( int ); void systemMessage( const QCString&, const QByteArray& ); void showContextMenu(); void resoMenuItemClicked( QAction* ); void qualityMenuItemClicked( QAction* ); void zoomMenuItemClicked( QAction* ); void flipMenuItemClicked( QAction* ); void outputToMenuItemClicked( QAction* ); void outputMenuItemClicked( QAction* ); void prefixItemChoosen(); void appendSettingsChoosen(); void shutterClicked(); void updateCaption(); protected: void init(); void startVideoCapture(); void stopVideoCapture(); void postProcessVideo( const QString&, const QString& ); void performCapture( const QString& ); virtual void timerEvent( QTimerEvent* ); protected slots: void doSomething(); // solely for debugging purposes private: diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index f3eafab..452117c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -1,85 +1,83 @@ /* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "audiowidget.h" -#include "mediaplayerstate.h" -#include "playlistwidget.h" #include <qpe/qpeapplication.h> namespace { const int xo = -2; // movable x offset const int yo = 22; // movable y offset const MediaWidget::SkinButtonInfo skinInfo[] = { { MediaWidget::Play, "play", MediaWidget::ToggleButton }, { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, { MediaWidget::Next, "next", MediaWidget::NormalButton }, { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, { MediaWidget::Back, "back", MediaWidget::NormalButton } }; const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); void changeTextColor( QWidget * w) { QPalette p = w->palette(); p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); w->setPalette( p ); } } AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), audioSliderBeingMoved( false ) { setCaption( tr("OpiePlayer") ); loadSkin(); connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); connect( &mediaPlayerState, SIGNAL( isSeekableToggled(bool) ), this, SLOT( setSeekable(bool) ) ); connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); diff --git a/noncore/multimedia/opieplayer2/inputDialog.cpp b/noncore/multimedia/opieplayer2/inputDialog.cpp index ebde9c6..05dc2d1 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.cpp +++ b/noncore/multimedia/opieplayer2/inputDialog.cpp @@ -1,74 +1,67 @@ /* This file is part of the Opie Project Copyright (c) 2002,2003 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "inputDialog.h" -#include <qpe/resource.h> -#include <qpe/qpeapplication.h> -#include <qfileinfo.h> #include <qlineedit.h> -#include <qlayout.h> -#include <qvariant.h> -#include <qpushbutton.h> -#include <qwhatsthis.h> InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) { setName( "InputDialog" ); } resize( 234, 115); setMaximumSize( QSize( 240, 40)); setCaption( tr( name ) ); QPushButton *browserButton; //browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); //browserButton->setGeometry( QRect( 205, 10, 22, 22)); //connect( browserButton, SIGNAL(released()),this,SLOT(browse())); LineEdit1 = new QLineEdit( this, "LineEdit1" ); LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); LineEdit1->setFocus(); } /* * return the current text(input) */ QString InputDialog::text() const { return LineEdit1->text(); } /* * Destroys the object and frees any allocated resources */ InputDialog::~InputDialog() { } diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 664ec65..a42b8e5 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -1,88 +1,87 @@ /* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 LJP <> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qtextstream.h> #include <qdir.h> #include <qgfx_qws.h> -#include <qdirectpainter_qws.h> #include <assert.h> #include "xinevideowidget.h" #include "frame.h" #include "lib.h" typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, int width, int height,int bytes ); extern "C" { xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * ); int null_is_showing_video( const xine_vo_driver_t* self ); void null_set_show_video( const xine_vo_driver_t* self, int show ); int null_is_fullscreen( const xine_vo_driver_t* self ); void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); int null_is_scaling( const xine_vo_driver_t* self ); void null_set_scaling( const xine_vo_driver_t* self, int scale ); void null_set_gui_width( const xine_vo_driver_t* self, int width ); void null_set_gui_height( const xine_vo_driver_t* self, int height ); void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); void null_set_videoGamma( const xine_vo_driver_t* self , int value ); void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); void null_preload_decoders( xine_stream_t *stream ); } using namespace XINE; Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) { m_initialized = false; m_duringInitialization = false; m_video = false; m_wid = widget; printf("Lib"); QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; // get the configuration // not really OO, should be an extra class, later if ( !QFile::exists(configPath) ) { QFile f(configPath); f.open(IO_WriteOnly); QTextStream ts( &f ); ts << "misc.memcpy_method:glibc\n"; ts << "# uncomment if you experience double speed audio \n #audio.oss_sync_method:softsync\n"; ts << "codec.ffmpeg_pp_quality:3\n"; diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp index b0a22b2..00f72d1 100644 --- a/noncore/multimedia/opieplayer2/main.cpp +++ b/noncore/multimedia/opieplayer2/main.cpp @@ -1,29 +1,26 @@ -#include <qpe/qpeapplication.h> -#include "mediaplayerstate.h" -#include "playlistwidget.h" #include "mediaplayer.h" #include <opie/oapplicationfactory.h> OPIE_EXPORT_APP( OApplicationFactory<PlayListWidget> ) #if 0 int main(int argc, char **argv) { QPEApplication a(argc,argv); MediaPlayerState st( 0, "mediaPlayerState" ); PlayListWidget pl( st, 0, "playList" ); pl.showMaximized(); MediaPlayer mp( pl, st, 0, "mediaPlayer" ); QObject::connect( &pl, SIGNAL( skinSelected() ), &mp, SLOT( reloadSkins() ) ); a.showMainDocumentWidget(&pl); return a.exec(); } #endif diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 1e6bc4d..a236775 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -1,61 +1,57 @@ #include <qpe/qpeapplication.h> #include <qpe/config.h> -#include <qpe/qcopenvelope_qws.h> #include <qfileinfo.h> #include "mediaplayer.h" -#include "playlistwidget.h" #include "audiowidget.h" #include "videowidget.h" #include "volumecontrol.h" -#include "lib.h" -#include "mediaplayerstate.h" // for setBacklight() #include <linux/fb.h> #include <sys/file.h> #include <sys/ioctl.h> #define FBIOBLANK 0x4611 MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { m_audioUI = 0; m_videoUI = 0; m_xineControl = 0; xine = new XINE::Lib( XINE::Lib::InitializeInThread ); fd=-1;fl=-1; playList.setCaption( tr( "OpiePlayer: Initializating" ) ); qApp->processEvents(); // QPEApplication::grabKeyboard(); // EVIL connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); // What is pauseCheck good for? (Simon) // connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pauseCheck(bool) ) ); connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); connect( &mediaPlayerState, SIGNAL( blankToggled(bool) ), this, SLOT ( blank(bool) ) ); volControl = new VolumeControl; Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); playList.setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); m_skinLoader = new SkinLoader; m_skinLoader->schedule( AudioWidget::guiInfo() ); m_skinLoader->schedule( VideoWidget::guiInfo() ); m_skinLoader->start(); } MediaPlayer::~MediaPlayer() { // this shold never happen, but one never knows... if ( xine ) { diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 40fa1a4..203ff91 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -1,89 +1,84 @@ /* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // this file is based on work by trolltech -#include <qpe/qpeapplication.h> -#include <qpe/qlibrary.h> #include <qpe/config.h> -#include <qvaluelist.h> -#include <qobject.h> -#include <qdir.h> #include "mediaplayerstate.h" #include <assert.h> //#define MediaPlayerDebug(x) qDebug x #define MediaPlayerDebug(x) MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) : QObject( parent, name ) { Config cfg( "OpiePlayer" ); readConfig( cfg ); streaming = false; seekable = true; } MediaPlayerState::~MediaPlayerState() { } void MediaPlayerState::readConfig( Config& cfg ) { cfg.setGroup("Options"); fullscreen = cfg.readBoolEntry( "FullScreen" ); scaled = cfg.readBoolEntry( "Scaling" ); looping = cfg.readBoolEntry( "Looping" ); shuffled = cfg.readBoolEntry( "Shuffle" ); videoGamma = cfg.readNumEntry( "VideoGamma" ); playing = FALSE; streaming = FALSE; paused = FALSE; curPosition = 0; curLength = 0; m_displayType = MediaSelection; } void MediaPlayerState::writeConfig( Config& cfg ) const { cfg.setGroup( "Options" ); cfg.writeEntry( "FullScreen", fullscreen ); cfg.writeEntry( "Scaling", scaled ); cfg.writeEntry( "Looping", looping ); cfg.writeEntry( "Shuffle", shuffled ); cfg.writeEntry( "VideoGamma", videoGamma ); } MediaPlayerState::DisplayType MediaPlayerState::displayType() const { diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 08c62a2..563ccf5 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -1,74 +1,73 @@ /* Copyright (C) 2002 Simon Hausmann <simon@lst.de> (C) 2002 Max Reiss <harlekin@handhelds.org> (C) 2002 L. Potter <ljp@llornkcor.com> (C) 2002 Holger Freyther <zecke@handhelds.org> 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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <assert.h> #include "mediawidget.h" -#include "playlistwidget.h" #include "skin.h" MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { connect( &mediaPlayerState, SIGNAL( displayTypeChanged(MediaPlayerState::DisplayType) ), this, SLOT( setDisplayType(MediaPlayerState::DisplayType) ) ); connect( &mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); setBackgroundMode( NoBackground ); } MediaWidget::~MediaWidget() { } void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, const Skin &skin ) { buttonMask = skin.buttonMask( skinInfo, buttonCount ); buttons.clear(); buttons.reserve( buttonCount ); for ( uint i = 0; i < buttonCount; ++i ) { Button button = setupButton( skinInfo[ i ], skin ); buttons.push_back( button ); } } MediaWidget::Button MediaWidget::setupButton( const SkinButtonInfo &buttonInfo, const Skin &skin ) { Button button; button.command = buttonInfo.command; button.type = buttonInfo.type; button.mask = skin.buttonMaskImage( buttonInfo.fileName ); return button; } void MediaWidget::loadDefaultSkin( const GUIInfo &guiInfo ) { Skin skin( guiInfo.fileNameInfix ); skin.setCachable( false ); loadSkin( guiInfo.buttonInfo, guiInfo.buttonCount, skin ); diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 69e87e7..26d5e15 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp @@ -1,95 +1,82 @@ /* This file is part of the Opie Project Copyright (c) 2002 L. Potter <ljp@llornkcor.com> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "playlistwidget.h" #include "om3u.h" -#include <qpe/applnk.h> -#include <qpe/qpeapplication.h> -#include <qpe/storage.h> -#include <qpe/mimetype.h> -#include <qpe/global.h> -#include <qpe/resource.h> - -#include <qdir.h> -#include <qregexp.h> -#include <qstring.h> -#include <qtextstream.h> -#include <qstringlist.h> -#include <qcstring.h> + //extern PlayListWidget *playList; Om3u::Om3u( const QString &filePath, int mode) : QStringList (){ qDebug("<<<<<<<new m3u "+filePath); f.setName(filePath); f.open(mode); } Om3u::~Om3u(){} void Om3u::readM3u() { // qDebug("<<<<<<reading m3u "+f.name()); QTextStream t(&f); t.setEncoding(QTextStream::UnicodeUTF8); QString s; while ( !t.atEnd() ) { s=t.readLine(); // qDebug(s); if( s.find( "#", 0, TRUE) == -1 ) { if( s.left(2) == "E:" || s.left(2) == "P:" ) { s = s.right( s.length() -2 ); QFileInfo f( s ); QString name = f.baseName(); name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); s=s.replace( QRegExp( "\\" ), "/" ); append(s); // qDebug(s); } else { // is url QString name; name = s; append(name); } } } } void Om3u::readPls() { //it's a pls file QTextStream t( &f ); t.setEncoding(QTextStream::UnicodeUTF8); QString s; while ( !t.atEnd() ) { s = t.readLine(); if( s.left(4) == "File" ) { s = s.right( s.length() - s.find("=",0,true)-1 ); s = s.stripWhiteSpace(); s.replace( QRegExp( "%20" )," "); diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp index 2019b3a..015896f 100644 --- a/noncore/multimedia/opieplayer2/playlistselection.cpp +++ b/noncore/multimedia/opieplayer2/playlistselection.cpp @@ -1,77 +1,69 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia 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. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ -#include <qpe/applnk.h> -#include <qpe/resource.h> -#include <qpe/config.h> -#include <qpainter.h> -#include <qimage.h> #include <qheader.h> -#include <qlistview.h> -#include <qlist.h> -#include <qpixmap.h> #include "playlistselection.h" #include <stdlib.h> class PlayListSelectionItem : public QListViewItem { public: PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) { setText( 0, f->name() ); setPixmap( 0, f->pixmap() ); } ~PlayListSelectionItem() { }; const DocLnk *file() const { return fl; } private: const DocLnk *fl; }; PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) : QListView( parent, name ) { // qDebug("starting playlistselector"); // #ifdef USE_PLAYLIST_BACKGROUND // setStaticBackground( TRUE ); // setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); // setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); // #endif // addColumn("Title",236); // setAllColumnsShowFocus( TRUE ); addColumn( tr( "Playlist Selection" ) ); header()->hide(); setSorting( -1, FALSE ); } PlayListSelection::~PlayListSelection() { } // #ifdef USE_PLAYLIST_BACKGROUND void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { // qDebug("drawBackground"); p->fillRect( r, QBrush( white ) ); diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 0a84268..84aba55 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -1,91 +1,90 @@ /* This file is part of the Opie Project Copyright (c) 2002,2003 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qtoolbar.h> #include <opie/ofiledialog.h> #include <qmessagebox.h> #include "playlistselection.h" #include "playlistwidget.h" #include "mediaplayer.h" -#include "mediaplayerstate.h" #include "inputDialog.h" #include "om3u.h" #include "playlistfileview.h" //only needed for the random play #include <assert.h> PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) { mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer2/add_to_playlist", this , SLOT(addSelected() ) ); d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer2/remove_from_playlist", this , SLOT(removeSelected() ) ); d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", this , SLOT( btnPlay(bool) ), TRUE ); d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", mediaPlayerState, SLOT( setShuffled(bool) ), TRUE ); d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); (void)new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); (void)new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); pmPlayList->insertSeparator(-1); (void)new MenuItem( pmPlayList, tr( "Add File" ), this,SLOT( openFile() ) ); (void)new MenuItem( pmPlayList, tr("Add URL"), this,SLOT( openURL() ) ); pmPlayList->insertSeparator(-1); (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), this, SLOT(writem3u() ) ); pmPlayList->insertSeparator(-1); (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), audioView, SLOT( scanFiles() ) ); (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), videoView, SLOT( scanFiles() ) ); diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 33fe188..2ff190d 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp @@ -1,95 +1,94 @@ /* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qtoolbar.h> #include <qpe/qpeapplication.h> #include <qlayout.h> #include <qmenubar.h> #include "playlistselection.h" #include "playlistwidget.h" #include "mediaplayerstate.h" #include "inputDialog.h" #include "playlistfileview.h" -#include "mediaplayerstate.h" PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) : QMainWindow( parent, name ) { d = new PlayListWidgetPrivate; d->setDocumentUsed = FALSE; setBackgroundMode( PaletteButton ); setToolBarsMovable( FALSE ); // Create Toolbar QToolBar *toolbar = new QToolBar( this ); toolbar->setHorizontalStretchable( TRUE ); // Create Menubar QMenuBar *menu = new QMenuBar( toolbar ); menu->setMargin( 0 ); bar = new QToolBar( this ); bar->setLabel( tr( "Play Operations" ) ); tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); tbDeletePlaylist->setFlat( TRUE ); tbDeletePlaylist->setFixedSize( 20, 20 ); tbDeletePlaylist->hide(); pmPlayList = new QPopupMenu( this ); menu->insertItem( tr( "File" ), pmPlayList ); pmView = new QPopupMenu( this ); menu->insertItem( tr( "View" ), pmView ); pmView->isCheckable(); skinsMenu = new QPopupMenu( this ); pmView->insertItem( tr( "Skins" ), skinsMenu ); skinsMenu->isCheckable(); gammaMenu = new QPopupMenu( this ); pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); gammaSlider->setRange( -40, 40 ); gammaSlider->setTickmarks( QSlider::Left ); gammaSlider->setTickInterval( 20 ); gammaSlider->setFocusPolicy( QWidget::StrongFocus ); gammaSlider->setValue( 0 ); gammaSlider->setMinimumHeight( 50 ); diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp index 742e495..7c38983 100644 --- a/noncore/multimedia/opieplayer2/skin.cpp +++ b/noncore/multimedia/opieplayer2/skin.cpp @@ -1,78 +1,76 @@ /* Copyright (C) 2002 Simon Hausmann <simon@lst.de> (C) 2002 Max Reiss <harlekin@handhelds.org> (C) 2002 L. Potter <ljp@llornkcor.com> (C) 2002 Holger Freyther <zecke@handhelds.org> 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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "skin.h" #include "singleton.h" #include <qcache.h> -#include <qmap.h> #include <qtimer.h> -#include <qpe/resource.h> #include <qpe/config.h> #include <assert.h> struct SkinData { typedef QMap<QString, QImage> ButtonMaskImageMap; QPixmap backgroundPixmap; QImage buttonUpImage; QImage buttonDownImage; QImage buttonMask; ButtonMaskImageMap buttonMasks; }; class SkinCache : public Singleton<SkinCache> { public: SkinCache(); SkinData *lookupAndTake( const QString &skinPath, const QString &fileNameInfix ); void store( const QString &skinPath, const QString &fileNameInfix, SkinData *data ); private: typedef QCache<SkinData> DataCache; typedef QCache<QPixmap> BackgroundPixmapCache; template <class CacheType> void store( const QCache<CacheType> &cache, const QString &key, CacheType *data ); DataCache m_cache; BackgroundPixmapCache m_backgroundPixmapCache; }; Skin::Skin( const QString &name, const QString &fileNameInfix ) : m_fileNameInfix( fileNameInfix ) { init( name ); } Skin::Skin( const QString &fileNameInfix ) : m_fileNameInfix( fileNameInfix ) { init( defaultSkinName() ); } Skin::~Skin() diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index a4d09f5..0625376 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -1,84 +1,82 @@ /* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "videowidget.h" -#include "mediaplayerstate.h" -#include "playlistwidget.h" #ifdef Q_WS_QWS # define USE_DIRECT_PAINTER # include <qdirectpainter_qws.h> # include <qgfxraster_qws.h> #endif namespace { const int xo = 2; // movable x offset const int yo = 0; // movable y offset const MediaWidget::SkinButtonInfo skinInfo[] = { { MediaWidget::Play, "play", MediaWidget::ToggleButton }, { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, { MediaWidget::Next, "fwd", MediaWidget::NormalButton }, { MediaWidget::Previous, "back", MediaWidget::NormalButton }, { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, { MediaWidget::FullScreen, "full", MediaWidget::ToggleButton } }; const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); } VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ), videoSliderBeingMoved( false ) { setCaption( tr("OpiePlayer - Video") ); videoFrame = new XineVideoWidget ( this, "Video frame" ); connect ( videoFrame, SIGNAL( videoResized(const QSize&)), this, SIGNAL( videoResized(const QSize&))); connect ( videoFrame, SIGNAL( clicked() ), this, SLOT ( backToNormal() ) ); slider = 0; loadSkin(); setLength( mediaPlayerState.length() ); setPosition( mediaPlayerState.position() ); setFullscreen( mediaPlayerState.isFullscreen() ); setPlaying( mediaPlayerState.isPlaying() ); diff --git a/noncore/multimedia/opieplayer2/volumecontrol.cpp b/noncore/multimedia/opieplayer2/volumecontrol.cpp index 271b84e..b3f5f8d 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.cpp +++ b/noncore/multimedia/opieplayer2/volumecontrol.cpp @@ -1,53 +1,51 @@ -#include <qpe/qpeapplication.h> #include <qpe/config.h> #include "qpe/qcopenvelope_qws.h" -#include <qmessagebox.h> #include "volumecontrol.h" int VolumeControl::volume() { Config cfg( "qpe" ); cfg. setGroup( "Volume" ); m_volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); return m_volumePerc; } void VolumeControl::setVolume( int volumePerc ) { Config cfg("qpe"); cfg.setGroup("Volume"); if ( volumePerc > 100 ) { volumePerc = 100; } if ( volumePerc < 0 ) { volumePerc = 0; } m_volumePerc = volumePerc; cfg.writeEntry("VolumePercent", volumePerc ); QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; // QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0, volumePerc; } void VolumeControl::incVol( int ammount ) { int oldVol = volume(); setVolume( oldVol + ammount); } void VolumeControl::decVol( int ammount ) { int oldVol = volume(); setVolume( oldVol - ammount); } VolumeControl::VolumeControl( ) { volume(); } VolumeControl::~VolumeControl() { QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; } diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 70f2ffd..8f11b2e 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -1,89 +1,88 @@ /* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qtimer.h> #include <qmessagebox.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include "xinecontrol.h" -#include "mediaplayerstate.h" #include "xinevideowidget.h" XineControl::XineControl( XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) { libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); init(); } XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) { xine->ensureInitialized(); xine->setWidget( xineWidget ); init(); } void XineControl::init() { connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); connect( this, SIGNAL( positionChanged(long) ), &mediaPlayerState, SLOT( updatePosition(long) ) ); connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( stop(bool) ) ); connect( &mediaPlayerState, SIGNAL( fullscreenToggled(bool) ), this, SLOT( setFullscreen(bool) ) ); connect( &mediaPlayerState, SIGNAL( positionChanged(long) ), this, SLOT( seekTo(long) ) ); connect( &mediaPlayerState, SIGNAL( videoGammaChanged(int) ), this, SLOT( setGamma(int) ) ); connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); connect( xineVideoWidget, SIGNAL( videoResized(const QSize&) ), this, SLOT( videoResized(const QSize&) ) ); disabledSuspendScreenSaver = FALSE; } XineControl::~XineControl() { #if defined(Q_WS_QWS) && !defined(QT_NO_COP) if ( disabledSuspendScreenSaver ) { disabledSuspendScreenSaver = FALSE; // Re-enable the suspend mode QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; } #endif delete libXine; } diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 0833784..b55750a 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp @@ -1,89 +1,86 @@ /* This file is part of the Opie Project Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <qimage.h> -#include <qpainter.h> -#include <qgfx_qws.h> #include <qdirectpainter_qws.h> #include <qgfx_qws.h> #include <qsize.h> #include <qapplication.h> -#include <qpainter.h> #include <qpe/resource.h> #include "xinevideowidget.h" // 0 deg rot: copy a line from src to dst (use libc memcpy) // 180 deg rot: copy a line from src to dst reversed static inline void memcpy_rev ( void *dst, void *src, size_t len ) { len >>= 1; ((char *) src ) += ( len << 1 ); while ( len-- ) *((short int *) dst )++ = *--((short int *) src ); } // 90 deg rot: copy a column from src to dst static inline void memcpy_step ( void *dst, void *src, size_t len, size_t step ) { len >>= 1; while ( len-- ) { *((short int *) dst )++ = *((short int *) src ); ((char *) src ) += step; } } // 270 deg rot: copy a column from src to dst reversed static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t step ) { len >>= 1; ((char *) src ) += ( len * step ); while ( len-- ) { ((char *) src ) -= step; *((short int *) dst )++ = *((short int *) src ); } } XineVideoWidget::XineVideoWidget ( QWidget* parent, const char* name ) : QWidget ( parent, name, WRepaintNoErase | WResizeNoErase ) diff --git a/noncore/multimedia/opierec/main.cpp b/noncore/multimedia/opierec/main.cpp index 714907c..74a175b 100644 --- a/noncore/multimedia/opierec/main.cpp +++ b/noncore/multimedia/opierec/main.cpp @@ -1,30 +1,29 @@ /*************************************************************************** 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" -#include <qpe/qpeapplication.h> #ifdef PDAUDIO int main(int argc, char* argv[]) { QPEApplication a(argc, argv); QtRec qtrec; a.showMainWidget( &qtrec); return a.exec(); } #else #include <opie/oapplicationfactory.h> OPIE_EXPORT_APP( OApplicationFactory<QtRec> ) #endif diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp index f2035ef..1c64ab1 100644 --- a/noncore/multimedia/opierec/qtrec.cpp +++ b/noncore/multimedia/opierec/qtrec.cpp @@ -1,59 +1,58 @@ /**************************************************************************** // qtrec.cpp Created: Thu Jan 17 11:19:58 2002 copyright 2002 by L.J. Potter <ljp@llornkcor.com> ****************************************************************************/ #define DEV_VERSION #include "pixmaps.h" #include "qtrec.h" #include "waveform.h" -#include "device.h" #include <pthread.h> extern "C" { #include "adpcm.h" } #include <sys/soundcard.h> #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/storage.h> #include <qcheckbox.h> #include <qcombobox.h> //#include <qdatetime.h> #include <qdir.h> #include <qgroupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qlistview.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <qpushbutton.h> #include <qslider.h> #include <qtabwidget.h> #include <qtimer.h> #include <errno.h> #include <fcntl.h> #include <math.h> #include <mntent.h> #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <sys/soundcard.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> #include <sys/vfs.h> #include <unistd.h> #include <sys/wait.h> #include <sys/signal.h> #ifdef PDAUDIO //ALSA diff --git a/noncore/multimedia/opierec/wavFile.cpp b/noncore/multimedia/opierec/wavFile.cpp index 1d58bb3..35bc14d 100644 --- a/noncore/multimedia/opierec/wavFile.cpp +++ b/noncore/multimedia/opierec/wavFile.cpp @@ -1,56 +1,55 @@ //wavFile.cpp #include "wavFile.h" #include "qtrec.h" #include <qmessagebox.h> #include <qdir.h> -#include <qpe/timestring.h> #include <qpe/config.h> #include <errno.h> #include <sys/time.h> #include <sys/types.h> #include <sys/vfs.h> #include <fcntl.h> #include <math.h> #include <mntent.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int sampleRate, int channels, int resolution, int format ) : QObject( parent) { //qDebug("new wave file"); bool b = makeNwFile; wavSampleRate=sampleRate; wavFormat=format; wavChannels=channels; wavResolution=resolution; useTmpFile=false; if( b) { newFile(); } else { openFile(fileName); } } bool WavFile::newFile() { // qDebug("Set up new file"); Config cfg("OpieRec"); cfg.setGroup("Settings"); currentFileName=cfg.readEntry("directory",QDir::homeDirPath()); QString date; QDateTime dt = QDateTime::currentDateTime(); date = dt.toString();//TimeString::dateString( QDateTime::currentDateTime(),false,true); date.replace(QRegExp("'"),""); date.replace(QRegExp(" "),"_"); date.replace(QRegExp(":"),"."); date.replace(QRegExp(","),""); diff --git a/noncore/multimedia/opierec/waveform.cpp b/noncore/multimedia/opierec/waveform.cpp index 05be373..9cc40b4 100644 --- a/noncore/multimedia/opierec/waveform.cpp +++ b/noncore/multimedia/opierec/waveform.cpp @@ -1,70 +1,69 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia 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. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "waveform.h" -#include <qlabel.h> #include <qpainter.h> Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) : QWidget( parent, name, fl ) { pixmap = 0; windowSize = 100; samplesPerPixel = 8000 / (5 * windowSize); currentValue = 0; numSamples = 0; windowPosn = 0; window = 0; } void Waveform::changeSettings( int frequency, int channels ) { makePixmap(); // qWarning("change waveform %d, %d", frequency, channels); samplesPerPixel = frequency * channels / (5 * windowSize); qWarning("Waveform::changeSettings %d", samplesPerPixel); if ( !samplesPerPixel ) samplesPerPixel = 1; currentValue = 0; numSamples = 0; windowPosn = 0; draw(); } Waveform::~Waveform() { if ( window ) delete[] window; if ( pixmap ) delete pixmap; } void Waveform::reset() { makePixmap(); currentValue = 0; numSamples = 0; windowPosn = 0; draw(); } diff --git a/noncore/multimedia/powerchord/fretboard.cpp b/noncore/multimedia/powerchord/fretboard.cpp index 0687d00..bf78e4c 100644 --- a/noncore/multimedia/powerchord/fretboard.cpp +++ b/noncore/multimedia/powerchord/fretboard.cpp @@ -1,74 +1,73 @@ // // FretBoard class to display interface for chord finder application // // Copyright (c) 2001 Camilo Mesias // camilo@mesias.co.uk // // 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. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //#include <FL/Fl.H> //#include <FL/Fl_Widget.H> //#include <FL/fl_draw.H> #include <stdio.h> -#include <qpixmap.h> #include <qpe/resource.h> #include "fretboard.h" #include <qpainter.h> void FretBoard::refresh(){ ce.calculate(); emit nameChanged(QString(ce.label())); for (int i=0;i<6;i++){ Finger(i, ce.finger(i)); // yuk switch (i) { case 0: emit s1nameChanged(QString(ce.name(i))); break; case 1: emit s2nameChanged(QString(ce.name(i))); break; case 2: emit s3nameChanged(QString(ce.name(i))); break; case 3: emit s4nameChanged(QString(ce.name(i))); break; case 4: emit s5nameChanged(QString(ce.name(i))); break; case 5: emit s6nameChanged(QString(ce.name(i))); break; } } update(); } FretBoard::FretBoard(QWidget *parent, const char *name ) : QWidget( parent, name ), ce() { ce.base(9); ce.chord(0); ce.fret(0); ce.span(1); ce.vary(7); ce.tune(0); refresh(); diff --git a/noncore/multimedia/powerchord/gs.cpp b/noncore/multimedia/powerchord/gs.cpp index fdcfb74..69d9d75 100644 --- a/noncore/multimedia/powerchord/gs.cpp +++ b/noncore/multimedia/powerchord/gs.cpp @@ -1,69 +1,67 @@ //#include <FL/Fl.H> //#include <FL/Fl_Widget.H> //#include <FL/fl_draw.H> #include <stdio.h> //#include <qpixmap.h> #include "gs.h" #include <sys/ioctl.h> #include <unistd.h> #include <fcntl.h> #include <sys/soundcard.h> #include <errno.h> #include <string.h> #include <stdlib.h> //#include <qpainter.h> -#include <qmessagebox.h> -#include <qstring.h> gs::gs() { finger[0] = OPEN; finger[1] = OPEN; finger[2] = OPEN; finger[3] = OPEN; finger[4] = OPEN; finger[5] = OPEN; tuning[0] = 0; tuning[1] = 0; tuning[2] = 0; tuning[3] = 0; tuning[4] = 0; tuning[5] = 0; initial_fret = 0; audio_fd = -1; pb_rate0 = 0; pb_rate1 = 0; pb_rate2 = 0; pb_rate3 = 0; pb_rate4 = 0; pb_rate5 = 0; pb_rate6 = 0; pb_oct0 = 0; pb_oct1 = 0; pb_oct2 = 0; pb_oct3 = 0; pb_oct4 = 0; pb_oct5 = 0; pb_oct6 = 0; // initialise reverb buffer reverb = (signed short *)malloc(1024 * sizeof(signed short)); for (reverb_ptr=0;reverb_ptr<1024;reverb_ptr++){ reverb[reverb_ptr] = 0; } reverb_ptr = 0; reverb_max = 1024; diff --git a/noncore/multimedia/powerchord/powerchord.cpp b/noncore/multimedia/powerchord/powerchord.cpp index 79a26ea..31d517b 100644 --- a/noncore/multimedia/powerchord/powerchord.cpp +++ b/noncore/multimedia/powerchord/powerchord.cpp @@ -1,28 +1,27 @@ #include "powerchord.h" -#include <qpushbutton.h> /* * Constructs a Example which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ Powerchord::Powerchord( QWidget* parent, const char* name, WFlags fl ) : PowerchordBase( parent, name, fl ) { // connect(quit, SIGNAL(clicked), this, SLOT(goodBye())); } /* * Destroys the object and frees any allocated resources */ Powerchord::~Powerchord() { // no need to delete child widgets, Qt does it all for us } /* * A simple slot... not very interesting. */ void Powerchord::goodBye() { close(); } diff --git a/noncore/multimedia/powerchord/powerchordbase.cpp b/noncore/multimedia/powerchord/powerchordbase.cpp index 7978426..4fb5dda 100644 --- a/noncore/multimedia/powerchord/powerchordbase.cpp +++ b/noncore/multimedia/powerchord/powerchordbase.cpp @@ -1,75 +1,68 @@ /**************************************************************************** ** Form implementation generated from reading ui file 'powerchordbase.ui' ** ** Created: Sun Jan 13 23:05:11 2002 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "powerchordbase.h" #include "fretboard.h" #include "vumeter.h" -#include "gs.h" #include <qcombobox.h> -#include <qframe.h> #include <qlabel.h> #include <qlistbox.h> #include <qpushbutton.h> #include <qspinbox.h> #include <qtabwidget.h> #include <qlayout.h> -#include <qvariant.h> #include <qtooltip.h> -#include <qwhatsthis.h> -#include <qimage.h> -#include <qpixmap.h> -#include <qbitmap.h> #include <qpe/resource.h> /* * Constructs a PowerchordBase which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { simulation_timer = 0; audio_timer = 0; // setPalette( QPalette( QColor( 232, 227, 215) ) ); // QPixmap image0(QString("/opt/Qtopia/pics/powerchord/image0")); QPixmap image1 = Resource::loadPixmap( "powerchord/image1"); QPixmap image2 = Resource::loadPixmap( "powerchord/image2"); QPixmap image3 = Resource::loadPixmap( "powerchord/image3"); QPixmap image4 = Resource::loadPixmap( "powerchord/image4"); QPixmap image5 = Resource::loadPixmap( "powerchord/image5"); image6 = Resource::loadPixmap( "powerchord/image6"); image_open = Resource::loadPixmap( "powerchord/image_open"); // image0.setMask(image0.createHeuristicMask()); image1.setMask(image1.createHeuristicMask()); // image2.setMask(image2.createHeuristicMask()); // image3.setMask(image3.createHeuristicMask()); // image4.setMask(image4.createHeuristicMask()); // image5.setMask(image5.createHeuristicMask()); // image6->setMask(image6->createHeuristicMask()); // image_open->setMask(image_open->createHeuristicMask()); if ( !name ) setName( "PowerchordBase" ); resize( 240, 284 ); setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, sizePolicy().hasHeightForWidth() ) ); setMinimumSize( QSize( 240, 284 ) ); setMaximumSize( QSize( 240, 284 ) ); setCaption( tr( "Powerchord" ) ); tabs = new QTabWidget( this, "tabs" ); tabs->setEnabled( TRUE ); tabs->setGeometry( QRect( 0, 0, 240, 286 ) ); tabs->setTabPosition( QTabWidget::Bottom ); tab = new QWidget( tabs, "tab" ); diff --git a/noncore/multimedia/showimg/ImageFileSelector.cpp b/noncore/multimedia/showimg/ImageFileSelector.cpp index d2b65a9..79ee925 100644 --- a/noncore/multimedia/showimg/ImageFileSelector.cpp +++ b/noncore/multimedia/showimg/ImageFileSelector.cpp @@ -1,67 +1,56 @@ -#include "qpe/global.h" -#include "qpe/applnk.h" -#include "qpe/lnkproperties.h" -#include "qpe/applnk.h" #include "qpe/qpeapplication.h" #include <stdlib.h> -#include <qdir.h> -#include <qwidget.h> -#include <qheader.h> -#include <qimage.h> -#include <qpixmap.h> #include <qlabel.h> #include <qfileinfo.h> -#include <qpainter.h> -#include <qscrollview.h> #include "ImageFileSelector.h" ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w) : QWidget( parent ),fl(f) { setBackgroundMode(NoBackground); if ( w!=-1 ) setMinimumSize(w,p.height()+24); else setMinimumSize(p.width(),p.height()+24); description=new QLabel(text,this); description->setBackgroundColor(colorGroup().base()); description->setAlignment(AlignCenter); description->setGeometry(0,height()-24,width(),24); pixmap=p; } void ThumbWidget::resizeEvent(QResizeEvent *) { description->setGeometry(0,height()-24,width(),24); } void ThumbWidget::paintEvent( QPaintEvent *e ) { QPainter painter(this); painter.setClipRect(e->rect()); painter.fillRect(0,0,width(),height(),QColor(255,255,255)); painter.drawPixmap((width() - pixmap.width()) / 2,0, pixmap); } void ThumbWidget::mouseReleaseEvent(QMouseEvent* ) { emit clicked(fl); } ImageFileSelectorItem::ImageFileSelectorItem( QListView *parent, const DocLnk &f) : QListViewItem( parent ), fl( f ) { setText( 0, f.name() ); QFileInfo fi(f.file()); setText( 1, (fi.extension()).upper() ); setPixmap( 0, f.pixmap() ); diff --git a/noncore/multimedia/showimg/main.cpp b/noncore/multimedia/showimg/main.cpp index efb1c68..1c864e9 100644 --- a/noncore/multimedia/showimg/main.cpp +++ b/noncore/multimedia/showimg/main.cpp @@ -1,27 +1,26 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia 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. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "showimg.h" -#include <qpe/qpeapplication.h> #include <opie/oapplicationfactory.h> OPIE_EXPORT_APP( OApplicationFactory<ImageViewer> )
\ No newline at end of file diff --git a/noncore/multimedia/showimg/settingsdialog.cpp b/noncore/multimedia/showimg/settingsdialog.cpp index 55d555a..202bd0c 100644 --- a/noncore/multimedia/showimg/settingsdialog.cpp +++ b/noncore/multimedia/showimg/settingsdialog.cpp @@ -1,74 +1,72 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia 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. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "settingsdialog.h" #include <qslider.h> #include <qlabel.h> #include <qcheckbox.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> SettingsDialog::SettingsDialog( QWidget *parent, const char *name, bool modal, WFlags f ) : SettingsDialogBase( parent, name, modal, f ) { connect( delaySlider, SIGNAL(valueChanged(int)), this, SLOT(delayChanged(int)) ); } void SettingsDialog::setDelay( int d ) { delaySlider->setValue( d ); delayChanged( d ); } int SettingsDialog::delay() const { return delaySlider->value(); } void SettingsDialog::setRepeat( bool r ) { repeatCheck->setChecked( r ); } bool SettingsDialog::repeat() const { return repeatCheck->isChecked(); } void SettingsDialog::delayChanged( int d ) { delayText->setText( QString::number( d ) + " s" ); } void SettingsDialog::setReverse(bool r) { reverseCheck->setChecked(r); } bool SettingsDialog::reverse() const { return reverseCheck->isChecked(); } void SettingsDialog::setRotate(bool r) { rotateCheck->setChecked(r); } diff --git a/noncore/multimedia/showimg/settingsdialogbase.cpp b/noncore/multimedia/showimg/settingsdialogbase.cpp index e0c5bb0..7a64e89 100644 --- a/noncore/multimedia/showimg/settingsdialogbase.cpp +++ b/noncore/multimedia/showimg/settingsdialogbase.cpp @@ -1,67 +1,63 @@ /**************************************************************************** ** Form implementation generated from reading ui file 'settingsdialogbase.ui' ** ** Created: Sun Nov 3 07:29:03 2002 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "settingsdialogbase.h" #include <qcheckbox.h> #include <qgroupbox.h> #include <qlabel.h> -#include <qpushbutton.h> #include <qslider.h> #include <qlayout.h> -#include <qvariant.h> -#include <qtooltip.h> -#include <qwhatsthis.h> /* * Constructs a SettingsDialogBase which is a child of 'parent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ SettingsDialogBase::SettingsDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "SettingsDialogBase" ); resize( 246, 201 ); setCaption( tr( "Preferences" ) ); SettingsDialogBaseLayout = new QVBoxLayout( this ); SettingsDialogBaseLayout->setSpacing( 6 ); SettingsDialogBaseLayout->setMargin( 6 ); GroupBox1 = new QGroupBox( this, "GroupBox1" ); GroupBox1->setTitle( tr( "Slide Show" ) ); GroupBox1->setColumnLayout(0, Qt::Vertical ); GroupBox1->layout()->setSpacing( 0 ); GroupBox1->layout()->setMargin( 0 ); GroupBox1Layout = new QVBoxLayout( GroupBox1->layout() ); GroupBox1Layout->setAlignment( Qt::AlignTop ); GroupBox1Layout->setSpacing( 6 ); GroupBox1Layout->setMargin( 11 ); Layout3 = new QGridLayout; Layout3->setSpacing( 6 ); Layout3->setMargin( 0 ); TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); TextLabel1->setText( tr( "Delay between pictures" ) ); Layout3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); delaySlider = new QSlider( GroupBox1, "delaySlider" ); delaySlider->setMinValue( 2 ); delaySlider->setMaxValue( 60 ); delaySlider->setLineStep( 2 ); delaySlider->setOrientation( QSlider::Horizontal ); delaySlider->setTickmarks( QSlider::Right ); delaySlider->setTickInterval( 10); Layout3->addWidget( delaySlider, 1, 0 ); diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp index 02a1d91..82eac33 100644 --- a/noncore/multimedia/showimg/showimg.cpp +++ b/noncore/multimedia/showimg/showimg.cpp @@ -1,100 +1,87 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia 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. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ // // Full-screen and rotation options contributed by Robert Wittams <robert@wittams.com> // #include "showimg.h" #include "ImageFileSelector.h" #include "settingsdialog.h" #include <opie/ofiledialog.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/resource.h> -#include <qpe/fileselector.h> -#include <qpe/applnk.h> -#include <qfileinfo.h> #include <math.h> #include <qmenubar.h> -#include <qwidgetstack.h> #include <qpe/qpetoolbar.h> #include <qaction.h> #include <qfiledialog.h> -#include <qmessagebox.h> -#include <qpopupmenu.h> -#include <qscrollview.h> -#include <qlabel.h> -#include <qpainter.h> -#include <qkeycode.h> -#include <qapplication.h> -#include <qclipboard.h> -#include <qtimer.h> #include <qspinbox.h> ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) : QDialog(parent,0,true) { setCaption(caption); if ( parent ) { setPalette(parent->palette()); } b=brightness; img=image; setMinimumSize(140,80); QGridLayout *gl= new QGridLayout(this,2,2,4,4); pixmap =new ImageWidget(this);; QPixmap pm; pm.convertFromImage(img); pixmap->setPixmap(pm); pixmap->setMinimumSize(pm.width(),pm.height()); gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter); QLabel *l=new QLabel(tr("Brightness")+":",this); gl->addWidget(l,1,0,AlignLeft); spb=new QSpinBox(-100,100,2,this); gl->addWidget(spb,1,1,AlignRight); spb->setValue(0); connect(spb,SIGNAL(valueChanged(int)),this, SLOT(bValueChanged(int))); } void ControlsDialog::bValueChanged(int value) { QImage nImage=img; nImage.detach(); ImageViewer::intensity(nImage, (float)value/100); QPixmap pm; pm.convertFromImage(nImage); pixmap->setPixmap(pm); pixmap->repaint(false); diff --git a/noncore/multimedia/tonleiter/editinst.cpp b/noncore/multimedia/tonleiter/editinst.cpp index 5616569..ccb4560 100644 --- a/noncore/multimedia/tonleiter/editinst.cpp +++ b/noncore/multimedia/tonleiter/editinst.cpp @@ -1,51 +1,50 @@ #include "editinst.h" -#include <qlabel.h> #include <qpushbutton.h> #include <qpe/qpeapplication.h> Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) :QDialog(parent,name,true,0),data(data) { setCaption("Tonleiter::"+tr("Instrument")); QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); instid=data->getCurrentInstrumentID(); stringlist.setAutoDelete(true); QBoxLayout* toplayout=new QBoxLayout(masterlayout,QBoxLayout::LeftToRight); //Name combo + Add + Delete boxInst=new QComboBox(this,"boxInst"); boxInst->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); connect(boxInst,SIGNAL(activated(int)),this,SLOT(setCurrentInstrumetID(int))); for(int i=0;i<data->noOfInstruments();i++) { Instrument inst=data->getInstrument(i); QString name=inst.instName(); if(name.isNull()) continue; boxInst->insertItem(name,i); } boxInst->setCurrentItem(instid); toplayout->addWidget(boxInst); QPushButton* addButton=new QPushButton(tr("Add"),this,"addButton"); connect(addButton,SIGNAL(pressed()),this,SLOT(addInstrument())); toplayout->addWidget(addButton); QPushButton* delButton=new QPushButton(tr("Delete"),this,"delButton"); connect(delButton,SIGNAL(pressed()),this,SLOT(deleteInstrument())); toplayout->addWidget(delButton); QPushButton* addhighButton=new QPushButton(tr("Add High String"),this,"addhighButton"); masterlayout->addWidget(addhighButton); scrollview=new QScrollView(this); scrollview->setVScrollBarMode(QScrollView::AlwaysOn); scrollview->setHScrollBarMode(QScrollView::AlwaysOff); stringwidget=new QVBox(scrollview->viewport()); stringwidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum)); stringwidget->setSpacing(10); scrollview->addChild(stringwidget); scrollview->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); masterlayout->addWidget(scrollview); diff --git a/noncore/multimedia/tonleiter/editstringwidget.cpp b/noncore/multimedia/tonleiter/editstringwidget.cpp index d22bbc5..33dc6e1 100644 --- a/noncore/multimedia/tonleiter/editstringwidget.cpp +++ b/noncore/multimedia/tonleiter/editstringwidget.cpp @@ -1,32 +1,31 @@ #include "editstringwidget.h" -#include <qlabel.h> #include <qlayout.h> using namespace Data; Menu::EditStringWidget::EditStringWidget(int note,QWidget* parent,const char* name,WFlags f) :QFrame(parent,name,f) { QBoxLayout* layout=new QBoxLayout(this,QBoxLayout::LeftToRight,10); boxNote=new QComboBox(this,"boxNote"); boxNote->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); //connect(boxNote,SIGNAL(activated(int)),data,SLOT(setCurrentNote(int))); layout->addWidget(boxNote,1,1); for(int a=0;a<12;a++) boxNote->insertItem(Note::notenames[a],a); boxNote->setCurrentItem(note-12*Note::getOctaveOfNote(note)); layout->addWidget(boxNote); setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); setFrameShape(QFrame::Panel); setFrameShadow(QFrame::Sunken); } //**************************************************************************** Menu::EditStringWidget::~EditStringWidget() { } //**************************************************************************** //**************************************************************************** diff --git a/noncore/multimedia/tonleiter/mainwidget.cpp b/noncore/multimedia/tonleiter/mainwidget.cpp index b9c3d01..db16541 100644 --- a/noncore/multimedia/tonleiter/mainwidget.cpp +++ b/noncore/multimedia/tonleiter/mainwidget.cpp @@ -1,45 +1,44 @@ #include "mainwidget.h" -#include <qwidget.h> #include <qlayout.h> MainWidget::MainWidget(QWidget* parent,const char* name,WFlags f) :QMainWindow(parent,name,f) { setCaption("Tonleiter"); data=new Data::TonleiterData(this); QWidget* mainwidget=new QWidget(this,"mainwidget"); setCentralWidget(mainwidget); QBoxLayout* mainlayout=new QBoxLayout(mainwidget,QBoxLayout::TopToBottom); menuwidget=new Menu::MenuWidget(data,mainwidget); mainlayout->addWidget(menuwidget); fretboard=new Graph::FretBoard(data,mainwidget); connect(fretboard,SIGNAL(pressed()),this,SLOT(fretboardPressed())); mainlayout->addWidget(fretboard); showmenu=true; } //**************************************************************************** MainWidget::~MainWidget() { } //**************************************************************************** void MainWidget::fretboardPressed() { if(showmenu) { menuwidget->hide(); showmenu=false; } else { menuwidget->show(); showmenu=true; } } //**************************************************************************** //**************************************************************************** diff --git a/noncore/multimedia/tonleiter/menuwidget.cpp b/noncore/multimedia/tonleiter/menuwidget.cpp index 56a2f8a..91d052e 100644 --- a/noncore/multimedia/tonleiter/menuwidget.cpp +++ b/noncore/multimedia/tonleiter/menuwidget.cpp @@ -1,52 +1,50 @@ #include "menuwidget.h" -#include <qlabel.h> -#include <qlayout.h> #include "editinst.h" #include "editscale.h" Menu::MenuWidget::MenuWidget(TonleiterData* data,QWidget* parent,const char* name,WFlags f) :QWidget(parent,name,f),data(data) { QGridLayout* layout=new QGridLayout(this,3,3,10,-1,"menulayout"); //Instrument QLabel* instLabel=new QLabel(tr("Instr."),this,"instLabel"); instLabel->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); layout->addWidget(instLabel,0,0); boxInst=new QComboBox(this,"boxInst"); boxInst->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); connect(boxInst,SIGNAL(activated(int)),data,SLOT(setCurrentInstrumetID(int))); layout->addWidget(boxInst,0,1); editInst=new QPushButton(tr("Edit"),this,"editInst"); editInst->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); connect(editInst,SIGNAL(pressed()),this,SLOT(editInstPressed())); layout->addWidget(editInst,0,2); //Note QLabel* noteLabel=new QLabel(tr("Note"),this,"noteLabel"); noteLabel->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); layout->addWidget(noteLabel,1,0); boxNote=new QComboBox(this,"boxNote"); boxNote->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); connect(boxNote,SIGNAL(activated(int)),data,SLOT(setCurrentNote(int))); layout->addWidget(boxNote,1,1); for(int a=0;a<12;a++) boxNote->insertItem(Note::notenames[a],a); boxNote->setCurrentItem(data->getCurrentBaseNote()); noteCheck=new QCheckBox(tr("show"),this,"noteCheck"); noteCheck->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); noteCheck->setChecked(data->isDrawNames()); connect(noteCheck,SIGNAL(toggled(bool)),data,SLOT(setDrawNames(bool))); layout->addWidget(noteCheck,1,2); //Scale QLabel* scaleLabel=new QLabel(tr("Scale"),this,"scaleLabel"); scaleLabel->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Maximum)); layout->addWidget(scaleLabel,2,0); |