summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp23
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/opieplayer2.pro5
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp24
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp1
7 files changed, 15 insertions, 41 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index e7da6c5..626004a 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -74,25 +74,24 @@ protected:
74private: 74private:
75 QString scrollText; 75 QString scrollText;
76 int pos, pixelLen; 76 int pos, pixelLen;
77}; 77};
78 78
79 79
80class AudioWidget : public QWidget { 80class AudioWidget : public QWidget {
81 Q_OBJECT 81 Q_OBJECT
82public: 82public:
83 AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); 83 AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
84 ~AudioWidget(); 84 ~AudioWidget();
85 void setTickerText( const QString &text ) { songInfo.setText( text ); } 85 void setTickerText( const QString &text ) { songInfo.setText( text ); }
86 bool isStreaming;
87public slots: 86public slots:
88 void updateSlider( long, long ); 87 void updateSlider( long, long );
89 void sliderPressed( ); 88 void sliderPressed( );
90 void sliderReleased( ); 89 void sliderReleased( );
91// void setPaused( bool b) { setToggleButton( AudioPause, b ); } 90// void setPaused( bool b) { setToggleButton( AudioPause, b ); }
92 void setLooping( bool b) { setToggleButton( AudioLoop, b ); } 91 void setLooping( bool b) { setToggleButton( AudioLoop, b ); }
93 void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } 92 void setPlaying( bool b) { setToggleButton( AudioPlay, b ); }
94 void setPosition( long ); 93 void setPosition( long );
95 void setLength( long ); 94 void setLength( long );
96 void setView( char ); 95 void setView( char );
97 96
98signals: 97signals:
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 3a82a50..c187f52 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -78,47 +78,24 @@ Lib::Lib(XineVideoWidget* widget) {
78 QFile f(str); 78 QFile f(str);
79 f.open(IO_WriteOnly); 79 f.open(IO_WriteOnly);
80 QTextStream ts( &f ); 80 QTextStream ts( &f );
81 ts << "misc.memcpy_method:glibc\n"; 81 ts << "misc.memcpy_method:glibc\n";
82 f.close(); 82 f.close();
83 } 83 }
84 84
85 m_config = xine_config_file_init( str.data() ); 85 m_config = xine_config_file_init( str.data() );
86 86
87 // allocate oss for sound 87 // allocate oss for sound
88 // and fb for framebuffer 88 // and fb for framebuffer
89 m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; 89 m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ;
90 if (m_audioOutput == NULL )
91 printf("Failure\n");
92 else
93 printf("Success\n");
94
95
96 // test code
97/* m_videoOutput = xine_load_video_output_plugin(m_config, "fb",
98 VISUAL_TYPE_FB,
99 0 );
100*/
101
102 char** files = xine_list_video_output_plugins(3);
103 char* out;
104 int i = 0;
105 while ( ( out = files[i] ) != 0 ) {
106 printf("Video %s\n", out );
107 i++;
108 }
109// m_xine = xine_init( m_videoOutput,
110// m_audioOutput,
111// m_config );
112 // test loading
113 m_videoOutput = ::init_video_out_plugin( m_config, NULL ); 90 m_videoOutput = ::init_video_out_plugin( m_config, NULL );
114 if (m_wid != 0 ) { 91 if (m_wid != 0 ) {
115 printf("!0\n" ); 92 printf("!0\n" );
116 resize ( m_wid-> size ( )); 93 resize ( m_wid-> size ( ));
117 ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); 94 ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() );
118 m_wid-> setImage ( new QImage ( Resource::loadImage(""))); 95 m_wid-> setImage ( new QImage ( Resource::loadImage("")));
119 m_wid->repaint(); 96 m_wid->repaint();
120 } 97 }
121 null_display_handler( m_videoOutput, 98 null_display_handler( m_videoOutput,
122 xine_display_frame, 99 xine_display_frame,
123 this ); 100 this );
124 101
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 5531e81..18caaad 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -84,25 +84,24 @@ void MediaPlayer::setPlaying( bool play ) {
84 if ( mediaPlayerState->paused() ) { 84 if ( mediaPlayerState->paused() ) {
85 mediaPlayerState->setPaused( FALSE ); 85 mediaPlayerState->setPaused( FALSE );
86 return; 86 return;
87 } 87 }
88 88
89 const DocLnk *playListCurrent = playList->current(); 89 const DocLnk *playListCurrent = playList->current();
90 if ( playListCurrent != NULL ) { 90 if ( playListCurrent != NULL ) {
91 currentFile = playListCurrent; 91 currentFile = playListCurrent;
92 } 92 }
93 93
94 xineControl->play( currentFile->file() ); 94 xineControl->play( currentFile->file() );
95 95
96 xineControl->length();
97 long seconds = mediaPlayerState->length();// 96 long seconds = mediaPlayerState->length();//
98 QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); 97 QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
99 qDebug(time); 98 qDebug(time);
100 99
101 QString tickerText; 100 QString tickerText;
102 if( currentFile->file().left(4) == "http" ) 101 if( currentFile->file().left(4) == "http" )
103 tickerText= tr( " File: " ) + currentFile->name(); 102 tickerText= tr( " File: " ) + currentFile->name();
104 else 103 else
105 tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; 104 tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time;
106 105
107 audioUI->setTickerText( currentFile->file( ) ); 106 audioUI->setTickerText( currentFile->file( ) );
108 107
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
index 6833e07..8366ab4 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -27,24 +27,25 @@ MediaPlayerState::~MediaPlayerState() {
27} 27}
28 28
29 29
30void MediaPlayerState::readConfig( Config& cfg ) { 30void MediaPlayerState::readConfig( Config& cfg ) {
31 cfg.setGroup("Options"); 31 cfg.setGroup("Options");
32 isFullscreen = cfg.readBoolEntry( "FullScreen" ); 32 isFullscreen = cfg.readBoolEntry( "FullScreen" );
33 isScaled = cfg.readBoolEntry( "Scaling" ); 33 isScaled = cfg.readBoolEntry( "Scaling" );
34 isLooping = cfg.readBoolEntry( "Looping" ); 34 isLooping = cfg.readBoolEntry( "Looping" );
35 isShuffled = cfg.readBoolEntry( "Shuffle" ); 35 isShuffled = cfg.readBoolEntry( "Shuffle" );
36 usePlaylist = cfg.readBoolEntry( "UsePlayList" ); 36 usePlaylist = cfg.readBoolEntry( "UsePlayList" );
37 usePlaylist = TRUE; 37 usePlaylist = TRUE;
38 isPlaying = FALSE; 38 isPlaying = FALSE;
39 isStreaming = FALSE;
39 isPaused = FALSE; 40 isPaused = FALSE;
40 curPosition = 0; 41 curPosition = 0;
41 curLength = 0; 42 curLength = 0;
42 curView = 'l'; 43 curView = 'l';
43} 44}
44 45
45 46
46void MediaPlayerState::writeConfig( Config& cfg ) const { 47void MediaPlayerState::writeConfig( Config& cfg ) const {
47 cfg.setGroup("Options"); 48 cfg.setGroup("Options");
48 cfg.writeEntry("FullScreen", isFullscreen ); 49 cfg.writeEntry("FullScreen", isFullscreen );
49 cfg.writeEntry("Scaling", isScaled ); 50 cfg.writeEntry("Scaling", isScaled );
50 cfg.writeEntry("Looping", isLooping ); 51 cfg.writeEntry("Looping", isLooping );
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro
index 03540a1..8cbac06 100644
--- a/noncore/multimedia/opieplayer2/opieplayer2.pro
+++ b/noncore/multimedia/opieplayer2/opieplayer2.pro
@@ -1,16 +1,15 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on release 2#CONFIG = qt warn_on release
3#CONFIG = qt warn_on debug 3CONFIG = qt warn_on debug
4#release
5DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
6HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\ 5HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\
7 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ 6 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \
8 frame.h lib.h xinevideowidget.h volumecontrol.h\ 7 frame.h lib.h xinevideowidget.h volumecontrol.h\
9 alphablend.h yuv2rgb.h 8 alphablend.h yuv2rgb.h
10SOURCES = main.cpp \ 9SOURCES = main.cpp \
11 playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\ 10 playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\
12 videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \ 11 videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \
13 frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp\ 12 frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp\
14 alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S 13 alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S
15TARGET = opieplayer2 14TARGET = opieplayer2
16INCLUDEPATH += $(OPIEDIR)/include 15INCLUDEPATH += $(OPIEDIR)/include
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 39f5090..262b685 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -124,36 +124,36 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
124 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer2/remove_from_playlist", 124 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer2/remove_from_playlist",
125 this , SLOT(removeSelected()) ); 125 this , SLOT(removeSelected()) );
126 d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", 126 d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play",
127 this , SLOT( btnPlay(bool) ), TRUE ); 127 this , SLOT( btnPlay(bool) ), TRUE );
128 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", 128 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle",
129 mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); 129 mediaPlayerState, SLOT(setShuffled(bool)), TRUE );
130 d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer2/loop", 130 d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer2/loop",
131 mediaPlayerState, SLOT(setLooping(bool)), TRUE ); 131 mediaPlayerState, SLOT(setLooping(bool)), TRUE );
132 tbDeletePlaylist->hide(); 132 tbDeletePlaylist->hide();
133 133
134 QPopupMenu *pmPlayList = new QPopupMenu( this ); 134 QPopupMenu *pmPlayList = new QPopupMenu( this );
135 menu->insertItem( tr( "File" ), pmPlayList ); 135 menu->insertItem( tr( "File" ), pmPlayList );
136 new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); 136 (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) );
137 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 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 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 new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); 141 (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) );
142 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 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 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 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 149
150 pmView = new QPopupMenu( this ); 150 pmView = new QPopupMenu( this );
151 menu->insertItem( tr( "View" ), pmView ); 151 menu->insertItem( tr( "View" ), pmView );
152 pmView->isCheckable(); 152 pmView->isCheckable();
153 153
154 pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); 154 pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) );
155 155
156 Config cfg( "OpiePlayer" ); 156 Config cfg( "OpiePlayer" );
157 bool b= cfg.readBoolEntry("FullScreen", 0); 157 bool b= cfg.readBoolEntry("FullScreen", 0);
158 mediaPlayerState->setFullscreen( b ); 158 mediaPlayerState->setFullscreen( b );
159 pmView->setItemChecked( -16, b ); 159 pmView->setItemChecked( -16, b );
@@ -188,27 +188,27 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
188 188
189 QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); 189 QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton );
190 d->playListFrame = vbox3; 190 d->playListFrame = vbox3;
191 191
192 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); 192 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton );
193 193
194 d->selectedFiles = new PlayListSelection( hbox2); 194 d->selectedFiles = new PlayListSelection( hbox2);
195 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); 195 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton );
196 196
197 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); 197 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold);
198 198
199 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch 199 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch
200 new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) ); 200 (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) );
201 new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) ); 201 (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) );
202 new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) ); 202 (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) );
203 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch 203 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch
204 204
205 205
206 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); 206 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 );
207 207
208 QWidget *aTab; 208 QWidget *aTab;
209 aTab = new QWidget( tabWidget, "aTab" ); 209 aTab = new QWidget( tabWidget, "aTab" );
210 210
211 QGridLayout *Alayout = new QGridLayout( aTab ); 211 QGridLayout *Alayout = new QGridLayout( aTab );
212 Alayout->setSpacing( 2); 212 Alayout->setSpacing( 2);
213 Alayout->setMargin( 2); 213 Alayout->setMargin( 2);
214 214
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index c03ea16..766ece2 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -82,25 +82,24 @@ void XineControl::play( const QString& fileName ) {
82 return; 82 return;
83 } 83 }
84 84
85 if (whichGui == 'a') { 85 if (whichGui == 'a') {
86 libXine->setShowVideo( false ); 86 libXine->setShowVideo( false );
87 hasAudioChannel=TRUE; 87 hasAudioChannel=TRUE;
88 } else { 88 } else {
89 libXine->setShowVideo( true ); 89 libXine->setShowVideo( true );
90 hasVideoChannel=TRUE; 90 hasVideoChannel=TRUE;
91 } 91 }
92 92
93 // determine if slider is shown 93 // determine if slider is shown
94 // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) );
95 mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); 94 mediaPlayerState->setIsStreaming( !libXine->isSeekable() );
96 // which gui (video / audio) 95 // which gui (video / audio)
97 mediaPlayerState->setView( whichGui ); 96 mediaPlayerState->setView( whichGui );
98 97
99#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 98#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
100 if ( !disabledSuspendScreenSaver ) { 99 if ( !disabledSuspendScreenSaver ) {
101 disabledSuspendScreenSaver = TRUE; 100 disabledSuspendScreenSaver = TRUE;
102 // Stop the screen from blanking and power saving state 101 // Stop the screen from blanking and power saving state
103 QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) 102 QCopEnvelope("QPE/System", "setScreenSaverMode(int)" )
104 << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); 103 << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend );
105 } 104 }
106#endif 105#endif