summaryrefslogtreecommitdiff
path: root/noncore/multimedia
authorharlekin <harlekin>2002-08-19 20:39:26 (UTC)
committer harlekin <harlekin>2002-08-19 20:39:26 (UTC)
commit6c0751d0d1869089066269430b4664655e1dbe68 (patch) (unidiff)
tree870894a8eba99d8d07d2db8e3daae21e77eba450 /noncore/multimedia
parent5c057c7040fe0669a159173f07793c7f28c95477 (diff)
downloadopie-6c0751d0d1869089066269430b4664655e1dbe68.zip
opie-6c0751d0d1869089066269430b4664655e1dbe68.tar.gz
opie-6c0751d0d1869089066269430b4664655e1dbe68.tar.bz2
works now also on retail sharp rom
Diffstat (limited to 'noncore/multimedia') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/opieplayer2.pro6
-rw-r--r--noncore/multimedia/opieplayer2/playlistselection.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp7
5 files changed, 10 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index bf3590b..40e20e1 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -139,25 +139,25 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
139 //skin = "scaleTest"; 139 //skin = "scaleTest";
140 // color of background, frame, degree of transparency 140 // color of background, frame, degree of transparency
141 141
142 QString skinPath = "opieplayer2/skins/" + skin; 142 QString skinPath = "opieplayer2/skins/" + skin;
143 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); 143 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
144 imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); 144 imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
145 imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); 145 imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) );
146 146
147 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); 147 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 );
148 imgButtonMask->fill( 0 ); 148 imgButtonMask->fill( 0 );
149 149
150 for ( int i = 0; i < 10; i++ ) { 150 for ( int i = 0; i < 10; i++ ) {
151 QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png"; 151 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png" );
152 masks[i] = new QBitmap( filename ); 152 masks[i] = new QBitmap( filename );
153 153
154 if ( !masks[i]->isNull() ) { 154 if ( !masks[i]->isNull() ) {
155 QImage imgMask = masks[i]->convertToImage(); 155 QImage imgMask = masks[i]->convertToImage();
156 uchar **dest = imgButtonMask->jumpTable(); 156 uchar **dest = imgButtonMask->jumpTable();
157 for ( int y = 0; y < imgUp->height(); y++ ) { 157 for ( int y = 0; y < imgUp->height(); y++ ) {
158 uchar *line = dest[y]; 158 uchar *line = dest[y];
159 for ( int x = 0; x < imgUp->width(); x++ ) 159 for ( int x = 0; x < imgUp->width(); x++ )
160 if ( !qRed( imgMask.pixel( x, y ) ) ) 160 if ( !qRed( imgMask.pixel( x, y ) ) )
161 line[x] = i + 1; 161 line[x] = i + 1;
162 } 162 }
163 } 163 }
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro
index 8cbac06..3a47c06 100644
--- a/noncore/multimedia/opieplayer2/opieplayer2.pro
+++ b/noncore/multimedia/opieplayer2/opieplayer2.pro
@@ -1,23 +1,23 @@
1TEMPLATE = app 1TEMPLATE = app
2#CONFIG = qt warn_on release 2CONFIG = qt warn_on release
3CONFIG = qt warn_on debug 3#CONFIG = qt warn_on debug
4DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
5HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\ 5HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\
6 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ 6 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \
7 frame.h lib.h xinevideowidget.h volumecontrol.h\ 7 frame.h lib.h xinevideowidget.h volumecontrol.h\
8 alphablend.h yuv2rgb.h 8 alphablend.h yuv2rgb.h
9SOURCES = main.cpp \ 9SOURCES = main.cpp \
10 playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\ 10 playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\
11 videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \ 11 videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \
12 frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp\ 12 frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp\
13 alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S 13 alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S
14TARGET = opieplayer2 14TARGET = opieplayer2
15INCLUDEPATH += $(OPIEDIR)/include 15INCLUDEPATH += $(OPIEDIR)/include
16DEPENDPATH += $(OPIEDIR)/include 16DEPENDPATH += $(OPIEDIR)/include
17LIBS += -lqpe -lpthread -lopie -lxine -lxineutils 17LIBS += -lqpe -lpthread -lopie -lxine -lxineutils
18MOC_DIR=qpeobj 18MOC_DIR=qpeobj
19OBJECTS_DIR=qpeobj 19OBJECTS_DIR=qpeobj
20 20
21INCLUDEPATH += $(OPIEDIR)/include 21INCLUDEPATH += $(OPIEDIR)/include
22DEPENDPATH += $(OPIEDIR)/include 22DEPENDPATH += $(OPIEDIR)/include
23 23
diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp
index 85228a9..975dec3 100644
--- a/noncore/multimedia/opieplayer2/playlistselection.cpp
+++ b/noncore/multimedia/opieplayer2/playlistselection.cpp
@@ -175,25 +175,25 @@ bool PlayListSelection::last() {
175 while ( ( item = item->nextSibling() ) ) 175 while ( ( item = item->nextSibling() ) )
176 prevItem = item; 176 prevItem = item;
177 if ( prevItem ) 177 if ( prevItem )
178 setSelected( prevItem, TRUE ); 178 setSelected( prevItem, TRUE );
179 else 179 else
180 return FALSE; 180 return FALSE;
181 ensureItemVisible( selectedItem() ); 181 ensureItemVisible( selectedItem() );
182 return TRUE; 182 return TRUE;
183} 183}
184 184
185void PlayListSelection::unSelect() 185void PlayListSelection::unSelect()
186{ 186{
187 QListViewItem *item = selectedItem(); 187 //QListViewItem *item = selectedItem();
188 setSelected( currentItem(), FALSE); 188 setSelected( currentItem(), FALSE);
189} 189}
190 190
191void PlayListSelection::writeCurrent( Config& cfg ) { 191void PlayListSelection::writeCurrent( Config& cfg ) {
192 cfg.setGroup("PlayList"); 192 cfg.setGroup("PlayList");
193 QListViewItem *item = selectedItem(); 193 QListViewItem *item = selectedItem();
194 if ( item ) 194 if ( item )
195 cfg.writeEntry("current", item->text(0) ); 195 cfg.writeEntry("current", item->text(0) );
196 qDebug(item->text(0)); 196 qDebug(item->text(0));
197 197
198} 198}
199 199
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 262b685..6299328 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -137,25 +137,24 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
137 (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); 137 (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) );
138 (void)new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); 138 (void)new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) );
139 (void)new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); 139 (void)new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) );
140 pmPlayList->insertSeparator(-1); 140 pmPlayList->insertSeparator(-1);
141 (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); 141 (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) );
142 (void)new MenuItem( pmPlayList, tr( "Export playlist to m3u" ), this, SLOT(writem3u() ) ); 142 (void)new MenuItem( pmPlayList, tr( "Export playlist to m3u" ), this, SLOT(writem3u() ) );
143 pmPlayList->insertSeparator(-1); 143 pmPlayList->insertSeparator(-1);
144 (void)new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); 144 (void)new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) );
145 pmPlayList->insertSeparator(-1); 145 pmPlayList->insertSeparator(-1);
146 (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); 146 (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) );
147 (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); 147 (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) );
148 148
149
150 pmView = new QPopupMenu( this ); 149 pmView = new QPopupMenu( this );
151 menu->insertItem( tr( "View" ), pmView ); 150 menu->insertItem( tr( "View" ), pmView );
152 pmView->isCheckable(); 151 pmView->isCheckable();
153 152
154 pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); 153 pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) );
155 154
156 Config cfg( "OpiePlayer" ); 155 Config cfg( "OpiePlayer" );
157 bool b= cfg.readBoolEntry("FullScreen", 0); 156 bool b= cfg.readBoolEntry("FullScreen", 0);
158 mediaPlayerState->setFullscreen( b ); 157 mediaPlayerState->setFullscreen( b );
159 pmView->setItemChecked( -16, b ); 158 pmView->setItemChecked( -16, b );
160 159
161 // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); 160 // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) );
@@ -575,25 +574,25 @@ bool PlayListWidget::first() {
575 574
576bool PlayListWidget::last() { 575bool PlayListWidget::last() {
577 if ( mediaPlayerState->playlist() ) 576 if ( mediaPlayerState->playlist() )
578 return d->selectedFiles->last(); 577 return d->selectedFiles->last();
579 else 578 else
580 return mediaPlayerState->looping(); 579 return mediaPlayerState->looping();
581} 580}
582 581
583 582
584void PlayListWidget::saveList() { 583void PlayListWidget::saveList() {
585 584
586 QString filename; 585 QString filename;
587 InputDialog *fileDlg; 586 InputDialog *fileDlg = 0l;
588 fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); 587 fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0);
589 fileDlg->exec(); 588 fileDlg->exec();
590 if( fileDlg->result() == 1 ) { 589 if( fileDlg->result() == 1 ) {
591 if ( d->current ) 590 if ( d->current )
592 delete d->current; 591 delete d->current;
593 filename = fileDlg->LineEdit1->text();//+".playlist"; 592 filename = fileDlg->LineEdit1->text();//+".playlist";
594 // qDebug("saving playlist "+filename+".playlist"); 593 // qDebug("saving playlist "+filename+".playlist");
595 Config cfg( filename +".playlist"); 594 Config cfg( filename +".playlist");
596 writeConfig( cfg ); 595 writeConfig( cfg );
597 596
598 DocLnk lnk; 597 DocLnk lnk;
599 lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property 598 lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 60a3563..5b53568 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -22,24 +22,25 @@
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#include <qpe/qpeapplication.h>
34#include <qpe/resource.h> 35#include <qpe/resource.h>
35#include <qpe/mediaplayerplugininterface.h> 36#include <qpe/mediaplayerplugininterface.h>
36#include <qpe/config.h> 37#include <qpe/config.h>
37 38
38 39
39#include <qwidget.h> 40#include <qwidget.h>
40#include <qpainter.h> 41#include <qpainter.h>
41#include <qpixmap.h> 42#include <qpixmap.h>
42#include <qslider.h> 43#include <qslider.h>
43#include <qdrawutil.h> 44#include <qdrawutil.h>
44#include "videowidget.h" 45#include "videowidget.h"
45#include "mediaplayerstate.h" 46#include "mediaplayerstate.h"
@@ -95,25 +96,25 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
95 cfg.setGroup("Options"); 96 cfg.setGroup("Options");
96 skin = cfg.readEntry("Skin","default"); 97 skin = cfg.readEntry("Skin","default");
97 98
98 QString skinPath = "opieplayer2/skins/" + skin; 99 QString skinPath = "opieplayer2/skins/" + skin;
99 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); 100 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
100 imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); 101 imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
101 imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); 102 imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
102 103
103 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); 104 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 );
104 imgButtonMask->fill( 0 ); 105 imgButtonMask->fill( 0 );
105 106
106 for ( int i = 0; i < 7; i++ ) { 107 for ( int i = 0; i < 7; i++ ) {
107 QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png"; 108 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png" );
108 masks[i] = new QBitmap( filename ); 109 masks[i] = new QBitmap( filename );
109 110
110 if ( !masks[i]->isNull() ) { 111 if ( !masks[i]->isNull() ) {
111 QImage imgMask = masks[i]->convertToImage(); 112 QImage imgMask = masks[i]->convertToImage();
112 uchar **dest = imgButtonMask->jumpTable(); 113 uchar **dest = imgButtonMask->jumpTable();
113 for ( int y = 0; y < imgUp->height(); y++ ) { 114 for ( int y = 0; y < imgUp->height(); y++ ) {
114 uchar *line = dest[y]; 115 uchar *line = dest[y];
115 for ( int x = 0; x < imgUp->width(); x++ ) { 116 for ( int x = 0; x < imgUp->width(); x++ ) {
116 if ( !qRed( imgMask.pixel( x, y ) ) ) 117 if ( !qRed( imgMask.pixel( x, y ) ) )
117 line[x] = i + 1; 118 line[x] = i + 1;
118 } 119 }
119 } 120 }
@@ -173,26 +174,26 @@ QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
173 return new QPixmap( pix ); 174 return new QPixmap( pix );
174} 175}
175 176
176QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) { 177QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) {
177 QPixmap *pixmap = new QPixmap( pix ); 178 QPixmap *pixmap = new QPixmap( pix );
178 pixmap->setMask( mask ); 179 pixmap->setMask( mask );
179 return pixmap; 180 return pixmap;
180} 181}
181 182
182void VideoWidget::resizeEvent( QResizeEvent * ) { 183void VideoWidget::resizeEvent( QResizeEvent * ) {
183 int h = height(); 184 int h = height();
184 int w = width(); 185 int w = width();
185 int Vh = 160; 186 //int Vh = 160;
186 int Vw = 220; 187 //int Vw = 220;
187 188
188 slider->setFixedWidth( w - 20 ); 189 slider->setFixedWidth( w - 20 );
189 slider->setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); 190 slider->setGeometry( QRect( 15, h - 30, w - 90, 20 ) );
190 slider->setBackgroundOrigin( QWidget::ParentOrigin ); 191 slider->setBackgroundOrigin( QWidget::ParentOrigin );
191 slider->setFocusPolicy( QWidget::NoFocus ); 192 slider->setFocusPolicy( QWidget::NoFocus );
192 slider->setBackgroundPixmap( *pixBg ); 193 slider->setBackgroundPixmap( *pixBg );
193 194
194 xoff = 0;// ( imgUp->width() ) / 2; 195 xoff = 0;// ( imgUp->width() ) / 2;
195 yoff = 185;//(( Vh - imgUp->height() ) / 2) - 10; 196 yoff = 185;//(( Vh - imgUp->height() ) / 2) - 10;
196 QPoint p( xoff, yoff ); 197 QPoint p( xoff, yoff );
197 198
198 QPixmap *pixUp = combineVImageWithBackground( *imgUp, *pixBg, p ); 199 QPixmap *pixUp = combineVImageWithBackground( *imgUp, *pixBg, p );